swift-dinner-29731
06/25/2019, 7:55 AMconst nlb = new awsx.elasticloadbalancingv2.NetworkLoadBalancer("some-nlb", {external: true });
const tg = nlb.createTargetGroup("some-tg", { port: 3000 });
const listener = tg.createListener("some-http-listener", { port: 80 });
const listener2 = tg.createListener('https-listener', {
certificateArn: certificate.arn,
loadBalancerArn: nlb.arn,
port: 443,
protocol: "TLS",
sslPolicy: "ELBSecurityPolicy-2016-08"
});
let service = new awsx.ecs.FargateService("some-app", {
desiredCount: 1,
taskDefinitionArgs: {
containers: {
myapp: {
image: awsx.ecs.Image.fromPath("app", "../"),
memory: 512,
portMappings: [listener],
},
},
},
});
const webDnsRecord = new aws.route53.Record("webDnsRecord", {
name: domain,
type: "A",
zoneId: hostedZoneId,
aliases: [{
evaluateTargetHealth: true,
name: listener.endpoint.hostname,
zoneId: listener.loadBalancer.zoneId, <!!! problem here>
}],
}, { dependsOn: sslCertValidationIssued });
How to get zoneId for elastic load balacer ?
Because in this code I had this error :
error: awsroute53/recordRecord resource 'webDnsRecord' has a problem: "alias.0.zone_id": required field is not setgentle-diamond-70147
06/25/2019, 3:57 PMnew pulumi.Config().require("zoneId")
), or you can do a look up to get the Zone ID based on the zone name.swift-dinner-29731
06/25/2019, 4:00 PMtg.loadBalancer.loadBalancer.zoneId
gentle-diamond-70147
06/25/2019, 4:03 PMhostedZoneId
for the record itself, not the aliases. 👍lemon-student-18495
06/26/2019, 9:04 PM