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

Some variables can't be defined in PACKER_VARIABLE_FILE #1112

Closed
sidewinder12s opened this issue Nov 28, 2022 · 3 comments · Fixed by #1115
Closed

Some variables can't be defined in PACKER_VARIABLE_FILE #1112

sidewinder12s opened this issue Nov 28, 2022 · 3 comments · Fixed by #1115
Labels
enhancement New feature or request

Comments

@sidewinder12s
Copy link

I think #1079 missed a couple more variables that override what is in the Packer variables files:

https://github.com/awslabs/amazon-eks-ami/blob/master/Makefile#L9-L10

I had to remove that before I could build the AMI in us-east-1. Otherwise my AWS_DEFAULT_REGION variable overrode the binary_bucket_region variable that is explicitly set to us-west-2.

@cartermckinnon
Copy link
Member

Do you mean you're trying to set aws_region and binary_bucket_region in a user-provided variable file (PACKER_VARIABLE_FILE)?

@sidewinder12s
Copy link
Author

I updated aws_region to us-east-1 in a user provided variable file & I have AWS_DEFAULT_REGION set to us-east-1 in my environment.

The makefile will override those region variables depending on if AWS_DEFAULT_REGION is set. My read of some of the PRs that have added the packer variable file was that it will be the preferred configuration method and you probably want to make the makefile do less right?

@cartermckinnon
Copy link
Member

Makes sense; I was just trying to figure out if we changed existing behavior unintentionally. It'd be great to remove this limitation and allow all template variables to be defined in the user-provided variable file; if you have an idea, feel free to open a PR. 😄

it will be the preferred configuration method

Time will tell; I primarily made this change because it made some things easier in our internal build process. But yeah I think many users could benefit from it.

and you probably want to make the makefile do less right?

Not necessarily; I think the logic around aws_region, instance_type, etc. is handy. But the user's input should take precedence, obviously.

@cartermckinnon cartermckinnon changed the title Binary Bucket Region variable overridden Some variables can't be defined in PACKER_VARIABLE_FILE Nov 30, 2022
@cartermckinnon cartermckinnon added the enhancement New feature or request label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants