terraform-landscape icon indicating copy to clipboard operation
terraform-landscape copied to clipboard

Support custom output formatters

Open smiller171 opened this issue 5 years ago • 2 comments

I'm using Atlantis to put my plans in GH PRs, and it would be great if landscape could better support the diff language format. Just a flag that would put the -/+ operators always at the start of the line.

Current:

Switched to workspace "test".

~ aws_ecs_service.webapp
    task_definition:   "redacted_webapp:64" => "${aws_ecs_task_definition.webapp.family}:${max("${aws_ecs_task_definition.webapp.revision}", "${aws_ecs_task_definition.webapp.revision}")}"

-/+ aws_ecs_task_definition.webapp (new resource required)
    id:                      "redacted_webapp" => "<computed>" (forces new resource)
    arn:                     "arn:aws:ecs:redacted:redacted:task-definition/redacted_webapp:64" => "<computed>"
    container_definitions:   "name": "MAIL_PROTOCOL",
                                      "value": "smtp"
                                    }
                                  ],
                                  "essential": true,
                             -    "image": "redacted.dkr.ecr.redacted.amazonaws.com/redacted:82bd2bb",
                             +    "image": "redacted.dkr.ecr.redacted.amazonaws.com/redacted:124c156",
                                  "logConfiguration": {
                                    "logDriver": "awslogs",
                                    "options": {
                                      "awslogs-create-group": "true",
                                      "awslogs-group": "php-logs-test",
                                  ],
                                  "environment": [
                              
                                  ],
                                  "essential": true,
                             -    "image": "redacted.dkr.ecr.redacted.amazonaws.com/nginx:82bd2bb",
                             +    "image": "redacted.dkr.ecr.redacted.amazonaws.com/nginx:124c156",
                                  "links": [
                                    "redacted"
                                  ],
                                  "logConfiguration": {
                                    "logDriver": "awslogs", (forces new resource)
    network_mode:            "" => "<computed>"
    revision:                "64" => "<computed>"

Plan: 1 to add, 1 to change, 1 to destroy.

Proposed:

Switched to workspace "test".

~ aws_ecs_service.webapp
    task_definition:   "redacted_webapp:64" => "${aws_ecs_task_definition.webapp.family}:${max("${aws_ecs_task_definition.webapp.revision}", "${aws_ecs_task_definition.webapp.revision}")}"

-/+ aws_ecs_task_definition.webapp (new resource required)
    id:                      "redacted_webapp" => "<computed>" (forces new resource)
    arn:                     "arn:aws:ecs:redacted:redacted:task-definition/redacted_webapp:64" => "<computed>"
    container_definitions:   "name": "MAIL_PROTOCOL",
                                      "value": "smtp"
                                    }
                                  ],
                                  "essential": true,
-                                 "image": "redacted.dkr.ecr.redacted.amazonaws.com/redacted:82bd2bb",
+                                 "image": "redacted.dkr.ecr.redacted.amazonaws.com/redacted:124c156",
                                  "logConfiguration": {
                                    "logDriver": "awslogs",
                                    "options": {
                                      "awslogs-create-group": "true",
                                      "awslogs-group": "php-logs-test",
                                  ],
                                  "environment": [
                              
                                  ],
                                  "essential": true,
-                                 "image": "redacted.dkr.ecr.redacted.amazonaws.com/nginx:82bd2bb",
+                                 "image": "redacted.dkr.ecr.redacted.amazonaws.com/nginx:124c156",
                                  "links": [
                                    "redacted"
                                  ],
                                  "logConfiguration": {
                                    "logDriver": "awslogs", (forces new resource)
    network_mode:            "" => "<computed>"
    revision:                "64" => "<computed>"

Plan: 1 to add, 1 to change, 1 to destroy.

smiller171 avatar Apr 24 '19 15:04 smiller171

Open to a pull request adding this functionality.

sds avatar May 03 '19 17:05 sds

I would but I've never used Ruby. I looked through the code a bit but couldn't quite grok what I'd need to change where.

smiller171 avatar May 03 '19 19:05 smiller171