-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching Data from Maps and List Variable Video #35
Comments
this is my code, provider "aws" {
region = "us-west-2"
access_key = "YOUR-KEY"
secret_key = "YOUR-KEY"
}
resource "aws_instance" "myec2" {
ami = "ami-082b5a644766e0e6f"
instance_type = var.list[1] # for list
# instance_type = "t2.micro"
# instance_type = var.types["us-west-2"]
# to try
# instance_type = var.types["ap-south-1"]
}
variable "list" {
type = list(any)
default = ["m5.large", "m5.xlarge", "t2.medium"]
}
variable "types" {
type = map(any)
default = {
us-east-1 = "t2.micro"
us-west-2 = "t2.nano"
ap-south-1 = "t2.small"
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On the "Fetching Data from Maps and List Variable" Video. With the variables. tf file you only have the List Example. Might be helpful if you also add the Map code as well which is aligned with the video:
resource "aws_instance" "myec2" {
ami = "ami-082b5a644766e0e6f"
instance_type = var.types["ap-south-1"]
The text was updated successfully, but these errors were encountered: