You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
In #2337 a change was made to try to identify only terraform specific changes when performing modifications to terraform plan output to make it look nicer in github. However, it doesn't work when adding new resources where the values are not (known after apply). For example, the following aws_route53_record resource is formatted incorrectly:
# module.foo.aws_route53_record.bar will be created
+ resource "aws_route53_record" "bar" {
+ allow_overwrite = (known after apply)
+ fqdn = (known after apply)
+ id = (known after apply)
+ name = "bar.example.com"
+ type = "A"
+ zone_id = "REDACTED"
+ alias {
+ evaluate_target_health = true
+ name = (known after apply)
+ zone_id = (known after apply)
}
}
gets formatted as:
# module.foo.aws_route53_record.bar will be created
+ resource "aws_route53_record" "bar" {+ allow_overwrite = (known after apply)+ fqdn = (known after apply)+ id = (known after apply)
+ name = "bar.example.com"
+ type = "A"
+ zone_id = "REDACTED"
+ alias {
+ evaluate_target_health = true
+ name = (known after apply)+ zone_id = (known after apply)
}
}
which is even more confusing than the case where the diff formatting hasn't been applied.
Reproduction Steps
Run atlantis with --enable-diff-markdown-format (or the equivalent environment variable) and configured to run against a github repository.
Create a new terraform configuration with a simple resource, such as a route53 zone (a route53 record was shown above, but it's easier to reproduce by adding a resource that doesn't depend on something else, such as a route53 zone). Ensure there are some values you specify directly (e.g. the name of the resource). A trivial example would be:
(don't worry about the name of the zone, we're only going to run terraform plan and not actually create anything)
Optional: run terraform plan locally to verify the plan output. It should look something like this (with the beginning part of the plan stripped off):
Terraform will perform the following actions:
# aws_route53_zone.foo will be created
+ resource "aws_route53_zone" "foo" {
+ arn = (known after apply)
+ comment = "Managed by Terraform"
+ force_destroy = false
+ id = (known after apply)
+ name = "foo.example.com"
+ name_servers = (known after apply)
+ tags_all = (known after apply)
+ zone_id = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
Commit the change to a branch, push it to github, and open a PR
View the atlantis plan output, and see that it looks something like this (the beginning part of the output is stripped off):
Terraform will perform the following actions:
# aws_route53_zone.foo will be created
+ resource "aws_route53_zone" "foo" {+ arn = (known after apply)
+ comment = "Managed by Terraform"
+ force_destroy = false
+ id = (known after apply)
+ name = "foo.example.com"
+ name_servers = (known after apply)+ tags_all = (known after apply)+ zone_id = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
Environment details
Atlantis version: 0.19.8
Relevant atlantis flags: --enable-diff-markdown-format (and appropriate configuration to have atlantis work with github)
The text was updated successfully, but these errors were encountered:
I haven't tested it with an actual atlantis install yet (I'll wait on the next release for that), but my quick test script I was using to reproduce the issue works fine with the regex changes. Thank you.
Community Note
Overview of the Issue
In #2337 a change was made to try to identify only terraform specific changes when performing modifications to terraform plan output to make it look nicer in github. However, it doesn't work when adding new resources where the values are not
(known after apply)
. For example, the following aws_route53_record resource is formatted incorrectly:gets formatted as:
which is even more confusing than the case where the diff formatting hasn't been applied.
Reproduction Steps
--enable-diff-markdown-format
(or the equivalent environment variable) and configured to run against a github repository.terraform plan
locally to verify the plan output. It should look something like this (with the beginning part of the plan stripped off):Environment details
--enable-diff-markdown-format
(and appropriate configuration to have atlantis work with github)The text was updated successfully, but these errors were encountered: