dazzling-sundown-39670
05/27/2020, 11:32 AMawsx.ec2.Vpc
, how can I create a aws.elasticache.SubnetGroup
based on the subnets in that VPC? I've tried some different things, code in thread:export const vpc = new awsx.ec2.Vpc("test-pulumi-vpc-2", {
numberOfAvailabilityZones: 2,
cidrBlock: "10.0.0.0/16",
tags: {
Name: "tf-test",
},
});
const selectedVpc = pulumi.output(aws.ec2.getVpc({
tags: {
Name: vpc.id,
},
}, { async: true }));
const selectedSubnetIds = selectedVpc.apply(selectedVpc => aws.ec2.getSubnetIds({
tags: {
Tier: "private",
},
vpcId: selectedVpc.id!,
}, { async: true }));
// const subnetGroup = selectedSubnetIds.apply(ids => {
// return new aws.elasticache.SubnetGroup("subnetGroup", {
// subnetIds: [ids], // how to use?
// });
// })
// const subnetGroup = new aws.elasticache.SubnetGroup("subnetGroup", {
// subnetIds: [selectedSubnetIds.apply], // how to use?
// });
broad-dog-22463
05/27/2020, 11:34 AMdazzling-sundown-39670
05/27/2020, 11:36 AMType 'Promise<Output<string>[]>' is not assignable to type 'Input<string>'.
const subnetGroup = new aws.elasticache.SubnetGroup("subnetGroup", {
subnetIds: [vpc.privateSubnetIds],
});
when I do thisbroad-dog-22463
05/27/2020, 11:37 AMdazzling-sundown-39670
05/27/2020, 11:38 AMType 'Output<UnwrappedArray<Output<string>>>' is not assignable to type 'Input<string>'.
broad-dog-22463
05/27/2020, 11:40 AMdazzling-sundown-39670
05/27/2020, 11:46 AMbroad-dog-22463
05/27/2020, 11:50 AMdazzling-sundown-39670
05/27/2020, 11:52 AMbroad-dog-22463
05/27/2020, 12:10 PMimport * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
export const vpc = new awsx.ec2.Vpc("test-pulumi-vpc-2", {
numberOfAvailabilityZones: 2,
cidrBlock: "10.0.0.0/16",
tags: {
Name: "tf-test",
},
});
const subnetGroup = new aws.elasticache.SubnetGroup("subnetGroup", {
subnetIds: vpc.privateSubnetIds.then(),
}, {
dependsOn: [vpc]
});
then()
as that resolves the promisedazzling-sundown-39670
05/27/2020, 12:11 PMbroad-dog-22463
05/27/2020, 12:12 PMdazzling-sundown-39670
05/27/2020, 12:13 PMbroad-dog-22463
05/27/2020, 12:20 PMdazzling-sundown-39670
05/27/2020, 12:23 PMconfigurationEndpoint
broad-dog-22463
05/27/2020, 12:25 PMdazzling-sundown-39670
05/27/2020, 1:02 PM