1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. RegionNetworkFirewallPolicyAssociation
Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi

gcp.compute.RegionNetworkFirewallPolicyAssociation

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi

    The Compute NetworkFirewallPolicyAssociation resource

    Example Usage

    Regional

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var basicRegionalNetworkFirewallPolicy = new Gcp.Compute.RegionNetworkFirewallPolicy("basicRegionalNetworkFirewallPolicy", new()
        {
            Project = "my-project-name",
            Description = "Sample global network firewall policy",
            Region = "us-west1",
        });
    
        var basicNetwork = new Gcp.Compute.Network("basicNetwork");
    
        var primary = new Gcp.Compute.RegionNetworkFirewallPolicyAssociation("primary", new()
        {
            AttachmentTarget = basicNetwork.Id,
            FirewallPolicy = basicRegionalNetworkFirewallPolicy.Name,
            Project = "my-project-name",
            Region = "us-west1",
        });
    
    });
    
    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, "basicRegionalNetworkFirewallPolicy", &compute.RegionNetworkFirewallPolicyArgs{
    			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, "basicNetwork", nil)
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRegionNetworkFirewallPolicyAssociation(ctx, "primary", &compute.RegionNetworkFirewallPolicyAssociationArgs{
    			AttachmentTarget: basicNetwork.ID(),
    			FirewallPolicy:   basicRegionalNetworkFirewallPolicy.Name,
    			Project:          pulumi.String("my-project-name"),
    			Region:           pulumi.String("us-west1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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.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()        
                .project("my-project-name")
                .description("Sample global network firewall policy")
                .region("us-west1")
                .build());
    
            var basicNetwork = new Network("basicNetwork");
    
            var primary = new RegionNetworkFirewallPolicyAssociation("primary", RegionNetworkFirewallPolicyAssociationArgs.builder()        
                .attachmentTarget(basicNetwork.id())
                .firewallPolicy(basicRegionalNetworkFirewallPolicy.name())
                .project("my-project-name")
                .region("us-west1")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    basic_regional_network_firewall_policy = gcp.compute.RegionNetworkFirewallPolicy("basicRegionalNetworkFirewallPolicy",
        project="my-project-name",
        description="Sample global network firewall policy",
        region="us-west1")
    basic_network = gcp.compute.Network("basicNetwork")
    primary = gcp.compute.RegionNetworkFirewallPolicyAssociation("primary",
        attachment_target=basic_network.id,
        firewall_policy=basic_regional_network_firewall_policy.name,
        project="my-project-name",
        region="us-west1")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const basicRegionalNetworkFirewallPolicy = new gcp.compute.RegionNetworkFirewallPolicy("basicRegionalNetworkFirewallPolicy", {
        project: "my-project-name",
        description: "Sample global network firewall policy",
        region: "us-west1",
    });
    const basicNetwork = new gcp.compute.Network("basicNetwork", {});
    const primary = new gcp.compute.RegionNetworkFirewallPolicyAssociation("primary", {
        attachmentTarget: basicNetwork.id,
        firewallPolicy: basicRegionalNetworkFirewallPolicy.name,
        project: "my-project-name",
        region: "us-west1",
    });
    
    resources:
      basicRegionalNetworkFirewallPolicy:
        type: gcp:compute:RegionNetworkFirewallPolicy
        properties:
          project: my-project-name
          description: Sample global network firewall policy
          region: us-west1
      basicNetwork:
        type: gcp:compute:Network
      primary:
        type: gcp:compute:RegionNetworkFirewallPolicyAssociation
        properties:
          attachmentTarget: ${basicNetwork.id}
          firewallPolicy: ${basicRegionalNetworkFirewallPolicy.name}
          project: my-project-name
          region: us-west1
    

    Create RegionNetworkFirewallPolicyAssociation Resource

    new RegionNetworkFirewallPolicyAssociation(name: string, args: RegionNetworkFirewallPolicyAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def RegionNetworkFirewallPolicyAssociation(resource_name: str,
                                               opts: Optional[ResourceOptions] = None,
                                               attachment_target: Optional[str] = None,
                                               firewall_policy: Optional[str] = None,
                                               name: Optional[str] = None,
                                               project: Optional[str] = None,
                                               region: Optional[str] = None)
    @overload
    def RegionNetworkFirewallPolicyAssociation(resource_name: str,
                                               args: RegionNetworkFirewallPolicyAssociationArgs,
                                               opts: Optional[ResourceOptions] = None)
    func NewRegionNetworkFirewallPolicyAssociation(ctx *Context, name string, args RegionNetworkFirewallPolicyAssociationArgs, opts ...ResourceOption) (*RegionNetworkFirewallPolicyAssociation, error)
    public RegionNetworkFirewallPolicyAssociation(string name, RegionNetworkFirewallPolicyAssociationArgs args, CustomResourceOptions? opts = null)
    public RegionNetworkFirewallPolicyAssociation(String name, RegionNetworkFirewallPolicyAssociationArgs args)
    public RegionNetworkFirewallPolicyAssociation(String name, RegionNetworkFirewallPolicyAssociationArgs args, CustomResourceOptions options)
    
    type: gcp:compute:RegionNetworkFirewallPolicyAssociation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RegionNetworkFirewallPolicyAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RegionNetworkFirewallPolicyAssociationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RegionNetworkFirewallPolicyAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegionNetworkFirewallPolicyAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegionNetworkFirewallPolicyAssociationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RegionNetworkFirewallPolicyAssociation Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RegionNetworkFirewallPolicyAssociation resource accepts the following input properties:

    AttachmentTarget string

    The target that the firewall policy is attached to.

    FirewallPolicy string

    The firewall policy ID of the association.

    Name string

    The name for an association.


    Project string

    The project for the resource

    Region string

    The location of this resource.

    AttachmentTarget string

    The target that the firewall policy is attached to.

    FirewallPolicy string

    The firewall policy ID of the association.

    Name string

    The name for an association.


    Project string

    The project for the resource

    Region string

    The location of this resource.

    attachmentTarget String

    The target that the firewall policy is attached to.

    firewallPolicy String

    The firewall policy ID of the association.

    name String

    The name for an association.


    project String

    The project for the resource

    region String

    The location of this resource.

    attachmentTarget string

    The target that the firewall policy is attached to.

    firewallPolicy string

    The firewall policy ID of the association.

    name string

    The name for an association.


    project string

    The project for the resource

    region string

    The location of this resource.

    attachment_target str

    The target that the firewall policy is attached to.

    firewall_policy str

    The firewall policy ID of the association.

    name str

    The name for an association.


    project str

    The project for the resource

    region str

    The location of this resource.

    attachmentTarget String

    The target that the firewall policy is attached to.

    firewallPolicy String

    The firewall policy ID of the association.

    name String

    The name for an association.


    project String

    The project for the resource

    region String

    The location of this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RegionNetworkFirewallPolicyAssociation resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    ShortName string

    The short name of the firewall policy of the association.

    Id string

    The provider-assigned unique ID for this managed resource.

    ShortName string

    The short name of the firewall policy of the association.

    id String

    The provider-assigned unique ID for this managed resource.

    shortName String

    The short name of the firewall policy of the association.

    id string

    The provider-assigned unique ID for this managed resource.

    shortName string

    The short name of the firewall policy of the association.

    id str

    The provider-assigned unique ID for this managed resource.

    short_name str

    The short name of the firewall policy of the association.

    id String

    The provider-assigned unique ID for this managed resource.

    shortName String

    The short name of the firewall policy of the association.

    Look up Existing RegionNetworkFirewallPolicyAssociation Resource

    Get an existing RegionNetworkFirewallPolicyAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RegionNetworkFirewallPolicyAssociationState, opts?: CustomResourceOptions): RegionNetworkFirewallPolicyAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            attachment_target: Optional[str] = None,
            firewall_policy: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            short_name: Optional[str] = None) -> RegionNetworkFirewallPolicyAssociation
    func GetRegionNetworkFirewallPolicyAssociation(ctx *Context, name string, id IDInput, state *RegionNetworkFirewallPolicyAssociationState, opts ...ResourceOption) (*RegionNetworkFirewallPolicyAssociation, error)
    public static RegionNetworkFirewallPolicyAssociation Get(string name, Input<string> id, RegionNetworkFirewallPolicyAssociationState? state, CustomResourceOptions? opts = null)
    public static RegionNetworkFirewallPolicyAssociation get(String name, Output<String> id, RegionNetworkFirewallPolicyAssociationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AttachmentTarget string

    The target that the firewall policy is attached to.

    FirewallPolicy string

    The firewall policy ID of the association.

    Name string

    The name for an association.


    Project string

    The project for the resource

    Region string

    The location of this resource.

    ShortName string

    The short name of the firewall policy of the association.

    AttachmentTarget string

    The target that the firewall policy is attached to.

    FirewallPolicy string

    The firewall policy ID of the association.

    Name string

    The name for an association.


    Project string

    The project for the resource

    Region string

    The location of this resource.

    ShortName string

    The short name of the firewall policy of the association.

    attachmentTarget String

    The target that the firewall policy is attached to.

    firewallPolicy String

    The firewall policy ID of the association.

    name String

    The name for an association.


    project String

    The project for the resource

    region String

    The location of this resource.

    shortName String

    The short name of the firewall policy of the association.

    attachmentTarget string

    The target that the firewall policy is attached to.

    firewallPolicy string

    The firewall policy ID of the association.

    name string

    The name for an association.


    project string

    The project for the resource

    region string

    The location of this resource.

    shortName string

    The short name of the firewall policy of the association.

    attachment_target str

    The target that the firewall policy is attached to.

    firewall_policy str

    The firewall policy ID of the association.

    name str

    The name for an association.


    project str

    The project for the resource

    region str

    The location of this resource.

    short_name str

    The short name of the firewall policy of the association.

    attachmentTarget String

    The target that the firewall policy is attached to.

    firewallPolicy String

    The firewall policy ID of the association.

    name String

    The name for an association.


    project String

    The project for the resource

    region String

    The location of this resource.

    shortName String

    The short name of the firewall policy of the association.

    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}} In Terraform v1.5.0 and later, use an import block to import NetworkFirewallPolicyAssociation using one of the formats above. For exampletf import {

    id = “projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}”

    to = google_compute_region_network_firewall_policy_association.default }

     $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), NetworkFirewallPolicyAssociation can be imported using one of the formats above. For example
    
     $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}
    
     $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{project}}/{{region}}/{{firewall_policy}}/{{name}}
    

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the google-beta Terraform Provider.

    gcp logo
    Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi