GetCustomerGateway
Get an existing AWS Customer Gateway.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var foo = Output.Create(Aws.Ec2.GetCustomerGateway.InvokeAsync(new Aws.Ec2.GetCustomerGatewayArgs
{
Filters =
{
new Aws.Ec2.Inputs.GetCustomerGatewayFilterArgs
{
Name = "tag:Name",
Values =
{
"foo-prod",
},
},
},
}));
var main = new Aws.Ec2.VpnGateway("main", new Aws.Ec2.VpnGatewayArgs
{
AmazonSideAsn = "7224",
VpcId = aws_vpc.Main.Id,
});
var transit = new Aws.Ec2.VpnConnection("transit", new Aws.Ec2.VpnConnectionArgs
{
CustomerGatewayId = foo.Apply(foo => foo.Id),
StaticRoutesOnly = false,
Type = foo.Apply(foo => foo.Type),
VpnGatewayId = main.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := ec2.LookupCustomerGateway(ctx, &ec2.LookupCustomerGatewayArgs{
Filters: []ec2.GetCustomerGatewayFilter{
ec2.GetCustomerGatewayFilter{
Name: "tag:Name",
Values: []string{
"foo-prod",
},
},
},
}, nil)
if err != nil {
return err
}
main, err := ec2.NewVpnGateway(ctx, "main", &ec2.VpnGatewayArgs{
AmazonSideAsn: pulumi.String("7224"),
VpcId: pulumi.String(aws_vpc.Main.Id),
})
if err != nil {
return err
}
_, err = ec2.NewVpnConnection(ctx, "transit", &ec2.VpnConnectionArgs{
CustomerGatewayId: pulumi.String(foo.Id),
StaticRoutesOnly: pulumi.Bool(false),
Type: pulumi.String(foo.Type),
VpnGatewayId: main.ID(),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
foo = aws.ec2.get_customer_gateway(filters=[{
"name": "tag:Name",
"values": ["foo-prod"],
}])
main = aws.ec2.VpnGateway("main",
amazon_side_asn=7224,
vpc_id=aws_vpc["main"]["id"])
transit = aws.ec2.VpnConnection("transit",
customer_gateway_id=foo.id,
static_routes_only=False,
type=foo.type,
vpn_gateway_id=main.id)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foo = pulumi.output(aws.ec2.getCustomerGateway({
filters: [{
name: "tag:Name",
values: ["foo-prod"],
}],
}, { async: true }));
const main = new aws.ec2.VpnGateway("main", {
amazonSideAsn: "7224",
vpcId: aws_vpc_main.id,
});
const transit = new aws.ec2.VpnConnection("transit", {
customerGatewayId: foo.id!,
staticRoutesOnly: false,
type: foo.type,
vpnGatewayId: main.id,
});Using GetCustomerGateway
function getCustomerGateway(args: GetCustomerGatewayArgs, opts?: InvokeOptions): Promise<GetCustomerGatewayResult>function get_customer_gateway(filters=None, id=None, tags=None, opts=None)func LookupCustomerGateway(ctx *Context, args *LookupCustomerGatewayArgs, opts ...InvokeOption) (*LookupCustomerGatewayResult, error)Note: This function is named
LookupCustomerGatewayin the Go SDK.
public static class GetCustomerGateway {
public static Task<GetCustomerGatewayResult> InvokeAsync(GetCustomerGatewayArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Filters
List<Get
Customer Gateway Filter Args> One or more [name-value pairs][dcg-filters] to filter by.
- Id string
The ID of the gateway.
- Dictionary<string, string>
Map of key-value pairs assigned to the gateway.
- Filters
[]Get
Customer Gateway Filter One or more [name-value pairs][dcg-filters] to filter by.
- Id string
The ID of the gateway.
- map[string]string
Map of key-value pairs assigned to the gateway.
- filters
Get
Customer Gateway Filter[] One or more [name-value pairs][dcg-filters] to filter by.
- id string
The ID of the gateway.
- {[key: string]: string}
Map of key-value pairs assigned to the gateway.
- filters
List[Get
Customer Gateway Filter] One or more [name-value pairs][dcg-filters] to filter by.
- id str
The ID of the gateway.
- Dict[str, str]
Map of key-value pairs assigned to the gateway.
GetCustomerGateway Result
The following output properties are available:
- Arn string
The ARN of the customer gateway.
- Bgp
Asn int (Optional) The gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
- Ip
Address string (Optional) The IP address of the gateway’s Internet-routable external interface.
- Dictionary<string, string>
Map of key-value pairs assigned to the gateway.
- Type string
(Optional) The type of customer gateway. The only type AWS supports at this time is “ipsec.1”.
- Filters
List<Get
Customer Gateway Filter> - Id string
- Arn string
The ARN of the customer gateway.
- Bgp
Asn int (Optional) The gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
- Ip
Address string (Optional) The IP address of the gateway’s Internet-routable external interface.
- map[string]string
Map of key-value pairs assigned to the gateway.
- Type string
(Optional) The type of customer gateway. The only type AWS supports at this time is “ipsec.1”.
- Filters
[]Get
Customer Gateway Filter - Id string
- arn string
The ARN of the customer gateway.
- bgp
Asn number (Optional) The gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
- ip
Address string (Optional) The IP address of the gateway’s Internet-routable external interface.
- {[key: string]: string}
Map of key-value pairs assigned to the gateway.
- type string
(Optional) The type of customer gateway. The only type AWS supports at this time is “ipsec.1”.
- filters
Get
Customer Gateway Filter[] - id string
- arn str
The ARN of the customer gateway.
- bgp_
asn float (Optional) The gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
- ip_
address str (Optional) The IP address of the gateway’s Internet-routable external interface.
- Dict[str, str]
Map of key-value pairs assigned to the gateway.
- type str
(Optional) The type of customer gateway. The only type AWS supports at this time is “ipsec.1”.
- filters
List[Get
Customer Gateway Filter] - id str
Supporting Types
GetCustomerGatewayFilter
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.