Update ECS Service only when TaskDefinition is changed locally in pulumi
See original GitHub issueI created ECS Service and initial TaskDefintion with pulumi, then I set up automatic deployment (creating new task definition and update service from CI).
In this configuration, how do I achieve both of 1 and 2?:
- When
pulumi up
without change, expects no change. - When
pulumi up
with change on task definition, expects updating Service.
pulumi/pulumi-awsx#856 suggests ignoreChanges
but it does not solve the second case.
Maybe we need to have ignoreChanges with function, to ignore only when updating revision is older than the state.
Current behavior of pulumi up
after task def & service are updated by automatic deployment:
When I made NO changes to task def and without ignoreChanges
~ aws:ecs/service:Service: (update)
[id=...]
[urn=...]
[provider=...]
~ taskDefinition: "arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:task-definition/our-app-rails:5" => "arn:aws:ecs:ap-northeast-1:711533999350:task-definition/our-app-rails:4"
Pulumi is reverting task definition revision of service, even after pulumi refresh
(Use Case of pulumi/pulumi-awsx#856)
When I made SOME changes to task def and with ignoreChanges (in transformations
└─ awsx:x:ecs:FargateTaskDefinition rails
+- └─ aws:ecs:TaskDefinition rails replace [diff: ~containerDefinitions]
and no Service update.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Update ECS Service only when TaskDefinition is changed ...
I created ECS Service and initial TaskDefintion with pulumi, then I set up automatic deployment (creating new task definition and update ...
Read more >aws.ecs.TaskDefinition - Pulumi
Documentation for the aws.ecs.TaskDefinition resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >aws.ecs.Service - Pulumi
Documentation for the aws.ecs.Service resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >Module ecs | Package @pulumi/awsx | Node.js SDK
Create an ECS Service resource for EC2 with the given unique name, arguments, and options. Creates Task definition if taskDefinitionArgs is specified.
Read more >Module classic/ecs | Package @pulumi/awsx | Node.js SDK
Explore members of the ecs module in the @pulumi/awsx package. ... A Task Definition can be used to define a Service, or it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is due to the design of the upstream provider diff implementation - which does some normalization on
containerDefinitions
, but does not normalize empty values. You must either leave off env vars that are undefined, or specify them with the empty string value. The request to handle this and similar issues more specifically in the upstream provider is https://github.com/hashicorp/terraform-provider-aws/issues/11526.When I run the repro from @phillipedwards for the second time, this is the essence of the diff that I get:
This means that the environment variable with an undefined value got ignored (makes sense) but now the provider calculates the difference as if it was meaningful.
I believe this is specific to the provider implementation, so I’ll move the issue to
pulumi-aws
.