1. Packages
  2. AWS
  3. API Docs
  4. networkmanager
  5. TransitGatewayRegistration
AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi

aws.networkmanager.TransitGatewayRegistration

Explore with Pulumi AI

aws logo
AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi

    Registers a transit gateway to a global network. The transit gateway can be in any AWS Region, but it must be owned by the same AWS account that owns the global network. You cannot register a transit gateway in more than one global network.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.networkmanager.GlobalNetwork("example", {description: "example"});
    const exampleTransitGateway = new aws.ec2transitgateway.TransitGateway("example", {});
    const exampleTransitGatewayRegistration = new aws.networkmanager.TransitGatewayRegistration("example", {
        globalNetworkId: example.id,
        transitGatewayArn: exampleTransitGateway.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.networkmanager.GlobalNetwork("example", description="example")
    example_transit_gateway = aws.ec2transitgateway.TransitGateway("example")
    example_transit_gateway_registration = aws.networkmanager.TransitGatewayRegistration("example",
        global_network_id=example.id,
        transit_gateway_arn=example_transit_gateway.arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := networkmanager.NewGlobalNetwork(ctx, "example", &networkmanager.GlobalNetworkArgs{
    			Description: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitGateway, err := ec2transitgateway.NewTransitGateway(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		_, err = networkmanager.NewTransitGatewayRegistration(ctx, "example", &networkmanager.TransitGatewayRegistrationArgs{
    			GlobalNetworkId:   example.ID(),
    			TransitGatewayArn: exampleTransitGateway.Arn,
    		})
    		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.NetworkManager.GlobalNetwork("example", new()
        {
            Description = "example",
        });
    
        var exampleTransitGateway = new Aws.Ec2TransitGateway.TransitGateway("example");
    
        var exampleTransitGatewayRegistration = new Aws.NetworkManager.TransitGatewayRegistration("example", new()
        {
            GlobalNetworkId = example.Id,
            TransitGatewayArn = exampleTransitGateway.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.networkmanager.GlobalNetwork;
    import com.pulumi.aws.networkmanager.GlobalNetworkArgs;
    import com.pulumi.aws.ec2transitgateway.TransitGateway;
    import com.pulumi.aws.networkmanager.TransitGatewayRegistration;
    import com.pulumi.aws.networkmanager.TransitGatewayRegistrationArgs;
    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 GlobalNetwork("example", GlobalNetworkArgs.builder()
                .description("example")
                .build());
    
            var exampleTransitGateway = new TransitGateway("exampleTransitGateway");
    
            var exampleTransitGatewayRegistration = new TransitGatewayRegistration("exampleTransitGatewayRegistration", TransitGatewayRegistrationArgs.builder()
                .globalNetworkId(example.id())
                .transitGatewayArn(exampleTransitGateway.arn())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:networkmanager:GlobalNetwork
        properties:
          description: example
      exampleTransitGateway:
        type: aws:ec2transitgateway:TransitGateway
        name: example
      exampleTransitGatewayRegistration:
        type: aws:networkmanager:TransitGatewayRegistration
        name: example
        properties:
          globalNetworkId: ${example.id}
          transitGatewayArn: ${exampleTransitGateway.arn}
    

    Create TransitGatewayRegistration Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TransitGatewayRegistration(name: string, args: TransitGatewayRegistrationArgs, opts?: CustomResourceOptions);
    @overload
    def TransitGatewayRegistration(resource_name: str,
                                   args: TransitGatewayRegistrationArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def TransitGatewayRegistration(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   global_network_id: Optional[str] = None,
                                   transit_gateway_arn: Optional[str] = None)
    func NewTransitGatewayRegistration(ctx *Context, name string, args TransitGatewayRegistrationArgs, opts ...ResourceOption) (*TransitGatewayRegistration, error)
    public TransitGatewayRegistration(string name, TransitGatewayRegistrationArgs args, CustomResourceOptions? opts = null)
    public TransitGatewayRegistration(String name, TransitGatewayRegistrationArgs args)
    public TransitGatewayRegistration(String name, TransitGatewayRegistrationArgs args, CustomResourceOptions options)
    
    type: aws:networkmanager:TransitGatewayRegistration
    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 TransitGatewayRegistrationArgs
    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 TransitGatewayRegistrationArgs
    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 TransitGatewayRegistrationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TransitGatewayRegistrationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TransitGatewayRegistrationArgs
    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 transitGatewayRegistrationResource = new Aws.NetworkManager.TransitGatewayRegistration("transitGatewayRegistrationResource", new()
    {
        GlobalNetworkId = "string",
        TransitGatewayArn = "string",
    });
    
    example, err := networkmanager.NewTransitGatewayRegistration(ctx, "transitGatewayRegistrationResource", &networkmanager.TransitGatewayRegistrationArgs{
    	GlobalNetworkId:   pulumi.String("string"),
    	TransitGatewayArn: pulumi.String("string"),
    })
    
    var transitGatewayRegistrationResource = new TransitGatewayRegistration("transitGatewayRegistrationResource", TransitGatewayRegistrationArgs.builder()
        .globalNetworkId("string")
        .transitGatewayArn("string")
        .build());
    
    transit_gateway_registration_resource = aws.networkmanager.TransitGatewayRegistration("transitGatewayRegistrationResource",
        global_network_id="string",
        transit_gateway_arn="string")
    
    const transitGatewayRegistrationResource = new aws.networkmanager.TransitGatewayRegistration("transitGatewayRegistrationResource", {
        globalNetworkId: "string",
        transitGatewayArn: "string",
    });
    
    type: aws:networkmanager:TransitGatewayRegistration
    properties:
        globalNetworkId: string
        transitGatewayArn: string
    

    TransitGatewayRegistration 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 TransitGatewayRegistration resource accepts the following input properties:

    GlobalNetworkId string
    The ID of the Global Network to register to.
    TransitGatewayArn string
    The ARN of the Transit Gateway to register.
    GlobalNetworkId string
    The ID of the Global Network to register to.
    TransitGatewayArn string
    The ARN of the Transit Gateway to register.
    globalNetworkId String
    The ID of the Global Network to register to.
    transitGatewayArn String
    The ARN of the Transit Gateway to register.
    globalNetworkId string
    The ID of the Global Network to register to.
    transitGatewayArn string
    The ARN of the Transit Gateway to register.
    global_network_id str
    The ID of the Global Network to register to.
    transit_gateway_arn str
    The ARN of the Transit Gateway to register.
    globalNetworkId String
    The ID of the Global Network to register to.
    transitGatewayArn String
    The ARN of the Transit Gateway to register.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TransitGatewayRegistration 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 TransitGatewayRegistration Resource

    Get an existing TransitGatewayRegistration 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?: TransitGatewayRegistrationState, opts?: CustomResourceOptions): TransitGatewayRegistration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            global_network_id: Optional[str] = None,
            transit_gateway_arn: Optional[str] = None) -> TransitGatewayRegistration
    func GetTransitGatewayRegistration(ctx *Context, name string, id IDInput, state *TransitGatewayRegistrationState, opts ...ResourceOption) (*TransitGatewayRegistration, error)
    public static TransitGatewayRegistration Get(string name, Input<string> id, TransitGatewayRegistrationState? state, CustomResourceOptions? opts = null)
    public static TransitGatewayRegistration get(String name, Output<String> id, TransitGatewayRegistrationState 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.
    The following state arguments are supported:
    GlobalNetworkId string
    The ID of the Global Network to register to.
    TransitGatewayArn string
    The ARN of the Transit Gateway to register.
    GlobalNetworkId string
    The ID of the Global Network to register to.
    TransitGatewayArn string
    The ARN of the Transit Gateway to register.
    globalNetworkId String
    The ID of the Global Network to register to.
    transitGatewayArn String
    The ARN of the Transit Gateway to register.
    globalNetworkId string
    The ID of the Global Network to register to.
    transitGatewayArn string
    The ARN of the Transit Gateway to register.
    global_network_id str
    The ID of the Global Network to register to.
    transit_gateway_arn str
    The ARN of the Transit Gateway to register.
    globalNetworkId String
    The ID of the Global Network to register to.
    transitGatewayArn String
    The ARN of the Transit Gateway to register.

    Import

    Using pulumi import, import aws_networkmanager_transit_gateway_registration using the global network ID and transit gateway ARN. For example:

    $ pulumi import aws:networkmanager/transitGatewayRegistration:TransitGatewayRegistration example global-network-0d47f6t230mz46dy4,arn:aws:ec2:us-west-2:123456789012:transit-gateway/tgw-123abc05e04123abc
    

    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.
    aws logo
    AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi