1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. OrganizationSecurityPolicy
Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

gcp.compute.OrganizationSecurityPolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

    Organization security policies are used to control incoming/outgoing traffic.

    To get more information about OrganizationSecurityPolicy, see:

    Example Usage

    Organization Security Policy Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = new gcp.compute.OrganizationSecurityPolicy("policy", {
        displayName: "tf-test",
        parent: "organizations/123456789",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.compute.OrganizationSecurityPolicy("policy",
        display_name="tf-test",
        parent="organizations/123456789")
    
    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 {
    		_, err := compute.NewOrganizationSecurityPolicy(ctx, "policy", &compute.OrganizationSecurityPolicyArgs{
    			DisplayName: pulumi.String("tf-test"),
    			Parent:      pulumi.String("organizations/123456789"),
    		})
    		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.OrganizationSecurityPolicy("policy", new()
        {
            DisplayName = "tf-test",
            Parent = "organizations/123456789",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.OrganizationSecurityPolicy;
    import com.pulumi.gcp.compute.OrganizationSecurityPolicyArgs;
    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 OrganizationSecurityPolicy("policy", OrganizationSecurityPolicyArgs.builder()        
                .displayName("tf-test")
                .parent("organizations/123456789")
                .build());
    
        }
    }
    
    resources:
      policy:
        type: gcp:compute:OrganizationSecurityPolicy
        properties:
          displayName: tf-test
          parent: organizations/123456789
    

    Create OrganizationSecurityPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OrganizationSecurityPolicy(name: string, args: OrganizationSecurityPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationSecurityPolicy(resource_name: str,
                                   args: OrganizationSecurityPolicyArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationSecurityPolicy(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   display_name: Optional[str] = None,
                                   parent: Optional[str] = None,
                                   description: Optional[str] = None,
                                   type: Optional[str] = None)
    func NewOrganizationSecurityPolicy(ctx *Context, name string, args OrganizationSecurityPolicyArgs, opts ...ResourceOption) (*OrganizationSecurityPolicy, error)
    public OrganizationSecurityPolicy(string name, OrganizationSecurityPolicyArgs args, CustomResourceOptions? opts = null)
    public OrganizationSecurityPolicy(String name, OrganizationSecurityPolicyArgs args)
    public OrganizationSecurityPolicy(String name, OrganizationSecurityPolicyArgs args, CustomResourceOptions options)
    
    type: gcp:compute:OrganizationSecurityPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args OrganizationSecurityPolicyArgs
    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 OrganizationSecurityPolicyArgs
    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 OrganizationSecurityPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationSecurityPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationSecurityPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var organizationSecurityPolicyResource = new Gcp.Compute.OrganizationSecurityPolicy("organizationSecurityPolicyResource", new()
    {
        DisplayName = "string",
        Parent = "string",
        Description = "string",
        Type = "string",
    });
    
    example, err := compute.NewOrganizationSecurityPolicy(ctx, "organizationSecurityPolicyResource", &compute.OrganizationSecurityPolicyArgs{
    	DisplayName: pulumi.String("string"),
    	Parent:      pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Type:        pulumi.String("string"),
    })
    
    var organizationSecurityPolicyResource = new OrganizationSecurityPolicy("organizationSecurityPolicyResource", OrganizationSecurityPolicyArgs.builder()        
        .displayName("string")
        .parent("string")
        .description("string")
        .type("string")
        .build());
    
    organization_security_policy_resource = gcp.compute.OrganizationSecurityPolicy("organizationSecurityPolicyResource",
        display_name="string",
        parent="string",
        description="string",
        type="string")
    
    const organizationSecurityPolicyResource = new gcp.compute.OrganizationSecurityPolicy("organizationSecurityPolicyResource", {
        displayName: "string",
        parent: "string",
        description: "string",
        type: "string",
    });
    
    type: gcp:compute:OrganizationSecurityPolicy
    properties:
        description: string
        displayName: string
        parent: string
        type: string
    

    OrganizationSecurityPolicy 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 OrganizationSecurityPolicy resource accepts the following input properties:

    DisplayName string
    A textual name of the security policy.
    Parent string
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    Description string
    A textual description for the organization security policy.
    Type string
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    DisplayName string
    A textual name of the security policy.
    Parent string
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    Description string
    A textual description for the organization security policy.
    Type string
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    displayName String
    A textual name of the security policy.
    parent String
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    description String
    A textual description for the organization security policy.
    type String
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    displayName string
    A textual name of the security policy.
    parent string
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    description string
    A textual description for the organization security policy.
    type string
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    display_name str
    A textual name of the security policy.
    parent str
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    description str
    A textual description for the organization security policy.
    type str
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    displayName String
    A textual name of the security policy.
    parent String
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    description String
    A textual description for the organization security policy.
    type String
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.

    Outputs

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

    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    policyId String
    The unique identifier for the resource. This identifier is defined by the server.
    fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.
    id string
    The provider-assigned unique ID for this managed resource.
    policyId string
    The unique identifier for the resource. This identifier is defined by the server.
    fingerprint str
    Fingerprint of this resource. This field is used internally during updates of this resource.
    id str
    The provider-assigned unique ID for this managed resource.
    policy_id str
    The unique identifier for the resource. This identifier is defined by the server.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    policyId String
    The unique identifier for the resource. This identifier is defined by the server.

    Look up Existing OrganizationSecurityPolicy Resource

    Get an existing OrganizationSecurityPolicy 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?: OrganizationSecurityPolicyState, opts?: CustomResourceOptions): OrganizationSecurityPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            fingerprint: Optional[str] = None,
            parent: Optional[str] = None,
            policy_id: Optional[str] = None,
            type: Optional[str] = None) -> OrganizationSecurityPolicy
    func GetOrganizationSecurityPolicy(ctx *Context, name string, id IDInput, state *OrganizationSecurityPolicyState, opts ...ResourceOption) (*OrganizationSecurityPolicy, error)
    public static OrganizationSecurityPolicy Get(string name, Input<string> id, OrganizationSecurityPolicyState? state, CustomResourceOptions? opts = null)
    public static OrganizationSecurityPolicy get(String name, Output<String> id, OrganizationSecurityPolicyState 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:
    Description string
    A textual description for the organization security policy.
    DisplayName string
    A textual name of the security policy.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.
    Parent string
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    PolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    Type string
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    Description string
    A textual description for the organization security policy.
    DisplayName string
    A textual name of the security policy.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.
    Parent string
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    PolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    Type string
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    description String
    A textual description for the organization security policy.
    displayName String
    A textual name of the security policy.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.
    parent String
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    policyId String
    The unique identifier for the resource. This identifier is defined by the server.
    type String
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    description string
    A textual description for the organization security policy.
    displayName string
    A textual name of the security policy.
    fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.
    parent string
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    policyId string
    The unique identifier for the resource. This identifier is defined by the server.
    type string
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    description str
    A textual description for the organization security policy.
    display_name str
    A textual name of the security policy.
    fingerprint str
    Fingerprint of this resource. This field is used internally during updates of this resource.
    parent str
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    policy_id str
    The unique identifier for the resource. This identifier is defined by the server.
    type str
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.
    description String
    A textual description for the organization security policy.
    displayName String
    A textual name of the security policy.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.
    parent String
    The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id} or folders/{folder_id}


    policyId String
    The unique identifier for the resource. This identifier is defined by the server.
    type String
    The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are: FIREWALL.

    Import

    OrganizationSecurityPolicy can be imported using any of these accepted formats:

    • locations/global/securityPolicies/{{policy_id}}

    • {{policy_id}}

    When using the pulumi import command, OrganizationSecurityPolicy can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/organizationSecurityPolicy:OrganizationSecurityPolicy default locations/global/securityPolicies/{{policy_id}}
    
    $ pulumi import gcp:compute/organizationSecurityPolicy:OrganizationSecurityPolicy default {{policy_id}}
    

    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.
    gcp logo
    Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi