narrow-boots-93205
01/24/2024, 10:20 PMminiature-musician-31262
01/24/2024, 10:22 PMegress
block -- have you tried this? https://www.pulumi.com/docs/clouds/aws/guides/ecs/#creating-an-ecs-cluster-in-a-vpccuddly-computer-18851
01/25/2024, 12:11 AMnarrow-boots-93205
01/25/2024, 12:27 AMconst cluster = new awsx.classic.ecs.Cluster('cluster');
export const alb = new awsx.classic.lb.ApplicationLoadBalancer( 'net-lb', {
external: true,
securityGroups: cluster.securityGroups
});
const atg = alb.createTargetGroup('app-tg', { port: 4000, deregistrationDelay: 0, protocol: 'HTTP' });
export const webHTTPS = atg.createListener('webHTTPS', {
external: true,
port: 443,
protocol: 'HTTPS',
sslPolicy: 'ELBSecurityPolicy-2016-08',
certificateArn: config.certificateArn
});
const fargateSecurityGroup = new aws.ec2.SecurityGroup('fargateSecurityGroup', {
egress: [
{
fromPort: 0,
toPort: 0,
protocol: '-1',
cidrBlocks: [ '0.0.0.0/0' ],
ipv6CidrBlocks: [ '::/0' ]
}
]
});
const appService = new awsx.classic.ecs.FargateService('app-svc', {
cluster,
securityGroups: [ fargateSecurityGroup.id, ...cluster.securityGroups.map(g => g.id) ],
taskDefinitionArgs: {
container: {
image: img.imageUri,
cpu: 102 /*10% of 1024*/,
memory: 50 /*MB*/,
portMappings: [
// webHTTP,
webHTTPS
]
}
},
desiredCount: 1
});
narrow-boots-93205
01/25/2024, 12:29 AMcuddly-computer-18851
01/25/2024, 12:45 AMnarrow-boots-93205
01/25/2024, 12:55 AMnetworkConfiguration
. Is that what you are talking about?cuddly-computer-18851
01/25/2024, 1:11 AMawsx
- they're a poorly document / maintained abstraction compared to the core packages.