@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
94 lines • 3.3 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRouteTablesOutput = exports.getRouteTables = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* This resource can be useful for getting back a list of route table ids to be referenced elsewhere.
*
* ## Example Usage
*
* The following adds a route for a particular cidr block to every (private
* kops) route table in a specified vpc to use a particular vpc peering
* connection.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const rts = aws.ec2.getRouteTables({
* vpcId: vpcId,
* filters: [{
* name: "tag:kubernetes.io/kops/role",
* values: ["private*"],
* }],
* });
* const r: aws.ec2.Route[] = [];
* rts.then(rts => rts.ids).length.apply(rangeBody => {
* for (const range = {value: 0}; range.value < rangeBody; range.value++) {
* r.push(new aws.ec2.Route(`r-${range.value}`, {
* routeTableId: rts.then(rts => rts.ids[range.value]),
* destinationCidrBlock: "10.0.0.0/22",
* vpcPeeringConnectionId: "pcx-0e9a7a9ecd137dc54",
* }));
* }
* });
* ```
*/
function getRouteTables(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:ec2/getRouteTables:getRouteTables", {
"filters": args.filters,
"region": args.region,
"tags": args.tags,
"vpcId": args.vpcId,
}, opts);
}
exports.getRouteTables = getRouteTables;
/**
* This resource can be useful for getting back a list of route table ids to be referenced elsewhere.
*
* ## Example Usage
*
* The following adds a route for a particular cidr block to every (private
* kops) route table in a specified vpc to use a particular vpc peering
* connection.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const rts = aws.ec2.getRouteTables({
* vpcId: vpcId,
* filters: [{
* name: "tag:kubernetes.io/kops/role",
* values: ["private*"],
* }],
* });
* const r: aws.ec2.Route[] = [];
* rts.then(rts => rts.ids).length.apply(rangeBody => {
* for (const range = {value: 0}; range.value < rangeBody; range.value++) {
* r.push(new aws.ec2.Route(`r-${range.value}`, {
* routeTableId: rts.then(rts => rts.ids[range.value]),
* destinationCidrBlock: "10.0.0.0/22",
* vpcPeeringConnectionId: "pcx-0e9a7a9ecd137dc54",
* }));
* }
* });
* ```
*/
function getRouteTablesOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:ec2/getRouteTables:getRouteTables", {
"filters": args.filters,
"region": args.region,
"tags": args.tags,
"vpcId": args.vpcId,
}, opts);
}
exports.getRouteTablesOutput = getRouteTablesOutput;
//# sourceMappingURL=getRouteTables.js.map