gcp.compute.RegionNetworkFirewallPolicyAssociation
Explore with Pulumi AI
- Example Usage
- Region Network Firewall Policy Association
- Create RegionNetworkFirewallPolicyAssociation Resource
- Constructor syntax
- Constructor example
- RegionNetworkFirewallPolicyAssociation Resource Properties
- Inputs
- Outputs
- Look up Existing RegionNetworkFirewallPolicyAssociation Resource
- Import
- Package Details
The Compute NetworkFirewallPolicyAssociation resource
To get more information about RegionNetworkFirewallPolicyAssociation, see:
Example Usage
Region Network Firewall Policy Association
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const policy = new gcp.compute.RegionNetworkFirewallPolicy("policy", {
name: "my-policy",
project: "my-project-name",
description: "Sample global network firewall policy",
region: "us-west1",
});
const network = new gcp.compute.Network("network", {
name: "my-network",
autoCreateSubnetworks: false,
});
const _default = new gcp.compute.RegionNetworkFirewallPolicyAssociation("default", {
name: "my-association",
project: "my-project-name",
attachmentTarget: network.id,
firewallPolicy: policy.id,
region: "us-west1",
});
import pulumi
import pulumi_gcp as gcp
policy = gcp.compute.RegionNetworkFirewallPolicy("policy",
name="my-policy",
project="my-project-name",
description="Sample global network firewall policy",
region="us-west1")
network = gcp.compute.Network("network",
name="my-network",
auto_create_subnetworks=False)
default = gcp.compute.RegionNetworkFirewallPolicyAssociation("default",
name="my-association",
project="my-project-name",
attachment_target=network.id,
firewall_policy=policy.id,
region="us-west1")
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.NewRegionNetworkFirewallPolicy(ctx, "policy", &compute.RegionNetworkFirewallPolicyArgs{
Name: pulumi.String("my-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
}
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("my-network"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = compute.NewRegionNetworkFirewallPolicyAssociation(ctx, "default", &compute.RegionNetworkFirewallPolicyAssociationArgs{
Name: pulumi.String("my-association"),
Project: pulumi.String("my-project-name"),
AttachmentTarget: network.ID(),
FirewallPolicy: policy.ID(),
Region: pulumi.String("us-west1"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var policy = new Gcp.Compute.RegionNetworkFirewallPolicy("policy", new()
{
Name = "my-policy",
Project = "my-project-name",
Description = "Sample global network firewall policy",
Region = "us-west1",
});
var network = new Gcp.Compute.Network("network", new()
{
Name = "my-network",
AutoCreateSubnetworks = false,
});
var @default = new Gcp.Compute.RegionNetworkFirewallPolicyAssociation("default", new()
{
Name = "my-association",
Project = "my-project-name",
AttachmentTarget = network.Id,
FirewallPolicy = policy.Id,
Region = "us-west1",
});
});
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 policy = new RegionNetworkFirewallPolicy("policy", RegionNetworkFirewallPolicyArgs.builder()
.name("my-policy")
.project("my-project-name")
.description("Sample global network firewall policy")
.region("us-west1")
.build());
var network = new Network("network", NetworkArgs.builder()
.name("my-network")
.autoCreateSubnetworks(false)
.build());
var default_ = new RegionNetworkFirewallPolicyAssociation("default", RegionNetworkFirewallPolicyAssociationArgs.builder()
.name("my-association")
.project("my-project-name")
.attachmentTarget(network.id())
.firewallPolicy(policy.id())
.region("us-west1")
.build());
}
}
resources:
policy:
type: gcp:compute:RegionNetworkFirewallPolicy
properties:
name: my-policy
project: my-project-name
description: Sample global network firewall policy
region: us-west1
network:
type: gcp:compute:Network
properties:
name: my-network
autoCreateSubnetworks: false
default:
type: gcp:compute:RegionNetworkFirewallPolicyAssociation
properties:
name: my-association
project: my-project-name
attachmentTarget: ${network.id}
firewallPolicy: ${policy.id}
region: us-west1
Create RegionNetworkFirewallPolicyAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RegionNetworkFirewallPolicyAssociation(name: string, args: RegionNetworkFirewallPolicyAssociationArgs, opts?: CustomResourceOptions);
@overload
def RegionNetworkFirewallPolicyAssociation(resource_name: str,
args: RegionNetworkFirewallPolicyAssociationArgs,
opts: Optional[ResourceOptions] = None)
@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)
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.
Parameters
- name
This property is required. string - The unique name of the resource.
- args
This property is required. RegionNetworkFirewallPolicyAssociationArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
This property is required. str - The unique name of the resource.
- args
This property is required. 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
This property is required. string - The unique name of the resource.
- args
This property is required. RegionNetworkFirewallPolicyAssociationArgs - The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. RegionNetworkFirewallPolicyAssociationArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name
This property is required. String - The unique name of the resource.
- args
This property is required. RegionNetworkFirewallPolicyAssociationArgs - The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var regionNetworkFirewallPolicyAssociationResource = new Gcp.Compute.RegionNetworkFirewallPolicyAssociation("regionNetworkFirewallPolicyAssociationResource", new()
{
AttachmentTarget = "string",
FirewallPolicy = "string",
Name = "string",
Project = "string",
Region = "string",
});
example, err := compute.NewRegionNetworkFirewallPolicyAssociation(ctx, "regionNetworkFirewallPolicyAssociationResource", &compute.RegionNetworkFirewallPolicyAssociationArgs{
AttachmentTarget: pulumi.String("string"),
FirewallPolicy: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
Region: pulumi.String("string"),
})
var regionNetworkFirewallPolicyAssociationResource = new RegionNetworkFirewallPolicyAssociation("regionNetworkFirewallPolicyAssociationResource", RegionNetworkFirewallPolicyAssociationArgs.builder()
.attachmentTarget("string")
.firewallPolicy("string")
.name("string")
.project("string")
.region("string")
.build());
region_network_firewall_policy_association_resource = gcp.compute.RegionNetworkFirewallPolicyAssociation("regionNetworkFirewallPolicyAssociationResource",
attachment_target="string",
firewall_policy="string",
name="string",
project="string",
region="string")
const regionNetworkFirewallPolicyAssociationResource = new gcp.compute.RegionNetworkFirewallPolicyAssociation("regionNetworkFirewallPolicyAssociationResource", {
attachmentTarget: "string",
firewallPolicy: "string",
name: "string",
project: "string",
region: "string",
});
type: gcp:compute:RegionNetworkFirewallPolicyAssociation
properties:
attachmentTarget: string
firewallPolicy: string
name: string
project: string
region: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RegionNetworkFirewallPolicyAssociation resource accepts the following input properties:
- Attachment
Target This property is required. Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- Firewall
Policy This property is required. Changes to this property will trigger replacement.
- The firewall policy of the resource.
- Name
Changes to this property will trigger replacement.
- The name for an association.
- Project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region
Changes to this property will trigger replacement.
- The location of this resource.
- Attachment
Target This property is required. Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- Firewall
Policy This property is required. Changes to this property will trigger replacement.
- The firewall policy of the resource.
- Name
Changes to this property will trigger replacement.
- The name for an association.
- Project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region
Changes to this property will trigger replacement.
- The location of this resource.
- attachment
Target This property is required. Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall
Policy This property is required. Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- attachment
Target This property is required. Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall
Policy This property is required. Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- attachment_
target This property is required. Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall_
policy This property is required. Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- attachment
Target This property is required. Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall
Policy This property is required. Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- 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 str
- The provider-assigned unique ID for this managed resource.
- short_
name str - 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)
resources: _: type: gcp:compute:RegionNetworkFirewallPolicyAssociation get: id: ${id}
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - The unique provider ID of the resource to lookup.
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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.
- Attachment
Target Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- Firewall
Policy Changes to this property will trigger replacement.
- The firewall policy of the resource.
- Name
Changes to this property will trigger replacement.
- The name for an association.
- Project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region
Changes to this property will trigger replacement.
- The location of this resource.
- Short
Name string - The short name of the firewall policy of the association.
- Attachment
Target Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- Firewall
Policy Changes to this property will trigger replacement.
- The firewall policy of the resource.
- Name
Changes to this property will trigger replacement.
- The name for an association.
- Project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region
Changes to this property will trigger replacement.
- The location of this resource.
- Short
Name string - The short name of the firewall policy of the association.
- attachment
Target Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall
Policy Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- short
Name String - The short name of the firewall policy of the association.
- attachment
Target Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall
Policy Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- short
Name string - The short name of the firewall policy of the association.
- attachment_
target Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall_
policy Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- short_
name str - The short name of the firewall policy of the association.
- attachment
Target Changes to this property will trigger replacement.
- The target that the firewall policy is attached to.
- firewall
Policy Changes to this property will trigger replacement.
- The firewall policy of the resource.
- name
Changes to this property will trigger replacement.
- The name for an association.
- project
Changes to this property will trigger replacement.
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region
Changes to this property will trigger replacement.
- The location of this resource.
- short
Name String - The short name of the firewall policy of the association.
Import
RegionNetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}
{{project}}/{{region}}/{{firewall_policy}}/{{name}}
{{region}}/{{firewall_policy}}/{{name}}
{{project}}/{{firewall_policy}}/{{name}}
{{firewall_policy}}/{{name}}
When using the pulumi import
command, RegionNetworkFirewallPolicyAssociation 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}}
$ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{region}}/{{firewall_policy}}/{{name}}
$ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{project}}/{{firewall_policy}}/{{name}}
$ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{firewall_policy}}/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
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.
- Example Usage
- Region Network Firewall Policy Association
- Create RegionNetworkFirewallPolicyAssociation Resource
- Constructor syntax
- Constructor example
- RegionNetworkFirewallPolicyAssociation Resource Properties
- Inputs
- Outputs
- Look up Existing RegionNetworkFirewallPolicyAssociation Resource
- Import
- Package Details