Skip to content

Instantly share code, notes, and snippets.

@halberom
Created April 29, 2024 06:35
Show Gist options
  • Save halberom/4a4aaabda189df511d32926986968268 to your computer and use it in GitHub Desktop.
Save halberom/4a4aaabda189df511d32926986968268 to your computer and use it in GitHub Desktop.
Terraform detected the following changes - example code.
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"
}
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