Skip to content

Commit

Permalink
Allow sharing AMI with other AWS accounts at creation
Browse files Browse the repository at this point in the history
Need follow-up CLs to actually use this in scripts

Bug: b/293918417
Change-Id: I0be7d6fc275dc8e65f7db3bb7cd464033908d24c
GitOrigin-RevId: 6e572d2dd43a33ac22a6a261f9640844db93b14d
  • Loading branch information
peiwenhu authored and copybara-github committed Jan 9, 2025
1 parent f8fa8de commit ccadf13
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions production/packaging/aws/data_server/ami/image.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ variable "build_mode" {
type = string
}

variable "ami_users_env" {
type = string
default = ""
}

# Directory path where the built artifacts appear
variable "distribution_dir" {
type = string
Expand Down Expand Up @@ -66,6 +71,8 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
# source.
source "amazon-ebs" "dataserver" {
ami_name = "data-server-${local.timestamp}"
ami_users = var.ami_users_env != "" ? split(",", var.ami_users_env) : null

instance_type = "m5.xlarge"
region = var.regions[0]
ami_regions = var.regions
Expand Down

0 comments on commit ccadf13

Please sign in to comment.