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

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

package com.pulumi.gcp.networksecurity.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.networksecurity.kotlin.outputs.MirroringDeploymentGroupConnectedEndpointGroup
import com.pulumi.gcp.networksecurity.kotlin.outputs.MirroringDeploymentGroupConnectedEndpointGroup.Companion.toKotlin
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 kotlin.collections.Map

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

    public var args: MirroringDeploymentGroupArgs = MirroringDeploymentGroupArgs()

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

/**
 * ## Example Usage
 * ### Network Security Mirroring Deployment Group Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network = new gcp.compute.Network("network", {
 *     name: "example-network",
 *     autoCreateSubnetworks: false,
 * });
 * const _default = new gcp.networksecurity.MirroringDeploymentGroup("default", {
 *     mirroringDeploymentGroupId: "example-dg",
 *     location: "global",
 *     network: network.id,
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network = gcp.compute.Network("network",
 *     name="example-network",
 *     auto_create_subnetworks=False)
 * default = gcp.networksecurity.MirroringDeploymentGroup("default",
 *     mirroring_deployment_group_id="example-dg",
 *     location="global",
 *     network=network.id,
 *     labels={
 *         "foo": "bar",
 *     })
 * ```
 * ```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 = "example-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var @default = new Gcp.NetworkSecurity.MirroringDeploymentGroup("default", new()
 *     {
 *         MirroringDeploymentGroupId = "example-dg",
 *         Location = "global",
 *         Network = network.Id,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networksecurity"
 * 	"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("example-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networksecurity.NewMirroringDeploymentGroup(ctx, "default", &networksecurity.MirroringDeploymentGroupArgs{
 * 			MirroringDeploymentGroupId: pulumi.String("example-dg"),
 * 			Location:                   pulumi.String("global"),
 * 			Network:                    network.ID(),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 		})
 * 		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.networksecurity.MirroringDeploymentGroup;
 * import com.pulumi.gcp.networksecurity.MirroringDeploymentGroupArgs;
 * 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("example-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var default_ = new MirroringDeploymentGroup("default", MirroringDeploymentGroupArgs.builder()
 *             .mirroringDeploymentGroupId("example-dg")
 *             .location("global")
 *             .network(network.id())
 *             .labels(Map.of("foo", "bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: example-network
 *       autoCreateSubnetworks: false
 *   default:
 *     type: gcp:networksecurity:MirroringDeploymentGroup
 *     properties:
 *       mirroringDeploymentGroupId: example-dg
 *       location: global
 *       network: ${network.id}
 *       labels:
 *         foo: bar
 * ```
 * 
 * ## Import
 * MirroringDeploymentGroup can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/mirroringDeploymentGroups/{{mirroring_deployment_group_id}}`
 * * `{{project}}/{{location}}/{{mirroring_deployment_group_id}}`
 * * `{{location}}/{{mirroring_deployment_group_id}}`
 * When using the `pulumi import` command, MirroringDeploymentGroup can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networksecurity/mirroringDeploymentGroup:MirroringDeploymentGroup default projects/{{project}}/locations/{{location}}/mirroringDeploymentGroups/{{mirroring_deployment_group_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:networksecurity/mirroringDeploymentGroup:MirroringDeploymentGroup default {{project}}/{{location}}/{{mirroring_deployment_group_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:networksecurity/mirroringDeploymentGroup:MirroringDeploymentGroup default {{location}}/{{mirroring_deployment_group_id}}
 * ```
 */
public class MirroringDeploymentGroup internal constructor(
    override val javaResource: com.pulumi.gcp.networksecurity.MirroringDeploymentGroup,
) : KotlinCustomResource(javaResource, MirroringDeploymentGroupMapper) {
    /**
     * Output only. The list of Mirroring Endpoint Groups that are connected to this resource.
     * Structure is documented below.
     */
    public val connectedEndpointGroups: Output>
        get() = javaResource.connectedEndpointGroups().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            })
        })

    /**
     * Output only. [Output only] Create time stamp
     */
    public val createTime: Output
        get() = javaResource.createTime().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()
        })

    /**
     * Optional. Labels as key value pairs
     * **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)
        })

    /**
     * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. See documentation for resource type `networksecurity.googleapis.com/MirroringDeploymentGroup`.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Required. Id of the requesting object
     * If auto-generating Id server-side, remove this field and
     * mirroring_deployment_group_id from the method_signature of Create RPC
     * - - -
     */
    public val mirroringDeploymentGroupId: Output
        get() = javaResource.mirroringDeploymentGroupId().applyValue({ args0 -> args0 })

    /**
     * (Output)
     * Output only. A connected mirroring endpoint group.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Required. Immutable. The network that is being used for the deployment. Format is:
     * projects/{project}/global/networks/{network}.
     */
    public val network: Output
        get() = javaResource.network().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    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()
        })

    /**
     * Output only. Whether reconciling is in progress, recommended per
     * https://google.aip.dev/128.
     */
    public val reconciling: Output
        get() = javaResource.reconciling().applyValue({ args0 -> args0 })

    /**
     * Output only. Current state of the deployment group.
     * Possible values:
     * STATE_UNSPECIFIED
     * ACTIVE
     * CREATING
     * DELETING
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Output only. [Output only] Update time stamp
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object MirroringDeploymentGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.networksecurity.MirroringDeploymentGroup::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy