fix: adding support for opt-in regions and arm architecture #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
This module cannot currently be used in opt-in regions (e.g. Zurich eu-central-2) where the Spacelift AMIs are not replicated.
Also when using a custom AMI via
var.ami_id
the module fails as the data sourcedata.aws_ami.this
always fails if there is no Spacelift AMI in the Spacelift AWS account (643313122712). Usingdata.aws_ami_ids.spacelift
avoids this problem as the data source returns an empty list if the AMI does not exist. A lifecycle postcondition checks that an AMI was provided either withvar.ami_id
or by the data source.When choosing an arm based instance type via
var.ec2_instance_type
the data sourcedata.aws_ami.this
will return a x86_64 AMI because it's hardcoded into the name_regex and filter. By adding thedata.aws_ec2_instance_type.spacelift
data source we can dynamically get the correct architecture for the Spacelift AMI. This allows to use the latest arm based Spacelift AMIs by default.Type of change
Checklists
Development
Code review