Pulumi桥接模式ECS服务的无效网络配置

时间:2019-04-22 12:37:07

标签: amazon-ecs pulumi

我正尝试使用具有网络模式bridge的任务的Pulumi创建ECS服务,以便在一个实例上运行多个任务。

创建服务时,pulumi输出error: Plan apply failed: InvalidParameterException: Network Configuration is not valid for the given networkMode of this task definition.无效。

pulumi似乎提供了networkConfiguration,即使在网络模式为bridge时也是不允许的:

    [urn=urn:pulumi:dev::pulumi::pulumi:pulumi:Stack::pulumi-dev]
        + aws:ecs/service:Service: (create)
            [urn=urn:pulumi:dev::pulumi::awsx:x:ecs:EC2Service$aws:ecs/service:Service::test]
            cluster                        : "arn:aws:ecs:eu-central-1:131009595785:cluster/test-12196f9"
            deploymentMaximumPercent       : 200
            deploymentMinimumHealthyPercent: 100
            desiredCount                   : 2
            enableEcsManagedTags           : false
            launchType                     : "EC2"
            loadBalancers                  : [
                [0]: {
                    containerName : "backend"
                    containerPort : 3000
                    targetGroupArn: "arn:aws:elasticloadbalancing:eu-central-1:131009595785:targetgroup/57d096ee-73ab93e/fce1408d3c067066"
                }
            ]
            name                           : "test-3e870ec"
            networkConfiguration           : {
                assignPublicIp: false
                securityGroups: [
                    [0]: "sg-035513ef294414b65"
                ]
                subnets       : [
                    [0]: "subnet-08831ff5642406fc7"
                    [1]: "subnet-00e3e870707b6aa90"
                ]
            }
            schedulingStrategy             : "REPLICA"
            taskDefinition                 : "arn:aws:ecs:eu-central-1:131009595785:task-definition/test-aece9bcd:24"
            waitForSteadyState             : true

是否有避免设置networkConfiguration的方法?我可以将服务的securityGroupssubnets设置为[],但是无法设置assignPublicIp

1 个答案:

答案 0 :(得分:0)

pulumi尚不支持这种方法,但是PR 233中的this change已将其修复。

此修复程序包含在pulumi-awsx 0.18.2中。

现在仅为网络模式networkConfiguration指定了awsvpc