AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.ec2transitgateway.getDirectConnectGatewayAttachment
Explore with Pulumi AI
Get information on an EC2 Transit Gateway’s attachment to a Direct Connect Gateway.
Example Usage
By Transit Gateway and Direct Connect Gateway Identifiers
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2transitgateway.getDirectConnectGatewayAttachment({
    transitGatewayId: exampleAwsEc2TransitGateway.id,
    dxGatewayId: exampleAwsDxGateway.id,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2transitgateway.get_direct_connect_gateway_attachment(transit_gateway_id=example_aws_ec2_transit_gateway["id"],
    dx_gateway_id=example_aws_dx_gateway["id"])
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.GetDirectConnectGatewayAttachment(ctx, &ec2transitgateway.GetDirectConnectGatewayAttachmentArgs{
			TransitGatewayId: pulumi.StringRef(exampleAwsEc2TransitGateway.Id),
			DxGatewayId:      pulumi.StringRef(exampleAwsDxGateway.Id),
		}, 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.GetDirectConnectGatewayAttachment.Invoke(new()
    {
        TransitGatewayId = exampleAwsEc2TransitGateway.Id,
        DxGatewayId = exampleAwsDxGateway.Id,
    });
});
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.GetDirectConnectGatewayAttachmentArgs;
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.getDirectConnectGatewayAttachment(GetDirectConnectGatewayAttachmentArgs.builder()
            .transitGatewayId(exampleAwsEc2TransitGateway.id())
            .dxGatewayId(exampleAwsDxGateway.id())
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:ec2transitgateway:getDirectConnectGatewayAttachment
      arguments:
        transitGatewayId: ${exampleAwsEc2TransitGateway.id}
        dxGatewayId: ${exampleAwsDxGateway.id}
Using getDirectConnectGatewayAttachment
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 getDirectConnectGatewayAttachment(args: GetDirectConnectGatewayAttachmentArgs, opts?: InvokeOptions): Promise<GetDirectConnectGatewayAttachmentResult>
function getDirectConnectGatewayAttachmentOutput(args: GetDirectConnectGatewayAttachmentOutputArgs, opts?: InvokeOptions): Output<GetDirectConnectGatewayAttachmentResult>def get_direct_connect_gateway_attachment(dx_gateway_id: Optional[str] = None,
                                          filters: Optional[Sequence[GetDirectConnectGatewayAttachmentFilter]] = None,
                                          tags: Optional[Mapping[str, str]] = None,
                                          transit_gateway_id: Optional[str] = None,
                                          opts: Optional[InvokeOptions] = None) -> GetDirectConnectGatewayAttachmentResult
def get_direct_connect_gateway_attachment_output(dx_gateway_id: Optional[pulumi.Input[str]] = None,
                                          filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDirectConnectGatewayAttachmentFilterArgs]]]] = None,
                                          tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                                          transit_gateway_id: Optional[pulumi.Input[str]] = None,
                                          opts: Optional[InvokeOptions] = None) -> Output[GetDirectConnectGatewayAttachmentResult]func GetDirectConnectGatewayAttachment(ctx *Context, args *GetDirectConnectGatewayAttachmentArgs, opts ...InvokeOption) (*GetDirectConnectGatewayAttachmentResult, error)
func GetDirectConnectGatewayAttachmentOutput(ctx *Context, args *GetDirectConnectGatewayAttachmentOutputArgs, opts ...InvokeOption) GetDirectConnectGatewayAttachmentResultOutput> Note: This function is named GetDirectConnectGatewayAttachment in the Go SDK.
public static class GetDirectConnectGatewayAttachment 
{
    public static Task<GetDirectConnectGatewayAttachmentResult> InvokeAsync(GetDirectConnectGatewayAttachmentArgs args, InvokeOptions? opts = null)
    public static Output<GetDirectConnectGatewayAttachmentResult> Invoke(GetDirectConnectGatewayAttachmentInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDirectConnectGatewayAttachmentResult> getDirectConnectGatewayAttachment(GetDirectConnectGatewayAttachmentArgs args, InvokeOptions options)
public static Output<GetDirectConnectGatewayAttachmentResult> getDirectConnectGatewayAttachment(GetDirectConnectGatewayAttachmentArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2transitgateway/getDirectConnectGatewayAttachment:getDirectConnectGatewayAttachment
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DxGateway stringId 
- Identifier of the Direct Connect Gateway.
- Filters
List<GetDirect Connect Gateway Attachment Filter> 
- Configuration block(s) for filtering. Detailed below.
- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment.
- TransitGateway stringId 
- Identifier of the EC2 Transit Gateway.
- DxGateway stringId 
- Identifier of the Direct Connect Gateway.
- Filters
[]GetDirect Connect Gateway Attachment Filter 
- Configuration block(s) for filtering. Detailed below.
- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment.
- TransitGateway stringId 
- Identifier of the EC2 Transit Gateway.
- dxGateway StringId 
- Identifier of the Direct Connect Gateway.
- filters
List<GetDirect Connect Gateway Attachment Filter> 
- Configuration block(s) for filtering. Detailed below.
- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment.
- transitGateway StringId 
- Identifier of the EC2 Transit Gateway.
- dxGateway stringId 
- Identifier of the Direct Connect Gateway.
- filters
GetDirect Connect Gateway Attachment Filter[] 
- Configuration block(s) for filtering. Detailed below.
- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment.
- transitGateway stringId 
- Identifier of the EC2 Transit Gateway.
- dx_gateway_ strid 
- Identifier of the Direct Connect Gateway.
- filters
Sequence[GetDirect Connect Gateway Attachment Filter] 
- Configuration block(s) for filtering. Detailed below.
- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment.
- transit_gateway_ strid 
- Identifier of the EC2 Transit Gateway.
- dxGateway StringId 
- Identifier of the Direct Connect Gateway.
- filters List<Property Map>
- Configuration block(s) for filtering. Detailed below.
- Map<String>
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment.
- transitGateway StringId 
- Identifier of the EC2 Transit Gateway.
getDirectConnectGatewayAttachment Result
The following output properties are available:
- Arn string
- ARN of the attachment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- Key-value tags for the EC2 Transit Gateway Attachment.
- DxGateway stringId 
- Filters
List<GetDirect Connect Gateway Attachment Filter> 
- TransitGateway stringId 
- Arn string
- ARN of the attachment.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- Key-value tags for the EC2 Transit Gateway Attachment.
- DxGateway stringId 
- Filters
[]GetDirect Connect Gateway Attachment Filter 
- TransitGateway stringId 
- arn String
- ARN of the attachment.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- Key-value tags for the EC2 Transit Gateway Attachment.
- dxGateway StringId 
- filters
List<GetDirect Connect Gateway Attachment Filter> 
- transitGateway StringId 
- arn string
- ARN of the attachment.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- Key-value tags for the EC2 Transit Gateway Attachment.
- dxGateway stringId 
- filters
GetDirect Connect Gateway Attachment Filter[] 
- transitGateway stringId 
- arn str
- ARN of the attachment.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- Key-value tags for the EC2 Transit Gateway Attachment.
- dx_gateway_ strid 
- filters
Sequence[GetDirect Connect Gateway Attachment Filter] 
- transit_gateway_ strid 
- arn String
- ARN of the attachment.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- Key-value tags for the EC2 Transit Gateway Attachment.
- dxGateway StringId 
- filters List<Property Map>
- transitGateway StringId 
Supporting Types
GetDirectConnectGatewayAttachmentFilter     
- Name string
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- Values List<string>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- Name string
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- Values []string
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- values List<String>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name string
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- values string[]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name str
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- values Sequence[str]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- values List<String>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.