Hi everyone, I have an issue with ECS blue-green d...
# aws
c
Hi everyone, I have an issue with ECS blue-green deployment. When I deploy it for the first time, it works fine but when I run
pulumi up
again, I'm getting following exception. As I understand this is expected, but I can't make any changes on my stack. I can use code deploy for ECS deployment, that's ok. But I want to make some changes on other things and I'm not able to. Is there a workaround for this? Here is my code.
Copy code
* updating ECS Service (arn:aws:ecs:us-east-1:xxxxx): operation error ECS: UpdateService, https response error StatusCode: 400, RequestID: xxxxxxxx, InvalidParameterException: Unable to update task definition on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment.
q
c
Annoyingly ignoring doesn't work. I'm still getting the same error. There is a similar issue in here
q
What value did you try for
ignoreChanges
?
c
I'm passing following. I understand why it's happening. It looks like
new awsx.ecs.FargateService
is no respecting
ignoreChanges
parameter, but
new aws.ecs.Service
does. Probably I'll need to refactor my original code to use new
aws.ecs.Service
instead of
awsx.ecs.FargateService
.
Copy code
ignoreChanges: ['desiredCount', 'loadBalancers', 'taskDefinition'],
q
Ah, you're using a component. Components do not pass ignoreChanges to the child resources they're creating. You can use the
transforms
resource option to set ignore changes on the child resources: https://www.pulumi.com/docs/iac/concepts/options/transforms/
c
Interesting, then why are they accepting it as parameter?
q
ignoreChanges
is part of the generic base class for all resources. It's not like components do not support
ignoreChanges
, but it's up to the component implementor to decide how to pass that to the components childs. In most cases this is difficult to implement given that you rarely want
ignoreChanges
to apply to all the child resources.
c
ok thanks. That makes sense but I don't think it's clear in the documentation. Following transformation helped.
Copy code
transforms: [
        (args) => {
          if (args.type === 'aws:ecs/service:Service') {
            return {
              props: args.props,
              opts: pulumi.mergeOptions(args.opts, {
                ignoreChanges: ['desiredCount', 'loadBalancers', 'taskDefinition'],
              }),
            }
          }
          return undefined
        },
      ],