@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
86 lines • 3.26 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.getRouteTableOutput = exports.getRouteTable = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* `aws.ec2.RouteTable` provides details about a specific Route Table.
*
* This resource can prove useful when a module accepts a Subnet ID as an input variable and needs to, for example, add a route in the Route Table.
*
* ## Example Usage
*
* The following example shows how one might accept a Route Table ID as a variable and use this data source to obtain the data necessary to create a route.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const config = new pulumi.Config();
* const subnetId = config.requireObject<any>("subnetId");
* const selected = aws.ec2.getRouteTable({
* subnetId: subnetId,
* });
* const route = new aws.ec2.Route("route", {
* routeTableId: selected.then(selected => selected.id),
* destinationCidrBlock: "10.0.1.0/22",
* vpcPeeringConnectionId: "pcx-45ff3dc1",
* });
* ```
*/
function getRouteTable(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:ec2/getRouteTable:getRouteTable", {
"filters": args.filters,
"gatewayId": args.gatewayId,
"region": args.region,
"routeTableId": args.routeTableId,
"subnetId": args.subnetId,
"tags": args.tags,
"vpcId": args.vpcId,
}, opts);
}
exports.getRouteTable = getRouteTable;
/**
* `aws.ec2.RouteTable` provides details about a specific Route Table.
*
* This resource can prove useful when a module accepts a Subnet ID as an input variable and needs to, for example, add a route in the Route Table.
*
* ## Example Usage
*
* The following example shows how one might accept a Route Table ID as a variable and use this data source to obtain the data necessary to create a route.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const config = new pulumi.Config();
* const subnetId = config.requireObject<any>("subnetId");
* const selected = aws.ec2.getRouteTable({
* subnetId: subnetId,
* });
* const route = new aws.ec2.Route("route", {
* routeTableId: selected.then(selected => selected.id),
* destinationCidrBlock: "10.0.1.0/22",
* vpcPeeringConnectionId: "pcx-45ff3dc1",
* });
* ```
*/
function getRouteTableOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:ec2/getRouteTable:getRouteTable", {
"filters": args.filters,
"gatewayId": args.gatewayId,
"region": args.region,
"routeTableId": args.routeTableId,
"subnetId": args.subnetId,
"tags": args.tags,
"vpcId": args.vpcId,
}, opts);
}
exports.getRouteTableOutput = getRouteTableOutput;
//# sourceMappingURL=getRouteTable.js.map