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

问题描述 投票:0回答:1

我正在尝试使用Pulumi创建一个带有网络模式bridge任务的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

amazon-ecs pulumi
1个回答
0
投票

看起来这还没有普鲁米支持,但在PR 233this change修复。

修复包含在pulumi-awsx 0.18.2中。

现在只为网络模式networkConfiguration指定awsvpc

© www.soinside.com 2019 - 2024. All rights reserved.