1. Packages
  2. AWS Classic
  3. API Docs
  4. directconnect
  5. ConnectionAssociation

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.41.0 published on Tuesday, Jun 18, 2024 by Pulumi

aws.directconnect.ConnectionAssociation

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.41.0 published on Tuesday, Jun 18, 2024 by Pulumi

    Associates a Direct Connect Connection with a LAG.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.directconnect.Connection("example", {
        name: "example",
        bandwidth: "1Gbps",
        location: "EqSe2-EQ",
    });
    const exampleLinkAggregationGroup = new aws.directconnect.LinkAggregationGroup("example", {
        name: "example",
        connectionsBandwidth: "1Gbps",
        location: "EqSe2-EQ",
    });
    const exampleConnectionAssociation = new aws.directconnect.ConnectionAssociation("example", {
        connectionId: example.id,
        lagId: exampleLinkAggregationGroup.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.directconnect.Connection("example",
        name="example",
        bandwidth="1Gbps",
        location="EqSe2-EQ")
    example_link_aggregation_group = aws.directconnect.LinkAggregationGroup("example",
        name="example",
        connections_bandwidth="1Gbps",
        location="EqSe2-EQ")
    example_connection_association = aws.directconnect.ConnectionAssociation("example",
        connection_id=example.id,
        lag_id=example_link_aggregation_group.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := directconnect.NewConnection(ctx, "example", &directconnect.ConnectionArgs{
    			Name:      pulumi.String("example"),
    			Bandwidth: pulumi.String("1Gbps"),
    			Location:  pulumi.String("EqSe2-EQ"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleLinkAggregationGroup, err := directconnect.NewLinkAggregationGroup(ctx, "example", &directconnect.LinkAggregationGroupArgs{
    			Name:                 pulumi.String("example"),
    			ConnectionsBandwidth: pulumi.String("1Gbps"),
    			Location:             pulumi.String("EqSe2-EQ"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = directconnect.NewConnectionAssociation(ctx, "example", &directconnect.ConnectionAssociationArgs{
    			ConnectionId: example.ID(),
    			LagId:        exampleLinkAggregationGroup.ID(),
    		})
    		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.DirectConnect.Connection("example", new()
        {
            Name = "example",
            Bandwidth = "1Gbps",
            Location = "EqSe2-EQ",
        });
    
        var exampleLinkAggregationGroup = new Aws.DirectConnect.LinkAggregationGroup("example", new()
        {
            Name = "example",
            ConnectionsBandwidth = "1Gbps",
            Location = "EqSe2-EQ",
        });
    
        var exampleConnectionAssociation = new Aws.DirectConnect.ConnectionAssociation("example", new()
        {
            ConnectionId = example.Id,
            LagId = exampleLinkAggregationGroup.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.directconnect.Connection;
    import com.pulumi.aws.directconnect.ConnectionArgs;
    import com.pulumi.aws.directconnect.LinkAggregationGroup;
    import com.pulumi.aws.directconnect.LinkAggregationGroupArgs;
    import com.pulumi.aws.directconnect.ConnectionAssociation;
    import com.pulumi.aws.directconnect.ConnectionAssociationArgs;
    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 Connection("example", ConnectionArgs.builder()
                .name("example")
                .bandwidth("1Gbps")
                .location("EqSe2-EQ")
                .build());
    
            var exampleLinkAggregationGroup = new LinkAggregationGroup("exampleLinkAggregationGroup", LinkAggregationGroupArgs.builder()
                .name("example")
                .connectionsBandwidth("1Gbps")
                .location("EqSe2-EQ")
                .build());
    
            var exampleConnectionAssociation = new ConnectionAssociation("exampleConnectionAssociation", ConnectionAssociationArgs.builder()
                .connectionId(example.id())
                .lagId(exampleLinkAggregationGroup.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:directconnect:Connection
        properties:
          name: example
          bandwidth: 1Gbps
          location: EqSe2-EQ
      exampleLinkAggregationGroup:
        type: aws:directconnect:LinkAggregationGroup
        name: example
        properties:
          name: example
          connectionsBandwidth: 1Gbps
          location: EqSe2-EQ
      exampleConnectionAssociation:
        type: aws:directconnect:ConnectionAssociation
        name: example
        properties:
          connectionId: ${example.id}
          lagId: ${exampleLinkAggregationGroup.id}
    

    Create ConnectionAssociation Resource

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

    Constructor syntax

    new ConnectionAssociation(name: string, args: ConnectionAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def ConnectionAssociation(resource_name: str,
                              args: ConnectionAssociationArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConnectionAssociation(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              connection_id: Optional[str] = None,
                              lag_id: Optional[str] = None)
    func NewConnectionAssociation(ctx *Context, name string, args ConnectionAssociationArgs, opts ...ResourceOption) (*ConnectionAssociation, error)
    public ConnectionAssociation(string name, ConnectionAssociationArgs args, CustomResourceOptions? opts = null)
    public ConnectionAssociation(String name, ConnectionAssociationArgs args)
    public ConnectionAssociation(String name, ConnectionAssociationArgs args, CustomResourceOptions options)
    
    type: aws:directconnect:ConnectionAssociation
    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 ConnectionAssociationArgs
    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 ConnectionAssociationArgs
    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 ConnectionAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConnectionAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConnectionAssociationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var connectionAssociationResource = new Aws.DirectConnect.ConnectionAssociation("connectionAssociationResource", new()
    {
        ConnectionId = "string",
        LagId = "string",
    });
    
    example, err := directconnect.NewConnectionAssociation(ctx, "connectionAssociationResource", &directconnect.ConnectionAssociationArgs{
    	ConnectionId: pulumi.String("string"),
    	LagId:        pulumi.String("string"),
    })
    
    var connectionAssociationResource = new ConnectionAssociation("connectionAssociationResource", ConnectionAssociationArgs.builder()
        .connectionId("string")
        .lagId("string")
        .build());
    
    connection_association_resource = aws.directconnect.ConnectionAssociation("connectionAssociationResource",
        connection_id="string",
        lag_id="string")
    
    const connectionAssociationResource = new aws.directconnect.ConnectionAssociation("connectionAssociationResource", {
        connectionId: "string",
        lagId: "string",
    });
    
    type: aws:directconnect:ConnectionAssociation
    properties:
        connectionId: string
        lagId: string
    

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

    ConnectionId string
    The ID of the connection.
    LagId string
    The ID of the LAG with which to associate the connection.
    ConnectionId string
    The ID of the connection.
    LagId string
    The ID of the LAG with which to associate the connection.
    connectionId String
    The ID of the connection.
    lagId String
    The ID of the LAG with which to associate the connection.
    connectionId string
    The ID of the connection.
    lagId string
    The ID of the LAG with which to associate the connection.
    connection_id str
    The ID of the connection.
    lag_id str
    The ID of the LAG with which to associate the connection.
    connectionId String
    The ID of the connection.
    lagId String
    The ID of the LAG with which to associate the connection.

    Outputs

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

    Get an existing ConnectionAssociation 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?: ConnectionAssociationState, opts?: CustomResourceOptions): ConnectionAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_id: Optional[str] = None,
            lag_id: Optional[str] = None) -> ConnectionAssociation
    func GetConnectionAssociation(ctx *Context, name string, id IDInput, state *ConnectionAssociationState, opts ...ResourceOption) (*ConnectionAssociation, error)
    public static ConnectionAssociation Get(string name, Input<string> id, ConnectionAssociationState? state, CustomResourceOptions? opts = null)
    public static ConnectionAssociation get(String name, Output<String> id, ConnectionAssociationState 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:
    ConnectionId string
    The ID of the connection.
    LagId string
    The ID of the LAG with which to associate the connection.
    ConnectionId string
    The ID of the connection.
    LagId string
    The ID of the LAG with which to associate the connection.
    connectionId String
    The ID of the connection.
    lagId String
    The ID of the LAG with which to associate the connection.
    connectionId string
    The ID of the connection.
    lagId string
    The ID of the LAG with which to associate the connection.
    connection_id str
    The ID of the connection.
    lag_id str
    The ID of the LAG with which to associate the connection.
    connectionId String
    The ID of the connection.
    lagId String
    The ID of the LAG with which to associate the connection.

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.41.0 published on Tuesday, Jun 18, 2024 by Pulumi