1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. Policy
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi

oci.Identity.Policy

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi

    This resource provides the Policy resource in Oracle Cloud Infrastructure Identity service.

    Creates a new policy in the specified compartment (either the tenancy or another of your compartments). If you’re new to policies, see Getting Started with Policies.

    You must specify a name for the policy, which must be unique across all policies in your tenancy and cannot be changed.

    You must also specify a description for the policy (although it can be an empty string). It does not have to be unique, and you can change it anytime with UpdatePolicy.

    You must specify one or more policy statements in the statements array. For information about writing policies, see How Policies Work and Common Policies. New policies take effect typically within 10 seconds.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testPolicy = new oci.identity.Policy("test_policy", {
        compartmentId: tenancyOcid,
        description: policyDescription,
        name: policyName,
        statements: policyStatements,
        definedTags: {
            "Operations.CostCenter": "42",
        },
        freeformTags: {
            Department: "Finance",
        },
        versionDate: policyVersionDate,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_policy = oci.identity.Policy("test_policy",
        compartment_id=tenancy_ocid,
        description=policy_description,
        name=policy_name,
        statements=policy_statements,
        defined_tags={
            "Operations.CostCenter": "42",
        },
        freeform_tags={
            "Department": "Finance",
        },
        version_date=policy_version_date)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Identity.NewPolicy(ctx, "test_policy", &Identity.PolicyArgs{
    			CompartmentId: pulumi.Any(tenancyOcid),
    			Description:   pulumi.Any(policyDescription),
    			Name:          pulumi.Any(policyName),
    			Statements:    pulumi.Any(policyStatements),
    			DefinedTags: pulumi.Map{
    				"Operations.CostCenter": pulumi.Any("42"),
    			},
    			FreeformTags: pulumi.Map{
    				"Department": pulumi.Any("Finance"),
    			},
    			VersionDate: pulumi.Any(policyVersionDate),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testPolicy = new Oci.Identity.Policy("test_policy", new()
        {
            CompartmentId = tenancyOcid,
            Description = policyDescription,
            Name = policyName,
            Statements = policyStatements,
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
            VersionDate = policyVersionDate,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Identity.Policy;
    import com.pulumi.oci.Identity.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 testPolicy = new Policy("testPolicy", PolicyArgs.builder()
                .compartmentId(tenancyOcid)
                .description(policyDescription)
                .name(policyName)
                .statements(policyStatements)
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .freeformTags(Map.of("Department", "Finance"))
                .versionDate(policyVersionDate)
                .build());
    
        }
    }
    
    resources:
      testPolicy:
        type: oci:Identity:Policy
        name: test_policy
        properties:
          compartmentId: ${tenancyOcid}
          description: ${policyDescription}
          name: ${policyName}
          statements: ${policyStatements}
          definedTags:
            Operations.CostCenter: '42'
          freeformTags:
            Department: Finance
          versionDate: ${policyVersionDate}
    

    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: PolicyArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Policy(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               compartment_id: Optional[str] = None,
               description: Optional[str] = None,
               statements: Optional[Sequence[str]] = None,
               defined_tags: Optional[Mapping[str, Any]] = None,
               freeform_tags: Optional[Mapping[str, Any]] = None,
               name: Optional[str] = None,
               version_date: Optional[str] = None)
    func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)
    public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
    public Policy(String name, PolicyArgs args)
    public Policy(String name, PolicyArgs args, CustomResourceOptions options)
    
    type: oci:Identity: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 Oci.Identity.Policy("policyResource", new()
    {
        CompartmentId = "string",
        Description = "string",
        Statements = new[]
        {
            "string",
        },
        DefinedTags = 
        {
            { "string", "any" },
        },
        FreeformTags = 
        {
            { "string", "any" },
        },
        Name = "string",
        VersionDate = "string",
    });
    
    example, err := Identity.NewPolicy(ctx, "policyResource", &Identity.PolicyArgs{
    	CompartmentId: pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	Statements: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DefinedTags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	FreeformTags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	Name:        pulumi.String("string"),
    	VersionDate: pulumi.String("string"),
    })
    
    var policyResource = new Policy("policyResource", PolicyArgs.builder()
        .compartmentId("string")
        .description("string")
        .statements("string")
        .definedTags(Map.of("string", "any"))
        .freeformTags(Map.of("string", "any"))
        .name("string")
        .versionDate("string")
        .build());
    
    policy_resource = oci.identity.Policy("policyResource",
        compartment_id="string",
        description="string",
        statements=["string"],
        defined_tags={
            "string": "any",
        },
        freeform_tags={
            "string": "any",
        },
        name="string",
        version_date="string")
    
    const policyResource = new oci.identity.Policy("policyResource", {
        compartmentId: "string",
        description: "string",
        statements: ["string"],
        definedTags: {
            string: "any",
        },
        freeformTags: {
            string: "any",
        },
        name: "string",
        versionDate: "string",
    });
    
    type: oci:Identity:Policy
    properties:
        compartmentId: string
        definedTags:
            string: any
        description: string
        freeformTags:
            string: any
        name: string
        statements:
            - string
        versionDate: 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

    The Policy resource accepts the following input properties:

    CompartmentId string
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    Description string
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    Statements List<string>
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    DefinedTags Dictionary<string, object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    FreeformTags Dictionary<string, object>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Name string
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    VersionDate string

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    Description string
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    Statements []string
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    DefinedTags map[string]interface{}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    FreeformTags map[string]interface{}
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Name string
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    VersionDate string

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    description String
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    statements List<String>
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    definedTags Map<String,Object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeformTags Map<String,Object>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    name String
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    versionDate String

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId string
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    description string
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    statements string[]
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    definedTags {[key: string]: any}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeformTags {[key: string]: any}
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    name string
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    versionDate string

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_id str
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    description str
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    statements Sequence[str]
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    defined_tags Mapping[str, Any]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeform_tags Mapping[str, Any]
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    name str
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    version_date str

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    description String
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    statements List<String>
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    definedTags Map<Any>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeformTags Map<Any>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    name String
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    versionDate String

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Outputs

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

    ETag string

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    LastUpdateETag string

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    PolicyHash string

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    State string
    The policy's current state.
    TimeCreated string
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    ETag string

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    LastUpdateETag string

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    PolicyHash string

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    State string
    The policy's current state.
    TimeCreated string
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    ETag String

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    lastUpdateETag String

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    policyHash String

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state String
    The policy's current state.
    timeCreated String
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    ETag string

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    id string
    The provider-assigned unique ID for this managed resource.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    lastUpdateETag string

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    policyHash string

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state string
    The policy's current state.
    timeCreated string
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    e_tag str

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    id str
    The provider-assigned unique ID for this managed resource.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    last_update_e_tag str

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    policy_hash str

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state str
    The policy's current state.
    time_created str
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    ETag String

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    lastUpdateETag String

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    policyHash String

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state String
    The policy's current state.
    timeCreated String
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

    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,
            e_tag: Optional[str] = None,
            compartment_id: Optional[str] = None,
            defined_tags: Optional[Mapping[str, Any]] = None,
            description: Optional[str] = None,
            freeform_tags: Optional[Mapping[str, Any]] = None,
            inactive_state: Optional[str] = None,
            last_update_e_tag: Optional[str] = None,
            name: Optional[str] = None,
            policy_hash: Optional[str] = None,
            state: Optional[str] = None,
            statements: Optional[Sequence[str]] = None,
            time_created: Optional[str] = None,
            version_date: 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)
    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:
    CompartmentId string
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    DefinedTags Dictionary<string, object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    ETag string

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    FreeformTags Dictionary<string, object>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    LastUpdateETag string

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    Name string
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    PolicyHash string

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    State string
    The policy's current state.
    Statements List<string>
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    TimeCreated string
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VersionDate string

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    DefinedTags map[string]interface{}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    ETag string

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    FreeformTags map[string]interface{}
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    LastUpdateETag string

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    Name string
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    PolicyHash string

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    State string
    The policy's current state.
    Statements []string
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    TimeCreated string
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VersionDate string

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ETag String

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    compartmentId String
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    definedTags Map<String,Object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    freeformTags Map<String,Object>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    lastUpdateETag String

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    name String
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    policyHash String

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state String
    The policy's current state.
    statements List<String>
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    timeCreated String
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    versionDate String

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ETag string

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    compartmentId string
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    definedTags {[key: string]: any}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description string
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    freeformTags {[key: string]: any}
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    lastUpdateETag string

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    name string
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    policyHash string

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state string
    The policy's current state.
    statements string[]
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    timeCreated string
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    versionDate string

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_id str
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    defined_tags Mapping[str, Any]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description str
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    e_tag str

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    freeform_tags Mapping[str, Any]
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    last_update_e_tag str

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    name str
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    policy_hash str

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state str
    The policy's current state.
    statements Sequence[str]
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    time_created str
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    version_date str

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ETag String

    Deprecated: The 'ETag' field has been deprecated and may be removed in a future version. Do not use this field.

    compartmentId String
    The OCID of the compartment containing the policy (either the tenancy or another compartment).
    definedTags Map<Any>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    (Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
    freeformTags Map<Any>
    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    lastUpdateETag String

    Deprecated: The 'lastUpdateETag' field has been deprecated and may be removed in a future version. Do not use this field.

    name String
    The name you assign to the policy during creation. The name must be unique across all policies in the tenancy and cannot be changed.
    policyHash String

    Deprecated: The 'policyHash' field has been deprecated and may be removed in a future version. Do not use this field.

    state String
    The policy's current state.
    statements List<String>
    (Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
    timeCreated String
    Date and time the policy was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    versionDate String

    (Updatable) The version of the policy. If null or set to an empty string, when a request comes in for authorization, the policy will be evaluated according to the current behavior of the services at that moment. If set to a particular date (YYYY-MM-DD), the policy will be evaluated according to the behavior of the services on that date.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Import

    Policies can be imported using the id, e.g.

    $ pulumi import oci:Identity/policy:Policy test_policy "id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi