get Peering Attachment
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"],
}])
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 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
})
}
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")
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 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
})
}
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
Return
A collection of values returned by getPeeringAttachment.
Parameters
A collection of arguments for invoking getPeeringAttachment.
Return
A collection of values returned by getPeeringAttachment.
Parameters
One or more configuration blocks containing name-values filters. Detailed below.
Identifier of the EC2 Transit Gateway Peering Attachment.
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:
See also
Return
A collection of values returned by getPeeringAttachment.
Parameters
Builder for com.pulumi.aws.ec2transitgateway.kotlin.inputs.GetPeeringAttachmentPlainArgs.