coinbase / terraform-landscape

Improve Terraform's plan output to be easier to read and understand
Apache License 2.0
1.59k stars 116 forks source link

Parsing printed line breaks incorrectly #83

Closed walkafwalka closed 5 years ago

walkafwalka commented 5 years ago

The following was parsed incorrectly:

module.kops-cluster.aws_iam_role_policy.additional-nodes-REDACTED: Modifying... (ID: REDACTED:REDACTED)
  policy: "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"route53:ChangeResourceRecordSets\"\n      ],\n      \"Resource\": [\n        \"arn:aws:route53:::hostedzone/*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"route53:ListHostedZones\",\n        \"route53:ListResourceRecordSets\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:*\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    }\n  ]\n}" => "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"route53:ChangeResourceRecordSets\"\n      ],\n      \"Resource\": [\n        \"arn:aws:route53:::hostedzone/*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"route53:ListHostedZones\",\n        \"route53:ListResourceRecordSets\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:CreateBucket\",\n        \"s3:DeleteObject\",\n        \"s3:Put*\",\n        \"s3:Get*\",\n        \"s3:List*\"\n      ],\n      \"Resource\": [\n        \"arn:aws:s3:::*\"\n      ]\n    }\n  ]\n}"

It was parsed as:

~ module.kops-cluster.aws_iam_role_policy.REDACTED
    policy:

I am using GitLab CI to plan with landscape and then apply without landscape. I think the apply output would have had actual line breaks instead of printed line breaks.

rifelpet commented 5 years ago

Are you using an alpine base image? Possibly related: #51

walkafwalka commented 5 years ago

This did it. Is https://hub.docker.com/r/airhelp/terraform-landscape/ the official Docker image? If not, have you thought about creating a Docker hub image?