Created
December 26, 2016 18:23
-
-
Save mooyoul/15c78a2a3098fc67274a226ae8150666 to your computer and use it in GitHub Desktop.
Terraform 101 - Non-dependent Dependency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
access_key = "ACCESS_KEY_HERE" | |
secret_key = "SECRET_KEY_HERE" | |
region = "ap-northeast-2" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-983ce8f6" | |
instance_type = "t2.micro" | |
} | |
resource "aws_eip" "ip" { | |
instance = "${aws_instance.example.id}" | |
depends_on = ["aws_instance.example"] | |
} | |
resource "aws_instance" "another" { | |
ami = "ami-f293459c" | |
instance_type = "t2.micro" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment