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

add base ami choice to packer json and Makefiles #921

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stvhawes
Copy link

@stvhawes stvhawes commented Sep 15, 2021

In our use case the base ami is pre-hardened so owned by our aws account. Note also that the list of owners can be passed as a comma separated string (or a single string) and is automatically converted to an array by packer.

ref: hashicorp/packer#2278 (comment) for comma separated string automatically converted to an array by packer.

also: we reference this repo as a submodule, with our own pipeline.yml and our own steps/packer.json driving the submodule Makefile.

Copy link
Contributor

@keithduncan keithduncan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening this pull request @stvhawes!

Customising the stack’s source AMI for the Packer build isn’t a customisation I had considered but I think it’s a nice feature I’m keen to support.

I’ve got one question 👇 on the ergonomics of using this to ensure existing automation that invokes make packer continues to work but otherwise I support it in principle.

-e PACKER_LOG \
-v ${HOME}/.aws:/root/.aws \
-v "$(PWD):/src" \
--rm \
-w /src/packer/linux \
hashicorp/packer:$(PACKER_VERSION) build -timestamp-ui -var 'region=$(AWS_REGION)' \
-var 'arch=x86_64' -var 'goarch=amd64' -var 'instance_type=$(AMD64_INSTANCE_TYPE)' \
-var 'source_ami_name_filter=$(SOURCE_AMI_NAME_FILTER)' \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this override the default value from the variables section with an empty string if the environment variable isn’t set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants