Created
April 29, 2024 06:35
-
-
Save halberom/4a4aaabda189df511d32926986968268 to your computer and use it in GitHub Desktop.
Terraform detected the following changes - example code.
This file contains 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
data "aws_ami" "amazon_linux_2" { | |
most_recent = true | |
filter { | |
name = "owner-alias" | |
values = ["amazon"] | |
} | |
filter { | |
name = "name" | |
values = ["amzn2-ami-hvm-*-x86_64-ebs"] | |
} | |
} | |
resource "aws_instance" "this" { | |
ami = data.aws_ami.amazon_linux_2.id | |
instance_type = "t3.micro" | |
tags = { | |
Name = "Demo" | |
} | |
} | |
resource "aws_ec2_instance_state" "this" { | |
instance_id = aws_instance.this.id | |
state = "running" | |
} |
This file contains 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
terraform { | |
required_version = ">= 1.6" | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 5.0" | |
} | |
} | |
backend "s3" {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment