Thread
#general
    p

    prehistoric-ram-58389

    2 months ago
    Hi all, in my setup, I have many different AWS components, which include ECS Task definition, and ECS Service. Whenever I run
    pulumi up
    , without changing anything to ECS Task definition, it is still replaced. Is there anyway to prevent this from happening?
    My task definition is wrapped within
    pulumi.all
    b

    billowy-army-68599

    2 months ago
    can you show the diff?
    p

    prehistoric-ram-58389

    2 months ago
    const taskDefinition = pulumi.all([region.name, dbHost, dbName, dbUsername, dbPassword])
    .apply(([region, dbHost, dbName, dbUsername, dbPassword]) =>
    new aws.ecs.TaskDefinition("metis", { …
    Just a sec
    pulumi:pulumi:Stack: (same)
        [urn=urn:pulumi:zoined-forecast/dev::singularity::pulumi:pulumi:Stack::singularity-zoined-forecast/dev]
        ++aws:ecs/taskDefinition:TaskDefinition: (create-replacement)
            [id=metis]
            [urn=urn:pulumi:zoined-forecast/dev::singularity::aws:ecs/taskDefinition:TaskDefinition::metis]
            [provider=urn:pulumi:zoined-forecast/dev::singularity::pulumi:providers:aws::default_5_10_0::deb0d88b-de94-4bf0-8e11-99c3f347ce69]
          ~ containerDefinitions: (json) [
              ~ [0]: {
                      ~ environment     : [
                          ~ [0]: {
                                  ~ name : "DB_HOST" => "JOB_QUEUE_FETCH"
                                  ~ value: "[secret]" => "dev-singularity-fetch"
                                }
                          ~ [1]: {
                                  ~ name : "DB_NAME" => "JOB_QUEUE_FORECAST"
                                  ~ value: "[secret]" => "dev-singularity-tuning"
                                }
                          ~ [2]: {
                                  ~ name : "DB_PASSWORD" => "JOB_QUEUE_TUNE"
                                  ~ value: "[secret]" => "dev-singularity-forecast"
                                }
                          ~ [3]: {
                                  ~ name : "DB_PORT" => "JOB_DEFINITION_FETCH"
                                  ~ value: "5432" => "dev-singularity-fetch"
                                }
                          ~ [4]: {
                                  ~ name : "DB_USERNAME" => "JOB_DEFINITION_FORECAST"
                                  ~ value: "[secret]" => "dev-singularity-tuning"
                                }
                          ~ [5]: {
                                  ~ name : "JOB_DEFINITION_FETCH" => "JOB_DEFINITION_TUNE"
                                  ~ value: "dev-singularity-fetch" => "dev-singularity-forecast"
                                }
                          ~ [6]: {
                                  ~ name : "JOB_DEFINITION_FORECAST" => "DB_HOST"
                                  ~ value: "dev-singularity-tuning" => "[secret]"
                                }
                          ~ [7]: {
                                  ~ name : "JOB_DEFINITION_TUNE" => "DB_PORT"
                                  ~ value: "dev-singularity-forecast" => "5432"
                                }
                          ~ [8]: {
                                  ~ name : "JOB_QUEUE_FETCH" => "DB_NAME"
                                  ~ value: "dev-singularity-fetch" => "[secret]"
                                }
                          ~ [9]: {
                                  ~ name : "JOB_QUEUE_FORECAST" => "DB_USERNAME"
                                  ~ value: "dev-singularity-tuning" => "[secret]"
                                }
                          ~ [10]: {
                                  ~ name : "JOB_QUEUE_TUNE" => "DB_PASSWORD"
                                  ~ value: "dev-singularity-forecast" => "[secret]"
                                }
                        ]
                      ~ healthCheck     : {
                          - retries : 3
                          - timeout : 5
                        }
                      - mountPoints     : []
                      - portMappings    : []
                      - volumesFrom     : []
                    }
              ~ [1]: {
                      - mountPoints     : []
                      ~ portMappings    : [
                          ~ [0]: {
                                  - protocol     : "tcp"
                                }
                        ]
                      - volumesFrom     : []
                    }
            ]
        +-aws:ecs/taskDefinition:TaskDefinition: (replace)
            [id=metis]
            [urn=urn:pulumi:zoined-forecast/dev::singularity::aws:ecs/taskDefinition:TaskDefinition::metis]
            [provider=urn:pulumi:zoined-forecast/dev::singularity::pulumi:providers:aws::default_5_10_0::deb0d88b-de94-4bf0-8e11-99c3f347ce69]
          ~ containerDefinitions: (json) [
              ~ [0]: {
                      ~ environment     : [
                          ~ [0]: {
                                  ~ name : "DB_HOST" => "JOB_QUEUE_FETCH"
                                  ~ value: "[secret]" => "dev-singularity-fetch"
                                }
                          ~ [1]: {
                                  ~ name : "DB_NAME" => "JOB_QUEUE_FORECAST"
                                  ~ value: "[secret]" => "dev-singularity-tuning"
                                }
                          ~ [2]: {
                                  ~ name : "DB_PASSWORD" => "JOB_QUEUE_TUNE"
                                  ~ value: "[secret]" => "dev-singularity-forecast"
                                }
                          ~ [3]: {
                                  ~ name : "DB_PORT" => "JOB_DEFINITION_FETCH"
                                  ~ value: "5432" => "dev-singularity-fetch"
                                }
                          ~ [4]: {
                                  ~ name : "DB_USERNAME" => "JOB_DEFINITION_FORECAST"
                                  ~ value: "[secret]" => "dev-singularity-tuning"
                                }
                          ~ [5]: {
                                  ~ name : "JOB_DEFINITION_FETCH" => "JOB_DEFINITION_TUNE"
                                  ~ value: "dev-singularity-fetch" => "dev-singularity-forecast"
                                }
                          ~ [6]: {
                                  ~ name : "JOB_DEFINITION_FORECAST" => "DB_HOST"
                                  ~ value: "dev-singularity-tuning" => "[secret]"
                                }
                          ~ [7]: {
                                  ~ name : "JOB_DEFINITION_TUNE" => "DB_PORT"
                                  ~ value: "dev-singularity-forecast" => "5432"
                                }
                          ~ [8]: {
                                  ~ name : "JOB_QUEUE_FETCH" => "DB_NAME"
                                  ~ value: "dev-singularity-fetch" => "[secret]"
                                }
                          ~ [9]: {
                                  ~ name : "JOB_QUEUE_FORECAST" => "DB_USERNAME"
                                  ~ value: "dev-singularity-tuning" => "[secret]"
                                }
                          ~ [10]: {
                                  ~ name : "JOB_QUEUE_TUNE" => "DB_PASSWORD"
                                  ~ value: "dev-singularity-forecast" => "[secret]"
                                }
                        ]
                      ~ healthCheck     : {
                          - retries : 3
                          - timeout : 5
                        }
                      - mountPoints     : []
                      - portMappings    : []
                      - volumesFrom     : []
                    }
              ~ [1]: {
                      - mountPoints     : []
                      ~ portMappings    : [
                          ~ [0]: {
                                  - protocol     : "tcp"
                                }
                        ]
                      - volumesFrom     : []
                    }
            ]
        ~ aws:ecs/service:Service: (update)
            [id=arn:aws:ecs:eu-west-1:xxx:service/dev/metis-8ab8ca1]
            [urn=urn:pulumi:zoined-forecast/dev::singularity::aws:ecs/service:Service::metis]
            [provider=urn:pulumi:zoined-forecast/dev::singularity::pulumi:providers:aws::default_5_10_0::deb0d88b-de94-4bf0-8e11-99c3f347ce69]
          ~ taskDefinition: [secret] => output<string>
        --aws:ecs/taskDefinition:TaskDefinition: (delete-replaced)
            [id=metis]
            [urn=urn:pulumi:zoined-forecast/dev::singularity::aws:ecs/taskDefinition:TaskDefinition::metis]
            [provider=urn:pulumi:zoined-forecast/dev::singularity::pulumi:providers:aws::default_5_10_0::deb0d88b-de94-4bf0-8e11-99c3f347ce69]
    It seems to remove a few settings in containerDefinitions, even though I don’t specify these settings.
    b

    billowy-army-68599

    2 months ago
    it looks like it’s reordering things?
    p

    prehistoric-ram-58389

    2 months ago
    Reordering?
    b

    billowy-army-68599

    2 months ago
    the same environment variables are there, but they appear to be in a different order right?
    p

    prehistoric-ram-58389

    2 months ago
    Yes, they appear in different order than I have specified
    Do you think that matters?
    This issue describes exactly what I am seeing https://github.com/pulumi/pulumi-aws/issues/1985
    I think the main issue is that pulumi compares my raw config with the one it has formatted.