This message was deleted.
# aws
s
This message was deleted.
b
The code I am running into this issue with. Also the package versions are list below but should be the latest since this a brand new create stack. `@pulumi/aws`: 5.31.0 `@pulumi/awsx`: 1.0.2
@pulumi/pulumi
: 3.58.0
b
@bored-branch-92019 you’re not passing the vpc configuration to your fargate service, so it’s trying to use the default which doesn’t exist. take a look at the network configuration settings in awsx.ecs.fargateservice
b
That fixed my error. Thank you very much @billowy-army-68599. For reference incase anyone finds this in the future. I needed to update my fargate service as @billowy-army-68599 suggested above like like below.
Copy code
const service = new awsx.ecs.FargateService("pulumi-service", {
    cluster: cluster.arn,
    desiredCount: 2,
    networkConfiguration: {
      assignPublicIp: true,
      securityGroups: [securityGroup.id],
      subnets: vpc.publicSubnetIds
    },
    taskDefinitionArgs: {
        container: {
            // would in the future pull this from a ECR repository
            image: "nginx:latest",
            cpu: 512,
            memory: 128,
            essential: true,
            portMappings: [
              {
                targetGroup: lb.defaultTargetGroup,
              }
            ]
        },
    },

});
Follow up question If I wanted to use an existing VPC + security groups + subnets. Is there a way to import them while making it absolutely 100% immutable so that pulumi never tries to change, update, delete those resources but just references them for use in building other net new infra? I ask because the ECS + Fargate service side would all be new to our company but we have several other setups within a VPC not managed by any IAC (right now 😏 ) that would very bad if they were updated by pulumi.
b
you can set
protect
on those resources so that it won’t modify any immutable properties
alternatively you can just reference them with aws.ec2.getVpc
b
🙏 I will give this a try.