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.10.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.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
 * ## Example Usage
 * ### Global
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const networkFirewallPolicy = new gcp.compute.NetworkFirewallPolicy("network_firewall_policy", {
 *     name: "policy",
 *     project: "my-project-name",
 *     description: "Sample global network firewall policy",
 * });
 * const network = new gcp.compute.Network("network", {name: "network"});
 * const primary = new gcp.compute.NetworkFirewallPolicyAssociation("primary", {
 *     name: "association",
 *     attachmentTarget: network.id,
 *     firewallPolicy: networkFirewallPolicy.name,
 *     project: "my-project-name",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network_firewall_policy = gcp.compute.NetworkFirewallPolicy("network_firewall_policy",
 *     name="policy",
 *     project="my-project-name",
 *     description="Sample global network firewall policy")
 * network = gcp.compute.Network("network", name="network")
 * primary = gcp.compute.NetworkFirewallPolicyAssociation("primary",
 *     name="association",
 *     attachment_target=network.id,
 *     firewall_policy=network_firewall_policy.name,
 *     project="my-project-name")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var networkFirewallPolicy = new Gcp.Compute.NetworkFirewallPolicy("network_firewall_policy", new()
 *     {
 *         Name = "policy",
 *         Project = "my-project-name",
 *         Description = "Sample global network firewall policy",
 *     });
 *     var network = new Gcp.Compute.Network("network", new()
 *     {
 *         Name = "network",
 *     });
 *     var primary = new Gcp.Compute.NetworkFirewallPolicyAssociation("primary", new()
 *     {
 *         Name = "association",
 *         AttachmentTarget = network.Id,
 *         FirewallPolicy = networkFirewallPolicy.Name,
 *         Project = "my-project-name",
 *     });
 * });
 * ```
 * ```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 {
 * 		networkFirewallPolicy, err := compute.NewNetworkFirewallPolicy(ctx, "network_firewall_policy", &compute.NetworkFirewallPolicyArgs{
 * 			Name:        pulumi.String("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("network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewNetworkFirewallPolicyAssociation(ctx, "primary", &compute.NetworkFirewallPolicyAssociationArgs{
 * 			Name:             pulumi.String("association"),
 * 			AttachmentTarget: network.ID(),
 * 			FirewallPolicy:   networkFirewallPolicy.Name,
 * 			Project:          pulumi.String("my-project-name"),
 * 		})
 * 		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 networkFirewallPolicy = new NetworkFirewallPolicy("networkFirewallPolicy", NetworkFirewallPolicyArgs.builder()
 *             .name("policy")
 *             .project("my-project-name")
 *             .description("Sample global network firewall policy")
 *             .build());
 *         var network = new Network("network", NetworkArgs.builder()
 *             .name("network")
 *             .build());
 *         var primary = new NetworkFirewallPolicyAssociation("primary", NetworkFirewallPolicyAssociationArgs.builder()
 *             .name("association")
 *             .attachmentTarget(network.id())
 *             .firewallPolicy(networkFirewallPolicy.name())
 *             .project("my-project-name")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   networkFirewallPolicy:
 *     type: gcp:compute:NetworkFirewallPolicy
 *     name: network_firewall_policy
 *     properties:
 *       name: policy
 *       project: my-project-name
 *       description: Sample global network firewall policy
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: network
 *   primary:
 *     type: gcp:compute:NetworkFirewallPolicyAssociation
 *     properties:
 *       name: association
 *       attachmentTarget: ${network.id}
 *       firewallPolicy: ${networkFirewallPolicy.name}
 *       project: my-project-name
 * ```
 * 
 * ## Import
 * NetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}`
 * * `{{project}}/{{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}}
 * ```
 * @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
 */
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("epituceoycqpomkh")
    public suspend fun attachmentTarget(`value`: Output) {
        this.attachmentTarget = value
    }

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

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

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

    /**
     * @param value The target that the firewall policy is attached to.
     */
    @JvmName("mjqnsriujrakfbxu")
    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("iqcdugwoejmdhmxr")
    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("buxhhvluomymyxqq")
    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("tvgjagonuadhnfcq")
    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 - 2024 Weber Informatics LLC | Privacy Policy