terraform apply and plan is broken with carriage return in opsworks custom.json template file #310
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.
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)
Terraform Configuration Files
Attached as file
opsworks-create-stack.tf includes the data "template_file" + the module that is used for creating an opsworks stack
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
orapply
.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
plan
orapply
will show changes , but actually there are noneWhat 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
orterraform apply
show 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
The text was updated successfully, but these errors were encountered: