-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws/aws_instance: add instance_initiated_shutdown_behavior (supersedes 2779) #2887
Conversation
…own_behavior`, accepts string values of 'stop' or 'terminate'. Signed-off-by: Marc Tamsky <tamsky@users.noreply.github.com>
* master: (86 commits) providers/google: Fix reading account_file path providers/google: Fix error appending providers/google: Return if we could parse JSON providers/google: Change account_file to JSON providers/google: Default account_file* to empty providers/google: Add account_file/account_file_contents ConflictsWith providers/google: Document account_file_contents providers/google: Use account_file_contents if provided providers/google: Add account_file_contents to provider Update CHANGELOG.md Update CHANGELOG.md use d.Id() Update CHANGELOG.md Update CHANGELOG.md scripts: change website_push to push from HEAD update analytics core: fix crash on provider warning provider/aws: Update source to comply with upstream breaking change Update CHANGELOG. provider/aws: Fix issue with IAM Server Certificates and Chains ...
Hey @tamsky – I tried running the TestAccAWSInstance_basic basic test after this addition, and got a peculiar error:
Did you ever encounter that error by chance? I didn't see any mention of The test uses AMI I used AMI |
@catsby I have not seen that error. Others have, but without a clear origin or cause: puppetlabs-toy-chest/puppetlabs-aws#176 |
I opened a support case with AWS to inquire, and it turns out the AMI I was using is Instance-Store backed, thus not "elastic". Instance-store are always terminated at shutdown, so this behavior is impossible to set for them. From what I can see we can't simply have a I've adjusted the PR to no longer have a default, and make this value be optional. This way, we don't try to send that default to an instance type that doesn't support it. Unfortunately now you can't simply remove the attribute from the config after you set it, or at least, doing so won't "restore the default". E.g., an instance with resource "aws_instance" "example" {
ami = "ami-21f78e11"
instance_initiated_shutdown_behavior = "terminate"
} As it stands now with 8d5fe93, removing @tamsky / @phinze let me know if you think that behavior is OK, or if you have other ideas on how to support |
I agree not having a This behavior means the docs I wrote will need a bump. Is it possible to also improve the user-visible error message? When we see the error text |
@@ -36,6 +36,8 @@ The following arguments are supported: | |||
EBS-optimized. | |||
* `disable_api_termination` - (Optional) If true, enables [EC2 Instance | |||
Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination) | |||
* `instance_initiated_shutdown_behavior` - (Optional) [Shutdown Behavior](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) Can be `"stop"` | |||
or `"terminate"`. (Default: `"stop"`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be updated to something like:
Defaults to
stop
for EBS-backed instances andterminate
for instance-store instances. Cannot be set on instance-store instances.
With a wee docs tweak this looks good to go! |
* master: (84 commits) provider/aws: Update to aws-sdk 0.9.0 rc1 use name instead of id - launch configs use the name and not ID Fix typo on heroku_cert example provider/aws: add value into ELB name validation message tests: fix missed test update from last merge update prevent_destroy error message Update CHANGELOG.md Update CHANGELOG.md providers/aws: Update Launch Config. docs to detail naming and lifecycle recommendation release: cleanup after v0.6.3 v0.6.3 Update CHANGELOG.md core: fix deadlock when dependable node replaced with non-dependable one tests: extract deadlock checking test helper core: log every 5s while waiting for dependencies Fixed indentation in a code sample state/remote/s3: match with upstream changes provider/aws: match with upstream changes google: Add example of two-tier app Updating Launch Config Docs for Name attribute ...
provider/aws/aws_instance: add instance_initiated_shutdown_behavior (supersedes 2779)
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Supersedes #2779 by merging
master
so the original contributor doesn't have to