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

Integrate terraform plan with cloudformation changesets #132

Closed
hashibot opened this issue Jun 13, 2017 · 6 comments
Closed

Integrate terraform plan with cloudformation changesets #132

hashibot opened this issue Jun 13, 2017 · 6 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudformation Issues and PRs that pertain to the cloudformation service.

Comments

@hashibot
Copy link

This issue was originally opened by @torfredrik as hashicorp/terraform#6014. It was migrated here as part of the provider split. The original body of the issue is below.


When a cloudformation stack is changed in terraform the terraform plan only shows a change to the stack, it would be useful to know the underlying resource changes that will occur. An easy way to add this feature is using cloudformation change sets .

@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 13, 2017
@nathanielks
Copy link
Contributor

nathanielks commented Aug 25, 2017

@apparentlymart I'm debating on if this is a problem to tackle now and could use your input. In thinking through how to create an aws_cloudformation_changeset resource, I believe an issue that still wouldn't be solved is displaying what changes would actually be applied to the stack. If I understand what you were saying in the previous ticket as well as hashicorp/terraform#8769, presenting the changes that CloudFormation would be applying to the stack would be an issue because Terraform doesn't support custom diff presentation. Is that correct?

To further clarify: in creating a aws_cloudformation_changeset resource, whenever changes were to be made, only the changes to the actual resource would be displayed (eg, parameter_a being changed from true to false), not that an EC2 Instance would be created or not. Does Terraform currently support the ability to customize the diff presentation? Or maybe this could be solved by using an aws_cloudformation_changeset resource in conjunction with a data source, and the data source could display the diff?

resource "aws_cloudformation_changeset" "main" {
  name_prefix  = "some-stack"
  description  = "Performs updates on some-stack CloudFormation Stack"
  stack_name   = "some-stack"
  capabilities = ["CAPABILITY_IAM"]

  parameters = {
    foo = "bar"
    bar = "baz"
    baz = true
  }

  tags = {
    "foo" = "bar"
  }

  template_body = "${file(var.template_path)}"
}

data "aws_cloudformation_changeset" "main" {
  id = "${aws_cloudformation_changeset.main.id}"
}

Or maybe this could be solved by using an external data source and a script?

@radeksimko radeksimko added the service/cloudformation Issues and PRs that pertain to the cloudformation service. label Jan 25, 2018
@lorengordon
Copy link
Contributor

This might also help with a problem when the CloudFormation template contains a transform, since the transform must be executed through a changeset. Right now, if you attempt to launch a stack using the aws_cloudformation_stack resource the API will return an error:

* aws_cloudformation_stack.foo: Creating CloudFormation stack failed: ValidationError: CreateStack cannot be used with templates containing Transforms.    status code: 400, request id: <elided>

@github-actions
Copy link

github-actions bot commented Jun 5, 2020

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jun 5, 2020
@github-actions github-actions bot closed this as completed Jul 5, 2020
@lorengordon
Copy link
Contributor

Wait, can we reopen this please!

@ghost ghost removed the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jul 5, 2020
@fdiorazio
Copy link

This actually would be a great feature since changesets are very fast compared to deleting the entire stack and re-deploying it.

@ghost
Copy link

ghost commented Aug 5, 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 Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudformation Issues and PRs that pertain to the cloudformation service.
Projects
None yet
Development

No branches or pull requests

5 participants