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

com.pulumi.gcp.networksecurity.kotlin.AddressGroupArgs.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.networksecurity.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networksecurity.AddressGroupArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * AddressGroup is a resource that specifies how a collection of IP/DNS used in Firewall Policy.
 * To get more information about AddressGroup, see:
 * * [API documentation](https://cloud.google.com/traffic-director/docs/reference/network-security/rest/v1beta1/organizations.locations.addressGroups)
 * * How-to Guides
 *     * [Use AddressGroups](https://cloud.google.com/vpc/docs/use-address-groups-firewall-policies)
 * ## Example Usage
 * ### Network Security Address Groups Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.networksecurity.AddressGroup("default", {
 *     name: "my-address-groups",
 *     parent: "projects/my-project-name",
 *     location: "us-central1",
 *     type: "IPV4",
 *     capacity: 100,
 *     items: ["208.80.154.224/32"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.networksecurity.AddressGroup("default",
 *     name="my-address-groups",
 *     parent="projects/my-project-name",
 *     location="us-central1",
 *     type="IPV4",
 *     capacity=100,
 *     items=["208.80.154.224/32"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.NetworkSecurity.AddressGroup("default", new()
 *     {
 *         Name = "my-address-groups",
 *         Parent = "projects/my-project-name",
 *         Location = "us-central1",
 *         Type = "IPV4",
 *         Capacity = 100,
 *         Items = new[]
 *         {
 *             "208.80.154.224/32",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networksecurity.NewAddressGroup(ctx, "default", &networksecurity.AddressGroupArgs{
 * 			Name:     pulumi.String("my-address-groups"),
 * 			Parent:   pulumi.String("projects/my-project-name"),
 * 			Location: pulumi.String("us-central1"),
 * 			Type:     pulumi.String("IPV4"),
 * 			Capacity: pulumi.Int(100),
 * 			Items: pulumi.StringArray{
 * 				pulumi.String("208.80.154.224/32"),
 * 			},
 * 		})
 * 		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.networksecurity.AddressGroup;
 * import com.pulumi.gcp.networksecurity.AddressGroupArgs;
 * 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 AddressGroup("default", AddressGroupArgs.builder()
 *             .name("my-address-groups")
 *             .parent("projects/my-project-name")
 *             .location("us-central1")
 *             .type("IPV4")
 *             .capacity("100")
 *             .items("208.80.154.224/32")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networksecurity:AddressGroup
 *     properties:
 *       name: my-address-groups
 *       parent: projects/my-project-name
 *       location: us-central1
 *       type: IPV4
 *       capacity: '100'
 *       items:
 *         - 208.80.154.224/32
 * ```
 * 
 * ### Network Security Address Groups Organization Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.networksecurity.AddressGroup("default", {
 *     name: "my-address-groups",
 *     parent: "organizations/123456789",
 *     location: "us-central1",
 *     type: "IPV4",
 *     capacity: 100,
 *     items: ["208.80.154.224/32"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.networksecurity.AddressGroup("default",
 *     name="my-address-groups",
 *     parent="organizations/123456789",
 *     location="us-central1",
 *     type="IPV4",
 *     capacity=100,
 *     items=["208.80.154.224/32"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.NetworkSecurity.AddressGroup("default", new()
 *     {
 *         Name = "my-address-groups",
 *         Parent = "organizations/123456789",
 *         Location = "us-central1",
 *         Type = "IPV4",
 *         Capacity = 100,
 *         Items = new[]
 *         {
 *             "208.80.154.224/32",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networksecurity.NewAddressGroup(ctx, "default", &networksecurity.AddressGroupArgs{
 * 			Name:     pulumi.String("my-address-groups"),
 * 			Parent:   pulumi.String("organizations/123456789"),
 * 			Location: pulumi.String("us-central1"),
 * 			Type:     pulumi.String("IPV4"),
 * 			Capacity: pulumi.Int(100),
 * 			Items: pulumi.StringArray{
 * 				pulumi.String("208.80.154.224/32"),
 * 			},
 * 		})
 * 		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.networksecurity.AddressGroup;
 * import com.pulumi.gcp.networksecurity.AddressGroupArgs;
 * 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 AddressGroup("default", AddressGroupArgs.builder()
 *             .name("my-address-groups")
 *             .parent("organizations/123456789")
 *             .location("us-central1")
 *             .type("IPV4")
 *             .capacity("100")
 *             .items("208.80.154.224/32")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networksecurity:AddressGroup
 *     properties:
 *       name: my-address-groups
 *       parent: organizations/123456789
 *       location: us-central1
 *       type: IPV4
 *       capacity: '100'
 *       items:
 *         - 208.80.154.224/32
 * ```
 * 
 * ### Network Security Address Groups Advanced
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.networksecurity.AddressGroup("default", {
 *     name: "my-address-groups",
 *     parent: "projects/my-project-name",
 *     location: "us-central1",
 *     description: "my description",
 *     type: "IPV4",
 *     capacity: 100,
 *     items: ["208.80.154.224/32"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.networksecurity.AddressGroup("default",
 *     name="my-address-groups",
 *     parent="projects/my-project-name",
 *     location="us-central1",
 *     description="my description",
 *     type="IPV4",
 *     capacity=100,
 *     items=["208.80.154.224/32"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.NetworkSecurity.AddressGroup("default", new()
 *     {
 *         Name = "my-address-groups",
 *         Parent = "projects/my-project-name",
 *         Location = "us-central1",
 *         Description = "my description",
 *         Type = "IPV4",
 *         Capacity = 100,
 *         Items = new[]
 *         {
 *             "208.80.154.224/32",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networksecurity.NewAddressGroup(ctx, "default", &networksecurity.AddressGroupArgs{
 * 			Name:        pulumi.String("my-address-groups"),
 * 			Parent:      pulumi.String("projects/my-project-name"),
 * 			Location:    pulumi.String("us-central1"),
 * 			Description: pulumi.String("my description"),
 * 			Type:        pulumi.String("IPV4"),
 * 			Capacity:    pulumi.Int(100),
 * 			Items: pulumi.StringArray{
 * 				pulumi.String("208.80.154.224/32"),
 * 			},
 * 		})
 * 		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.networksecurity.AddressGroup;
 * import com.pulumi.gcp.networksecurity.AddressGroupArgs;
 * 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 AddressGroup("default", AddressGroupArgs.builder()
 *             .name("my-address-groups")
 *             .parent("projects/my-project-name")
 *             .location("us-central1")
 *             .description("my description")
 *             .type("IPV4")
 *             .capacity("100")
 *             .items("208.80.154.224/32")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networksecurity:AddressGroup
 *     properties:
 *       name: my-address-groups
 *       parent: projects/my-project-name
 *       location: us-central1
 *       description: my description
 *       type: IPV4
 *       capacity: '100'
 *       items:
 *         - 208.80.154.224/32
 * ```
 * 
 * ## Import
 * AddressGroup can be imported using any of these accepted formats:
 * * `{{parent}}/locations/{{location}}/addressGroups/{{name}}`
 * When using the `pulumi import` command, AddressGroup can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networksecurity/addressGroup:AddressGroup default {{parent}}/locations/{{location}}/addressGroups/{{name}}
 * ```
 * @property capacity Capacity of the Address Group.
 * @property description Free-text description of the resource.
 * @property items List of items.
 * @property labels Set of label tags associated with the AddressGroup resource.
 * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
 * **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 The location of the gateway security policy.
 * The default value is `global`.
 * - - -
 * @property name Name of the AddressGroup resource.
 * @property parent The name of the parent this address group belongs to. Format: organizations/{organization_id} or projects/{project_id}.
 * @property type The type of the Address Group. Possible values are "IPV4" or "IPV6".
 * Possible values are: `IPV4`, `IPV6`.
 */
public data class AddressGroupArgs(
    public val capacity: Output? = null,
    public val description: Output? = null,
    public val items: Output>? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val parent: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networksecurity.AddressGroupArgs =
        com.pulumi.gcp.networksecurity.AddressGroupArgs.builder()
            .capacity(capacity?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .items(items?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parent(parent?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AddressGroupArgs].
 */
@PulumiTagMarker
public class AddressGroupArgsBuilder internal constructor() {
    private var capacity: Output? = null

    private var description: Output? = null

    private var items: Output>? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var parent: Output? = null

    private var type: Output? = null

    /**
     * @param value Capacity of the Address Group.
     */
    @JvmName("dmvodoexfwkqdyvb")
    public suspend fun capacity(`value`: Output) {
        this.capacity = value
    }

    /**
     * @param value Free-text description of the resource.
     */
    @JvmName("sgvsonjshuedcmpf")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value List of items.
     */
    @JvmName("ifombabwohnhgurq")
    public suspend fun items(`value`: Output>) {
        this.items = value
    }

    @JvmName("ttbvxcypyhwitpqw")
    public suspend fun items(vararg values: Output) {
        this.items = Output.all(values.asList())
    }

    /**
     * @param values List of items.
     */
    @JvmName("fpqjvsotqladeswe")
    public suspend fun items(values: List>) {
        this.items = Output.all(values)
    }

    /**
     * @param value Set of label tags associated with the AddressGroup resource.
     * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **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("joxmjkrdwqtqtogv")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The location of the gateway security policy.
     * The default value is `global`.
     * - - -
     */
    @JvmName("ikyucrwyhqbckxmg")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Name of the AddressGroup resource.
     */
    @JvmName("mhmmbrqabuuekspr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the parent this address group belongs to. Format: organizations/{organization_id} or projects/{project_id}.
     */
    @JvmName("trfvosqkttyiumke")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value The type of the Address Group. Possible values are "IPV4" or "IPV6".
     * Possible values are: `IPV4`, `IPV6`.
     */
    @JvmName("wqnrjhitanyygtgh")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value Capacity of the Address Group.
     */
    @JvmName("gebrlyhadlokpyva")
    public suspend fun capacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacity = mapped
    }

    /**
     * @param value Free-text description of the resource.
     */
    @JvmName("snxodtcmcgkavpyq")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value List of items.
     */
    @JvmName("gkwkbrqetimvkkot")
    public suspend fun items(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.items = mapped
    }

    /**
     * @param values List of items.
     */
    @JvmName("rsikxvpwvxmfesog")
    public suspend fun items(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.items = mapped
    }

    /**
     * @param value Set of label tags associated with the AddressGroup resource.
     * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **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("spuvbduwbeqogdef")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Set of label tags associated with the AddressGroup resource.
     * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **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("btdtuqfjcfjmbbhm")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The location of the gateway security policy.
     * The default value is `global`.
     * - - -
     */
    @JvmName("twdndruhxjftwbnc")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Name of the AddressGroup resource.
     */
    @JvmName("blewtytwicudvmru")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the parent this address group belongs to. Format: organizations/{organization_id} or projects/{project_id}.
     */
    @JvmName("ceongcnamfpxidcl")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    /**
     * @param value The type of the Address Group. Possible values are "IPV4" or "IPV6".
     * Possible values are: `IPV4`, `IPV6`.
     */
    @JvmName("sxvicakqpbgjhbgo")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): AddressGroupArgs = AddressGroupArgs(
        capacity = capacity,
        description = description,
        items = items,
        labels = labels,
        location = location,
        name = name,
        parent = parent,
        type = type,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy