Skip to content

Commit

Permalink
aws provider version change to ~> 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Great-Stone committed Nov 6, 2023
1 parent 91f27f9 commit 2a48a15
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
12 changes: 6 additions & 6 deletions exercises/main.tf.completed
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "=3.42.0"
version = "~> 5.0"
}
}
}
Expand Down Expand Up @@ -109,7 +109,7 @@ data "aws_ami" "ubuntu" {

resource "aws_eip" "hashicat" {
instance = aws_instance.hashicat.id
vpc = true
domain = "vpc"
}

resource "aws_eip_association" "hashicat" {
Expand Down Expand Up @@ -142,12 +142,12 @@ resource "aws_instance" "hashicat" {
# Set up some environment variables for our script.
# Add execute permissions to our scripts.
# Run the deploy_app.sh script.
resource "null_resource" "configure-cat-app" {
resource "terraform_data" "configure-cat-app" {
depends_on = [aws_eip_association.hashicat]

triggers = {
build_number = timestamp()
}
triggers_replace = [
timestamp()
]

provisioner "file" {
source = "files/"
Expand Down
12 changes: 6 additions & 6 deletions exercises/main.tf.cowsay
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "=3.42.0"
version = "~> 5.0"
}
}
}
Expand Down Expand Up @@ -109,7 +109,7 @@ data "aws_ami" "ubuntu" {

resource "aws_eip" "hashicat" {
instance = aws_instance.hashicat.id
vpc = true
domain = "vpc"
}

resource "aws_eip_association" "hashicat" {
Expand Down Expand Up @@ -142,12 +142,12 @@ resource "aws_instance" "hashicat" {
# Set up some environment variables for our script.
# Add execute permissions to our scripts.
# Run the deploy_app.sh script.
resource "null_resource" "configure-cat-app" {
resource "terraform_data" "configure-cat-app" {
depends_on = [aws_eip_association.hashicat]

triggers = {
build_number = timestamp()
}
triggers_replace = [
timestamp()
]

provisioner "file" {
source = "files/"
Expand Down
12 changes: 6 additions & 6 deletions exercises/main.tf.start
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "=3.42.0"
version = "~> 5.0"
}
}
}
Expand Down Expand Up @@ -109,7 +109,7 @@ resource "aws_vpc" "hashicat" {

# resource "aws_eip" "hashicat" {
# instance = aws_instance.hashicat.id
# vpc = true
# domain = "vpc"
# }

# resource "aws_eip_association" "hashicat" {
Expand Down Expand Up @@ -142,12 +142,12 @@ resource "aws_vpc" "hashicat" {
# # Set up some environment variables for our script.
# # Add execute permissions to our scripts.
# # Run the deploy_app.sh script.
# resource "null_resource" "configure-cat-app" {
# resource "terraform_data" "configure-cat-app" {
# depends_on = [aws_eip_association.hashicat]

# triggers = {
# build_number = timestamp()
# }
# triggers_replace = [
# timestamp()
# ]

# provisioner "file" {
# source = "files/"
Expand Down
13 changes: 6 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "=3.42.0"
version = "~> 5.0"
}
}
}
Expand Down Expand Up @@ -96,7 +96,6 @@ data "aws_ami" "ubuntu" {

filter {
name = "name"
#values = ["ubuntu/images/hvm-ssd/ubuntu-disco-19.04-amd64-server-*"]
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
}

Expand All @@ -110,7 +109,7 @@ data "aws_ami" "ubuntu" {

resource "aws_eip" "hashicat" {
instance = aws_instance.hashicat.id
vpc = true
domain = "vpc"
}

resource "aws_eip_association" "hashicat" {
Expand Down Expand Up @@ -143,12 +142,12 @@ resource "aws_instance" "hashicat" {
# Set up some environment variables for our script.
# Add execute permissions to our scripts.
# Run the deploy_app.sh script.
resource "null_resource" "configure-cat-app" {
resource "terraform_data" "configure-cat-app" {
depends_on = [aws_eip_association.hashicat]

triggers = {
build_number = timestamp()
}
triggers_replace = [
timestamp()
]

provisioner "file" {
source = "files/"
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variable "prefix" {

variable "region" {
description = "The region where the resources are created."
default = "us-east-1"
default = "ap-northeast-1"
}

variable "address_space" {
Expand Down

0 comments on commit 2a48a15

Please sign in to comment.