@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
169 lines (168 loc) • 5.73 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* `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",
* });
* ```
*/
export declare function getRouteTable(args?: GetRouteTableArgs, opts?: pulumi.InvokeOptions): Promise<GetRouteTableResult>;
/**
* A collection of arguments for invoking getRouteTable.
*/
export interface GetRouteTableArgs {
/**
* Configuration block. Detailed below.
*/
filters?: inputs.ec2.GetRouteTableFilter[];
/**
* ID of an Internet Gateway or Virtual Private Gateway which is connected to the Route Table (not exported if not passed as a parameter).
*/
gatewayId?: string;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: string;
/**
* ID of the specific Route Table to retrieve.
*/
routeTableId?: string;
/**
* ID of a Subnet which is connected to the Route Table (not exported if not passed as a parameter).
*/
subnetId?: string;
/**
* Map of tags, each pair of which must exactly match a pair on the desired Route Table.
*/
tags?: {
[key: string]: string;
};
/**
* ID of the VPC that the desired Route Table belongs to.
*/
vpcId?: string;
}
/**
* A collection of values returned by getRouteTable.
*/
export interface GetRouteTableResult {
/**
* ARN of the route table.
*/
readonly arn: string;
/**
* List of associations with attributes detailed below.
*/
readonly associations: outputs.ec2.GetRouteTableAssociation[];
readonly filters?: outputs.ec2.GetRouteTableFilter[];
/**
* Gateway ID. Only set when associated with an Internet Gateway or Virtual Private Gateway.
*/
readonly gatewayId: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* ID of the AWS account that owns the route table.
*/
readonly ownerId: string;
readonly region: string;
/**
* Route Table ID.
*/
readonly routeTableId: string;
/**
* List of routes with attributes detailed below.
*/
readonly routes: outputs.ec2.GetRouteTableRoute[];
/**
* Subnet ID. Only set when associated with a subnet.
*/
readonly subnetId: string;
readonly tags: {
[key: string]: string;
};
readonly vpcId: string;
}
/**
* `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",
* });
* ```
*/
export declare function getRouteTableOutput(args?: GetRouteTableOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetRouteTableResult>;
/**
* A collection of arguments for invoking getRouteTable.
*/
export interface GetRouteTableOutputArgs {
/**
* Configuration block. Detailed below.
*/
filters?: pulumi.Input<pulumi.Input<inputs.ec2.GetRouteTableFilterArgs>[]>;
/**
* ID of an Internet Gateway or Virtual Private Gateway which is connected to the Route Table (not exported if not passed as a parameter).
*/
gatewayId?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* ID of the specific Route Table to retrieve.
*/
routeTableId?: pulumi.Input<string>;
/**
* ID of a Subnet which is connected to the Route Table (not exported if not passed as a parameter).
*/
subnetId?: pulumi.Input<string>;
/**
* Map of tags, each pair of which must exactly match a pair on the desired Route Table.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* ID of the VPC that the desired Route Table belongs to.
*/
vpcId?: pulumi.Input<string>;
}