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

terraform apply and plan is broken with carriage return in opsworks custom.json template file #310

Closed
hashibot opened this issue Jun 13, 2017 · 3 comments
Labels
bug Addresses a defect in current functionality. service/opsworks Issues and PRs that pertain to the opsworks service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@hashibot
Copy link

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


Hi there,

found a pretty strange issue. It seems like a carriage return at the bottom of a template.json are "compared / diffed / parsed" in a wrong way with the actually applied state within opsworks.
It seems only to afffect version 0.7.5

Terraform Version

0.7.5

Affected Resource(s)

  • aws_opsworks_stack

Terraform Configuration Files

Attached as file

  1. opsworks-create-stack.tf includes the data "template_file" + the module that is used for creating an opsworks stack

  2. config_stack.json is the template file itself that is rendered

Expected Behavior

As there are no changes within the custom.json - terraform should not try to apply or suggest any changes that are related to the custom.json during plan or apply.

Actual Behavior

terraform plan suggests changes , terraform apply - really applies changes although there are none - Actually if you apply the changes for the custom.json they are the same in Opsworks as before.

Steps to Reproduce

  • create a opsworks stack with a custom.json
  • the template file includes a carriage return at the end of the template.json
  • apply initially
  • the next plan or apply will show changes , but actually there are none

What i suspect to be a cause of the problem:
It seems like the carriage return "/n" within the template is deleted by the Opsworks API.
A strong indication for this issue is, that terraform plan or terraform applyshow in their change list an additional "/n" after the whole custom.json block.

If you delete the carriage return (bottom line) within the template file, the issue seems to be fixed.

Additional information:
Usage of S3 remote state files.

Cheers
Ole

opsworks-create-stack.tf.txt
config_stack.json.txt

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@repl-raymond-bolander
Copy link

We are seeing a similar issue as well.

@radeksimko radeksimko added the service/opsworks Issues and PRs that pertain to the opsworks service. label Jan 25, 2018
@github-actions
Copy link

github-actions bot commented Apr 4, 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 Apr 4, 2020
@github-actions github-actions bot closed this as completed May 4, 2020
@ghost
Copy link

ghost commented Jun 4, 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 Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/opsworks Issues and PRs that pertain to the opsworks service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

3 participants