sparse-intern-71089
03/29/2021, 7:32 PMmillions-furniture-75402
03/29/2021, 7:37 PMlittle-cartoon-10569
03/29/2021, 7:38 PMwonderful-napkin-50018
03/29/2021, 7:40 PMwonderful-napkin-50018
03/29/2021, 7:41 PMmillions-furniture-75402
03/29/2021, 7:44 PMconst cluster = new awsx.ecs.Cluster(`${appName}-cluster`,{
cluster: aws.ecs.Cluster.get(`${appName}-local`, "sandbox-cluster"),
vpc: vpc,
});
millions-furniture-75402
03/29/2021, 7:45 PMconst appService = new awsx.ecs.FargateService(`${appName}-service`, {
assignPublicIp: false,
cluster,
deploymentMinimumHealthyPercent: 0,
deploymentMaximumPercent: 100,
desiredCount: 1,
securityGroups: [appSecurityGroup],
subnets: vpc.privateSubnetIds,
taskDefinitionArgs: {
containers: {
grafana: {
image: awsx.ecs.Image.fromDockerBuild(`${appName}-image`, {
context: "./src",
dockerfile: "./src/grafana.Dockerfile",
}),
logConfiguration: {
logDriver: "awsfirelens",
options: {
"Name": "tail",
"region": "us-east-1",
"auto_create_stream": "true",
}
},
portMappings: [appTargetGroup],
}
},
taskRole: applicationRole,
}
});
wonderful-napkin-50018
03/29/2021, 7:53 PMwonderful-napkin-50018
03/29/2021, 10:51 PMlittle-cartoon-10569
03/29/2021, 10:53 PMwonderful-napkin-50018
03/29/2021, 11:05 PMwonderful-napkin-50018
03/29/2021, 11:06 PMaws.ec2.getVpc()
which supposedly does what I want but I cannot pass my vpcId
input to it because it's not a string. I am very confused.wonderful-napkin-50018
03/29/2021, 11:06 PMaws.ec2.Vpc
I could make an awsx.ec2.Vpc
with it, right? But how...little-cartoon-10569
03/29/2021, 11:34 PMlittle-cartoon-10569
03/29/2021, 11:35 PMlittle-cartoon-10569
03/29/2021, 11:36 PMlittle-cartoon-10569
03/29/2021, 11:37 PMlittle-cartoon-10569
03/29/2021, 11:39 PMwonderful-napkin-50018
03/30/2021, 12:29 AMfromExistingId()
but found that this is not really importing any of the VPC data like subnets:
const vpcId = infra.requireOutputValue('vpcId');
const vpc = awsx.ec2.Vpc.fromExistingIds('staging', { vpcId });
export const vpcSubnets = vpc.publicSubnetIds;
vpcSubnets will be empty againwonderful-napkin-50018
03/30/2021, 12:30 AMVpc.get()
. It's as if none of them do any actual importing and they all just create an empty object with the vpcId.little-cartoon-10569
03/30/2021, 12:32 AMlittle-cartoon-10569
03/30/2021, 12:33 AMwonderful-napkin-50018
03/30/2021, 12:55 AMlittle-cartoon-10569
03/30/2021, 12:58 AMthen
clause, rather than within the "engine" like all the other resources.little-cartoon-10569
03/30/2021, 12:59 AMmillions-furniture-75402
03/30/2021, 1:14 PMmillions-furniture-75402
03/30/2021, 1:15 PM