All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.directconnect.kotlin.ConnectionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.directconnect.kotlin

import com.pulumi.aws.directconnect.ConnectionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a Connection of Direct Connect.
 * ## Example Usage
 * ### Create a connection
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const hoge = new aws.directconnect.Connection("hoge", {
 *     name: "tf-dx-connection",
 *     bandwidth: "1Gbps",
 *     location: "EqDC2",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * hoge = aws.directconnect.Connection("hoge",
 *     name="tf-dx-connection",
 *     bandwidth="1Gbps",
 *     location="EqDC2")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var hoge = new Aws.DirectConnect.Connection("hoge", new()
 *     {
 *         Name = "tf-dx-connection",
 *         Bandwidth = "1Gbps",
 *         Location = "EqDC2",
 *     });
 * });
 * ```
 * ```go
 * 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 {
 * 		_, err := directconnect.NewConnection(ctx, "hoge", &directconnect.ConnectionArgs{
 * 			Name:      pulumi.String("tf-dx-connection"),
 * 			Bandwidth: pulumi.String("1Gbps"),
 * 			Location:  pulumi.String("EqDC2"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 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 hoge = new Connection("hoge", ConnectionArgs.builder()
 *             .name("tf-dx-connection")
 *             .bandwidth("1Gbps")
 *             .location("EqDC2")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   hoge:
 *     type: aws:directconnect:Connection
 *     properties:
 *       name: tf-dx-connection
 *       bandwidth: 1Gbps
 *       location: EqDC2
 * ```
 * 
 * ### Request a MACsec-capable connection
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.directconnect.Connection("example", {
 *     name: "tf-dx-connection",
 *     bandwidth: "10Gbps",
 *     location: "EqDA2",
 *     requestMacsec: true,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.directconnect.Connection("example",
 *     name="tf-dx-connection",
 *     bandwidth="10Gbps",
 *     location="EqDA2",
 *     request_macsec=True)
 * ```
 * ```csharp
 * 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 = "tf-dx-connection",
 *         Bandwidth = "10Gbps",
 *         Location = "EqDA2",
 *         RequestMacsec = true,
 *     });
 * });
 * ```
 * ```go
 * 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 {
 * 		_, err := directconnect.NewConnection(ctx, "example", &directconnect.ConnectionArgs{
 * 			Name:          pulumi.String("tf-dx-connection"),
 * 			Bandwidth:     pulumi.String("10Gbps"),
 * 			Location:      pulumi.String("EqDA2"),
 * 			RequestMacsec: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 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("tf-dx-connection")
 *             .bandwidth("10Gbps")
 *             .location("EqDA2")
 *             .requestMacsec(true)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:directconnect:Connection
 *     properties:
 *       name: tf-dx-connection
 *       bandwidth: 10Gbps
 *       location: EqDA2
 *       requestMacsec: true
 * ```
 * 
 * ### Configure encryption mode for MACsec-capable connections
 * > **NOTE:** You can only specify the `encryption_mode` argument once the connection is in an `Available` state.
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.directconnect.Connection("example", {
 *     name: "tf-dx-connection",
 *     bandwidth: "10Gbps",
 *     location: "EqDC2",
 *     requestMacsec: true,
 *     encryptionMode: "must_encrypt",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.directconnect.Connection("example",
 *     name="tf-dx-connection",
 *     bandwidth="10Gbps",
 *     location="EqDC2",
 *     request_macsec=True,
 *     encryption_mode="must_encrypt")
 * ```
 * ```csharp
 * 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 = "tf-dx-connection",
 *         Bandwidth = "10Gbps",
 *         Location = "EqDC2",
 *         RequestMacsec = true,
 *         EncryptionMode = "must_encrypt",
 *     });
 * });
 * ```
 * ```go
 * 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 {
 * 		_, err := directconnect.NewConnection(ctx, "example", &directconnect.ConnectionArgs{
 * 			Name:           pulumi.String("tf-dx-connection"),
 * 			Bandwidth:      pulumi.String("10Gbps"),
 * 			Location:       pulumi.String("EqDC2"),
 * 			RequestMacsec:  pulumi.Bool(true),
 * 			EncryptionMode: pulumi.String("must_encrypt"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 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("tf-dx-connection")
 *             .bandwidth("10Gbps")
 *             .location("EqDC2")
 *             .requestMacsec(true)
 *             .encryptionMode("must_encrypt")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:directconnect:Connection
 *     properties:
 *       name: tf-dx-connection
 *       bandwidth: 10Gbps
 *       location: EqDC2
 *       requestMacsec: true
 *       encryptionMode: must_encrypt
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Direct Connect connections using the connection `id`. For example:
 * ```sh
 * $ pulumi import aws:directconnect/connection:Connection test_connection dxcon-ffre0ec3
 * ```
 * @property bandwidth The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps and 100Gbps. Case sensitive.
 * @property encryptionMode The connection MAC Security (MACsec) encryption mode. MAC Security (MACsec) is only available on dedicated connections. Valid values are `no_encrypt`, `should_encrypt`, and `must_encrypt`.
 * @property location The AWS Direct Connect location where the connection is located. See [DescribeLocations](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_DescribeLocations.html) for the list of AWS Direct Connect locations. Use `locationCode`.
 * @property name The name of the connection.
 * @property providerName The name of the service provider associated with the connection.
 * @property requestMacsec Boolean value indicating whether you want the connection to support MAC Security (MACsec). MAC Security (MACsec) is only available on dedicated connections. See [MACsec prerequisites](https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites) for more information about MAC Security (MACsec) prerequisites. Default value: `false`.
 * > **NOTE:** Changing the value of `request_macsec` will cause the resource to be destroyed and re-created.
 * @property skipDestroy Set to true if you do not wish the connection to be deleted at destroy time, and instead just removed from the state.
 * @property tags A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class ConnectionArgs(
    public val bandwidth: Output? = null,
    public val encryptionMode: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val providerName: Output? = null,
    public val requestMacsec: Output? = null,
    public val skipDestroy: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.directconnect.ConnectionArgs =
        com.pulumi.aws.directconnect.ConnectionArgs.builder()
            .bandwidth(bandwidth?.applyValue({ args0 -> args0 }))
            .encryptionMode(encryptionMode?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .providerName(providerName?.applyValue({ args0 -> args0 }))
            .requestMacsec(requestMacsec?.applyValue({ args0 -> args0 }))
            .skipDestroy(skipDestroy?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ConnectionArgs].
 */
@PulumiTagMarker
public class ConnectionArgsBuilder internal constructor() {
    private var bandwidth: Output? = null

    private var encryptionMode: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var providerName: Output? = null

    private var requestMacsec: Output? = null

    private var skipDestroy: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps and 100Gbps. Case sensitive.
     */
    @JvmName("vgobxvpwosspgnrl")
    public suspend fun bandwidth(`value`: Output) {
        this.bandwidth = value
    }

    /**
     * @param value The connection MAC Security (MACsec) encryption mode. MAC Security (MACsec) is only available on dedicated connections. Valid values are `no_encrypt`, `should_encrypt`, and `must_encrypt`.
     */
    @JvmName("rfboahhdrahogndp")
    public suspend fun encryptionMode(`value`: Output) {
        this.encryptionMode = value
    }

    /**
     * @param value The AWS Direct Connect location where the connection is located. See [DescribeLocations](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_DescribeLocations.html) for the list of AWS Direct Connect locations. Use `locationCode`.
     */
    @JvmName("vtbaokgjtctpucgk")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name of the connection.
     */
    @JvmName("pyojjaepridmxfee")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the service provider associated with the connection.
     */
    @JvmName("sdspdodhjjpkflxe")
    public suspend fun providerName(`value`: Output) {
        this.providerName = value
    }

    /**
     * @param value Boolean value indicating whether you want the connection to support MAC Security (MACsec). MAC Security (MACsec) is only available on dedicated connections. See [MACsec prerequisites](https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites) for more information about MAC Security (MACsec) prerequisites. Default value: `false`.
     * > **NOTE:** Changing the value of `request_macsec` will cause the resource to be destroyed and re-created.
     */
    @JvmName("qteabeuefcicqwwl")
    public suspend fun requestMacsec(`value`: Output) {
        this.requestMacsec = value
    }

    /**
     * @param value Set to true if you do not wish the connection to be deleted at destroy time, and instead just removed from the state.
     */
    @JvmName("sjsejcgxsvhaoehi")
    public suspend fun skipDestroy(`value`: Output) {
        this.skipDestroy = value
    }

    /**
     * @param value A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("aomgfrhsaiiexsjx")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps and 100Gbps. Case sensitive.
     */
    @JvmName("uusmqdfkgerqckvx")
    public suspend fun bandwidth(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bandwidth = mapped
    }

    /**
     * @param value The connection MAC Security (MACsec) encryption mode. MAC Security (MACsec) is only available on dedicated connections. Valid values are `no_encrypt`, `should_encrypt`, and `must_encrypt`.
     */
    @JvmName("yycyhlxrjubipepe")
    public suspend fun encryptionMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.encryptionMode = mapped
    }

    /**
     * @param value The AWS Direct Connect location where the connection is located. See [DescribeLocations](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_DescribeLocations.html) for the list of AWS Direct Connect locations. Use `locationCode`.
     */
    @JvmName("gsbqpewshhfogsjf")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name of the connection.
     */
    @JvmName("wtcbotbcpijttsun")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the service provider associated with the connection.
     */
    @JvmName("qipaweoteslkpukb")
    public suspend fun providerName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.providerName = mapped
    }

    /**
     * @param value Boolean value indicating whether you want the connection to support MAC Security (MACsec). MAC Security (MACsec) is only available on dedicated connections. See [MACsec prerequisites](https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites) for more information about MAC Security (MACsec) prerequisites. Default value: `false`.
     * > **NOTE:** Changing the value of `request_macsec` will cause the resource to be destroyed and re-created.
     */
    @JvmName("ltjvlfhhioytqann")
    public suspend fun requestMacsec(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestMacsec = mapped
    }

    /**
     * @param value Set to true if you do not wish the connection to be deleted at destroy time, and instead just removed from the state.
     */
    @JvmName("dxpsaesutsvkcpea")
    public suspend fun skipDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skipDestroy = mapped
    }

    /**
     * @param value A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("brcipxlibyweuuvh")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("hsqgdadqtqvfjisl")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ConnectionArgs = ConnectionArgs(
        bandwidth = bandwidth,
        encryptionMode = encryptionMode,
        location = location,
        name = name,
        providerName = providerName,
        requestMacsec = requestMacsec,
        skipDestroy = skipDestroy,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy