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

feat: Expose variables to set AMI share permisions #317

Open
wants to merge 1 commit 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
3 changes: 3 additions & 0 deletions al1.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ source "amazon-ebs" "al1" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
user_data_file = "scripts/al1/user_data.sh"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
Expand Down
3 changes: 3 additions & 0 deletions al2.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ source "amazon-ebs" "al2" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2023.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2023" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2023arm.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2023arm" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
4 changes: 3 additions & 1 deletion al2023neu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2023neu" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand All @@ -32,4 +35,3 @@ source "amazon-ebs" "al2023neu" {
ami_version = "2023.0.${var.ami_version_al2023}"
}
}

3 changes: 3 additions & 0 deletions al2arm.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2arm" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2gpu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2gpu" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2inf.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2inf" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2keplergpu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2keplergpu" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2kernel5dot10.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2kernel5dot10" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2kernel5dot10arm.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2kernel5dot10arm" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
3 changes: 3 additions & 0 deletions al2kernel5dot10gpu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2kernel5dot10gpu" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand Down
4 changes: 3 additions & 1 deletion al2kernel5dot10inf.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source "amazon-ebs" "al2kernel5dot10inf" {
most_recent = true
include_deprecated = true
}
ami_ou_arns = "${var.ami_ou_arns}"
ami_org_arns = "${var.ami_org_arns}"
ami_users = "${var.ami_users}"
ssh_interface = "public_ip"
ssh_username = "ec2-user"
tags = {
Expand All @@ -32,4 +35,3 @@ source "amazon-ebs" "al2kernel5dot10inf" {
ami_version = "2.0.${var.ami_version_al2}"
}
}

18 changes: 18 additions & 0 deletions variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,21 @@ variable "ebs_csi_driver_version" {
description = "EBS CSI driver version to build AMI with."
default = ""
}

variable "ami_ou_arns" {
type = list(string)
description = "A list of Amazon Resource Names (ARN) of AWS Organizations organizational units (OU) that have access to launch the resulting AMI(s)."
default = []
}

variable "ami_org_arns" {
type = list(string)
description = "A list of Amazon Resource Names (ARN) of AWS Organizations that have access to launch the resulting AMI(s)."
default = []
}

variable "ami_users" {
type = list(string)
description = "A list of account IDs that have access to launch the resulting AMI(s)."
default = []
}
Loading