aws.ec2transitgateway.getPeeringAttachment
Explore with Pulumi AI
Get information on an EC2 Transit Gateway Peering Attachment.
Example Usage
By Filter
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2transitgateway.getPeeringAttachment({
filters: [{
name: "transit-gateway-attachment-id",
values: ["tgw-attach-12345678"],
}],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2transitgateway.get_peering_attachment(filters=[{
"name": "transit-gateway-attachment-id",
"values": ["tgw-attach-12345678"],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2transitgateway.LookupPeeringAttachment(ctx, &ec2transitgateway.LookupPeeringAttachmentArgs{
Filters: []ec2transitgateway.GetPeeringAttachmentFilter{
{
Name: "transit-gateway-attachment-id",
Values: []string{
"tgw-attach-12345678",
},
},
},
}, nil)
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 = Aws.Ec2TransitGateway.GetPeeringAttachment.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2TransitGateway.Inputs.GetPeeringAttachmentFilterInputArgs
{
Name = "transit-gateway-attachment-id",
Values = new[]
{
"tgw-attach-12345678",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2transitgateway.Ec2transitgatewayFunctions;
import com.pulumi.aws.ec2transitgateway.inputs.GetPeeringAttachmentArgs;
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) {
final var example = Ec2transitgatewayFunctions.getPeeringAttachment(GetPeeringAttachmentArgs.builder()
.filters(GetPeeringAttachmentFilterArgs.builder()
.name("transit-gateway-attachment-id")
.values("tgw-attach-12345678")
.build())
.build());
}
}
variables:
example:
fn::invoke:
Function: aws:ec2transitgateway:getPeeringAttachment
Arguments:
filters:
- name: transit-gateway-attachment-id
values:
- tgw-attach-12345678
By Identifier
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const attachment = aws.ec2transitgateway.getPeeringAttachment({
id: "tgw-attach-12345678",
});
import pulumi
import pulumi_aws as aws
attachment = aws.ec2transitgateway.get_peering_attachment(id="tgw-attach-12345678")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2transitgateway.LookupPeeringAttachment(ctx, &ec2transitgateway.LookupPeeringAttachmentArgs{
Id: pulumi.StringRef("tgw-attach-12345678"),
}, nil)
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 attachment = Aws.Ec2TransitGateway.GetPeeringAttachment.Invoke(new()
{
Id = "tgw-attach-12345678",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2transitgateway.Ec2transitgatewayFunctions;
import com.pulumi.aws.ec2transitgateway.inputs.GetPeeringAttachmentArgs;
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) {
final var attachment = Ec2transitgatewayFunctions.getPeeringAttachment(GetPeeringAttachmentArgs.builder()
.id("tgw-attach-12345678")
.build());
}
}
variables:
attachment:
fn::invoke:
Function: aws:ec2transitgateway:getPeeringAttachment
Arguments:
id: tgw-attach-12345678
Using getPeeringAttachment
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getPeeringAttachment(args: GetPeeringAttachmentArgs, opts?: InvokeOptions): Promise<GetPeeringAttachmentResult>
function getPeeringAttachmentOutput(args: GetPeeringAttachmentOutputArgs, opts?: InvokeOptions): Output<GetPeeringAttachmentResult>
def get_peering_attachment(filters: Optional[Sequence[GetPeeringAttachmentFilter]] = None,
id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetPeeringAttachmentResult
def get_peering_attachment_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetPeeringAttachmentFilterArgs]]]] = None,
id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPeeringAttachmentResult]
func LookupPeeringAttachment(ctx *Context, args *LookupPeeringAttachmentArgs, opts ...InvokeOption) (*LookupPeeringAttachmentResult, error)
func LookupPeeringAttachmentOutput(ctx *Context, args *LookupPeeringAttachmentOutputArgs, opts ...InvokeOption) LookupPeeringAttachmentResultOutput
> Note: This function is named LookupPeeringAttachment
in the Go SDK.
public static class GetPeeringAttachment
{
public static Task<GetPeeringAttachmentResult> InvokeAsync(GetPeeringAttachmentArgs args, InvokeOptions? opts = null)
public static Output<GetPeeringAttachmentResult> Invoke(GetPeeringAttachmentInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPeeringAttachmentResult> getPeeringAttachment(GetPeeringAttachmentArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2transitgateway/getPeeringAttachment:getPeeringAttachment
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Peering Attachment Filter> - One or more configuration blocks containing name-values filters. Detailed below.
- Id string
- Identifier of the EC2 Transit Gateway Peering Attachment.
- Dictionary<string, string>
Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- Filters
[]Get
Peering Attachment Filter - One or more configuration blocks containing name-values filters. Detailed below.
- Id string
- Identifier of the EC2 Transit Gateway Peering Attachment.
- map[string]string
Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters
List<Get
Peering Attachment Filter> - One or more configuration blocks containing name-values filters. Detailed below.
- id String
- Identifier of the EC2 Transit Gateway Peering Attachment.
- Map<String,String>
Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters
Get
Peering Attachment Filter[] - One or more configuration blocks containing name-values filters. Detailed below.
- id string
- Identifier of the EC2 Transit Gateway Peering Attachment.
- {[key: string]: string}
Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters
Sequence[Get
Peering Attachment Filter] - One or more configuration blocks containing name-values filters. Detailed below.
- id str
- Identifier of the EC2 Transit Gateway Peering Attachment.
- Mapping[str, str]
Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
- filters List<Property Map>
- One or more configuration blocks containing name-values filters. Detailed below.
- id String
- Identifier of the EC2 Transit Gateway Peering Attachment.
- Map<String>
Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:
getPeeringAttachment Result
The following output properties are available:
- Id string
- Peer
Account stringId - Identifier of the peer AWS account
- Peer
Region string - Identifier of the peer AWS region
- Peer
Transit stringGateway Id - Identifier of the peer EC2 Transit Gateway
- State string
- Dictionary<string, string>
- Transit
Gateway stringId - Identifier of the local EC2 Transit Gateway
- Filters
List<Get
Peering Attachment Filter>
- Id string
- Peer
Account stringId - Identifier of the peer AWS account
- Peer
Region string - Identifier of the peer AWS region
- Peer
Transit stringGateway Id - Identifier of the peer EC2 Transit Gateway
- State string
- map[string]string
- Transit
Gateway stringId - Identifier of the local EC2 Transit Gateway
- Filters
[]Get
Peering Attachment Filter
- id String
- peer
Account StringId - Identifier of the peer AWS account
- peer
Region String - Identifier of the peer AWS region
- peer
Transit StringGateway Id - Identifier of the peer EC2 Transit Gateway
- state String
- Map<String,String>
- transit
Gateway StringId - Identifier of the local EC2 Transit Gateway
- filters
List<Get
Peering Attachment Filter>
- id string
- peer
Account stringId - Identifier of the peer AWS account
- peer
Region string - Identifier of the peer AWS region
- peer
Transit stringGateway Id - Identifier of the peer EC2 Transit Gateway
- state string
- {[key: string]: string}
- transit
Gateway stringId - Identifier of the local EC2 Transit Gateway
- filters
Get
Peering Attachment Filter[]
- id str
- peer_
account_ strid - Identifier of the peer AWS account
- peer_
region str - Identifier of the peer AWS region
- peer_
transit_ strgateway_ id - Identifier of the peer EC2 Transit Gateway
- state str
- Mapping[str, str]
- transit_
gateway_ strid - Identifier of the local EC2 Transit Gateway
- filters
Sequence[Get
Peering Attachment Filter]
- id String
- peer
Account StringId - Identifier of the peer AWS account
- peer
Region String - Identifier of the peer AWS region
- peer
Transit StringGateway Id - Identifier of the peer EC2 Transit Gateway
- state String
- Map<String>
- transit
Gateway StringId - Identifier of the local EC2 Transit Gateway
- filters List<Property Map>
Supporting Types
GetPeeringAttachmentFilter
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values List<string>
- Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values []string
- Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
- name string
- Name of the field to filter by, as defined by the underlying AWS API.
- values string[]
- Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
- name str
- Name of the field to filter by, as defined by the underlying AWS API.
- values Sequence[str]
- Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.