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

[Bug]: aws_batch_job_definition environment variables diff unclear #34947

Closed
james-mullen3 opened this issue Dec 15, 2023 · 3 comments · Fixed by #21834
Closed

[Bug]: aws_batch_job_definition environment variables diff unclear #34947

james-mullen3 opened this issue Dec 15, 2023 · 3 comments · Fixed by #21834
Labels
bug Addresses a defect in current functionality. service/batch Issues and PRs that pertain to the batch service.
Milestone

Comments

@james-mullen3
Copy link

james-mullen3 commented Dec 15, 2023

Terraform Core Version

1.6.5

AWS Provider Version

5.31.0

Affected Resource(s)

aws_batch_job_definition

Expected Behavior

Adding a new variable the diff should just show the new environment variable being added.

Actual Behavior

Diff output shows other variables being added/removed which makes the diff hard to read especially where there a lot of environment variables.

In the diff below the new variable called hello was added but bob/four/two also appear in the diff output.

 # aws_batch_job_definition.sample must be replaced
-/+ resource "aws_batch_job_definition" "sample" {
      ~ arn                   = "arn:aws:batch:eu-west-1:XXXXX:job-definition/sample-definition:6" -> (known after apply)
      ~ container_properties  = jsonencode(
          ~ {
              + entryPoint           = []
              ~ environment          = [
                  - {
                      - name  = "bob"
                      - value = "three"
                    },
                  - {
                      - name  = "four"
                      - value = "four"
                    },
                    {
                        name  = "one"
                        value = "one"
                    },
                  - {
                      - name  = "two"
                      - value = "two"
                    },
                    {
                        name  = "jim"
                        value = "wibble"
                    },
                  + {
                      + name  = "two"
                      + value = "two"
                    },
                  + {
                      + name  = "bob"
                      + value = "three"
                    },
                  + {
                      + name  = "four"
                      + value = "four"
                    },
                  + {
                      + name  = "hello"
                      + value = "world"
                    },
                ]
              - mountPoints          = []
              - resourceRequirements = []
              - secrets              = []
              - ulimits              = []
              - volumes              = []
                # (5 unchanged attributes hidden)
            } # forces replacement

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

Just add a new variable at the end and see other appear in the diff output.

Simplest Terraform to be recreate the issue.

resource "aws_batch_job_definition" "sample" {
  name = "sample-definition"
  type = "container"

  container_properties = jsonencode(
{
    "command": ["sleep", "60"],
    "image": "busybox",
    "memory": 1024,
    "vcpus": 1,
    "entryPoint": [],
    "jobRoleArn": "arn:aws:iam::103057695907:role/ecsTaskExecutionRole",
    "environment": [
        {
                name="one"
                value="one"
        },
        {
                name="two"
                value="two"
        },
        {
                name="three"
                value="three"
        },
        {
                name="four"
                value="four"
        },
        {
                name="hello"
                value="world"
        }
        ]
})
}

Steps to Reproduce

Add a new variable to the supplied terraform script above.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

@james-mullen3 james-mullen3 added the bug Addresses a defect in current functionality. label Dec 15, 2023
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/batch Issues and PRs that pertain to the batch service. label Dec 15, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 15, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Dec 18, 2023
Copy link

github-actions bot commented Oct 9, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.71.0 milestone Oct 9, 2024
Copy link

This functionality has been released in v5.72.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/batch Issues and PRs that pertain to the batch service.
Projects
None yet
2 participants