Skip to content

Commit

Permalink
chore: update module version
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Nov 22, 2021
1 parent f41de11 commit 09e97e4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 136 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc
/tmp
1 change: 0 additions & 1 deletion examples/cost-modules-tf/.gitignore

This file was deleted.

17 changes: 5 additions & 12 deletions examples/fixtures/all-resources/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,15 @@ data "aws_subnet_ids" "all" {

data "aws_ami" "amazon_linux" {
most_recent = true

owners = ["amazon"]
owners = ["amazon"]

filter {
name = "name"

values = [
"amzn-ami-hvm-*-x86_64-gp2",
]
name = "name"
values = ["amzn-ami-hvm-*-x86_64-gp2"]
}

filter {
name = "owner-alias"

values = [
"amazon",
]
name = "owner-alias"
values = ["amazon"]
}
}
87 changes: 0 additions & 87 deletions examples/fixtures/all-resources/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,93 +66,6 @@ resource "aws_instance" "i3" {
iops = 220
}
}
/*
data "aws_launch_template" "test_lt" {
name = "test-lt"
}
resource "aws_autoscaling_group" "with_lt1" {
desired_capacity = 1
max_size = 2
min_size = 0
vpc_zone_identifier = tolist(data.aws_subnet_ids.all.ids)
launch_template {
id = aws_launch_template.this_lt_spot1.id
version = "$Latest"
}
}
resource "aws_autoscaling_group" "with_lt2" {
desired_capacity = 0
max_size = 1
min_size = 0
vpc_zone_identifier = tolist(data.aws_subnet_ids.all.ids)
launch_template {
id = aws_launch_template.this_lt2.id
version = "$Latest"
}
}
resource "aws_launch_template" "this_lt_spot1" {
image_id = data.aws_ami.amazon_linux.id
instance_type = "t2.nano"
instance_market_options {
market_type = "spot"
}
elastic_gpu_specifications {
type = "eg1.medium"
}
elastic_gpu_specifications {
type = "eg1.large"
}
elastic_inference_accelerator { # this is not part of EC2 pricing
type = "eia1.medium"
}
}
resource "aws_launch_template" "this_lt1" {
image_id = data.aws_ami.amazon_linux.id
instance_type = "t2.nano"
elastic_gpu_specifications {
type = "eg1.medium"
}
elastic_gpu_specifications {
type = "eg1.large"
}
elastic_inference_accelerator { # this is not part of EC2 pricing
type = "eia1.medium"
}
}
resource "aws_launch_template" "this_lt2" {
image_id = data.aws_ami.amazon_linux.id
instance_type = "t2.nano"
}
*/
# resource "aws_ec2_fleet" "example" {
# launch_template_config {
# launch_template_specification {
# launch_template_id = aws_launch_template.fleet_lt_notspot.id
# version = aws_launch_template.fleet_lt_notspot.latest_version
# }
# }
#
# target_capacity_specification {
# default_target_capacity_type = "on-demand"
# total_target_capacity = 1
# }
# }

#######################################################
# aws_ebs_volume
Expand Down
1 change: 0 additions & 1 deletion examples/fixtures/combinations/.gitignore

This file was deleted.

49 changes: 14 additions & 35 deletions examples/fixtures/combinations/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,27 @@ data "aws_subnet_ids" "all" {

data "aws_ami" "amazon_linux" {
most_recent = true

owners = ["amazon"]
owners = ["amazon"]

filter {
name = "name"

values = [
"amzn-ami-hvm-*-x86_64-gp2",
]
name = "name"
values = ["amzn-ami-hvm-*-x86_64-gp2"]
}

filter {
name = "owner-alias"

values = [
"amazon",
]
name = "owner-alias"
values = ["amazon"]
}
}

module "instance_count_2" {
source = "terraform-aws-modules/ec2-instance/aws"

instance_count = 2
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 3.0"

name = "instance_count_"
ami = data.aws_ami.amazon_linux.id
instance_type = "t2.micro"
subnet_id = tolist(data.aws_subnet_ids.all.ids)[0]
subnet_id = element(data.aws_subnet_ids.all.ids, 0)

root_block_device = [
{
Expand All @@ -54,15 +46,13 @@ module "instance_count_2" {
}

module "module_count_2" {
source = "terraform-aws-modules/ec2-instance/aws"

count = 2

name = "module_count_"
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 3.0"

name = "module_count_"
ami = data.aws_ami.amazon_linux.id
instance_type = "t2.nano"
subnet_id = tolist(data.aws_subnet_ids.all.ids)[0]
subnet_id = element(data.aws_subnet_ids.all.ids, 0)

}

Expand All @@ -78,7 +68,7 @@ resource "aws_instance" "nano_count_2" {

ami = data.aws_ami.amazon_linux.id
instance_type = "t3.nano"
subnet_id = tolist(data.aws_subnet_ids.all.ids)[0]
subnet_id = element(data.aws_subnet_ids.all.ids, 0)
}

##########
Expand All @@ -88,18 +78,7 @@ resource "aws_instance" "small_for_each_fixed" {

ami = data.aws_ami.amazon_linux.id
instance_type = "t3.small"
subnet_id = tolist(data.aws_subnet_ids.all.ids)[0]
subnet_id = element(data.aws_subnet_ids.all.ids, 0)

tags = { Name : each.value }
}

#resource "aws_instance" "small_for_each_dynamic" {
# for_each = { for k, v in module.module_count_2 : k => v }
#
# ami = data.aws_ami.amazon_linux.id
# instance_type = "t3.small"
# subnet_id = tolist(data.aws_subnet_ids.all.ids)[0]
#
# tags = { Name : each.value }
#}
#

0 comments on commit 09e97e4

Please sign in to comment.