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

fix: adding support for opt-in regions and arm architecture #106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stefano-franco
Copy link

@stefano-franco stefano-franco commented Dec 2, 2024

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 source data.aws_ami.this always fails if there is no Spacelift AMI in the Spacelift AWS account (643313122712). Using data.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 with var.ami_id or by the data source.

When choosing an arm based instance type via var.ec2_instance_type the data source data.aws_ami.this will return a x86_64 AMI because it's hardcoded into the name_regex and filter. By adding the data.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

  • Bug fix (non-breaking change that fixes an issue);
  • New feature (non-breaking change that adds functionality);
  • Breaking change (fix or feature that would cause existing functionality to not work as expected);
  • Documentation (a documentation or example fix not affecting the infrastructure managed by this module);

Checklists

Development

  • All necessary variables have been defined, with defaults if applicable;
  • The code is formatted properly;

Code review

  • The module version is bumped accordingly;
  • Spacelift tests are passing;
  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached;
  • This pull request is no longer marked as "draft";
  • Reviewers have been assigned;
  • Changes have been reviewed by at least one other engineer;

stefano-franco and others added 3 commits October 29, 2024 21:34
improving error handling in case the official spacelift image is not available in current region and get the AMI architecture from the selected ec2 instance type.
@stefano-franco stefano-franco requested a review from a team as a code owner December 2, 2024 19:34
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.

1 participant