aws / amazon-ecs-ami

Packer recipes for building the official ECS-optimized Amazon Linux AMIs
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html
Apache License 2.0
204 stars 47 forks source link

feat: Expose variables to set AMI share permisions #317

Closed leigholiver closed 1 day ago

leigholiver commented 2 months ago

Summary

Exposes the ami_ou_arns, ami_org_arns, and ami_users variables for configuration. Resolves https://github.com/aws/amazon-ecs-ami/issues/30

Implementation details

Adds three entries to variables.tf for these variables, and pass them through to the underlying ebs_builders

Testing

I have built and deployed both the al2 and al2arm variants. Unfortunately the make tests command mentioned doesnt appear to exist but im happy to run any additional tests needed.

New tests cover the changes: no

Description for the changelog

Feature - Support AMI sharing

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

mye956 commented 3 weeks ago

Thanks @leigholiver for your contribution! I also tested this locally with AL1, AL2, AL2023, and AL2023 ARM and it seems to working as expected. Seems like this option was introduced on version v1.0.6 of packer-plugin-amazon.

Since we're requiring the version to be at least v1.2.8 already from this PR, this change looks pretty safe/good to me.

mye956 commented 3 weeks ago

You might need to format all of the packer files via a packer fmt.

danehlim commented 1 day ago

Thank you again @leigholiver for your contribution! This pull request has now been merged.