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

r/aws_instance: Add support for launch template #4543

Closed
wants to merge 1 commit into from
Closed

r/aws_instance: Add support for launch template #4543

wants to merge 1 commit into from

Conversation

gordonbondon
Copy link
Contributor

@gordonbondon gordonbondon commented May 15, 2018

Fixes #4264

Changes proposed in this pull request:

  • Add support for launch template in instance resource

Output from acceptance testing:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSInstance_LaunchTemplate'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSInstance_LaunchTemplate -timeout 120m
=== RUN   TestAccAWSInstance_LaunchTemplate
--- PASS: TestAccAWSInstance_LaunchTemplate (430.43s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	430.769s

A couple of notes:

  1. Template is used only once when instance is created, so later it should be possible to change instance parameters via direct attributes.
  2. Using template and overriding root volume device should check template ami and use its device.
  3. We can get launch template details only from instance tags
  4. I did not want to implement complicated logic of whether changes in template should force instance recreation or not, so any change to template version or id/name will force new instance.
  5. But if $Default or $Latest switch to a version that is actually the same, this will not force recreation.

Maybe there is a better way to do this CustomDiff?

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. labels May 15, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels May 16, 2018
@gordonbondon gordonbondon changed the title r/aws_instance: Add support for launch template [WIP] r/aws_instance: Add support for launch template May 23, 2018
aws/resource_aws_instance.go Outdated Show resolved Hide resolved
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Jun 19, 2018
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Jul 1, 2018
@gordonbondon
Copy link
Contributor Author

Rebased and resolved conflicts.

@gordonbondon gordonbondon changed the title [WIP] r/aws_instance: Add support for launch template r/aws_instance: Add support for launch template Jul 1, 2018
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Jul 19, 2018
@gordonbondon
Copy link
Contributor Author

Rebased and resolved conflicts.

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. labels Jul 19, 2018
@Jamie-BitFlight
Copy link

Is this scheduled to be added after the 0.12 release?

@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Sep 9, 2018
@ghost ghost added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 10, 2018
@gordonbondon
Copy link
Contributor Author

Rerun acc tests after rebase:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSInstance_LaunchTemplate'
Password:
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSInstance_LaunchTemplate -timeout 120m
=== RUN   TestAccAWSInstance_LaunchTemplate
--- PASS: TestAccAWSInstance_LaunchTemplate (568.05s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	568.093s

@dshmelev
Copy link

Hi! Still not merged? This is important change. Release please.

@gordonbondon
Copy link
Contributor Author

It's been some time so I decided to rebase and retest. All looks fine:

→ make testacc TEST=./aws TESTARGS='-run=TestAccAWSInstance_LaunchTemplate'
Password:
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSInstance_LaunchTemplate -timeout 120m
=== RUN   TestAccAWSInstance_LaunchTemplate
--- PASS: TestAccAWSInstance_LaunchTemplate (848.09s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	848.141s

@bflad anything else I need to do with this PR?

@gordonbondon gordonbondon reopened this Mar 8, 2019
@alexandrst88
Copy link

alexandrst88 commented Jun 4, 2019

@sftim, @bflad hi! could you please provide ETA about merge this PR? Thanks!

@sftim
Copy link
Contributor

sftim commented Jun 4, 2019

Hi @alexandrst88
A while ago I provided some informal feedback on this PR. I'm afraid I don't actually know what the route to approval looks like for this repo.

It looks like https://github.com/terraform-providers/terraform-provider-aws/blob/master/.github/CONTRIBUTING.md explains what you'd need to do, and what the Terraform core team need to do.

@aeschright aeschright requested a review from a team June 25, 2019 19:21
@jasonneurohr
Copy link

Is there any update on this as I'm keen to use this functionality?

@sftim
Copy link
Contributor

sftim commented Nov 4, 2019

It looks like the fork this is from might have disappeared. Maybe someone else would like to pick up the baton?

@gordonbondon
Copy link
Contributor Author

gordonbondon commented Nov 4, 2019

Oops, I've completely forgotten about this PR and deleted my fork. I'll probably have to create new PR to rebase this one.

@jasonneurohr
Copy link

Oops, I've completely forgotten about this PR and deleted my fork. I'll probably have to create new PR to rebase this one.

I'm happy to test it out and or contribute if needed - I'm a bit green to Go though :)

@gordonbondon
Copy link
Contributor Author

I've opened new PR at #10807

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add support for launch_template in aws_instance resource
7 participants