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

com.pulumi.azure.network.kotlin.NatGatewayPublicIpAssociationArgs.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.NatGatewayPublicIpAssociationArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages the association between a NAT Gateway and a Public IP.
 * ## 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 Europe",
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "example-PIP",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 *     sku: "Standard",
 * });
 * const exampleNatGateway = new azure.network.NatGateway("example", {
 *     name: "example-NatGateway",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "Standard",
 * });
 * const exampleNatGatewayPublicIpAssociation = new azure.network.NatGatewayPublicIpAssociation("example", {
 *     natGatewayId: exampleNatGateway.id,
 *     publicIpAddressId: examplePublicIp.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_public_ip = azure.network.PublicIp("example",
 *     name="example-PIP",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     allocation_method="Static",
 *     sku="Standard")
 * example_nat_gateway = azure.network.NatGateway("example",
 *     name="example-NatGateway",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="Standard")
 * example_nat_gateway_public_ip_association = azure.network.NatGatewayPublicIpAssociation("example",
 *     nat_gateway_id=example_nat_gateway.id,
 *     public_ip_address_id=example_public_ip.id)
 * ```
 * ```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 Europe",
 *     });
 *     var examplePublicIp = new Azure.Network.PublicIp("example", new()
 *     {
 *         Name = "example-PIP",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AllocationMethod = "Static",
 *         Sku = "Standard",
 *     });
 *     var exampleNatGateway = new Azure.Network.NatGateway("example", new()
 *     {
 *         Name = "example-NatGateway",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "Standard",
 *     });
 *     var exampleNatGatewayPublicIpAssociation = new Azure.Network.NatGatewayPublicIpAssociation("example", new()
 *     {
 *         NatGatewayId = exampleNatGateway.Id,
 *         PublicIpAddressId = examplePublicIp.Id,
 *     });
 * });
 * ```
 * ```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 Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
 * 			Name:              pulumi.String("example-PIP"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AllocationMethod:  pulumi.String("Static"),
 * 			Sku:               pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNatGateway, err := network.NewNatGateway(ctx, "example", &network.NatGatewayArgs{
 * 			Name:              pulumi.String("example-NatGateway"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewNatGatewayPublicIpAssociation(ctx, "example", &network.NatGatewayPublicIpAssociationArgs{
 * 			NatGatewayId:      exampleNatGateway.ID(),
 * 			PublicIpAddressId: examplePublicIp.ID(),
 * 		})
 * 		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.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * import com.pulumi.azure.network.NatGateway;
 * import com.pulumi.azure.network.NatGatewayArgs;
 * import com.pulumi.azure.network.NatGatewayPublicIpAssociation;
 * import com.pulumi.azure.network.NatGatewayPublicIpAssociationArgs;
 * 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 Europe")
 *             .build());
 *         var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
 *             .name("example-PIP")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .allocationMethod("Static")
 *             .sku("Standard")
 *             .build());
 *         var exampleNatGateway = new NatGateway("exampleNatGateway", NatGatewayArgs.builder()
 *             .name("example-NatGateway")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("Standard")
 *             .build());
 *         var exampleNatGatewayPublicIpAssociation = new NatGatewayPublicIpAssociation("exampleNatGatewayPublicIpAssociation", NatGatewayPublicIpAssociationArgs.builder()
 *             .natGatewayId(exampleNatGateway.id())
 *             .publicIpAddressId(examplePublicIp.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   examplePublicIp:
 *     type: azure:network:PublicIp
 *     name: example
 *     properties:
 *       name: example-PIP
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       allocationMethod: Static
 *       sku: Standard
 *   exampleNatGateway:
 *     type: azure:network:NatGateway
 *     name: example
 *     properties:
 *       name: example-NatGateway
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: Standard
 *   exampleNatGatewayPublicIpAssociation:
 *     type: azure:network:NatGatewayPublicIpAssociation
 *     name: example
 *     properties:
 *       natGatewayId: ${exampleNatGateway.id}
 *       publicIpAddressId: ${examplePublicIp.id}
 * ```
 * 
 * ## Import
 * Associations between NAT Gateway and Public IP Addresses can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/natGatewayPublicIpAssociation:NatGatewayPublicIpAssociation example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/natGateways/gateway1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/publicIPAddresses/myPublicIpAddress1"
 * ```
 * @property natGatewayId The ID of the NAT Gateway. Changing this forces a new resource to be created.
 * @property publicIpAddressId The ID of the Public IP which this NAT Gateway which should be connected to. Changing this forces a new resource to be created.
 */
public data class NatGatewayPublicIpAssociationArgs(
    public val natGatewayId: Output? = null,
    public val publicIpAddressId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.NatGatewayPublicIpAssociationArgs =
        com.pulumi.azure.network.NatGatewayPublicIpAssociationArgs.builder()
            .natGatewayId(natGatewayId?.applyValue({ args0 -> args0 }))
            .publicIpAddressId(publicIpAddressId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [NatGatewayPublicIpAssociationArgs].
 */
@PulumiTagMarker
public class NatGatewayPublicIpAssociationArgsBuilder internal constructor() {
    private var natGatewayId: Output? = null

    private var publicIpAddressId: Output? = null

    /**
     * @param value The ID of the NAT Gateway. Changing this forces a new resource to be created.
     */
    @JvmName("wjlcphnhbroihyjj")
    public suspend fun natGatewayId(`value`: Output) {
        this.natGatewayId = value
    }

    /**
     * @param value The ID of the Public IP which this NAT Gateway which should be connected to. Changing this forces a new resource to be created.
     */
    @JvmName("feevpewytfdnshxf")
    public suspend fun publicIpAddressId(`value`: Output) {
        this.publicIpAddressId = value
    }

    /**
     * @param value The ID of the NAT Gateway. Changing this forces a new resource to be created.
     */
    @JvmName("qnsvfisyqheunvkp")
    public suspend fun natGatewayId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.natGatewayId = mapped
    }

    /**
     * @param value The ID of the Public IP which this NAT Gateway which should be connected to. Changing this forces a new resource to be created.
     */
    @JvmName("jtutxsgdwphayxkv")
    public suspend fun publicIpAddressId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicIpAddressId = mapped
    }

    internal fun build(): NatGatewayPublicIpAssociationArgs = NatGatewayPublicIpAssociationArgs(
        natGatewayId = natGatewayId,
        publicIpAddressId = publicIpAddressId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy