Skip to content

Commit

Permalink
Upgrade Terraform modules in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hanscg committed Nov 6, 2023
1 parent 38b5fd2 commit 8ade034
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 60 deletions.
6 changes: 3 additions & 3 deletions examples/complete-ecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ $ terraform apply

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.24.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_alb"></a> [alb](#module\_alb) | terraform-aws-modules/alb/aws | 5.13.0 |
| <a name="module_alb_security_group"></a> [alb\_security\_group](#module\_alb\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 3.0 |
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 7.0 |
| <a name="module_asg_autoscaling"></a> [asg\_autoscaling](#module\_asg\_autoscaling) | ../../modules/autoscaling/asg-target-tracking/ecs-reservation | n/a |
| <a name="module_easy_ec2"></a> [easy\_ec2](#module\_easy\_ec2) | ../../modules/simple/ec2 | n/a |
| <a name="module_easy_fargate"></a> [easy\_fargate](#module\_easy\_fargate) | ../../modules/simple/fargate | n/a |
Expand All @@ -56,7 +56,7 @@ $ terraform apply
| <a name="module_ecs_security_group"></a> [ecs\_security\_group](#module\_ecs\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_fargate_service_autoscaling_target"></a> [fargate\_service\_autoscaling\_target](#module\_fargate\_service\_autoscaling\_target) | ../../modules/core/ecs-autoscaling-target | n/a |
| <a name="module_fargate_target_request_autoscaling"></a> [fargate\_target\_request\_autoscaling](#module\_fargate\_target\_request\_autoscaling) | ../../modules/autoscaling/alb-target-tracking/target-requests-count | n/a |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |

## Resources

Expand Down
2 changes: 1 addition & 1 deletion examples/complete-ecs/autoscaling.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module "asg_autoscaling" {
source = "../../modules/autoscaling/asg-target-tracking/ecs-reservation"

name = "${local.prefix}-autoscale"
autoscaling_group_name = module.asg.this_autoscaling_group_name
autoscaling_group_name = module.asg.autoscaling_group_id
ecs_cluster_name = module.ecs_cluster.name

enable_cpu_based_autoscaling = true
Expand Down
24 changes: 11 additions & 13 deletions examples/complete-ecs/support_infra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data "aws_ssm_parameter" "ami_image" {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
version = "~> 5.0"

name = "${local.prefix}-vpc"
cidr = local.vpc_cidr
Expand All @@ -17,7 +17,6 @@ module "vpc" {
dhcp_options_domain_name_servers = ["AmazonProvidedDNS"]

enable_ipv6 = var.enable_ipv6
assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_ipv6_prefixes = range(length(local.vpc_azs))
}
Expand Down Expand Up @@ -127,21 +126,20 @@ resource "aws_lb_listener_rule" "fargate" {

module "asg" {
source = "terraform-aws-modules/autoscaling/aws"
version = "~> 3.0"
version = "~> 7.0"

name = "${local.prefix}-asg"

image_id = data.aws_ssm_parameter.ami_image.value
instance_type = "t2.micro"
security_groups = [module.ecs_security_group.security_group_id]
vpc_zone_identifier = module.vpc.public_subnets
min_size = 1
max_size = 10
desired_capacity = 1
health_check_type = "EC2"
associate_public_ip_address = true
image_id = data.aws_ssm_parameter.ami_image.value
instance_type = "t2.micro"
security_groups = [module.ecs_security_group.security_group_id]
vpc_zone_identifier = module.vpc.public_subnets
min_size = 1
max_size = 10
desired_capacity = 1
health_check_type = "EC2"
user_data = templatefile("../templates/ec2_userdata.tpl", {
ecs_cluster = module.ecs_cluster.name
})
iam_instance_profile = var.instance_profile_arn
iam_instance_profile_arn = var.instance_profile_arn
}
6 changes: 3 additions & 3 deletions examples/easy/ec2-alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ To test that it's working:

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.24.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_alb"></a> [alb](#module\_alb) | terraform-aws-modules/alb/aws | 5.13.0 |
| <a name="module_alb_security_group"></a> [alb\_security\_group](#module\_alb\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 3.0 |
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 7.0 |
| <a name="module_easy_ec2"></a> [easy\_ec2](#module\_easy\_ec2) | ../../../modules/simple/ec2 | n/a |
| <a name="module_ec2_security_group"></a> [ec2\_security\_group](#module\_ec2\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_ecs_cluster"></a> [ecs\_cluster](#module\_ecs\_cluster) | ../../.. | n/a |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |

## Resources

Expand Down
24 changes: 11 additions & 13 deletions examples/easy/ec2-alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ locals {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
version = "~> 5.0"

name = "${local.prefix}-vpc"
cidr = local.vpc_cidr
Expand All @@ -29,7 +29,6 @@ module "vpc" {
dhcp_options_domain_name_servers = ["AmazonProvidedDNS"]

enable_ipv6 = var.enable_ipv6
assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_ipv6_prefixes = range(length(local.vpc_azs))
}
Expand Down Expand Up @@ -107,23 +106,22 @@ module "alb" {

module "asg" {
source = "terraform-aws-modules/autoscaling/aws"
version = "~> 3.0"
version = "~> 7.0"

name = "${local.prefix}-asg"

image_id = data.aws_ssm_parameter.ami_image.value
instance_type = "t2.micro"
security_groups = [module.ec2_security_group.security_group_id]
vpc_zone_identifier = module.vpc.public_subnets
min_size = 1
max_size = 2
desired_capacity = 1
health_check_type = "EC2"
associate_public_ip_address = true
image_id = data.aws_ssm_parameter.ami_image.value
instance_type = "t2.micro"
security_groups = [module.ec2_security_group.security_group_id]
vpc_zone_identifier = module.vpc.public_subnets
min_size = 1
max_size = 2
desired_capacity = 1
health_check_type = "EC2"
user_data = templatefile("../../templates/ec2_userdata.tpl", {
ecs_cluster = module.ecs_cluster.name
})
iam_instance_profile = var.instance_profile_arn
iam_instance_profile_arn = var.instance_profile_arn
}

# This module usage starts here
Expand Down
6 changes: 3 additions & 3 deletions examples/easy/ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ $ terraform apply

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.24.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 4.0 |
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 7.0 |
| <a name="module_easy_ec2"></a> [easy\_ec2](#module\_easy\_ec2) | ../../../modules/simple/ec2 | n/a |
| <a name="module_ec2_security_group"></a> [ec2\_security\_group](#module\_ec2\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_ecs_cluster"></a> [ecs\_cluster](#module\_ecs\_cluster) | ../../.. | n/a |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |

## Resources

Expand Down
22 changes: 10 additions & 12 deletions examples/easy/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ locals {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
version = "~> 5.0"

name = "${local.prefix}-vpc"
cidr = local.vpc_cidr
Expand All @@ -29,7 +29,6 @@ module "vpc" {
dhcp_options_domain_name_servers = ["AmazonProvidedDNS"]

enable_ipv6 = var.enable_ipv6
assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_ipv6_prefixes = range(length(local.vpc_azs))
}
Expand All @@ -55,19 +54,18 @@ module "ec2_security_group" {

module "asg" {
source = "terraform-aws-modules/autoscaling/aws"
version = "~> 4.0"
version = "~> 7.0"

name = "${local.prefix}-asg"

image_id = data.aws_ssm_parameter.ami_image.value
instance_type = "t2.micro"
security_groups = [module.ec2_security_group.security_group_id]
vpc_zone_identifier = module.vpc.public_subnets
min_size = 1
max_size = 2
desired_capacity = 1
health_check_type = "EC2"
associate_public_ip_address = true
image_id = data.aws_ssm_parameter.ami_image.value
instance_type = "t2.micro"
security_groups = [module.ec2_security_group.security_group_id]
vpc_zone_identifier = module.vpc.public_subnets
min_size = 1
max_size = 2
desired_capacity = 1
health_check_type = "EC2"
user_data = templatefile("../../templates/ec2_userdata.tpl", {
ecs_cluster = module.ecs_cluster.name
})
Expand Down
4 changes: 2 additions & 2 deletions examples/easy/fargate-alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $ terraform apply

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.24.0 |

## Modules

Expand All @@ -49,7 +49,7 @@ $ terraform apply
| <a name="module_easy_fargate"></a> [easy\_fargate](#module\_easy\_fargate) | ../../../modules/simple/fargate | n/a |
| <a name="module_ecs_cluster"></a> [ecs\_cluster](#module\_ecs\_cluster) | ../../.. | n/a |
| <a name="module_task_security_group"></a> [task\_security\_group](#module\_task\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |

## Resources

Expand Down
3 changes: 1 addition & 2 deletions examples/easy/fargate-alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
version = "~> 5.0"

name = "${local.prefix}-vpc"
cidr = local.vpc_cidr
Expand All @@ -25,7 +25,6 @@ module "vpc" {
dhcp_options_domain_name_servers = ["AmazonProvidedDNS"]

enable_ipv6 = var.enable_ipv6
assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_assign_ipv6_address_on_creation = var.enable_ipv6
public_subnet_ipv6_prefixes = range(length(local.vpc_azs))
}
Expand Down
4 changes: 2 additions & 2 deletions examples/easy/fargate-spot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $ terraform apply

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.24.0 |

## Modules

Expand All @@ -52,7 +52,7 @@ $ terraform apply
| <a name="module_easy_fargate"></a> [easy\_fargate](#module\_easy\_fargate) | ../../../modules/simple/fargate-spot | n/a |
| <a name="module_ecs_cluster"></a> [ecs\_cluster](#module\_ecs\_cluster) | ../../.. | n/a |
| <a name="module_task_security_group"></a> [task\_security\_group](#module\_task\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |

## Resources

Expand Down
3 changes: 1 addition & 2 deletions examples/easy/fargate-spot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
version = "~> 5.0"

name = "${local.prefix}-vpc"
cidr = local.vpc_cidr
Expand All @@ -24,7 +24,6 @@ module "vpc" {
dhcp_options_domain_name_servers = ["AmazonProvidedDNS"]

enable_ipv6 = true
assign_ipv6_address_on_creation = true
public_subnet_assign_ipv6_address_on_creation = true
public_subnet_ipv6_prefixes = range(length(local.vpc_azs))
}
Expand Down
4 changes: 2 additions & 2 deletions examples/easy/fargate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ terraform apply

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.74.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.24.0 |

## Modules

Expand All @@ -45,7 +45,7 @@ $ terraform apply
| <a name="module_easy_fargate"></a> [easy\_fargate](#module\_easy\_fargate) | ../../../modules/simple/fargate | n/a |
| <a name="module_ecs_cluster"></a> [ecs\_cluster](#module\_ecs\_cluster) | ../../.. | n/a |
| <a name="module_task_security_group"></a> [task\_security\_group](#module\_task\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |

## Resources

Expand Down
3 changes: 1 addition & 2 deletions examples/easy/fargate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
version = "~> 5.0"

name = "${local.prefix}-vpc"
cidr = local.vpc_cidr
Expand All @@ -24,7 +24,6 @@ module "vpc" {
dhcp_options_domain_name_servers = ["AmazonProvidedDNS"]

enable_ipv6 = true
assign_ipv6_address_on_creation = true
public_subnet_assign_ipv6_address_on_creation = true
public_subnet_ipv6_prefixes = range(length(local.vpc_azs))
}
Expand Down

0 comments on commit 8ade034

Please sign in to comment.