-
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: Add aws_cloudformation_stack #2636
provider/aws: Add aws_cloudformation_stack #2636
Conversation
7a90700
to
8383610
Compare
This is an extraordinarily meta feature. |
6d22f63
to
0aa06df
Compare
Nice 👍 looking forward to this. |
I'm experimenting with your feature branch and I'm running into an error when trying to update a CF stack. When this happens the state file becomes corrupt and terraform thinks it already updated the stack on subsequent runs. I spent some time debugging this but got nowhere.
I do have template_body defined in my resource - which gets initially created just fine. P.S. If you haven't seen it I think #1778 will help manage templates |
@bhourigan Thanks for testing it! Would you mind sharing the I have seen |
No problem at all - I can reproduce this reliably. Here's my cloudformation.tf https://gist.github.com/bhourigan/1baa3ec39905eb016da6 which includes the template and all other resource parameters. |
I didn't find issues enabled for http://github.com/timeincoss/terraform - so bug reports are going here. If there is a more appropriate location for these happy to oblige. During testing I munged my tfstate file and was forced to remove the CF stack via the web console. When I went to re-apply the refresh didn't pick up that the stack needs to be re-created.
|
This is the right place for bugs. I will have a look into that probably during the upcoming weekend or the next one. I wanted to finish some other bits & send PRs for Google provider-related stuff first. Thanks for providing the gist though. |
ec74f8f
to
1f8015d
Compare
@bhourigan This was an issue of missing fields for Update, should be fixed now. I also slightly improved error reporting during rollbacks, but I'm still not sure if that's the best approach to this. If there is |
1f8015d
to
b7cd361
Compare
I've been trying to test this - unsuccessfully. I don't know whether something is broken in my environment or if there is a regression introduced in your latest commits. I'm on b7cd361 of f-aws-cloudformation. Build steps: $ mv ~/gocode ~/gocode.attic
$ go get github.com/TimeIncOSS/terraform
$ cd ~/gocode/src/github.com/TimeIncOSS/terraform
$ git checkout f-aws-cloudformation
$ make updatedeps
$ make dev I'm getting the following error when running
I run your tests and they seem to pass:
I'm using the right binary in $PATH:
It matches the latest build in bin/:
When I run Is this PEBKAC on my part? |
This PR has been open for a long time & is important to us. Is there anything I can do to move it forward? I think progress report is the only thing not implemented, has anyone else already started on that? |
I'd love to continue testing - but I'm unable to. |
@woodhull Sorry for the silence here. I plan to get back to this PR probably this week. I want to add more acceptance tests with more complicated examples. I'm afraid that proper progress reporting will require bigger changes in the core - ain't saying it's impossible, just a bit more difficult, than you may imagine. Calling I was more thinking of merging this without progress reporting - just check more thoroughly for bugs and issues & then let someone else review this. Feature-wise it should be complete. Is progress reporting critical feature - i.e. if there was no detailed progress reporting, would you not be using this resource at all? @bhourigan I'll try to reproduce that, but I have never been compiling custom build like this. I usually use git remotes:
|
Progress reporting is not a critical feature for us. |
1bf9603
to
531bec0
Compare
That's now fixed. From now on any errors coming from
I'm not quite convinced Terraform should automate this. If you chose the CloudFormation workflow, I'd guess you did so for reason - i.e. if creation/update fails, you probably want to inspect the state. The "clean way" of approaching that problem would be probably
Do you really think we should be tainting the resource automatically or even destroying+creating again? It feels too magical to me. Current statusA few acceptance tests was added covering basic functionality, I'm just trying to find out how to parse events reliably due to |
👍
I must confess that the only thing I want from CloudFormation is the AutoScalingRollingUpdate policy. Since this functionality is not exposed via AWS APIs I'm forced to consume CF instead. I admit I don't have enough experience with the CF paradigm to offer an informed opinion.
I don't think terraform should ever destroy a resource unless you explicitly ask it to. I agree it's difficult to code around all possible CF policies but I think at the very least terraform should report deltas between my desired infrastructure and the currently applied infrastructure, without depending on catching errors from previous runs. |
@bhourigan I must admit I'm slightly confused now 😃
but you're getting that feedback now, aren't you?
Exactly, but AFAIK the only way out of failed creation is to destroy the stack and create it from scratch again, which you can actually even recognise from the AWS Console that has "Update" button greyed out when this happens. How do you want to solve this then?
That should be happening since the last commit too. CF has a special API endpoint just for templates which I'm using there. The diff may not be as useful as you'd hoped, because it's minified - i.e. spaces removed etc., but you should have that functionality there. Give it a try and let me know if there's something else you'd change/improve. |
NP - I should of tested before commenting. |
e6a8836
to
b77ce4f
Compare
a6d8537
to
d5cb741
Compare
So I finally managed to finish this PR. It's ready for review/merge. A few different acceptance tests is attached too. |
ecc797e
to
48c29d1
Compare
48c29d1
to
7088a00
Compare
Hey @radeksimko sorry for the delay, this looks good! Merge away 😄 |
provider/aws: Add aws_cloudformation_stack
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. |
Status
Proper events parsing & progress report - I'll see how easy/difficult it is, but this would be nice to have for UX- too difficult at this point, can be added laterTest plan