https://pulumi.com logo
Title
g

glamorous-camera-26392

04/20/2022, 6:39 AM
i’ve been running in to an issue with awsx.ecs. initial deployments work fine, but when we try to push new versions the task definition is being marked as
inactive
, but the task is not stopped, so the new definition is never used to create new tasks. relevant ecs code looks like
const cluster = new awsx.ecs.Cluster('mycluster', { vpc });
const myecs = new awsx.ecs.EC2Service('myservice', {
  cluster,
  securityGroups,
  taskDefinitionArgs: {
    containers: {
      flyway: {
        image: 'my/flyway:latest',
        entryPoint: ['/bin/sh'],
        command: ['-c', 'flyway -url=${JDBC_URL} -user=${POSTGRES_USER} -password=${POSTGRES_PASSWORD} migrate'],
        cpu: 1,
        memory: 1024,
        essential: false,
        environment: [
          { 'name': 'POSTGRES_PASSWORD', 'value': dbPassword },
          { 'name': 'JDBC_URL', 'value': jdbcUrl },
          { 'name': 'POSTGRES_USER', 'value': dbUsername },
        ],
      },
      myservice: {
        image: 'my/service:latest',
        cpu: 2,
        memory: 2750,
        environment: [
          { 'name': 'JDBC_PASSWORD', 'value': dbPassword },
          { 'name': 'JDBC_URL', 'value': jdbcUrl },
          { 'name': 'JDBC_USER', 'value': dbUsername },
        ],
        portMappings: [web],
        essential: true,
        dependsOn: [{
          containerName: 'flyway',
          condition: 'SUCCESS'
        }],
      },
    },
  },
});