Try AWS Native preview for resources not in the classic version.
aws.ec2.LocalGatewayRoute
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Manages an EC2 Local Gateway Route. More information can be found in the Outposts User Guide.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.LocalGatewayRoute("example", {
destinationCidrBlock: "172.16.0.0/16",
localGatewayRouteTableId: exampleAwsEc2LocalGatewayRouteTable.id,
localGatewayVirtualInterfaceGroupId: exampleAwsEc2LocalGatewayVirtualInterfaceGroup.id,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.LocalGatewayRoute("example",
destination_cidr_block="172.16.0.0/16",
local_gateway_route_table_id=example_aws_ec2_local_gateway_route_table["id"],
local_gateway_virtual_interface_group_id=example_aws_ec2_local_gateway_virtual_interface_group["id"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewLocalGatewayRoute(ctx, "example", &ec2.LocalGatewayRouteArgs{
DestinationCidrBlock: pulumi.String("172.16.0.0/16"),
LocalGatewayRouteTableId: pulumi.Any(exampleAwsEc2LocalGatewayRouteTable.Id),
LocalGatewayVirtualInterfaceGroupId: pulumi.Any(exampleAwsEc2LocalGatewayVirtualInterfaceGroup.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.LocalGatewayRoute("example", new()
{
DestinationCidrBlock = "172.16.0.0/16",
LocalGatewayRouteTableId = exampleAwsEc2LocalGatewayRouteTable.Id,
LocalGatewayVirtualInterfaceGroupId = exampleAwsEc2LocalGatewayVirtualInterfaceGroup.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.LocalGatewayRoute;
import com.pulumi.aws.ec2.LocalGatewayRouteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new LocalGatewayRoute("example", LocalGatewayRouteArgs.builder()
.destinationCidrBlock("172.16.0.0/16")
.localGatewayRouteTableId(exampleAwsEc2LocalGatewayRouteTable.id())
.localGatewayVirtualInterfaceGroupId(exampleAwsEc2LocalGatewayVirtualInterfaceGroup.id())
.build());
}
}
resources:
example:
type: aws:ec2:LocalGatewayRoute
properties:
destinationCidrBlock: 172.16.0.0/16
localGatewayRouteTableId: ${exampleAwsEc2LocalGatewayRouteTable.id}
localGatewayVirtualInterfaceGroupId: ${exampleAwsEc2LocalGatewayVirtualInterfaceGroup.id}
Create LocalGatewayRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LocalGatewayRoute(name: string, args: LocalGatewayRouteArgs, opts?: CustomResourceOptions);
@overload
def LocalGatewayRoute(resource_name: str,
args: LocalGatewayRouteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LocalGatewayRoute(resource_name: str,
opts: Optional[ResourceOptions] = None,
destination_cidr_block: Optional[str] = None,
local_gateway_route_table_id: Optional[str] = None,
local_gateway_virtual_interface_group_id: Optional[str] = None)
func NewLocalGatewayRoute(ctx *Context, name string, args LocalGatewayRouteArgs, opts ...ResourceOption) (*LocalGatewayRoute, error)
public LocalGatewayRoute(string name, LocalGatewayRouteArgs args, CustomResourceOptions? opts = null)
public LocalGatewayRoute(String name, LocalGatewayRouteArgs args)
public LocalGatewayRoute(String name, LocalGatewayRouteArgs args, CustomResourceOptions options)
type: aws:ec2:LocalGatewayRoute
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LocalGatewayRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LocalGatewayRouteArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LocalGatewayRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LocalGatewayRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LocalGatewayRouteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var localGatewayRouteResource = new Aws.Ec2.LocalGatewayRoute("localGatewayRouteResource", new()
{
DestinationCidrBlock = "string",
LocalGatewayRouteTableId = "string",
LocalGatewayVirtualInterfaceGroupId = "string",
});
example, err := ec2.NewLocalGatewayRoute(ctx, "localGatewayRouteResource", &ec2.LocalGatewayRouteArgs{
DestinationCidrBlock: pulumi.String("string"),
LocalGatewayRouteTableId: pulumi.String("string"),
LocalGatewayVirtualInterfaceGroupId: pulumi.String("string"),
})
var localGatewayRouteResource = new LocalGatewayRoute("localGatewayRouteResource", LocalGatewayRouteArgs.builder()
.destinationCidrBlock("string")
.localGatewayRouteTableId("string")
.localGatewayVirtualInterfaceGroupId("string")
.build());
local_gateway_route_resource = aws.ec2.LocalGatewayRoute("localGatewayRouteResource",
destination_cidr_block="string",
local_gateway_route_table_id="string",
local_gateway_virtual_interface_group_id="string")
const localGatewayRouteResource = new aws.ec2.LocalGatewayRoute("localGatewayRouteResource", {
destinationCidrBlock: "string",
localGatewayRouteTableId: "string",
localGatewayVirtualInterfaceGroupId: "string",
});
type: aws:ec2:LocalGatewayRoute
properties:
destinationCidrBlock: string
localGatewayRouteTableId: string
localGatewayVirtualInterfaceGroupId: string
LocalGatewayRoute Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The LocalGatewayRoute resource accepts the following input properties:
- Destination
Cidr stringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Local
Gateway stringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- Local
Gateway stringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- Destination
Cidr stringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Local
Gateway stringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- Local
Gateway stringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination
Cidr StringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local
Gateway StringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- local
Gateway StringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination
Cidr stringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local
Gateway stringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- local
Gateway stringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination_
cidr_ strblock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local_
gateway_ strroute_ table_ id - Identifier of EC2 Local Gateway Route Table.
- local_
gateway_ strvirtual_ interface_ group_ id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination
Cidr StringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local
Gateway StringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- local
Gateway StringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
Outputs
All input properties are implicitly available as output properties. Additionally, the LocalGatewayRoute resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing LocalGatewayRoute Resource
Get an existing LocalGatewayRoute resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LocalGatewayRouteState, opts?: CustomResourceOptions): LocalGatewayRoute
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
destination_cidr_block: Optional[str] = None,
local_gateway_route_table_id: Optional[str] = None,
local_gateway_virtual_interface_group_id: Optional[str] = None) -> LocalGatewayRoute
func GetLocalGatewayRoute(ctx *Context, name string, id IDInput, state *LocalGatewayRouteState, opts ...ResourceOption) (*LocalGatewayRoute, error)
public static LocalGatewayRoute Get(string name, Input<string> id, LocalGatewayRouteState? state, CustomResourceOptions? opts = null)
public static LocalGatewayRoute get(String name, Output<String> id, LocalGatewayRouteState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Destination
Cidr stringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Local
Gateway stringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- Local
Gateway stringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- Destination
Cidr stringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Local
Gateway stringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- Local
Gateway stringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination
Cidr StringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local
Gateway StringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- local
Gateway StringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination
Cidr stringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local
Gateway stringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- local
Gateway stringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination_
cidr_ strblock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local_
gateway_ strroute_ table_ id - Identifier of EC2 Local Gateway Route Table.
- local_
gateway_ strvirtual_ interface_ group_ id - Identifier of EC2 Local Gateway Virtual Interface Group.
- destination
Cidr StringBlock - IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- local
Gateway StringRoute Table Id - Identifier of EC2 Local Gateway Route Table.
- local
Gateway StringVirtual Interface Group Id - Identifier of EC2 Local Gateway Virtual Interface Group.
Import
Using pulumi import
, import aws_ec2_local_gateway_route
using the EC2 Local Gateway Route Table identifier and destination CIDR block separated by underscores (_
). For example:
$ pulumi import aws:ec2/localGatewayRoute:LocalGatewayRoute example lgw-rtb-12345678_172.16.0.0/16
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.