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

com.pulumi.gcp.backupdisasterrecovery.kotlin.ManagementServer.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.backupdisasterrecovery.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.backupdisasterrecovery.kotlin.outputs.ManagementServerManagementUri
import com.pulumi.gcp.backupdisasterrecovery.kotlin.outputs.ManagementServerNetwork
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.gcp.backupdisasterrecovery.kotlin.outputs.ManagementServerManagementUri.Companion.toKotlin as managementServerManagementUriToKotlin
import com.pulumi.gcp.backupdisasterrecovery.kotlin.outputs.ManagementServerNetwork.Companion.toKotlin as managementServerNetworkToKotlin

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

    public var args: ManagementServerArgs = ManagementServerArgs()

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

/**
 * ## Example Usage
 * ### Backup Dr Management Server
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.compute.Network("default", {name: "vpc-network"});
 * const privateIpAddress = new gcp.compute.GlobalAddress("private_ip_address", {
 *     name: "vpc-network",
 *     addressType: "INTERNAL",
 *     purpose: "VPC_PEERING",
 *     prefixLength: 20,
 *     network: _default.id,
 * });
 * const defaultConnection = new gcp.servicenetworking.Connection("default", {
 *     network: _default.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [privateIpAddress.name],
 * });
 * const ms_console = new gcp.backupdisasterrecovery.ManagementServer("ms-console", {
 *     location: "us-central1",
 *     name: "ms-console",
 *     type: "BACKUP_RESTORE",
 *     networks: [{
 *         network: _default.id,
 *         peeringMode: "PRIVATE_SERVICE_ACCESS",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.compute.Network("default", name="vpc-network")
 * private_ip_address = gcp.compute.GlobalAddress("private_ip_address",
 *     name="vpc-network",
 *     address_type="INTERNAL",
 *     purpose="VPC_PEERING",
 *     prefix_length=20,
 *     network=default.id)
 * default_connection = gcp.servicenetworking.Connection("default",
 *     network=default.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[private_ip_address.name])
 * ms_console = gcp.backupdisasterrecovery.ManagementServer("ms-console",
 *     location="us-central1",
 *     name="ms-console",
 *     type="BACKUP_RESTORE",
 *     networks=[gcp.backupdisasterrecovery.ManagementServerNetworkArgs(
 *         network=default.id,
 *         peering_mode="PRIVATE_SERVICE_ACCESS",
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Compute.Network("default", new()
 *     {
 *         Name = "vpc-network",
 *     });
 *     var privateIpAddress = new Gcp.Compute.GlobalAddress("private_ip_address", new()
 *     {
 *         Name = "vpc-network",
 *         AddressType = "INTERNAL",
 *         Purpose = "VPC_PEERING",
 *         PrefixLength = 20,
 *         Network = @default.Id,
 *     });
 *     var defaultConnection = new Gcp.ServiceNetworking.Connection("default", new()
 *     {
 *         Network = @default.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             privateIpAddress.Name,
 *         },
 *     });
 *     var ms_console = new Gcp.BackupDisasterRecovery.ManagementServer("ms-console", new()
 *     {
 *         Location = "us-central1",
 *         Name = "ms-console",
 *         Type = "BACKUP_RESTORE",
 *         Networks = new[]
 *         {
 *             new Gcp.BackupDisasterRecovery.Inputs.ManagementServerNetworkArgs
 *             {
 *                 Network = @default.Id,
 *                 PeeringMode = "PRIVATE_SERVICE_ACCESS",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/backupdisasterrecovery"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"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 {
 * 		_, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
 * 			Name: pulumi.String("vpc-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		privateIpAddress, err := compute.NewGlobalAddress(ctx, "private_ip_address", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("vpc-network"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			PrefixLength: pulumi.Int(20),
 * 			Network:      _default.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = servicenetworking.NewConnection(ctx, "default", &servicenetworking.ConnectionArgs{
 * 			Network: _default.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				privateIpAddress.Name,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = backupdisasterrecovery.NewManagementServer(ctx, "ms-console", &backupdisasterrecovery.ManagementServerArgs{
 * 			Location: pulumi.String("us-central1"),
 * 			Name:     pulumi.String("ms-console"),
 * 			Type:     pulumi.String("BACKUP_RESTORE"),
 * 			Networks: backupdisasterrecovery.ManagementServerNetworkArray{
 * 				&backupdisasterrecovery.ManagementServerNetworkArgs{
 * 					Network:     _default.ID(),
 * 					PeeringMode: pulumi.String("PRIVATE_SERVICE_ACCESS"),
 * 				},
 * 			},
 * 		})
 * 		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.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * import com.pulumi.gcp.servicenetworking.Connection;
 * import com.pulumi.gcp.servicenetworking.ConnectionArgs;
 * import com.pulumi.gcp.backupdisasterrecovery.ManagementServer;
 * import com.pulumi.gcp.backupdisasterrecovery.ManagementServerArgs;
 * import com.pulumi.gcp.backupdisasterrecovery.inputs.ManagementServerNetworkArgs;
 * 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 default_ = new Network("default", NetworkArgs.builder()
 *             .name("vpc-network")
 *             .build());
 *         var privateIpAddress = new GlobalAddress("privateIpAddress", GlobalAddressArgs.builder()
 *             .name("vpc-network")
 *             .addressType("INTERNAL")
 *             .purpose("VPC_PEERING")
 *             .prefixLength(20)
 *             .network(default_.id())
 *             .build());
 *         var defaultConnection = new Connection("defaultConnection", ConnectionArgs.builder()
 *             .network(default_.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(privateIpAddress.name())
 *             .build());
 *         var ms_console = new ManagementServer("ms-console", ManagementServerArgs.builder()
 *             .location("us-central1")
 *             .name("ms-console")
 *             .type("BACKUP_RESTORE")
 *             .networks(ManagementServerNetworkArgs.builder()
 *                 .network(default_.id())
 *                 .peeringMode("PRIVATE_SERVICE_ACCESS")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:Network
 *     properties:
 *       name: vpc-network
 *   privateIpAddress:
 *     type: gcp:compute:GlobalAddress
 *     name: private_ip_address
 *     properties:
 *       name: vpc-network
 *       addressType: INTERNAL
 *       purpose: VPC_PEERING
 *       prefixLength: 20
 *       network: ${default.id}
 *   defaultConnection:
 *     type: gcp:servicenetworking:Connection
 *     name: default
 *     properties:
 *       network: ${default.id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${privateIpAddress.name}
 *   ms-console:
 *     type: gcp:backupdisasterrecovery:ManagementServer
 *     properties:
 *       location: us-central1
 *       name: ms-console
 *       type: BACKUP_RESTORE
 *       networks:
 *         - network: ${default.id}
 *           peeringMode: PRIVATE_SERVICE_ACCESS
 * ```
 * 
 * ## Import
 * ManagementServer can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/managementServers/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, ManagementServer can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/managementServer:ManagementServer default projects/{{project}}/locations/{{location}}/managementServers/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/managementServer:ManagementServer default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/managementServer:ManagementServer default {{location}}/{{name}}
 * ```
 */
public class ManagementServer internal constructor(
    override val javaResource: com.pulumi.gcp.backupdisasterrecovery.ManagementServer,
) : KotlinCustomResource(javaResource, ManagementServerMapper) {
    /**
     * The location for the management server (management console)
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The management console URI
     * Structure is documented below.
     */
    public val managementUris: Output>
        get() = javaResource.managementUris().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> managementServerManagementUriToKotlin(args0) })
            })
        })

    /**
     * The name of management server (management console)
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Network details to create management server (management console).
     * Structure is documented below.
     */
    public val networks: Output>
        get() = javaResource.networks().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    managementServerNetworkToKotlin(args0)
                })
            })
        })

    /**
     * The oauth2ClientId of management console.
     */
    public val oauth2ClientId: Output
        get() = javaResource.oauth2ClientId().applyValue({ args0 -> args0 })

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

    /**
     * The type of management server (management console). Default value: "BACKUP_RESTORE" Possible values: ["BACKUP_RESTORE"]
     */
    public val type: Output?
        get() = javaResource.type().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object ManagementServerMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.backupdisasterrecovery.ManagementServer::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy