fancy-magazine-29876
01/11/2019, 8:25 PMstocky-spoon-28903
01/11/2019, 8:42 PMget
resources to populate their attributes. This can be done by ID:
const vpc = aws.ec2.Vpc.get("my-vpc", id, {})
2. Use a data source - all of the Terraform data sources are mapped as functions with a get
prefix:
const publicHostedZoneId = (await aws.route53.getZone({ name: baseDomain,
})).id;
fancy-magazine-29876
01/11/2019, 8:43 PMstocky-spoon-28903
01/11/2019, 8:43 PMfancy-magazine-29876
01/11/2019, 8:43 PMstocky-spoon-28903
01/11/2019, 8:44 PMfancy-magazine-29876
01/11/2019, 8:44 PMget
- but subnets, security_groups would be kind of a painstocky-spoon-28903
01/11/2019, 8:47 PMconst amiId = (await aws.getAmi({
owners: ["self"],
mostRecent: true,
filters: [{
name: "name",
values: ["some-ami-*"],
}],
})).id;
fancy-magazine-29876
01/11/2019, 8:49 PMAmi
with any other resource type?getVpc
for example in the reference docs for aws
stocky-spoon-28903
01/11/2019, 8:51 PMaws.ec2.getAmi
) - most get functions are in the module for their namespacegetVpc
is here: https://pulumi.io/reference/pkg/nodejs/@pulumi/aws/ec2/#getVpcfancy-magazine-29876
01/11/2019, 8:52 PMstocky-spoon-28903
01/11/2019, 9:05 PM