adorable-advantage-6937
05/23/2023, 2:28 PMconst cluster = new aws.ecs.Cluster(envRelated('st-primary-ecs-cluster'));
const alb = new <http://awsx.lb|awsx.lb>.ApplicationLoadBalancer(
envRelated("stp-loadbalancer"), {subnetIds: vpc.publicSubnetIds,listeners: [{
port: 443,
protocol: "HTTPS",
certificateArn: certificateArn,
defaultActions: [{ type: "forward", targetGroupArn: ??? },],
} ,
{
port: 80,
protocol: "HTTP",
defaultActions: [
{
type: "redirect",
redirect: {
port: "443",
protocol: "HTTPS",
statusCode: "HTTP_301",
},
},
],
}]});
const repo = new awsx.ecr.Repository(envRelated("ecr-st-repo"), {
forceDelete: true,
});
const imgApi = new awsx.ecr.Image(envRelated('st-api'), { repositoryUrl: repo.url, path: "./api", target: 'production' });
const appServiceApi = new awsx.ecs.FargateService("st-api-svc", {
cluster: cluster.arn,
assignPublicIp: true,
taskDefinitionArgs: {
container: {
image: imgApi.imageUri,
cpu: 102 /*10% of 1024*/,
memory: 50 /*MB*/,
essential: true,
portMappings: [ {containerPort: containerPort , targetGroup: alb.defaultTargetGroup} ],
},
},
desiredCount: 1,
});
ambitious-father-68746
05/23/2023, 3:44 PMalb.createListener
? That doesn't look very declarative.
Your code kind of matches what I use, but I'm not using crosswalk.adorable-advantage-6937
05/23/2023, 5:12 PMambitious-father-68746
05/23/2023, 5:48 PMadorable-advantage-6937
05/24/2023, 7:08 AMambitious-father-68746
05/24/2023, 11:17 AMconst alb = new awsx.lb.ApplicationLoadBalancer("web-traffic");
const listener = alb.createListener("web-listener", { port: 80 });