creamy-potato-29402
09/24/2018, 4:55 PMnpm install
, right?full-dress-10026
09/24/2018, 5:00 PMwooden-air-15246
09/24/2018, 5:00 PMfull-dress-10026
09/24/2018, 5:56 PMeager-area-86739
09/24/2018, 6:25 PMaws-serverless
, cloud-aws
and aws
packages.
Given that we want to use X-Ray and Cognitive, what is the best approach?full-dress-10026
09/24/2018, 7:16 PMmy-service.ts
, is there a way to conditionally provision those resources based on a value in the config?incalculable-sundown-82514
09/24/2018, 7:54 PMfull-dress-10026
09/24/2018, 8:23 PMaws.cloudformation.Stack
?full-dress-10026
09/24/2018, 9:08 PMStack
object so I tried this:
let myStack = new aws.cloudformation.Stack("my-stack", {
templateUrl: templateUrl,
capabilities: ["CAPABILITY_NAMED_IAM"]
});
let myStackName = myStack.name;
let r = shell.execSync(`aws cloudformation describe-stacks --stack-name ${myStackName}`);
console.log("out:", r);
Intuitively that would work, but it's now clear there are multiple stages in processing an update. Presumably .name.get()
is available at a later stage.stocky-spoon-28903
09/24/2018, 9:10 PMoutputs
should be a field available on a Stack resource unless something unusual has happened to that onestocky-spoon-28903
09/24/2018, 9:11 PMfull-dress-10026
09/24/2018, 9:14 PMstocky-spoon-28903
09/24/2018, 9:15 PMstocky-spoon-28903
09/24/2018, 9:15 PMlet particularOutput = myStack.outputs.apply(o => o.particularOutput);
stocky-spoon-28903
09/24/2018, 9:16 PMfull-dress-10026
09/24/2018, 9:18 PMlet myStackName = myStack.outputs.apply(o => o["VpcId"]);
console.log("out:", myStackName);
which prints this in Diagnostics after running `pulumi update`:
pulumi:pulumi:Stack: infrastructure-infra-dev
info: out: Output {
__pulumiOutput: true,
isKnown: Promise { <pending> },
resources: [Function],
promise: [Function],
apply: [Function],
get: [Function] }
stocky-spoon-28903
09/24/2018, 9:21 PMfull-dress-10026
09/24/2018, 9:23 PMstocky-spoon-28903
09/24/2018, 9:23 PMwhite-balloon-205
full-dress-10026
09/24/2018, 9:26 PMfull-dress-10026
09/24/2018, 9:28 PM.apply
function.full-dress-10026
09/24/2018, 9:30 PMlet myStack = new aws.cloudformation.Stack("my-stack", {
templateUrl: templateUrl,
capabilities: ["CAPABILITY_NAMED_IAM"]
});
let myStackName = myStack.name;
let r = shell.execSync(`aws cloudformation describe-stacks --stack-name ${myStackName}`);
console.log("out:", r);
full-dress-10026
09/24/2018, 10:22 PMcloud.Service
? I see .ecsService.networkConfiguration
contains subnets
but not vpc
.full-dress-10026
09/24/2018, 10:43 PMsubnets
was a list of `aws.ec2.Subnet`s then you'd be able to get the vpc id.proud-tiger-5743
09/24/2018, 10:53 PMname
of the previous one, how can I ensure that infrastructure A exists before Infrastructure B is created?proud-tiger-5743
09/24/2018, 10:56 PMname
of the Kinesis streamfull-dress-10026
09/24/2018, 10:57 PMlet serviceSubnets = service.ecsService.networkConfiguration.apply(o => {
if (o != null) {
return o["subnets"];
} else {
throw new Error("No network configuration present on service. Cannot proceed.");
}
});
let serviceFirstSubnet = serviceSubnets.apply(subnets => subnets[0]);
let serviceVpcId = aws.ec2.Subnet.get("subnet", serviceFirstSubnet).vpcId;
There must be a cleaner way to do this.white-balloon-205
null
in that code - the callback should only run when the networkConfiguration
is available. Were you seeing otherwise?white-balloon-205
let serviceVpcId = service.ecsService.networkConfiguration.apply(async (networkConfig) => {
let subnetId = networkConfig["subnets"][0];
let subnet = await aws.ec2.getSubnet({ id: subnetId });
return subnet.vpcId;
});