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

com.pulumi.gcp.compute.kotlin.RegionNetworkFirewallPolicyAssociationArgs.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.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyAssociationArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * The Compute NetworkFirewallPolicyAssociation resource
 * ## Example Usage
 * ### Regional
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const basicRegionalNetworkFirewallPolicy = new gcp.compute.RegionNetworkFirewallPolicy("basic_regional_network_firewall_policy", {
 *     name: "policy",
 *     project: "my-project-name",
 *     description: "Sample global network firewall policy",
 *     region: "us-west1",
 * });
 * const basicNetwork = new gcp.compute.Network("basic_network", {name: "network"});
 * const primary = new gcp.compute.RegionNetworkFirewallPolicyAssociation("primary", {
 *     name: "association",
 *     attachmentTarget: basicNetwork.id,
 *     firewallPolicy: basicRegionalNetworkFirewallPolicy.name,
 *     project: "my-project-name",
 *     region: "us-west1",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * basic_regional_network_firewall_policy = gcp.compute.RegionNetworkFirewallPolicy("basic_regional_network_firewall_policy",
 *     name="policy",
 *     project="my-project-name",
 *     description="Sample global network firewall policy",
 *     region="us-west1")
 * basic_network = gcp.compute.Network("basic_network", name="network")
 * primary = gcp.compute.RegionNetworkFirewallPolicyAssociation("primary",
 *     name="association",
 *     attachment_target=basic_network.id,
 *     firewall_policy=basic_regional_network_firewall_policy.name,
 *     project="my-project-name",
 *     region="us-west1")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var basicRegionalNetworkFirewallPolicy = new Gcp.Compute.RegionNetworkFirewallPolicy("basic_regional_network_firewall_policy", new()
 *     {
 *         Name = "policy",
 *         Project = "my-project-name",
 *         Description = "Sample global network firewall policy",
 *         Region = "us-west1",
 *     });
 *     var basicNetwork = new Gcp.Compute.Network("basic_network", new()
 *     {
 *         Name = "network",
 *     });
 *     var primary = new Gcp.Compute.RegionNetworkFirewallPolicyAssociation("primary", new()
 *     {
 *         Name = "association",
 *         AttachmentTarget = basicNetwork.Id,
 *         FirewallPolicy = basicRegionalNetworkFirewallPolicy.Name,
 *         Project = "my-project-name",
 *         Region = "us-west1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		basicRegionalNetworkFirewallPolicy, err := compute.NewRegionNetworkFirewallPolicy(ctx, "basic_regional_network_firewall_policy", &compute.RegionNetworkFirewallPolicyArgs{
 * 			Name:        pulumi.String("policy"),
 * 			Project:     pulumi.String("my-project-name"),
 * 			Description: pulumi.String("Sample global network firewall policy"),
 * 			Region:      pulumi.String("us-west1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		basicNetwork, err := compute.NewNetwork(ctx, "basic_network", &compute.NetworkArgs{
 * 			Name: pulumi.String("network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewRegionNetworkFirewallPolicyAssociation(ctx, "primary", &compute.RegionNetworkFirewallPolicyAssociationArgs{
 * 			Name:             pulumi.String("association"),
 * 			AttachmentTarget: basicNetwork.ID(),
 * 			FirewallPolicy:   basicRegionalNetworkFirewallPolicy.Name,
 * 			Project:          pulumi.String("my-project-name"),
 * 			Region:           pulumi.String("us-west1"),
 * 		})
 * 		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.RegionNetworkFirewallPolicy;
 * import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyArgs;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyAssociation;
 * import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyAssociationArgs;
 * 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 basicRegionalNetworkFirewallPolicy = new RegionNetworkFirewallPolicy("basicRegionalNetworkFirewallPolicy", RegionNetworkFirewallPolicyArgs.builder()
 *             .name("policy")
 *             .project("my-project-name")
 *             .description("Sample global network firewall policy")
 *             .region("us-west1")
 *             .build());
 *         var basicNetwork = new Network("basicNetwork", NetworkArgs.builder()
 *             .name("network")
 *             .build());
 *         var primary = new RegionNetworkFirewallPolicyAssociation("primary", RegionNetworkFirewallPolicyAssociationArgs.builder()
 *             .name("association")
 *             .attachmentTarget(basicNetwork.id())
 *             .firewallPolicy(basicRegionalNetworkFirewallPolicy.name())
 *             .project("my-project-name")
 *             .region("us-west1")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   basicRegionalNetworkFirewallPolicy:
 *     type: gcp:compute:RegionNetworkFirewallPolicy
 *     name: basic_regional_network_firewall_policy
 *     properties:
 *       name: policy
 *       project: my-project-name
 *       description: Sample global network firewall policy
 *       region: us-west1
 *   basicNetwork:
 *     type: gcp:compute:Network
 *     name: basic_network
 *     properties:
 *       name: network
 *   primary:
 *     type: gcp:compute:RegionNetworkFirewallPolicyAssociation
 *     properties:
 *       name: association
 *       attachmentTarget: ${basicNetwork.id}
 *       firewallPolicy: ${basicRegionalNetworkFirewallPolicy.name}
 *       project: my-project-name
 *       region: us-west1
 * ```
 * 
 * ## Import
 * NetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
 * * `projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}`
 * * `{{project}}/{{region}}/{{firewall_policy}}/{{name}}`
 * When using the `pulumi import` command, NetworkFirewallPolicyAssociation can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{project}}/{{region}}/{{firewall_policy}}/{{name}}
 * ```
 * @property attachmentTarget The target that the firewall policy is attached to.
 * @property firewallPolicy The firewall policy ID of the association.
 * @property name The name for an association.
 * - - -
 * @property project The project for the resource
 * @property region The location of this resource.
 */
public data class RegionNetworkFirewallPolicyAssociationArgs(
    public val attachmentTarget: Output? = null,
    public val firewallPolicy: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.RegionNetworkFirewallPolicyAssociationArgs =
        com.pulumi.gcp.compute.RegionNetworkFirewallPolicyAssociationArgs.builder()
            .attachmentTarget(attachmentTarget?.applyValue({ args0 -> args0 }))
            .firewallPolicy(firewallPolicy?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RegionNetworkFirewallPolicyAssociationArgs].
 */
@PulumiTagMarker
public class RegionNetworkFirewallPolicyAssociationArgsBuilder internal constructor() {
    private var attachmentTarget: Output? = null

    private var firewallPolicy: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    /**
     * @param value The target that the firewall policy is attached to.
     */
    @JvmName("ieboyfdqjsgodemy")
    public suspend fun attachmentTarget(`value`: Output) {
        this.attachmentTarget = value
    }

    /**
     * @param value The firewall policy ID of the association.
     */
    @JvmName("plrseiifiecmaulj")
    public suspend fun firewallPolicy(`value`: Output) {
        this.firewallPolicy = value
    }

    /**
     * @param value The name for an association.
     * - - -
     */
    @JvmName("djsryciwgfigbopm")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The project for the resource
     */
    @JvmName("ocfixlobxughxmhp")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The location of this resource.
     */
    @JvmName("ebkvcovmjnudwwij")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value The target that the firewall policy is attached to.
     */
    @JvmName("yahhmtrslqujidoe")
    public suspend fun attachmentTarget(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.attachmentTarget = mapped
    }

    /**
     * @param value The firewall policy ID of the association.
     */
    @JvmName("tydofoifnbakccff")
    public suspend fun firewallPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.firewallPolicy = mapped
    }

    /**
     * @param value The name for an association.
     * - - -
     */
    @JvmName("tjuwsvvfjcoqonnn")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The project for the resource
     */
    @JvmName("fkuoaldvwgtjvutf")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The location of this resource.
     */
    @JvmName("mmlkcewiielppgvx")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    internal fun build(): RegionNetworkFirewallPolicyAssociationArgs =
        RegionNetworkFirewallPolicyAssociationArgs(
            attachmentTarget = attachmentTarget,
            firewallPolicy = firewallPolicy,
            name = name,
            project = project,
            region = region,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy