Open tlinhart opened 3 days ago
Thank you for reporting this strange behavior. The bug reproduces.
Starting with this:
import json
import pulumi as pulumi
import pulumi_aws as aws
test = aws.batch.JobDefinition(
"test",
name="my_test_batch_job_definition",
type="container",
container_properties=json.dumps(
{
"command": [
"ls",
],
"image": "busybox",
"resourceRequirements": [
{
"type": "VCPU",
"value": "1",
},
{
"type": "MEMORY",
"value": "512",
},
]
}
),
tags={"env": "prod"}
)
pulumi.export("name", test.name)
pulumi.export("revision", test.revision)
Checking tagging with this snippet:
aws batch describe-job-definitions --job-definition-name my_test_batch_job_definition |
jq '.jobDefinitions[]|{revision: .revision, tags: .tags}'
After a pulumi up
, we get:
{
"revision": 1,
"tags": {
"env": "prod"
}
}
After changing the command and doing another pulumi up
:
"command": [
"ls", "--help"
],
We get this:
{
"revision": 1,
"tags": {
"env": "prod"
}
}
{
"revision": 2,
"tags": {}
}
I am finding the same behavior in Terraform proper, so I think this is something that needs fixing ideally in the upstream provider. I will file a bug there and link here.
I have filed this in https://github.com/hashicorp/terraform-provider-aws/issues/39795 - it might help to upvote it to get the maintainers attention! Once the fix is made available the Pulumi provider will likely inherit it and get fixed as well in a regular release.
Thanks! I upvoted the issue.
Describe what happened
We observe this strange behavior with
aws.batch.JobDefinition
tags:pulumi-aws-tags
library) or tags explicitly defined viatags
argument.tags
argument), the job definition resource receives the tags.Sample program
Log output
Here's the output of
pulumi up
after changing e.g. command in container properties which leads to a new job definition revision:Here's the output after the same change when adding a
--diff
option:Affected Resource(s)
aws.batch.JobDefinition
Output of
pulumi about
Additional context
We use tags propagation to propagate tags from the job and job definition to the ECS task. We found out in AWS Cost Explorer that the tags of ECS tasks corresponding to Batch jobs started to be missing on May 30 this year. This might relate to the Pulumi AWS package update from 6.34.1 to 6.37.1 that we performed on May 27.
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).