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

automatically select AMI for the intance type architecture #16

Merged
merged 8 commits into from
Sep 8, 2022

Conversation

tarunmenon95
Copy link
Contributor

Added support for dynamic selection of architecture based on selected instance type

User is now prompted to select the service they would like to retrieve their AMI from based on those the chosen instance type supports.


x86_64 example

  1. User initiates a bastion launch with selected instance type of "c3.large", the user is then given the option to select the supported architectures for the instance type.

Screen Shot 2022-09-02 at 3 26 17 pm

2) The user selects 'x86_64', they then choose the service where they want to pull the AMI from.

Screen Shot 2022-09-02 at 3 28 52 pm

3) Finally, they select the AMI they would like to launch the bastion with, then continue on the with the normal workflow.

Screen Shot 2022-09-02 at 3 29 51 pm

4) The bastion is launched with the selected AMI type.


arm64 example

  1. Instance type supplied is 'c6g.large' which only supports arm64

Screen Shot 2022-09-02 at 3 36 47 pm

2) We select our chosen AMI from our selected service.

Screen Shot 2022-09-02 at 3 37 46 pm

3) The bastion is launches with the AMI using the selected architecture type

@tarunmenon95 tarunmenon95 linked an issue Sep 2, 2022 that may be closed by this pull request
@tarunmenon95
Copy link
Contributor Author

Refactored AMI to be selected automatically from selected instance type

  • AMI's are now selected from predetermined SSM parameters
    Screen Shot 2022-09-08 at 3 29 01 pm

  • We now find the supported architecture for the supplied instance type and return which SSM parameter to use as such.

for _, arch := range supported_architectures {
   	if *arch == "arm64" {
   		return "amazon-linux-arm64", nil
   	}
   	if *arch == "x86_64" {
   		return "amazon-linux", nil
   	}
   }

t3.micro (x86_64) example

  • Bastion instance is launched with instance type 't3.micro' which only supports the 'x86_64' architecture.
    Screen Shot 2022-09-08 at 3 33 24 pm

  • Created bastion instance is launched with auto-selected type of x86_64 as expected
    Screen Shot 2022-09-08 at 3 35 58 pm


c6g.large (arm64) example

  • Bastion instance is launched with instance type 'c6g.large' which only supports the 'arm64' architecture.
    Screen Shot 2022-09-08 at 3 39 23 pm

  • Created bastion instance is launched with auto-selected type of arm64 as expected
    Screen Shot 2022-09-08 at 3 40 09 pm

@Guslington Guslington changed the title Feature/ami from instance type automatically select AMI for the intance type architecture Sep 8, 2022
@Guslington Guslington merged commit 1095b17 into main Sep 8, 2022
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.

Support launching arm64 instance types
2 participants