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

EC2 launch template support #70

Closed
wants to merge 3 commits into from

Conversation

jpalomaki
Copy link
Contributor

@jpalomaki jpalomaki commented Sep 2, 2021

Adds a new optional input ec2-launch-template, which refers to an existing EC2 launch template by name (human-readable, unlike a template ID).

An EC2 launch template can be used to define various EC2 instance parameters, including (but not limited to): AMI, instance type, subnet ID, multiple security group IDs, spot options and public IPv4 address attachment.

Can be used alone, or in combination with the individual EC2-related action inputs (AMI ID, instance type, subnet ID, security group ID).

Example Cloudformation template for setting up a launch template.

Should be backwards-compatible. Documentation probably needs some more work.

Ought to fix #65

@jpalomaki jpalomaki marked this pull request as draft September 2, 2021 19:20
@jpalomaki
Copy link
Contributor Author

jpalomaki commented Sep 26, 2021

@machulav Does this look like something you'd like to support?

If so, do you want to move in this direction (retaining backwards-compatibility by just adding a new input), or do you want to aim for v3 from the bat (perhaps leveraging launch templates as the default mechanism for specifying EC2 parameters)?

Why I'm asking: launch templates, while IMO useful, do mean that we'd add some indirection into the use of this action, so I'm not sure if it aligns with the original idea you had with the ec2-github-runner action.

@jpalomaki
Copy link
Contributor Author

@machulav Looks like we could fix this draft by incorporating the changes from the linked PR

@ynouri
Copy link

ynouri commented Dec 20, 2021

Hi @jpalomaki , thanks a lot for the contribution! We tested your fix by running the Github Action from your branch, but we've observed the following:

  • When passing a launch template with an incorrect configuration, it does not complain or error out
  • When using a correctly configured launch template, the resulting instance does not seem to be using the launch template

Curious if you tested on your side and if it was working for you?

Thanks!

@jpalomaki
Copy link
Contributor Author

jpalomaki commented Jan 7, 2022

Hi @jpalomaki , thanks a lot for the contribution! We tested your fix by running the Github Action from your branch, but we've observed the following:

  • When passing a launch template with an incorrect configuration, it does not complain or error out

What kind of incorrect configuration?

  • When using a correctly configured launch template, the resulting instance does not seem to be using the launch template

What do you mean by not seem to be using the launch template?

Curious if you tested on your side and if it was working for you?

Nope, my code is untested atm, hence this PR is a draft. Some fixes have already been done here: fac#3, which we should probably incorporate into this PR.

@ynouri
Copy link

ynouri commented Jan 11, 2022

What kind of incorrect configuration?

A configuration which would prevent the EC2 instance to launch, even when trying manually in the AWS console. An incompatible subnet and security group for example

What do you mean by not seem to be using the launch template?

Instance is still be provisioned and started, but with settings different from the launch template

@jpalomaki
Copy link
Contributor Author

@machulav @ynouri Closing this PR as stale (I unfortunately have not had time to work on this project). If this is still of interest, feel free to pick it up.

@jpalomaki jpalomaki closed this Jan 6, 2023
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 EC2 launch templates
2 participants