1. Packages
  2. Cyral Provider
  3. API Docs
  4. Policy
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

cyral.Policy

Explore with Pulumi AI

cyral logo
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

    DEPRECATED For control planes >= v4.15, use resource cyral.PolicyV2 instead.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cyral from "@pulumi/cyral";
    
    const _this = new cyral.Policy("this", {
        datas: ["EMAIL"],
        description: "This is my first policy",
        enabled: true,
        metadataTags: ["Risk Level 1"],
    });
    
    import pulumi
    import pulumi_cyral as cyral
    
    this = cyral.Policy("this",
        datas=["EMAIL"],
        description="This is my first policy",
        enabled=True,
        metadata_tags=["Risk Level 1"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cyral/v4/cyral"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cyral.NewPolicy(ctx, "this", &cyral.PolicyArgs{
    			Datas: pulumi.StringArray{
    				pulumi.String("EMAIL"),
    			},
    			Description: pulumi.String("This is my first policy"),
    			Enabled:     pulumi.Bool(true),
    			MetadataTags: pulumi.StringArray{
    				pulumi.String("Risk Level 1"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cyral = Pulumi.Cyral;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new Cyral.Policy("this", new()
        {
            Datas = new[]
            {
                "EMAIL",
            },
            Description = "This is my first policy",
            Enabled = true,
            MetadataTags = new[]
            {
                "Risk Level 1",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cyral.Policy;
    import com.pulumi.cyral.PolicyArgs;
    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 this_ = new Policy("this", PolicyArgs.builder()
                .datas("EMAIL")
                .description("This is my first policy")
                .enabled(true)
                .metadataTags("Risk Level 1")
                .build());
    
        }
    }
    
    resources:
      this:
        type: cyral:Policy
        properties:
          datas:
            - EMAIL
          description: This is my first policy
          enabled: true
          metadataTags:
            - Risk Level 1
    

    Create Policy Resource

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

    Constructor syntax

    new Policy(name: string, args?: PolicyArgs, opts?: CustomResourceOptions);
    @overload
    def Policy(resource_name: str,
               args: Optional[PolicyArgs] = None,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Policy(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               data_label_tags: Optional[Sequence[str]] = None,
               datas: Optional[Sequence[str]] = None,
               description: Optional[str] = None,
               enabled: Optional[bool] = None,
               metadata_tags: Optional[Sequence[str]] = None,
               name: Optional[str] = None,
               policy_id: Optional[str] = None,
               tags: Optional[Sequence[str]] = None)
    func NewPolicy(ctx *Context, name string, args *PolicyArgs, opts ...ResourceOption) (*Policy, error)
    public Policy(string name, PolicyArgs? args = null, CustomResourceOptions? opts = null)
    public Policy(String name, PolicyArgs args)
    public Policy(String name, PolicyArgs args, CustomResourceOptions options)
    
    type: cyral:Policy
    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 PolicyArgs
    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 PolicyArgs
    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 PolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyArgs
    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 policyResource = new Cyral.Policy("policyResource", new()
    {
        DataLabelTags = new[]
        {
            "string",
        },
        Datas = new[]
        {
            "string",
        },
        Description = "string",
        Enabled = false,
        MetadataTags = new[]
        {
            "string",
        },
        Name = "string",
        PolicyId = "string",
    });
    
    example, err := cyral.NewPolicy(ctx, "policyResource", &cyral.PolicyArgs{
    	DataLabelTags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Datas: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Enabled:     pulumi.Bool(false),
    	MetadataTags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:     pulumi.String("string"),
    	PolicyId: pulumi.String("string"),
    })
    
    var policyResource = new Policy("policyResource", PolicyArgs.builder()
        .dataLabelTags("string")
        .datas("string")
        .description("string")
        .enabled(false)
        .metadataTags("string")
        .name("string")
        .policyId("string")
        .build());
    
    policy_resource = cyral.Policy("policyResource",
        data_label_tags=["string"],
        datas=["string"],
        description="string",
        enabled=False,
        metadata_tags=["string"],
        name="string",
        policy_id="string")
    
    const policyResource = new cyral.Policy("policyResource", {
        dataLabelTags: ["string"],
        datas: ["string"],
        description: "string",
        enabled: false,
        metadataTags: ["string"],
        name: "string",
        policyId: "string",
    });
    
    type: cyral:Policy
    properties:
        dataLabelTags:
            - string
        datas:
            - string
        description: string
        enabled: false
        metadataTags:
            - string
        name: string
        policyId: string
    

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

    DataLabelTags List<string>
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    Datas List<string>
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    Description string
    String that describes the policy (ex: your_policy_description).
    Enabled bool
    Boolean that causes a policy to be enabled or disabled.
    MetadataTags List<string>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    Name string
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    PolicyId string
    The ID of this resource.
    Tags List<string>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    DataLabelTags []string
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    Datas []string
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    Description string
    String that describes the policy (ex: your_policy_description).
    Enabled bool
    Boolean that causes a policy to be enabled or disabled.
    MetadataTags []string
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    Name string
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    PolicyId string
    The ID of this resource.
    Tags []string
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    dataLabelTags List<String>
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas List<String>
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description String
    String that describes the policy (ex: your_policy_description).
    enabled Boolean
    Boolean that causes a policy to be enabled or disabled.
    metadataTags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name String
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policyId String
    The ID of this resource.
    tags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    dataLabelTags string[]
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas string[]
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description string
    String that describes the policy (ex: your_policy_description).
    enabled boolean
    Boolean that causes a policy to be enabled or disabled.
    metadataTags string[]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name string
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policyId string
    The ID of this resource.
    tags string[]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    data_label_tags Sequence[str]
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas Sequence[str]
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description str
    String that describes the policy (ex: your_policy_description).
    enabled bool
    Boolean that causes a policy to be enabled or disabled.
    metadata_tags Sequence[str]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name str
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policy_id str
    The ID of this resource.
    tags Sequence[str]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    dataLabelTags List<String>
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas List<String>
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description String
    String that describes the policy (ex: your_policy_description).
    enabled Boolean
    Boolean that causes a policy to be enabled or disabled.
    metadataTags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name String
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policyId String
    The ID of this resource.
    tags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    Outputs

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

    Created string
    Timestamp for the policy creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    Timestamp for the last update performed in this policy.
    Type string
    Policy type.
    Version string
    Incremental counter for every update on the policy.
    Created string
    Timestamp for the policy creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    Timestamp for the last update performed in this policy.
    Type string
    Policy type.
    Version string
    Incremental counter for every update on the policy.
    created String
    Timestamp for the policy creation.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    Timestamp for the last update performed in this policy.
    type String
    Policy type.
    version String
    Incremental counter for every update on the policy.
    created string
    Timestamp for the policy creation.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    Timestamp for the last update performed in this policy.
    type string
    Policy type.
    version string
    Incremental counter for every update on the policy.
    created str
    Timestamp for the policy creation.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    Timestamp for the last update performed in this policy.
    type str
    Policy type.
    version str
    Incremental counter for every update on the policy.
    created String
    Timestamp for the policy creation.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    Timestamp for the last update performed in this policy.
    type String
    Policy type.
    version String
    Incremental counter for every update on the policy.

    Look up Existing Policy Resource

    Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created: Optional[str] = None,
            data_label_tags: Optional[Sequence[str]] = None,
            datas: Optional[Sequence[str]] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            last_updated: Optional[str] = None,
            metadata_tags: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            policy_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None,
            version: Optional[str] = None) -> Policy
    func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
    public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
    public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)
    resources:  _:    type: cyral:Policy    get:      id: ${id}
    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:
    Created string
    Timestamp for the policy creation.
    DataLabelTags List<string>
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    Datas List<string>
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    Description string
    String that describes the policy (ex: your_policy_description).
    Enabled bool
    Boolean that causes a policy to be enabled or disabled.
    LastUpdated string
    Timestamp for the last update performed in this policy.
    MetadataTags List<string>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    Name string
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    PolicyId string
    The ID of this resource.
    Tags List<string>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    Type string
    Policy type.
    Version string
    Incremental counter for every update on the policy.
    Created string
    Timestamp for the policy creation.
    DataLabelTags []string
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    Datas []string
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    Description string
    String that describes the policy (ex: your_policy_description).
    Enabled bool
    Boolean that causes a policy to be enabled or disabled.
    LastUpdated string
    Timestamp for the last update performed in this policy.
    MetadataTags []string
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    Name string
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    PolicyId string
    The ID of this resource.
    Tags []string
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    Type string
    Policy type.
    Version string
    Incremental counter for every update on the policy.
    created String
    Timestamp for the policy creation.
    dataLabelTags List<String>
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas List<String>
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description String
    String that describes the policy (ex: your_policy_description).
    enabled Boolean
    Boolean that causes a policy to be enabled or disabled.
    lastUpdated String
    Timestamp for the last update performed in this policy.
    metadataTags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name String
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policyId String
    The ID of this resource.
    tags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    type String
    Policy type.
    version String
    Incremental counter for every update on the policy.
    created string
    Timestamp for the policy creation.
    dataLabelTags string[]
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas string[]
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description string
    String that describes the policy (ex: your_policy_description).
    enabled boolean
    Boolean that causes a policy to be enabled or disabled.
    lastUpdated string
    Timestamp for the last update performed in this policy.
    metadataTags string[]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name string
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policyId string
    The ID of this resource.
    tags string[]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    type string
    Policy type.
    version string
    Incremental counter for every update on the policy.
    created str
    Timestamp for the policy creation.
    data_label_tags Sequence[str]
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas Sequence[str]
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description str
    String that describes the policy (ex: your_policy_description).
    enabled bool
    Boolean that causes a policy to be enabled or disabled.
    last_updated str
    Timestamp for the last update performed in this policy.
    metadata_tags Sequence[str]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name str
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policy_id str
    The ID of this resource.
    tags Sequence[str]
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    type str
    Policy type.
    version str
    Incremental counter for every update on the policy.
    created String
    Timestamp for the policy creation.
    dataLabelTags List<String>
    List of tags that represent sets of data labels (established in your data map) that are used to specify the collections of data labels that the policy manages. For more information, see The tags block of a policy
    datas List<String>
    List that specify which data fields a policy manages. Each field is represented by the LABEL you established for it in your data map. The actual location of that data (the names of fields, columns, or databases that hold it) is listed in the data map.
    description String
    String that describes the policy (ex: your_policy_description).
    enabled Boolean
    Boolean that causes a policy to be enabled or disabled.
    lastUpdated String
    Timestamp for the last update performed in this policy.
    metadataTags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).
    name String
    Policy name that will be used internally in Control Plane (ex: your_policy_name).
    policyId String
    The ID of this resource.
    tags List<String>
    Metadata tags that can be used to organize and/or classify your policies (ex: [your_tag1, your_tag2]).

    Deprecated: Deprecated

    type String
    Policy type.
    version String
    Incremental counter for every update on the policy.

    Package Details

    Repository
    cyral cyralinc/terraform-provider-cyral
    License
    Notes
    This Pulumi package is based on the cyral Terraform Provider.
    cyral logo
    cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc