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

Add automatic recovery property to aws_launch_template and aws_instance #24377

Conversation

Nnachevvv
Copy link
Contributor

@Nnachevvv Nnachevvv commented Apr 23, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes : #24039

This PR introduces new property automatic_recovery_behavior to aws_launch_template and aws_instance. More details can be found in Recover your instance .

Output from acceptance testing:


 make testacc TESTS=TestAccEC2Instance_automaticRecoveryBehavior PKG=ec2   
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2Instance_automaticRecoveryBehavior'  -timeout 180m
=== RUN   TestAccEC2Instance_automaticRecoveryBehavior
=== PAUSE TestAccEC2Instance_automaticRecoveryBehavior
=== CONT  TestAccEC2Instance_automaticRecoveryBehavior

--- PASS: TestAccEC2Instance_automaticRecoveryBehavior (149.20s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	153.234s


make testacc TESTS=TestAccEC2LaunchTemplate_data PKG=ec2       ==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2LaunchTemplate_data'  -timeout 180m
=== RUN   TestAccEC2LaunchTemplate_data
=== PAUSE TestAccEC2LaunchTemplate_data
=== CONT  TestAccEC2LaunchTemplate_data
--- PASS: TestAccEC2LaunchTemplate_data (44.79s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	48.727s


make testacc TESTS=TestAccEC2InstanceDataSource_automaticRecoveryBehavior PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2InstanceDataSource_automaticRecoveryBehavior'  -timeout 180m
=== RUN   TestAccEC2InstanceDataSource_automaticRecoveryBehavior
=== PAUSE TestAccEC2InstanceDataSource_automaticRecoveryBehavior
=== CONT  TestAccEC2InstanceDataSource_automaticRecoveryBehavior
--- PASS: TestAccEC2InstanceDataSource_automaticRecoveryBehavior (182.71s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	186.685s
...

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. labels Apr 23, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @Nnachevvv 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Apr 25, 2022
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Apr 25, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccEC2Instance_basic\|TestAccEC2Instance_autoRecovery\|TestAccEC2LaunchTemplate_data\|TestAccEC2InstanceDataSource_autoRecovery\|TestAccEC2LaunchTemplateDataSource_name\|TestAccEC2LaunchTemplate_basic' PKG=ec2 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccEC2Instance_basic\|TestAccEC2Instance_autoRecovery\|TestAccEC2LaunchTemplate_data\|TestAccEC2InstanceDataSource_autoRecovery\|TestAccEC2LaunchTemplateDataSource_name\|TestAccEC2LaunchTemplate_basic -timeout 180m
=== RUN   TestAccEC2InstanceDataSource_autoRecovery
=== PAUSE TestAccEC2InstanceDataSource_autoRecovery
=== RUN   TestAccEC2Instance_basic
=== PAUSE TestAccEC2Instance_basic
=== RUN   TestAccEC2Instance_autoRecovery
=== PAUSE TestAccEC2Instance_autoRecovery
=== RUN   TestAccEC2LaunchTemplateDataSource_name
=== PAUSE TestAccEC2LaunchTemplateDataSource_name
=== RUN   TestAccEC2LaunchTemplate_basic
=== PAUSE TestAccEC2LaunchTemplate_basic
=== RUN   TestAccEC2LaunchTemplate_data
=== PAUSE TestAccEC2LaunchTemplate_data
=== CONT  TestAccEC2InstanceDataSource_autoRecovery
=== CONT  TestAccEC2LaunchTemplateDataSource_name
=== CONT  TestAccEC2Instance_autoRecovery
--- PASS: TestAccEC2LaunchTemplateDataSource_name (43.68s)
=== CONT  TestAccEC2LaunchTemplate_data
--- PASS: TestAccEC2LaunchTemplate_data (14.99s)
=== CONT  TestAccEC2Instance_basic
--- PASS: TestAccEC2Instance_basic (86.84s)
=== CONT  TestAccEC2LaunchTemplate_basic
--- PASS: TestAccEC2Instance_autoRecovery (155.51s)
--- PASS: TestAccEC2LaunchTemplate_basic (13.69s)
--- PASS: TestAccEC2InstanceDataSource_autoRecovery (178.38s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	182.308s

@ewbankkit
Copy link
Contributor

ewbankkit commented Apr 25, 2022

@Nnachevvv Thanks for the contribution 🎉 👏.
To more closely match the underlying AWS API and future-proof ourselves for any future enhancements I made the new argument part of a new maintenance_options configuration block.

@ewbankkit ewbankkit merged commit b9871a4 into hashicorp:main Apr 26, 2022
@github-actions github-actions bot added this to the v4.12.0 milestone Apr 26, 2022
@JohnnyBoi888
Copy link
Contributor

Appreciate involved for addressing this swiftly! 👏 🙇

@github-actions
Copy link

This functionality has been released in v4.12.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!


The `maintenance_options` block supports the following:

* `auto_recovery` - (Optional) The automatic recovery behavior of the Instance. Can be `"default"` or `"dedicated"`. See [Recover your instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html) for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the two valid values are default and disabled. dedicated is a type of instance tenancy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ewbankkit pls see ^^, I think documentation probably needs a quick touch up? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relates #24462.

@github-actions
Copy link

github-actions bot commented Jun 2, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2022
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. 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.

Launch Template/EC2 Support for Auto-Recovery Setting
4 participants