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

com.pulumi.azure.network.kotlin.ExpressRoutePort.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.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.kotlin.outputs.ExpressRoutePortIdentity
import com.pulumi.azure.network.kotlin.outputs.ExpressRoutePortLink1
import com.pulumi.azure.network.kotlin.outputs.ExpressRoutePortLink2
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import com.pulumi.azure.network.kotlin.outputs.ExpressRoutePortIdentity.Companion.toKotlin as expressRoutePortIdentityToKotlin
import com.pulumi.azure.network.kotlin.outputs.ExpressRoutePortLink1.Companion.toKotlin as expressRoutePortLink1ToKotlin
import com.pulumi.azure.network.kotlin.outputs.ExpressRoutePortLink2.Companion.toKotlin as expressRoutePortLink2ToKotlin

/**
 * Builder for [ExpressRoutePort].
 */
@PulumiTagMarker
public class ExpressRoutePortResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ExpressRoutePortArgs = ExpressRoutePortArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ExpressRoutePortArgsBuilder.() -> Unit) {
        val builder = ExpressRoutePortArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ExpressRoutePort {
        val builtJavaResource = com.pulumi.azure.network.ExpressRoutePort(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ExpressRoutePort(builtJavaResource)
    }
}

/**
 * Manages a Express Route Port.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West US",
 * });
 * const exampleExpressRoutePort = new azure.network.ExpressRoutePort("example", {
 *     name: "port1",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     peeringLocation: "Airtel-Chennai-CLS",
 *     bandwidthInGbps: 10,
 *     encapsulation: "Dot1Q",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West US")
 * example_express_route_port = azure.network.ExpressRoutePort("example",
 *     name="port1",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     peering_location="Airtel-Chennai-CLS",
 *     bandwidth_in_gbps=10,
 *     encapsulation="Dot1Q")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West US",
 *     });
 *     var exampleExpressRoutePort = new Azure.Network.ExpressRoutePort("example", new()
 *     {
 *         Name = "port1",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         PeeringLocation = "Airtel-Chennai-CLS",
 *         BandwidthInGbps = 10,
 *         Encapsulation = "Dot1Q",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West US"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewExpressRoutePort(ctx, "example", &network.ExpressRoutePortArgs{
 * 			Name:              pulumi.String("port1"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			PeeringLocation:   pulumi.String("Airtel-Chennai-CLS"),
 * 			BandwidthInGbps:   pulumi.Int(10),
 * 			Encapsulation:     pulumi.String("Dot1Q"),
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.ExpressRoutePort;
 * import com.pulumi.azure.network.ExpressRoutePortArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West US")
 *             .build());
 *         var exampleExpressRoutePort = new ExpressRoutePort("exampleExpressRoutePort", ExpressRoutePortArgs.builder()
 *             .name("port1")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .peeringLocation("Airtel-Chennai-CLS")
 *             .bandwidthInGbps(10)
 *             .encapsulation("Dot1Q")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West US
 *   exampleExpressRoutePort:
 *     type: azure:network:ExpressRoutePort
 *     name: example
 *     properties:
 *       name: port1
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       peeringLocation: Airtel-Chennai-CLS
 *       bandwidthInGbps: 10
 *       encapsulation: Dot1Q
 * ```
 * 
 * ## Import
 * Express Route Ports can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/expressRoutePort:ExpressRoutePort example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/expressRoutePorts/port1
 * ```
 */
public class ExpressRoutePort internal constructor(
    override val javaResource: com.pulumi.azure.network.ExpressRoutePort,
) : KotlinCustomResource(javaResource, ExpressRoutePortMapper) {
    /**
     * Bandwidth of the Express Route Port in Gbps. Changing this forces a new Express Route Port to be created.
     */
    public val bandwidthInGbps: Output
        get() = javaResource.bandwidthInGbps().applyValue({ args0 -> args0 })

    /**
     * The billing type of the Express Route Port. Possible values are `MeteredData` and `UnlimitedData`.
     */
    public val billingType: Output
        get() = javaResource.billingType().applyValue({ args0 -> args0 })

    /**
     * The encapsulation method used for the Express Route Port. Changing this forces a new Express Route Port to be created. Possible values are: `Dot1Q`, `QinQ`.
     */
    public val encapsulation: Output
        get() = javaResource.encapsulation().applyValue({ args0 -> args0 })

    /**
     * The EtherType of the Express Route Port.
     */
    public val ethertype: Output
        get() = javaResource.ethertype().applyValue({ args0 -> args0 })

    /**
     * The resource GUID of the Express Route Port.
     */
    public val guid: Output
        get() = javaResource.guid().applyValue({ args0 -> args0 })

    /**
     * An `identity` block as defined below.
     */
    public val identity: Output?
        get() = javaResource.identity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    expressRoutePortIdentityToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * A list of `link` blocks as defined below.
     */
    public val link1: Output
        get() = javaResource.link1().applyValue({ args0 ->
            args0.let({ args0 ->
                expressRoutePortLink1ToKotlin(args0)
            })
        })

    /**
     * A list of `link` blocks as defined below.
     */
    public val link2: Output
        get() = javaResource.link2().applyValue({ args0 ->
            args0.let({ args0 ->
                expressRoutePortLink2ToKotlin(args0)
            })
        })

    /**
     * The Azure Region where the Express Route Port should exist. Changing this forces a new Express Route Port to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The maximum transmission unit of the Express Route Port.
     */
    public val mtu: Output
        get() = javaResource.mtu().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this Express Route Port. Changing this forces a new Express Route Port to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the peering location that this Express Route Port is physically mapped to. Changing this forces a new Express Route Port to be created.
     */
    public val peeringLocation: Output
        get() = javaResource.peeringLocation().applyValue({ args0 -> args0 })

    /**
     * The name of the Resource Group where the Express Route Port should exist. Changing this forces a new Express Route Port to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the Express Route Port.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object ExpressRoutePortMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.network.ExpressRoutePort::class == javaResource::class

    override fun map(javaResource: Resource): ExpressRoutePort = ExpressRoutePort(
        javaResource as
            com.pulumi.azure.network.ExpressRoutePort,
    )
}

/**
 * @see [ExpressRoutePort].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ExpressRoutePort].
 */
public suspend fun expressRoutePort(
    name: String,
    block: suspend ExpressRoutePortResourceBuilder.() -> Unit,
): ExpressRoutePort {
    val builder = ExpressRoutePortResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ExpressRoutePort].
 * @param name The _unique_ name of the resulting resource.
 */
public fun expressRoutePort(name: String): ExpressRoutePort {
    val builder = ExpressRoutePortResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy