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

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

package com.pulumi.gcp.edgecontainer.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterAuthorization
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterControlPlane
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterControlPlaneEncryption
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterFleet
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterMaintenanceEvent
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterMaintenancePolicy
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterNetworking
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterSystemAddonsConfig
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.List
import kotlin.collections.Map
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterAuthorization.Companion.toKotlin as clusterAuthorizationToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterControlPlane.Companion.toKotlin as clusterControlPlaneToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterControlPlaneEncryption.Companion.toKotlin as clusterControlPlaneEncryptionToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterFleet.Companion.toKotlin as clusterFleetToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterMaintenanceEvent.Companion.toKotlin as clusterMaintenanceEventToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterMaintenancePolicy.Companion.toKotlin as clusterMaintenancePolicyToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterNetworking.Companion.toKotlin as clusterNetworkingToKotlin
import com.pulumi.gcp.edgecontainer.kotlin.outputs.ClusterSystemAddonsConfig.Companion.toKotlin as clusterSystemAddonsConfigToKotlin

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

    public var args: ClusterArgs = ClusterArgs()

    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 ClusterArgsBuilder.() -> Unit) {
        val builder = ClusterArgsBuilder()
        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(): Cluster {
        val builtJavaResource = com.pulumi.gcp.edgecontainer.Cluster(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Cluster(builtJavaResource)
    }
}

/**
 * Cluster contains information about a Google Distributed Cloud Edge Kubernetes cluster.
 * To get more information about Cluster, see:
 * * [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.clusters)
 * * How-to Guides
 *     * [Create and manage clusters](https://cloud.google.com/distributed-cloud/edge/latest/docs/clusters)
 * ## Example Usage
 * ### Edgecontainer Cluster
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const _default = new gcp.edgecontainer.Cluster("default", {
 *     name: "basic-cluster",
 *     location: "us-central1",
 *     authorization: {
 *         adminUsers: {
 *             username: "[email protected]",
 *         },
 *     },
 *     networking: {
 *         clusterIpv4CidrBlocks: ["10.0.0.0/16"],
 *         servicesIpv4CidrBlocks: ["10.1.0.0/16"],
 *     },
 *     fleet: {
 *         project: project.then(project => `projects/${project.number}`),
 *     },
 *     labels: {
 *         my_key: "my_val",
 *         other_key: "other_val",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * default = gcp.edgecontainer.Cluster("default",
 *     name="basic-cluster",
 *     location="us-central1",
 *     authorization=gcp.edgecontainer.ClusterAuthorizationArgs(
 *         admin_users=gcp.edgecontainer.ClusterAuthorizationAdminUsersArgs(
 *             username="[email protected]",
 *         ),
 *     ),
 *     networking=gcp.edgecontainer.ClusterNetworkingArgs(
 *         cluster_ipv4_cidr_blocks=["10.0.0.0/16"],
 *         services_ipv4_cidr_blocks=["10.1.0.0/16"],
 *     ),
 *     fleet=gcp.edgecontainer.ClusterFleetArgs(
 *         project=f"projects/{project.number}",
 *     ),
 *     labels={
 *         "my_key": "my_val",
 *         "other_key": "other_val",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var @default = new Gcp.EdgeContainer.Cluster("default", new()
 *     {
 *         Name = "basic-cluster",
 *         Location = "us-central1",
 *         Authorization = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationArgs
 *         {
 *             AdminUsers = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationAdminUsersArgs
 *             {
 *                 Username = "[email protected]",
 *             },
 *         },
 *         Networking = new Gcp.EdgeContainer.Inputs.ClusterNetworkingArgs
 *         {
 *             ClusterIpv4CidrBlocks = new[]
 *             {
 *                 "10.0.0.0/16",
 *             },
 *             ServicesIpv4CidrBlocks = new[]
 *             {
 *                 "10.1.0.0/16",
 *             },
 *         },
 *         Fleet = new Gcp.EdgeContainer.Inputs.ClusterFleetArgs
 *         {
 *             Project = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}",
 *         },
 *         Labels =
 *         {
 *             { "my_key", "my_val" },
 *             { "other_key", "other_val" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgecontainer"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = edgecontainer.NewCluster(ctx, "default", &edgecontainer.ClusterArgs{
 * 			Name:     pulumi.String("basic-cluster"),
 * 			Location: pulumi.String("us-central1"),
 * 			Authorization: &edgecontainer.ClusterAuthorizationArgs{
 * 				AdminUsers: &edgecontainer.ClusterAuthorizationAdminUsersArgs{
 * 					Username: pulumi.String("[email protected]"),
 * 				},
 * 			},
 * 			Networking: &edgecontainer.ClusterNetworkingArgs{
 * 				ClusterIpv4CidrBlocks: pulumi.StringArray{
 * 					pulumi.String("10.0.0.0/16"),
 * 				},
 * 				ServicesIpv4CidrBlocks: pulumi.StringArray{
 * 					pulumi.String("10.1.0.0/16"),
 * 				},
 * 			},
 * 			Fleet: &edgecontainer.ClusterFleetArgs{
 * 				Project: pulumi.String(fmt.Sprintf("projects/%v", project.Number)),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"my_key":    pulumi.String("my_val"),
 * 				"other_key": pulumi.String("other_val"),
 * 			},
 * 		})
 * 		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.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.edgecontainer.Cluster;
 * import com.pulumi.gcp.edgecontainer.ClusterArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs;
 * 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) {
 *         final var project = OrganizationsFunctions.getProject();
 *         var default_ = new Cluster("default", ClusterArgs.builder()
 *             .name("basic-cluster")
 *             .location("us-central1")
 *             .authorization(ClusterAuthorizationArgs.builder()
 *                 .adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
 *                     .username("[email protected]")
 *                     .build())
 *                 .build())
 *             .networking(ClusterNetworkingArgs.builder()
 *                 .clusterIpv4CidrBlocks("10.0.0.0/16")
 *                 .servicesIpv4CidrBlocks("10.1.0.0/16")
 *                 .build())
 *             .fleet(ClusterFleetArgs.builder()
 *                 .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number())))
 *                 .build())
 *             .labels(Map.ofEntries(
 *                 Map.entry("my_key", "my_val"),
 *                 Map.entry("other_key", "other_val")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:edgecontainer:Cluster
 *     properties:
 *       name: basic-cluster
 *       location: us-central1
 *       authorization:
 *         adminUsers:
 *           username: [email protected]
 *       networking:
 *         clusterIpv4CidrBlocks:
 *           - 10.0.0.0/16
 *         servicesIpv4CidrBlocks:
 *           - 10.1.0.0/16
 *       fleet:
 *         project: projects/${project.number}
 *       labels:
 *         my_key: my_val
 *         other_key: other_val
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ### Edgecontainer Cluster With Maintenance Window
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const _default = new gcp.edgecontainer.Cluster("default", {
 *     name: "cluster-with-maintenance",
 *     location: "us-central1",
 *     authorization: {
 *         adminUsers: {
 *             username: "[email protected]",
 *         },
 *     },
 *     networking: {
 *         clusterIpv4CidrBlocks: ["10.0.0.0/16"],
 *         servicesIpv4CidrBlocks: ["10.1.0.0/16"],
 *     },
 *     fleet: {
 *         project: project.then(project => `projects/${project.number}`),
 *     },
 *     maintenancePolicy: {
 *         window: {
 *             recurringWindow: {
 *                 window: {
 *                     startTime: "2023-01-01T08:00:00Z",
 *                     endTime: "2023-01-01T17:00:00Z",
 *                 },
 *                 recurrence: "FREQ=WEEKLY;BYDAY=SA",
 *             },
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * default = gcp.edgecontainer.Cluster("default",
 *     name="cluster-with-maintenance",
 *     location="us-central1",
 *     authorization=gcp.edgecontainer.ClusterAuthorizationArgs(
 *         admin_users=gcp.edgecontainer.ClusterAuthorizationAdminUsersArgs(
 *             username="[email protected]",
 *         ),
 *     ),
 *     networking=gcp.edgecontainer.ClusterNetworkingArgs(
 *         cluster_ipv4_cidr_blocks=["10.0.0.0/16"],
 *         services_ipv4_cidr_blocks=["10.1.0.0/16"],
 *     ),
 *     fleet=gcp.edgecontainer.ClusterFleetArgs(
 *         project=f"projects/{project.number}",
 *     ),
 *     maintenance_policy=gcp.edgecontainer.ClusterMaintenancePolicyArgs(
 *         window=gcp.edgecontainer.ClusterMaintenancePolicyWindowArgs(
 *             recurring_window=gcp.edgecontainer.ClusterMaintenancePolicyWindowRecurringWindowArgs(
 *                 window=gcp.edgecontainer.ClusterMaintenancePolicyWindowRecurringWindowWindowArgs(
 *                     start_time="2023-01-01T08:00:00Z",
 *                     end_time="2023-01-01T17:00:00Z",
 *                 ),
 *                 recurrence="FREQ=WEEKLY;BYDAY=SA",
 *             ),
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var @default = new Gcp.EdgeContainer.Cluster("default", new()
 *     {
 *         Name = "cluster-with-maintenance",
 *         Location = "us-central1",
 *         Authorization = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationArgs
 *         {
 *             AdminUsers = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationAdminUsersArgs
 *             {
 *                 Username = "[email protected]",
 *             },
 *         },
 *         Networking = new Gcp.EdgeContainer.Inputs.ClusterNetworkingArgs
 *         {
 *             ClusterIpv4CidrBlocks = new[]
 *             {
 *                 "10.0.0.0/16",
 *             },
 *             ServicesIpv4CidrBlocks = new[]
 *             {
 *                 "10.1.0.0/16",
 *             },
 *         },
 *         Fleet = new Gcp.EdgeContainer.Inputs.ClusterFleetArgs
 *         {
 *             Project = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}",
 *         },
 *         MaintenancePolicy = new Gcp.EdgeContainer.Inputs.ClusterMaintenancePolicyArgs
 *         {
 *             Window = new Gcp.EdgeContainer.Inputs.ClusterMaintenancePolicyWindowArgs
 *             {
 *                 RecurringWindow = new Gcp.EdgeContainer.Inputs.ClusterMaintenancePolicyWindowRecurringWindowArgs
 *                 {
 *                     Window = new Gcp.EdgeContainer.Inputs.ClusterMaintenancePolicyWindowRecurringWindowWindowArgs
 *                     {
 *                         StartTime = "2023-01-01T08:00:00Z",
 *                         EndTime = "2023-01-01T17:00:00Z",
 *                     },
 *                     Recurrence = "FREQ=WEEKLY;BYDAY=SA",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgecontainer"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = edgecontainer.NewCluster(ctx, "default", &edgecontainer.ClusterArgs{
 * 			Name:     pulumi.String("cluster-with-maintenance"),
 * 			Location: pulumi.String("us-central1"),
 * 			Authorization: &edgecontainer.ClusterAuthorizationArgs{
 * 				AdminUsers: &edgecontainer.ClusterAuthorizationAdminUsersArgs{
 * 					Username: pulumi.String("[email protected]"),
 * 				},
 * 			},
 * 			Networking: &edgecontainer.ClusterNetworkingArgs{
 * 				ClusterIpv4CidrBlocks: pulumi.StringArray{
 * 					pulumi.String("10.0.0.0/16"),
 * 				},
 * 				ServicesIpv4CidrBlocks: pulumi.StringArray{
 * 					pulumi.String("10.1.0.0/16"),
 * 				},
 * 			},
 * 			Fleet: &edgecontainer.ClusterFleetArgs{
 * 				Project: pulumi.String(fmt.Sprintf("projects/%v", project.Number)),
 * 			},
 * 			MaintenancePolicy: &edgecontainer.ClusterMaintenancePolicyArgs{
 * 				Window: &edgecontainer.ClusterMaintenancePolicyWindowArgs{
 * 					RecurringWindow: &edgecontainer.ClusterMaintenancePolicyWindowRecurringWindowArgs{
 * 						Window: &edgecontainer.ClusterMaintenancePolicyWindowRecurringWindowWindowArgs{
 * 							StartTime: pulumi.String("2023-01-01T08:00:00Z"),
 * 							EndTime:   pulumi.String("2023-01-01T17:00:00Z"),
 * 						},
 * 						Recurrence: pulumi.String("FREQ=WEEKLY;BYDAY=SA"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.edgecontainer.Cluster;
 * import com.pulumi.gcp.edgecontainer.ClusterArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterMaintenancePolicyArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterMaintenancePolicyWindowArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterMaintenancePolicyWindowRecurringWindowArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterMaintenancePolicyWindowRecurringWindowWindowArgs;
 * 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) {
 *         final var project = OrganizationsFunctions.getProject();
 *         var default_ = new Cluster("default", ClusterArgs.builder()
 *             .name("cluster-with-maintenance")
 *             .location("us-central1")
 *             .authorization(ClusterAuthorizationArgs.builder()
 *                 .adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
 *                     .username("[email protected]")
 *                     .build())
 *                 .build())
 *             .networking(ClusterNetworkingArgs.builder()
 *                 .clusterIpv4CidrBlocks("10.0.0.0/16")
 *                 .servicesIpv4CidrBlocks("10.1.0.0/16")
 *                 .build())
 *             .fleet(ClusterFleetArgs.builder()
 *                 .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number())))
 *                 .build())
 *             .maintenancePolicy(ClusterMaintenancePolicyArgs.builder()
 *                 .window(ClusterMaintenancePolicyWindowArgs.builder()
 *                     .recurringWindow(ClusterMaintenancePolicyWindowRecurringWindowArgs.builder()
 *                         .window(ClusterMaintenancePolicyWindowRecurringWindowWindowArgs.builder()
 *                             .startTime("2023-01-01T08:00:00Z")
 *                             .endTime("2023-01-01T17:00:00Z")
 *                             .build())
 *                         .recurrence("FREQ=WEEKLY;BYDAY=SA")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:edgecontainer:Cluster
 *     properties:
 *       name: cluster-with-maintenance
 *       location: us-central1
 *       authorization:
 *         adminUsers:
 *           username: [email protected]
 *       networking:
 *         clusterIpv4CidrBlocks:
 *           - 10.0.0.0/16
 *         servicesIpv4CidrBlocks:
 *           - 10.1.0.0/16
 *       fleet:
 *         project: projects/${project.number}
 *       maintenancePolicy:
 *         window:
 *           recurringWindow:
 *             window:
 *               startTime: 2023-01-01T08:00:00Z
 *               endTime: 2023-01-01T17:00:00Z
 *             recurrence: FREQ=WEEKLY;BYDAY=SA
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ### Edgecontainer Local Control Plane Cluster
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const _default = new gcp.edgecontainer.Cluster("default", {
 *     name: "local-control-plane-cluster",
 *     location: "us-central1",
 *     authorization: {
 *         adminUsers: {
 *             username: "[email protected]",
 *         },
 *     },
 *     networking: {
 *         clusterIpv4CidrBlocks: ["10.0.0.0/16"],
 *         servicesIpv4CidrBlocks: ["10.1.0.0/16"],
 *     },
 *     fleet: {
 *         project: project.then(project => `projects/${project.number}`),
 *     },
 *     externalLoadBalancerIpv4AddressPools: ["10.100.0.0-10.100.0.10"],
 *     controlPlane: {
 *         local: {
 *             nodeLocation: "us-central1-edge-example-edgesite",
 *             nodeCount: 1,
 *             machineFilter: "machine-name",
 *             sharedDeploymentPolicy: "ALLOWED",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * default = gcp.edgecontainer.Cluster("default",
 *     name="local-control-plane-cluster",
 *     location="us-central1",
 *     authorization=gcp.edgecontainer.ClusterAuthorizationArgs(
 *         admin_users=gcp.edgecontainer.ClusterAuthorizationAdminUsersArgs(
 *             username="[email protected]",
 *         ),
 *     ),
 *     networking=gcp.edgecontainer.ClusterNetworkingArgs(
 *         cluster_ipv4_cidr_blocks=["10.0.0.0/16"],
 *         services_ipv4_cidr_blocks=["10.1.0.0/16"],
 *     ),
 *     fleet=gcp.edgecontainer.ClusterFleetArgs(
 *         project=f"projects/{project.number}",
 *     ),
 *     external_load_balancer_ipv4_address_pools=["10.100.0.0-10.100.0.10"],
 *     control_plane=gcp.edgecontainer.ClusterControlPlaneArgs(
 *         local=gcp.edgecontainer.ClusterControlPlaneLocalArgs(
 *             node_location="us-central1-edge-example-edgesite",
 *             node_count=1,
 *             machine_filter="machine-name",
 *             shared_deployment_policy="ALLOWED",
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var @default = new Gcp.EdgeContainer.Cluster("default", new()
 *     {
 *         Name = "local-control-plane-cluster",
 *         Location = "us-central1",
 *         Authorization = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationArgs
 *         {
 *             AdminUsers = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationAdminUsersArgs
 *             {
 *                 Username = "[email protected]",
 *             },
 *         },
 *         Networking = new Gcp.EdgeContainer.Inputs.ClusterNetworkingArgs
 *         {
 *             ClusterIpv4CidrBlocks = new[]
 *             {
 *                 "10.0.0.0/16",
 *             },
 *             ServicesIpv4CidrBlocks = new[]
 *             {
 *                 "10.1.0.0/16",
 *             },
 *         },
 *         Fleet = new Gcp.EdgeContainer.Inputs.ClusterFleetArgs
 *         {
 *             Project = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}",
 *         },
 *         ExternalLoadBalancerIpv4AddressPools = new[]
 *         {
 *             "10.100.0.0-10.100.0.10",
 *         },
 *         ControlPlane = new Gcp.EdgeContainer.Inputs.ClusterControlPlaneArgs
 *         {
 *             Local = new Gcp.EdgeContainer.Inputs.ClusterControlPlaneLocalArgs
 *             {
 *                 NodeLocation = "us-central1-edge-example-edgesite",
 *                 NodeCount = 1,
 *                 MachineFilter = "machine-name",
 *                 SharedDeploymentPolicy = "ALLOWED",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgecontainer"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = edgecontainer.NewCluster(ctx, "default", &edgecontainer.ClusterArgs{
 * 			Name:     pulumi.String("local-control-plane-cluster"),
 * 			Location: pulumi.String("us-central1"),
 * 			Authorization: &edgecontainer.ClusterAuthorizationArgs{
 * 				AdminUsers: &edgecontainer.ClusterAuthorizationAdminUsersArgs{
 * 					Username: pulumi.String("[email protected]"),
 * 				},
 * 			},
 * 			Networking: &edgecontainer.ClusterNetworkingArgs{
 * 				ClusterIpv4CidrBlocks: pulumi.StringArray{
 * 					pulumi.String("10.0.0.0/16"),
 * 				},
 * 				ServicesIpv4CidrBlocks: pulumi.StringArray{
 * 					pulumi.String("10.1.0.0/16"),
 * 				},
 * 			},
 * 			Fleet: &edgecontainer.ClusterFleetArgs{
 * 				Project: pulumi.String(fmt.Sprintf("projects/%v", project.Number)),
 * 			},
 * 			ExternalLoadBalancerIpv4AddressPools: pulumi.StringArray{
 * 				pulumi.String("10.100.0.0-10.100.0.10"),
 * 			},
 * 			ControlPlane: &edgecontainer.ClusterControlPlaneArgs{
 * 				Local: &edgecontainer.ClusterControlPlaneLocalArgs{
 * 					NodeLocation:           pulumi.String("us-central1-edge-example-edgesite"),
 * 					NodeCount:              pulumi.Int(1),
 * 					MachineFilter:          pulumi.String("machine-name"),
 * 					SharedDeploymentPolicy: pulumi.String("ALLOWED"),
 * 				},
 * 			},
 * 		})
 * 		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.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.edgecontainer.Cluster;
 * import com.pulumi.gcp.edgecontainer.ClusterArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterControlPlaneArgs;
 * import com.pulumi.gcp.edgecontainer.inputs.ClusterControlPlaneLocalArgs;
 * 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) {
 *         final var project = OrganizationsFunctions.getProject();
 *         var default_ = new Cluster("default", ClusterArgs.builder()
 *             .name("local-control-plane-cluster")
 *             .location("us-central1")
 *             .authorization(ClusterAuthorizationArgs.builder()
 *                 .adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
 *                     .username("[email protected]")
 *                     .build())
 *                 .build())
 *             .networking(ClusterNetworkingArgs.builder()
 *                 .clusterIpv4CidrBlocks("10.0.0.0/16")
 *                 .servicesIpv4CidrBlocks("10.1.0.0/16")
 *                 .build())
 *             .fleet(ClusterFleetArgs.builder()
 *                 .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number())))
 *                 .build())
 *             .externalLoadBalancerIpv4AddressPools("10.100.0.0-10.100.0.10")
 *             .controlPlane(ClusterControlPlaneArgs.builder()
 *                 .local(ClusterControlPlaneLocalArgs.builder()
 *                     .nodeLocation("us-central1-edge-example-edgesite")
 *                     .nodeCount(1)
 *                     .machineFilter("machine-name")
 *                     .sharedDeploymentPolicy("ALLOWED")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:edgecontainer:Cluster
 *     properties:
 *       name: local-control-plane-cluster
 *       location: us-central1
 *       authorization:
 *         adminUsers:
 *           username: [email protected]
 *       networking:
 *         clusterIpv4CidrBlocks:
 *           - 10.0.0.0/16
 *         servicesIpv4CidrBlocks:
 *           - 10.1.0.0/16
 *       fleet:
 *         project: projects/${project.number}
 *       externalLoadBalancerIpv4AddressPools:
 *         - 10.100.0.0-10.100.0.10
 *       controlPlane:
 *         local:
 *           nodeLocation: us-central1-edge-example-edgesite
 *           nodeCount: 1
 *           machineFilter: machine-name
 *           sharedDeploymentPolicy: ALLOWED
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Cluster can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/clusters/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:edgecontainer/cluster:Cluster default projects/{{project}}/locations/{{location}}/clusters/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:edgecontainer/cluster:Cluster default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:edgecontainer/cluster:Cluster default {{location}}/{{name}}
 * ```
 */
public class Cluster internal constructor(
    override val javaResource: com.pulumi.gcp.edgecontainer.Cluster,
) : KotlinCustomResource(javaResource, ClusterMapper) {
    /**
     * RBAC policy that will be applied and managed by GEC.
     * Structure is documented below.
     */
    public val authorization: Output
        get() = javaResource.authorization().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterAuthorizationToKotlin(args0)
            })
        })

    /**
     * The PEM-encoded public certificate of the cluster's CA.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     */
    public val clusterCaCertificate: Output
        get() = javaResource.clusterCaCertificate().applyValue({ args0 -> args0 })

    /**
     * The configuration of the cluster control plane.
     */
    public val controlPlane: Output?
        get() = javaResource.controlPlane().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    clusterControlPlaneToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Remote control plane disk encryption options. This field is only used when enabling CMEK support.
     */
    public val controlPlaneEncryption: Output
        get() = javaResource.controlPlaneEncryption().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterControlPlaneEncryptionToKotlin(args0)
            })
        })

    /**
     * The control plane release version.
     */
    public val controlPlaneVersion: Output
        get() = javaResource.controlPlaneVersion().applyValue({ args0 -> args0 })

    /**
     * (Output)
     * The time when the maintenance event request was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The default maximum number of pods per node used if a maximum value is not specified explicitly for a node pool in this
     * cluster. If unspecified, the Kubernetes default value will be used.
     */
    public val defaultMaxPodsPerNode: Output
        get() = javaResource.defaultMaxPodsPerNode().applyValue({ args0 -> args0 })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The IP address of the Kubernetes API server.
     */
    public val endpoint: Output
        get() = javaResource.endpoint().applyValue({ args0 -> args0 })

    /**
     * Address pools for cluster data plane external load balancing.
     */
    public val externalLoadBalancerIpv4AddressPools: Output>
        get() = javaResource.externalLoadBalancerIpv4AddressPools().applyValue({ args0 ->
            args0.map({ args0 -> args0 })
        })

    /**
     * Fleet related configuration.
     * Fleets are a Google Cloud concept for logically organizing clusters,
     * letting you use and manage multi-cluster capabilities and apply
     * consistent policies across your systems.
     * Structure is documented below.
     */
    public val fleet: Output
        get() = javaResource.fleet().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterFleetToKotlin(args0)
            })
        })

    /**
     * User-defined labels for the edgecloud cluster. **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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The location of the resource.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * All the maintenance events scheduled for the cluster, including the ones
     * ongoing, planned for the future and done in the past (up to 90 days).
     * Structure is documented below.
     */
    public val maintenanceEvents: Output>
        get() = javaResource.maintenanceEvents().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> clusterMaintenanceEventToKotlin(args0) })
            })
        })

    /**
     * Cluster-wide maintenance policy configuration.
     */
    public val maintenancePolicy: Output
        get() = javaResource.maintenancePolicy().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterMaintenancePolicyToKotlin(args0)
            })
        })

    /**
     * The GDCE cluster name.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Fleet related configuration.
     * Fleets are a Google Cloud concept for logically organizing clusters,
     * letting you use and manage multi-cluster capabilities and apply
     * consistent policies across your systems.
     * Structure is documented below.
     */
    public val networking: Output
        get() = javaResource.networking().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterNetworkingToKotlin(args0)
            })
        })

    /**
     * The lowest release version among all worker nodes. This field can be empty
     * if the cluster does not have any worker nodes.
     */
    public val nodeVersion: Output
        get() = javaResource.nodeVersion().applyValue({ args0 -> args0 })

    /**
     * The port number of the Kubernetes API server.
     */
    public val port: Output
        get() = javaResource.port().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The release channel a cluster is subscribed to. Possible values: ["RELEASE_CHANNEL_UNSPECIFIED", "NONE", "REGULAR"]
     */
    public val releaseChannel: Output
        get() = javaResource.releaseChannel().applyValue({ args0 -> args0 })

    /**
     * Indicates the status of the cluster.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * Config that customers are allowed to define for GDCE system add-ons.
     */
    public val systemAddonsConfig: Output
        get() = javaResource.systemAddonsConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                clusterSystemAddonsConfigToKotlin(args0)
            })
        })

    /**
     * (Output)
     * The target version of the cluster.
     */
    public val targetVersion: Output
        get() = javaResource.targetVersion().applyValue({ args0 -> args0 })

    /**
     * (Output)
     * The time when the maintenance event message was updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object ClusterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.edgecontainer.Cluster::class == javaResource::class

    override fun map(javaResource: Resource): Cluster = Cluster(
        javaResource as
            com.pulumi.gcp.edgecontainer.Cluster,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy