· 9 years ago · Dec 26, 2016, 06:26 PM
1provider "aws" {
2 access_key = "ACCESS_KEY_HERE"
3 secret_key = "SECRET_KEY_HERE"
4 region = "ap-northeast-2"
5}
6
7resource "aws_instance" "example" {
8 ami = "ami-983ce8f6"
9 instance_type = "t2.micro"
10}
11
12resource "aws_eip" "ip" {
13 instance = "${aws_instance.example.id}"
14 depends_on = ["aws_instance.example"]
15}
16
17resource "aws_instance" "another" {
18 ami = "ami-f293459c"
19 instance_type = "t2.micro"
20}