Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overrides for tags and run_tags #303

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions al1.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al1 = "${var.ami_name_prefix_al1}${var.ami_version_al1}-amazon-ecs-optimized"
default_tags = {
os_version = "Amazon Linux"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al1}"
ecs_agent_version = "${var.ecs_version_al1}"
ami_type = "al1"
ami_version = "2018.03.${var.ami_version_al1}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al1" {
Expand Down Expand Up @@ -30,14 +39,8 @@ source "amazon-ebs" "al1" {
user_data_file = "scripts/al1/user_data.sh"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al1}"
ecs_agent_version = "${var.ecs_version_al1}"
ami_type = "al1"
ami_version = "2018.03.${var.ami_version_al1}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}

build {
Expand Down
19 changes: 11 additions & 8 deletions al2.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ locals {
"69-available-updates-begin",
"71-available-updates-finish"
]
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2" {
Expand All @@ -29,14 +38,8 @@ source "amazon-ebs" "al2" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}

build {
Expand Down
19 changes: 11 additions & 8 deletions al2023.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2023 = "${var.ami_name_prefix_al2023}-hvm-2023.0.${var.ami_version_al2023}${var.kernel_version_al2023}-x86_64"
default_tags = {
os_version = "Amazon Linux 2023"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al2023}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2023"
ami_version = "2023.0.${var.ami_version_al2023}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2023" {
Expand All @@ -23,14 +32,8 @@ source "amazon-ebs" "al2023" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2023"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al2023}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2023"
ami_version = "2023.0.${var.ami_version_al2023}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}

build {
Expand Down
19 changes: 11 additions & 8 deletions al2023arm.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2023arm = "${var.ami_name_prefix_al2023}-hvm-2023.0.${var.ami_version_al2023}${var.kernel_version_al2023arm}-arm64"
default_tags = {
os_version = "Amazon Linux 2023"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al2023}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2023arm"
ami_version = "2023.0.${var.ami_version_al2023}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2023arm" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2023arm" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2023"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al2023}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2023arm"
ami_version = "2023.0.${var.ami_version_al2023}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2023neu.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2023neu = "${var.ami_name_prefix_al2023}-neuron-hvm-2023.0.${var.ami_version_al2023}${var.kernel_version_al2023}-x86_64"
tags = {
os_version = "Amazon Linux 2023"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al2023}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2023neu"
ami_version = "2023.0.${var.ami_version_al2023}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2023neu" {
Expand All @@ -23,13 +32,7 @@ source "amazon-ebs" "al2023neu" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2023"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version_al2023}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2023neu"
ami_version = "2023.0.${var.ami_version_al2023}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}

19 changes: 11 additions & 8 deletions al2arm.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2arm = "${var.ami_name_prefix_al2}-hvm-2.0.${var.ami_version_al2}-arm64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2arm"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2arm" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2arm" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2arm"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2gpu.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2gpu = "${var.ami_name_prefix_al2}-gpu-hvm-2.0.${var.ami_version_al2}-x86_64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2gpu"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2gpu" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2gpu" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2gpu"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2inf.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2inf = "${var.ami_name_prefix_al2}-inf-hvm-2.0.${var.ami_version_al2}-x86_64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2inf"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2inf" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2inf" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2inf"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
18 changes: 10 additions & 8 deletions al2keplergpu.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
locals {
ami_name_al2keplergpu = "${var.ami_name_prefix_al2}-kepler-gpu-hvm-2.0.${var.ami_version_al2}-x86_64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2keplergpu"
ami_version = "2.0.${var.ami_version_al2}"
}
}

source "amazon-ebs" "al2keplergpu" {
Expand All @@ -23,12 +31,6 @@ source "amazon-ebs" "al2keplergpu" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2keplergpu"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2kernel5dot10.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2kernel5dot10 = "${var.ami_name_prefix_al2}-kernel-5.10-hvm-2.0.${var.ami_version_al2}-x86_64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2kernel5dot10" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2kernel5dot10" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2kernel5dot10arm.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2kernel5dot10arm = "${var.ami_name_prefix_al2}-kernel-5.10-hvm-2.0.${var.ami_version_al2}-arm64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10arm"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2kernel5dot10arm" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2kernel5dot10arm" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10arm"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2kernel5dot10gpu.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2kernel5dot10gpu = "${var.ami_name_prefix_al2}-kernel-5.10-gpu-hvm-2.0.${var.ami_version_al2}-x86_64-ebs"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10gpu"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2kernel5dot10gpu" {
Expand All @@ -23,12 +32,6 @@ source "amazon-ebs" "al2kernel5dot10gpu" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10gpu"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}
19 changes: 11 additions & 8 deletions al2kernel5dot10inf.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
locals {
ami_name_al2kernel5dot10inf = "${var.ami_name_prefix_al2}-kernel-5.10-inf-hvm-2.0.${var.ami_version_al2}-x86_64-ebs"
default_tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10inf"
ami_version = "2.0.${var.ami_version_al2}"
}
merged_tags = merge("${local.default_tags}", "${var.tags}")
}

source "amazon-ebs" "al2kernel5dot10inf" {
Expand All @@ -23,13 +32,7 @@ source "amazon-ebs" "al2kernel5dot10inf" {
}
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
os_version = "Amazon Linux 2"
source_image_name = "{{ .SourceAMIName }}"
ecs_runtime_version = "Docker version ${var.docker_version}"
ecs_agent_version = "${var.ecs_agent_version}"
ami_type = "al2kernel5dot10inf"
ami_version = "2.0.${var.ami_version_al2}"
}
tags = "${local.merged_tags}"
run_tags = "${var.run_tags}"
}

Loading