File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,20 @@ Resources:
99 Distributions:
1010 %{ ~ for region in regions ~}
1111 - AmiDistributionConfiguration:
12- Name: '${ name} - AmiCopyConfiguration - { { imagebuilder:buildDate } }'
12+ Name: '${ name} - $ { region } - AmiCopyConfiguration - { { imagebuilder:buildDate } }'
1313 %{ ~ if description != null ~}
1414 Description: ${ description}
1515 %{ ~ endif ~}
1616 AmiTags:
1717 ${ indent(14, chomp(yamlencode(tags))) }
18- %{ ~ if shared_account_ids != null ~}
1918 LaunchPermissionConfiguration:
19+ %{ ~ if public == false ~}
2020 UserIds:
21- ${ indent(14, chomp(yamlencode(shared_account_ids))) }
22- %{ ~ endif ~}
21+ ${ indent(16, chomp(yamlencode(shared_account_ids))) }
22+ %{ ~ else ~}
23+ UserGroups:
24+ - all
25+ %{ ~ endif ~}
2326 %{ ~ if license_config_arns != null ~}
2427 LicenseConfigurationArns:
2528 ${ indent(12, chomp(yamlencode(license_config_arns)))}
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ resource "aws_cloudformation_stack" "this" {
9393 log_bucket = var.log_bucket
9494 log_prefix = var.log_prefix
9595 name = var.name
96+ public = var.public
9697 recipe_arn = var.recipe_arn
9798 regions = var.regions
9899 schedule = var.schedule
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ variable "name" {
5757 type = string
5858}
5959
60+ variable "public" {
61+ default = false
62+ description = " Whether resulting AMI should be public"
63+ type = bool
64+ }
65+
6066variable "recipe_arn" {
6167 description = " ARN of the recipe to use. Must change with Recipe version"
6268 type = string
@@ -91,7 +97,7 @@ variable "security_group_ids" {
9197}
9298
9399variable "shared_account_ids" {
94- default = null
100+ default = []
95101 description = " AWS accounts to share AMIs with. If this is left null AMIs will be public"
96102 type = list (string )
97103}
You can’t perform that action at this time.
0 commit comments