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

com.pulumi.gcp.vmwareengine.kotlin.SubnetArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.vmwareengine.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.vmwareengine.SubnetArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Subnet in a private cloud. A Private Cloud contains two types of subnets: `management` subnets (such as vMotion) that
 * are read-only,and `userDefined`, which can also be updated. This resource should be used to read and update `userDefined`
 * subnets. To read `management` subnets, please utilize the subnet data source.
 * To get more information about Subnet, see:
 * * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.privateClouds.subnets)
 * ## Example Usage
 * ### Vmware Engine Subnet User Defined
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const subnet_nw = new gcp.vmwareengine.Network("subnet-nw", {
 *     name: "pc-nw",
 *     location: "global",
 *     type: "STANDARD",
 *     description: "PC network description.",
 * });
 * const subnet_pc = new gcp.vmwareengine.PrivateCloud("subnet-pc", {
 *     location: "us-west1-a",
 *     name: "sample-pc",
 *     description: "Sample test PC.",
 *     networkConfig: {
 *         managementCidr: "192.168.50.0/24",
 *         vmwareEngineNetwork: subnet_nw.id,
 *     },
 *     managementCluster: {
 *         clusterId: "sample-mgmt-cluster",
 *         nodeTypeConfigs: [{
 *             nodeTypeId: "standard-72",
 *             nodeCount: 3,
 *         }],
 *     },
 * });
 * const vmw_engine_subnet = new gcp.vmwareengine.Subnet("vmw-engine-subnet", {
 *     name: "service-1",
 *     parent: subnet_pc.id,
 *     ipCidrRange: "192.168.100.0/26",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * subnet_nw = gcp.vmwareengine.Network("subnet-nw",
 *     name="pc-nw",
 *     location="global",
 *     type="STANDARD",
 *     description="PC network description.")
 * subnet_pc = gcp.vmwareengine.PrivateCloud("subnet-pc",
 *     location="us-west1-a",
 *     name="sample-pc",
 *     description="Sample test PC.",
 *     network_config={
 *         "management_cidr": "192.168.50.0/24",
 *         "vmware_engine_network": subnet_nw.id,
 *     },
 *     management_cluster={
 *         "cluster_id": "sample-mgmt-cluster",
 *         "node_type_configs": [{
 *             "node_type_id": "standard-72",
 *             "node_count": 3,
 *         }],
 *     })
 * vmw_engine_subnet = gcp.vmwareengine.Subnet("vmw-engine-subnet",
 *     name="service-1",
 *     parent=subnet_pc.id,
 *     ip_cidr_range="192.168.100.0/26")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var subnet_nw = new Gcp.VMwareEngine.Network("subnet-nw", new()
 *     {
 *         Name = "pc-nw",
 *         Location = "global",
 *         Type = "STANDARD",
 *         Description = "PC network description.",
 *     });
 *     var subnet_pc = new Gcp.VMwareEngine.PrivateCloud("subnet-pc", new()
 *     {
 *         Location = "us-west1-a",
 *         Name = "sample-pc",
 *         Description = "Sample test PC.",
 *         NetworkConfig = new Gcp.VMwareEngine.Inputs.PrivateCloudNetworkConfigArgs
 *         {
 *             ManagementCidr = "192.168.50.0/24",
 *             VmwareEngineNetwork = subnet_nw.Id,
 *         },
 *         ManagementCluster = new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterArgs
 *         {
 *             ClusterId = "sample-mgmt-cluster",
 *             NodeTypeConfigs = new[]
 *             {
 *                 new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterNodeTypeConfigArgs
 *                 {
 *                     NodeTypeId = "standard-72",
 *                     NodeCount = 3,
 *                 },
 *             },
 *         },
 *     });
 *     var vmw_engine_subnet = new Gcp.VMwareEngine.Subnet("vmw-engine-subnet", new()
 *     {
 *         Name = "service-1",
 *         Parent = subnet_pc.Id,
 *         IpCidrRange = "192.168.100.0/26",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vmwareengine.NewNetwork(ctx, "subnet-nw", &vmwareengine.NetworkArgs{
 * 			Name:        pulumi.String("pc-nw"),
 * 			Location:    pulumi.String("global"),
 * 			Type:        pulumi.String("STANDARD"),
 * 			Description: pulumi.String("PC network description."),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewPrivateCloud(ctx, "subnet-pc", &vmwareengine.PrivateCloudArgs{
 * 			Location:    pulumi.String("us-west1-a"),
 * 			Name:        pulumi.String("sample-pc"),
 * 			Description: pulumi.String("Sample test PC."),
 * 			NetworkConfig: &vmwareengine.PrivateCloudNetworkConfigArgs{
 * 				ManagementCidr:      pulumi.String("192.168.50.0/24"),
 * 				VmwareEngineNetwork: subnet_nw.ID(),
 * 			},
 * 			ManagementCluster: &vmwareengine.PrivateCloudManagementClusterArgs{
 * 				ClusterId: pulumi.String("sample-mgmt-cluster"),
 * 				NodeTypeConfigs: vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArray{
 * 					&vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArgs{
 * 						NodeTypeId: pulumi.String("standard-72"),
 * 						NodeCount:  pulumi.Int(3),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewSubnet(ctx, "vmw-engine-subnet", &vmwareengine.SubnetArgs{
 * 			Name:        pulumi.String("service-1"),
 * 			Parent:      subnet_pc.ID(),
 * 			IpCidrRange: pulumi.String("192.168.100.0/26"),
 * 		})
 * 		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.gcp.vmwareengine.Network;
 * import com.pulumi.gcp.vmwareengine.NetworkArgs;
 * import com.pulumi.gcp.vmwareengine.PrivateCloud;
 * import com.pulumi.gcp.vmwareengine.PrivateCloudArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudNetworkConfigArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudManagementClusterArgs;
 * import com.pulumi.gcp.vmwareengine.Subnet;
 * import com.pulumi.gcp.vmwareengine.SubnetArgs;
 * 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 subnet_nw = new Network("subnet-nw", NetworkArgs.builder()
 *             .name("pc-nw")
 *             .location("global")
 *             .type("STANDARD")
 *             .description("PC network description.")
 *             .build());
 *         var subnet_pc = new PrivateCloud("subnet-pc", PrivateCloudArgs.builder()
 *             .location("us-west1-a")
 *             .name("sample-pc")
 *             .description("Sample test PC.")
 *             .networkConfig(PrivateCloudNetworkConfigArgs.builder()
 *                 .managementCidr("192.168.50.0/24")
 *                 .vmwareEngineNetwork(subnet_nw.id())
 *                 .build())
 *             .managementCluster(PrivateCloudManagementClusterArgs.builder()
 *                 .clusterId("sample-mgmt-cluster")
 *                 .nodeTypeConfigs(PrivateCloudManagementClusterNodeTypeConfigArgs.builder()
 *                     .nodeTypeId("standard-72")
 *                     .nodeCount(3)
 *                     .build())
 *                 .build())
 *             .build());
 *         var vmw_engine_subnet = new Subnet("vmw-engine-subnet", SubnetArgs.builder()
 *             .name("service-1")
 *             .parent(subnet_pc.id())
 *             .ipCidrRange("192.168.100.0/26")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   subnet-nw:
 *     type: gcp:vmwareengine:Network
 *     properties:
 *       name: pc-nw
 *       location: global
 *       type: STANDARD
 *       description: PC network description.
 *   subnet-pc:
 *     type: gcp:vmwareengine:PrivateCloud
 *     properties:
 *       location: us-west1-a
 *       name: sample-pc
 *       description: Sample test PC.
 *       networkConfig:
 *         managementCidr: 192.168.50.0/24
 *         vmwareEngineNetwork: ${["subnet-nw"].id}
 *       managementCluster:
 *         clusterId: sample-mgmt-cluster
 *         nodeTypeConfigs:
 *           - nodeTypeId: standard-72
 *             nodeCount: 3
 *   vmw-engine-subnet:
 *     type: gcp:vmwareengine:Subnet
 *     properties:
 *       name: service-1
 *       parent: ${["subnet-pc"].id}
 *       ipCidrRange: 192.168.100.0/26
 * ```
 * 
 * ## Import
 * Subnet can be imported using any of these accepted formats:
 * * `{{parent}}/subnets/{{name}}`
 * When using the `pulumi import` command, Subnet can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:vmwareengine/subnet:Subnet default {{parent}}/subnets/{{name}}
 * ```
 * @property ipCidrRange The IP address range of the subnet in CIDR format.
 * @property name The ID of the subnet. For userDefined subnets, this name should be in the format of "service-n",
 * where n ranges from 1 to 5.
 * - - -
 * @property parent The resource name of the private cloud to create a new subnet in.
 * Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
 * For example: projects/my-project/locations/us-west1-a/privateClouds/my-cloud
 */
public data class SubnetArgs(
    public val ipCidrRange: Output? = null,
    public val name: Output? = null,
    public val parent: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.vmwareengine.SubnetArgs =
        com.pulumi.gcp.vmwareengine.SubnetArgs.builder()
            .ipCidrRange(ipCidrRange?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parent(parent?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SubnetArgs].
 */
@PulumiTagMarker
public class SubnetArgsBuilder internal constructor() {
    private var ipCidrRange: Output? = null

    private var name: Output? = null

    private var parent: Output? = null

    /**
     * @param value The IP address range of the subnet in CIDR format.
     */
    @JvmName("wukakqifvlgbxkmb")
    public suspend fun ipCidrRange(`value`: Output) {
        this.ipCidrRange = value
    }

    /**
     * @param value The ID of the subnet. For userDefined subnets, this name should be in the format of "service-n",
     * where n ranges from 1 to 5.
     * - - -
     */
    @JvmName("oppffmvayrahagxa")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The resource name of the private cloud to create a new subnet in.
     * Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
     * For example: projects/my-project/locations/us-west1-a/privateClouds/my-cloud
     */
    @JvmName("tnaaykxurnlpiakl")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value The IP address range of the subnet in CIDR format.
     */
    @JvmName("awoxdtwyigxcqorq")
    public suspend fun ipCidrRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipCidrRange = mapped
    }

    /**
     * @param value The ID of the subnet. For userDefined subnets, this name should be in the format of "service-n",
     * where n ranges from 1 to 5.
     * - - -
     */
    @JvmName("befkkymdrguigqnj")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The resource name of the private cloud to create a new subnet in.
     * Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
     * For example: projects/my-project/locations/us-west1-a/privateClouds/my-cloud
     */
    @JvmName("ufoyqdtbafsusryv")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    internal fun build(): SubnetArgs = SubnetArgs(
        ipCidrRange = ipCidrRange,
        name = name,
        parent = parent,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy