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

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

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.NetworkFirewallPolicyAssociationArgs.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
 * To get more information about NetworkFirewallPolicyAssociation, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/networkFirewallPolicies/addAssociation)
 * ## Example Usage
 * ### Network Firewall Policy Association
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const policy = new gcp.compute.NetworkFirewallPolicy("policy", {
 *     name: "my-policy",
 *     project: "my-project-name",
 *     description: "Sample global network firewall policy",
 * });
 * const network = new gcp.compute.Network("network", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const _default = new gcp.compute.NetworkFirewallPolicyAssociation("default", {
 *     name: "my-association",
 *     project: "my-project-name",
 *     attachmentTarget: network.id,
 *     firewallPolicy: policy.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * policy = gcp.compute.NetworkFirewallPolicy("policy",
 *     name="my-policy",
 *     project="my-project-name",
 *     description="Sample global network firewall policy")
 * network = gcp.compute.Network("network",
 *     name="my-network",
 *     auto_create_subnetworks=False)
 * default = gcp.compute.NetworkFirewallPolicyAssociation("default",
 *     name="my-association",
 *     project="my-project-name",
 *     attachment_target=network.id,
 *     firewall_policy=policy.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var policy = new Gcp.Compute.NetworkFirewallPolicy("policy", new()
 *     {
 *         Name = "my-policy",
 *         Project = "my-project-name",
 *         Description = "Sample global network firewall policy",
 *     });
 *     var network = new Gcp.Compute.Network("network", new()
 *     {
 *         Name = "my-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var @default = new Gcp.Compute.NetworkFirewallPolicyAssociation("default", new()
 *     {
 *         Name = "my-association",
 *         Project = "my-project-name",
 *         AttachmentTarget = network.Id,
 *         FirewallPolicy = policy.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		policy, err := compute.NewNetworkFirewallPolicy(ctx, "policy", &compute.NetworkFirewallPolicyArgs{
 * 			Name:        pulumi.String("my-policy"),
 * 			Project:     pulumi.String("my-project-name"),
 * 			Description: pulumi.String("Sample global network firewall policy"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewNetworkFirewallPolicyAssociation(ctx, "default", &compute.NetworkFirewallPolicyAssociationArgs{
 * 			Name:             pulumi.String("my-association"),
 * 			Project:          pulumi.String("my-project-name"),
 * 			AttachmentTarget: network.ID(),
 * 			FirewallPolicy:   policy.ID(),
 * 		})
 * 		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.NetworkFirewallPolicy;
 * import com.pulumi.gcp.compute.NetworkFirewallPolicyArgs;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.NetworkFirewallPolicyAssociation;
 * import com.pulumi.gcp.compute.NetworkFirewallPolicyAssociationArgs;
 * 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 policy = new NetworkFirewallPolicy("policy", NetworkFirewallPolicyArgs.builder()
 *             .name("my-policy")
 *             .project("my-project-name")
 *             .description("Sample global network firewall policy")
 *             .build());
 *         var network = new Network("network", NetworkArgs.builder()
 *             .name("my-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var default_ = new NetworkFirewallPolicyAssociation("default", NetworkFirewallPolicyAssociationArgs.builder()
 *             .name("my-association")
 *             .project("my-project-name")
 *             .attachmentTarget(network.id())
 *             .firewallPolicy(policy.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   policy:
 *     type: gcp:compute:NetworkFirewallPolicy
 *     properties:
 *       name: my-policy
 *       project: my-project-name
 *       description: Sample global network firewall policy
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: my-network
 *       autoCreateSubnetworks: false
 *   default:
 *     type: gcp:compute:NetworkFirewallPolicyAssociation
 *     properties:
 *       name: my-association
 *       project: my-project-name
 *       attachmentTarget: ${network.id}
 *       firewallPolicy: ${policy.id}
 * ```
 * 
 * ## Import
 * NetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}`
 * * `{{project}}/{{firewall_policy}}/{{name}}`
 * * `{{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/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation default projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation default {{project}}/{{firewall_policy}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation default {{firewall_policy}}/{{name}}
 * ```
 * @property attachmentTarget The target that the firewall policy is attached to.
 * @property firewallPolicy The firewall policy of the resource.
 * - - -
 * @property name The name for an association.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class NetworkFirewallPolicyAssociationArgs(
    public val attachmentTarget: Output? = null,
    public val firewallPolicy: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.NetworkFirewallPolicyAssociationArgs =
        com.pulumi.gcp.compute.NetworkFirewallPolicyAssociationArgs.builder()
            .attachmentTarget(attachmentTarget?.applyValue({ args0 -> args0 }))
            .firewallPolicy(firewallPolicy?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

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

    private var firewallPolicy: Output? = null

    private var name: Output? = null

    private var project: Output? = null

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

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

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

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("ksnwqmpjdwiwvics")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

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

    /**
     * @param value The firewall policy of the resource.
     * - - -
     */
    @JvmName("uldaumnbtexllkdb")
    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("hwppjachwdpeswyt")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("pycngaadvvihhdxo")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy