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

com.pulumi.gcp.parallelstore.kotlin.InstanceArgs.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: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.parallelstore.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.parallelstore.InstanceArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Parallelstore Instance Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network = new gcp.compute.Network("network", {
 *     name: "network",
 *     autoCreateSubnetworks: true,
 *     mtu: 8896,
 * });
 * const instance = new gcp.parallelstore.Instance("instance", {
 *     instanceId: "instance",
 *     location: "us-central1-a",
 *     description: "test instance",
 *     capacityGib: "12000",
 *     network: network.name,
 *     labels: {
 *         test: "value",
 *     },
 * });
 * // Create an IP address
 * const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", {
 *     name: "address",
 *     purpose: "VPC_PEERING",
 *     addressType: "INTERNAL",
 *     prefixLength: 24,
 *     network: network.id,
 * });
 * // Create a private connection
 * const _default = new gcp.servicenetworking.Connection("default", {
 *     network: network.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [privateIpAlloc.name],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network = gcp.compute.Network("network",
 *     name="network",
 *     auto_create_subnetworks=True,
 *     mtu=8896)
 * instance = gcp.parallelstore.Instance("instance",
 *     instance_id="instance",
 *     location="us-central1-a",
 *     description="test instance",
 *     capacity_gib="12000",
 *     network=network.name,
 *     labels={
 *         "test": "value",
 *     })
 * # Create an IP address
 * private_ip_alloc = gcp.compute.GlobalAddress("private_ip_alloc",
 *     name="address",
 *     purpose="VPC_PEERING",
 *     address_type="INTERNAL",
 *     prefix_length=24,
 *     network=network.id)
 * # Create a private connection
 * default = gcp.servicenetworking.Connection("default",
 *     network=network.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[private_ip_alloc.name])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var network = new Gcp.Compute.Network("network", new()
 *     {
 *         Name = "network",
 *         AutoCreateSubnetworks = true,
 *         Mtu = 8896,
 *     });
 *     var instance = new Gcp.ParallelStore.Instance("instance", new()
 *     {
 *         InstanceId = "instance",
 *         Location = "us-central1-a",
 *         Description = "test instance",
 *         CapacityGib = "12000",
 *         Network = network.Name,
 *         Labels =
 *         {
 *             { "test", "value" },
 *         },
 *     });
 *     // Create an IP address
 *     var privateIpAlloc = new Gcp.Compute.GlobalAddress("private_ip_alloc", new()
 *     {
 *         Name = "address",
 *         Purpose = "VPC_PEERING",
 *         AddressType = "INTERNAL",
 *         PrefixLength = 24,
 *         Network = network.Id,
 *     });
 *     // Create a private connection
 *     var @default = new Gcp.ServiceNetworking.Connection("default", new()
 *     {
 *         Network = network.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             privateIpAlloc.Name,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/parallelstore"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(true),
 * 			Mtu:                   pulumi.Int(8896),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = parallelstore.NewInstance(ctx, "instance", ¶llelstore.InstanceArgs{
 * 			InstanceId:  pulumi.String("instance"),
 * 			Location:    pulumi.String("us-central1-a"),
 * 			Description: pulumi.String("test instance"),
 * 			CapacityGib: pulumi.String("12000"),
 * 			Network:     network.Name,
 * 			Labels: pulumi.StringMap{
 * 				"test": pulumi.String("value"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// Create an IP address
 * 		privateIpAlloc, err := compute.NewGlobalAddress(ctx, "private_ip_alloc", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("address"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			PrefixLength: pulumi.Int(24),
 * 			Network:      network.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// Create a private connection
 * 		_, err = servicenetworking.NewConnection(ctx, "default", &servicenetworking.ConnectionArgs{
 * 			Network: network.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				privateIpAlloc.Name,
 * 			},
 * 		})
 * 		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.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.parallelstore.Instance;
 * import com.pulumi.gcp.parallelstore.InstanceArgs;
 * import com.pulumi.gcp.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * import com.pulumi.gcp.servicenetworking.Connection;
 * import com.pulumi.gcp.servicenetworking.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 network = new Network("network", NetworkArgs.builder()
 *             .name("network")
 *             .autoCreateSubnetworks(true)
 *             .mtu(8896)
 *             .build());
 *         var instance = new Instance("instance", InstanceArgs.builder()
 *             .instanceId("instance")
 *             .location("us-central1-a")
 *             .description("test instance")
 *             .capacityGib(12000)
 *             .network(network.name())
 *             .labels(Map.of("test", "value"))
 *             .build());
 *         // Create an IP address
 *         var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
 *             .name("address")
 *             .purpose("VPC_PEERING")
 *             .addressType("INTERNAL")
 *             .prefixLength(24)
 *             .network(network.id())
 *             .build());
 *         // Create a private connection
 *         var default_ = new Connection("default", ConnectionArgs.builder()
 *             .network(network.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(privateIpAlloc.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:parallelstore:Instance
 *     properties:
 *       instanceId: instance
 *       location: us-central1-a
 *       description: test instance
 *       capacityGib: 12000
 *       network: ${network.name}
 *       labels:
 *         test: value
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: network
 *       autoCreateSubnetworks: true
 *       mtu: 8896
 *   # Create an IP address
 *   privateIpAlloc:
 *     type: gcp:compute:GlobalAddress
 *     name: private_ip_alloc
 *     properties:
 *       name: address
 *       purpose: VPC_PEERING
 *       addressType: INTERNAL
 *       prefixLength: 24
 *       network: ${network.id}
 *   # Create a private connection
 *   default:
 *     type: gcp:servicenetworking:Connection
 *     properties:
 *       network: ${network.id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${privateIpAlloc.name}
 * ```
 * 
 * ## Import
 * Instance can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/instances/{{instance_id}}`
 * * `{{project}}/{{location}}/{{instance_id}}`
 * * `{{location}}/{{instance_id}}`
 * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:parallelstore/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{instance_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:parallelstore/instance:Instance default {{project}}/{{location}}/{{instance_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:parallelstore/instance:Instance default {{location}}/{{instance_id}}
 * ```
 * @property capacityGib Immutable. Storage capacity of Parallelstore instance in Gibibytes (GiB).
 * @property description The description of the instance. 2048 characters or less.
 * @property instanceId The logical name of the Parallelstore instance in the user project with the following restrictions:
 * * Must contain only lowercase letters, numbers, and hyphens.
 * * Must start with a letter.
 * * Must be between 1-63 characters.
 * * Must end with a number or a letter.
 * * Must be unique within the customer project/ location
 * - - -
 * @property labels Cloud Labels are a flexible and lightweight mechanism for organizing cloud
 * resources into groups that reflect a customer's organizational needs and
 * deployment strategies. Cloud Labels can be used to filter collections of
 * resources. They can be used to control how resource metrics are aggregated.
 * And they can be used as arguments to policy management rules (e.g. route,
 * firewall, load balancing, etc.).
 * * Label keys must be between 1 and 63 characters long and must conform to
 * the following regular expression: `a-z{0,62}`.
 * * Label values must be between 0 and 63 characters long and must conform
 * to the regular expression `[a-z0-9_-]{0,63}`.
 * * No more than 64 labels can be associated with a given resource.
 * See https://goo.gl/xmQnxf for more information on and examples of labels.
 * If you plan to use labels in your own code, please note that additional
 * characters may be allowed in the future. Therefore, you are advised to use
 * an internal label representation, such as JSON, which doesn't rely upon
 * specific characters being disallowed.  For example, representing labels
 * as the string:  name + "_" + value  would prove problematic if we were to
 * allow "_" in a future release.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property location Part of `parent`. See documentation of `projectsId`.
 * @property network Immutable. The name of the Google Compute Engine
 * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
 * instance is connected.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property reservedIpRange Immutable. Contains the id of the allocated IP address range associated with the
 * private service access connection for example, "test-default" associated
 * with IP range 10.0.0.0/29. If no range id is provided all ranges will be
 * considered.
 */
public data class InstanceArgs(
    public val capacityGib: Output? = null,
    public val description: Output? = null,
    public val instanceId: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val network: Output? = null,
    public val project: Output? = null,
    public val reservedIpRange: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.parallelstore.InstanceArgs =
        com.pulumi.gcp.parallelstore.InstanceArgs.builder()
            .capacityGib(capacityGib?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .instanceId(instanceId?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .network(network?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .reservedIpRange(reservedIpRange?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceArgs].
 */
@PulumiTagMarker
public class InstanceArgsBuilder internal constructor() {
    private var capacityGib: Output? = null

    private var description: Output? = null

    private var instanceId: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var network: Output? = null

    private var project: Output? = null

    private var reservedIpRange: Output? = null

    /**
     * @param value Immutable. Storage capacity of Parallelstore instance in Gibibytes (GiB).
     */
    @JvmName("awbxofrmqivbgunj")
    public suspend fun capacityGib(`value`: Output) {
        this.capacityGib = value
    }

    /**
     * @param value The description of the instance. 2048 characters or less.
     */
    @JvmName("fqblldkcaqtdcght")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The logical name of the Parallelstore instance in the user project with the following restrictions:
     * * Must contain only lowercase letters, numbers, and hyphens.
     * * Must start with a letter.
     * * Must be between 1-63 characters.
     * * Must end with a number or a letter.
     * * Must be unique within the customer project/ location
     * - - -
     */
    @JvmName("enxxwvsnnbpcpyyq")
    public suspend fun instanceId(`value`: Output) {
        this.instanceId = value
    }

    /**
     * @param value Cloud Labels are a flexible and lightweight mechanism for organizing cloud
     * resources into groups that reflect a customer's organizational needs and
     * deployment strategies. Cloud Labels can be used to filter collections of
     * resources. They can be used to control how resource metrics are aggregated.
     * And they can be used as arguments to policy management rules (e.g. route,
     * firewall, load balancing, etc.).
     * * Label keys must be between 1 and 63 characters long and must conform to
     * the following regular expression: `a-z{0,62}`.
     * * Label values must be between 0 and 63 characters long and must conform
     * to the regular expression `[a-z0-9_-]{0,63}`.
     * * No more than 64 labels can be associated with a given resource.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * If you plan to use labels in your own code, please note that additional
     * characters may be allowed in the future. Therefore, you are advised to use
     * an internal label representation, such as JSON, which doesn't rely upon
     * specific characters being disallowed.  For example, representing labels
     * as the string:  name + "_" + value  would prove problematic if we were to
     * allow "_" in a future release.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("kngkeujhtovtkslj")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Part of `parent`. See documentation of `projectsId`.
     */
    @JvmName("aqgkxfhyuujmlynv")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Immutable. The name of the Google Compute Engine
     * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
     * instance is connected.
     */
    @JvmName("jynlfhmmfyfaefbo")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("kimsenmkdbpjrdhw")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Immutable. Contains the id of the allocated IP address range associated with the
     * private service access connection for example, "test-default" associated
     * with IP range 10.0.0.0/29. If no range id is provided all ranges will be
     * considered.
     */
    @JvmName("lwdsaylsaulfcegj")
    public suspend fun reservedIpRange(`value`: Output) {
        this.reservedIpRange = value
    }

    /**
     * @param value Immutable. Storage capacity of Parallelstore instance in Gibibytes (GiB).
     */
    @JvmName("afxiwnjpmenjmnux")
    public suspend fun capacityGib(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacityGib = mapped
    }

    /**
     * @param value The description of the instance. 2048 characters or less.
     */
    @JvmName("ftufleasfavpobre")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The logical name of the Parallelstore instance in the user project with the following restrictions:
     * * Must contain only lowercase letters, numbers, and hyphens.
     * * Must start with a letter.
     * * Must be between 1-63 characters.
     * * Must end with a number or a letter.
     * * Must be unique within the customer project/ location
     * - - -
     */
    @JvmName("glyecdocjuxkvsvv")
    public suspend fun instanceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceId = mapped
    }

    /**
     * @param value Cloud Labels are a flexible and lightweight mechanism for organizing cloud
     * resources into groups that reflect a customer's organizational needs and
     * deployment strategies. Cloud Labels can be used to filter collections of
     * resources. They can be used to control how resource metrics are aggregated.
     * And they can be used as arguments to policy management rules (e.g. route,
     * firewall, load balancing, etc.).
     * * Label keys must be between 1 and 63 characters long and must conform to
     * the following regular expression: `a-z{0,62}`.
     * * Label values must be between 0 and 63 characters long and must conform
     * to the regular expression `[a-z0-9_-]{0,63}`.
     * * No more than 64 labels can be associated with a given resource.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * If you plan to use labels in your own code, please note that additional
     * characters may be allowed in the future. Therefore, you are advised to use
     * an internal label representation, such as JSON, which doesn't rely upon
     * specific characters being disallowed.  For example, representing labels
     * as the string:  name + "_" + value  would prove problematic if we were to
     * allow "_" in a future release.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("qtiaaksrqnsfpmcc")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Cloud Labels are a flexible and lightweight mechanism for organizing cloud
     * resources into groups that reflect a customer's organizational needs and
     * deployment strategies. Cloud Labels can be used to filter collections of
     * resources. They can be used to control how resource metrics are aggregated.
     * And they can be used as arguments to policy management rules (e.g. route,
     * firewall, load balancing, etc.).
     * * Label keys must be between 1 and 63 characters long and must conform to
     * the following regular expression: `a-z{0,62}`.
     * * Label values must be between 0 and 63 characters long and must conform
     * to the regular expression `[a-z0-9_-]{0,63}`.
     * * No more than 64 labels can be associated with a given resource.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * If you plan to use labels in your own code, please note that additional
     * characters may be allowed in the future. Therefore, you are advised to use
     * an internal label representation, such as JSON, which doesn't rely upon
     * specific characters being disallowed.  For example, representing labels
     * as the string:  name + "_" + value  would prove problematic if we were to
     * allow "_" in a future release.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("jrwtfkqivagjmnxg")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Part of `parent`. See documentation of `projectsId`.
     */
    @JvmName("jeymdvomrrsbbges")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Immutable. The name of the Google Compute Engine
     * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
     * instance is connected.
     */
    @JvmName("rffucwtaqvxuicbe")
    public suspend fun network(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("mookwlrcocymrsvg")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Immutable. Contains the id of the allocated IP address range associated with the
     * private service access connection for example, "test-default" associated
     * with IP range 10.0.0.0/29. If no range id is provided all ranges will be
     * considered.
     */
    @JvmName("cqgyqvttywsoxdyf")
    public suspend fun reservedIpRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.reservedIpRange = mapped
    }

    internal fun build(): InstanceArgs = InstanceArgs(
        capacityGib = capacityGib,
        description = description,
        instanceId = instanceId,
        labels = labels,
        location = location,
        network = network,
        project = project,
        reservedIpRange = reservedIpRange,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy