From e7ed667aacabb2c2e76ffd084124c63f655a6e87 Mon Sep 17 00:00:00 2001 From: Nishitha1992 Date: Fri, 22 Dec 2023 13:12:53 +0530 Subject: [PATCH 1/2] practice --- .../terraform-manifests/ec2-instance.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/02-Terraform-Basics/02-02-Terraform-Command-Basics/terraform-manifests/ec2-instance.tf b/02-Terraform-Basics/02-02-Terraform-Command-Basics/terraform-manifests/ec2-instance.tf index 406cd47a..0d45397b 100644 --- a/02-Terraform-Basics/02-02-Terraform-Command-Basics/terraform-manifests/ec2-instance.tf +++ b/02-Terraform-Basics/02-02-Terraform-Command-Basics/terraform-manifests/ec2-instance.tf @@ -2,8 +2,8 @@ terraform { required_providers { aws = { - source = "hashicorp/aws" - #version = "~> 3.21" # Optional but recommended in production + source = "hashicorp/aws" + version = "5.31.0" } } } @@ -16,6 +16,6 @@ provider "aws" { # Resource Block resource "aws_instance" "ec2demo" { - ami = "ami-0533f2ba8a1995cf9" # Amazon Linux in us-east-1, update as per your region + ami = "ami-03643cf1426c9b40b" # Amazon Linux in us-east-1, update as per your region instance_type = "t2.micro" } From b2cee21e9f826380d448ad65d67c585eb20189c6 Mon Sep 17 00:00:00 2001 From: Nishitha1992 Date: Thu, 28 Dec 2023 12:38:10 +0530 Subject: [PATCH 2/2] ami-updation --- .../terraform-manifests/c1-versions.tf | 8 ++++---- .../terraform-manifests/c2-ec2instance.tf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/03-Terraform-Settings-Providers-Resources/terraform-manifests/c1-versions.tf b/03-Terraform-Settings-Providers-Resources/terraform-manifests/c1-versions.tf index 0ccea8d1..8db1b4ed 100644 --- a/03-Terraform-Settings-Providers-Resources/terraform-manifests/c1-versions.tf +++ b/03-Terraform-Settings-Providers-Resources/terraform-manifests/c1-versions.tf @@ -1,13 +1,13 @@ # Terraform Block terraform { - required_version = ">= 1.0" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx required_providers { aws = { source = "hashicorp/aws" - version = "~> 3.0" + version = "5.31.0" } - } -} + } +} + # Provider Block provider "aws" { region = "us-east-1" diff --git a/03-Terraform-Settings-Providers-Resources/terraform-manifests/c2-ec2instance.tf b/03-Terraform-Settings-Providers-Resources/terraform-manifests/c2-ec2instance.tf index e90b892e..1b85b54b 100644 --- a/03-Terraform-Settings-Providers-Resources/terraform-manifests/c2-ec2instance.tf +++ b/03-Terraform-Settings-Providers-Resources/terraform-manifests/c2-ec2instance.tf @@ -1,6 +1,6 @@ # Resource: EC2 Instance resource "aws_instance" "myec2vm" { - ami = "ami-0742b4e673072066f" + ami = "ami-079db87dc4c10ac91" instance_type = "t3.micro" user_data = file("${path.module}/app1-install.sh") tags = {