-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 auto recovery #5388
Comments
Looks like this might not be possible and that the alarms are really only useful with auto scaling polices. After trying a few things, I get the following error:
These properties aren't available when setting up auto recovery in the console, so I assume that setting up auto recovery in Terraform is not possible at this time. Someone please correct me if I'm wrong. |
Hi @toddrosner! Thanks for opening this issue. I think this is related to #5390 also, but since this one is (just about!) earlier, I'm going to keep this one open for future discussion. It looks like this is not supported right now in Terraform, but I'd imagine it should be possible, so I'll tag this as an enhancement. |
@jen20 Thanks for the update. Hopefully we'll see this implemented soon. |
I have gotten an autorecover CloudWatch alarm created as follows:
I replicated the CloudFormation definition for an EC2 autorecover alarm from the Amazon documentation - seems you just need to pass dummy values for the missing parameters. I'm still unable to test that the autorecover alarm is actually working, but at least the resource is created! |
Oddly enough, @craigwatson 's solution is correct, even though I still see the same behavior from #5390. That is, I cannot create the autorecover action in the console (greyed out, claiming unsupported instance type even though EBS only, etc) yet, creating the alarm via TF seems to have succeeded. As mentioned though, there's no way to test autorecovery in AWS so we'll all have to wait for somebody's instance to die and for them to report back :) |
Hi folks I am going to close this out. I was able to get this working as follows:
Hope this helps Paul |
Even with #8455, I don't seem to be able to create the auto-recovery alarm in the AWS console for an EC2 instance created like this:
I got the error:
I tried this with an m3.medium instance, and confirmed that no instance storage was mounted (whereas if I left out the I created an identical instance in the console (e.g. running a diff between the results of |
@borsboom Some AMIs contains more than one ephemeral block devices definitions, you need to exclude them all, they are not visible in neither the Console nor the API. You can only query the AMIs, and find out them in the "Block Devices" section. |
@timonwong: thank you! Once I add no_device ephemeral_block_devices for both that were defined by the AMI, I was able to create the auto-recovery alarm in the AWS console. That gives me much more confidence that a Terraform-created auto-recovery alarm will work as well. For anyone finding this issue in the future, you can find the block devices for an AMI using something like this:
This translates into the following
|
Thanks for all the info. I went through similar issues mentioned in this post and finally came up with the full implementation here: https://github.com/cxmcc/tf_aws_ec2_auto_recovery Please let me know if you have any feedback. |
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. |
I'm trying to setup auto recovery for an EC2 instance. I have the ARN and properties defined in the alarm, but can't see a way to tie that to the instance.
Is auto recovery possible, and if so, what am I missing?
The text was updated successfully, but these errors were encountered: