Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
terraform_validate_resources
# terraform validate will catch typo in resource reference
resource "aws_s3_bukcet" "wrong_resource" {
name = "my-bucket"
}
# terraform validate will catch wrong CIDR
resource "aws_vpc" "default" {
cidr_block = "0.0.0.0/0"
}
resource "aws_instance" "web" {
# .. however, non existing instance type is not caught by terraform validate
instance_type = "t200.micro"
ami = "ami-0db61e5fa6d1a815a"
vpc_security_group_ids = [aws_security_group.default.id]
subnet_id = aws_subnet.default.id
provisioner "remote-exec" {
inline = [
"sudo apt-get -y update",
"sudo apt-get -y install nginx",
"sudo service nginx start",
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment