1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. Policy
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.Identity.Policy

Explore with Pulumi AI

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,
});
Copy
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)
Copy
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.StringMap{
				"Operations.CostCenter": pulumi.String("42"),
			},
			FreeformTags: pulumi.StringMap{
				"Department": pulumi.String("Finance"),
			},
			VersionDate: pulumi.Any(policyVersionDate),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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}
Copy

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, str]] = None,
           freeform_tags: Optional[Mapping[str, str]] = 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 This property is required. string
The unique name of the resource.
args This property is required. PolicyArgs
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. 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 This property is required. string
The unique name of the resource.
args This property is required. PolicyArgs
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. PolicyArgs
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. 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", "string" },
    },
    FreeformTags = 
    {
        { "string", "string" },
    },
    Name = "string",
    VersionDate = "string",
});
Copy
example, err := Identity.NewPolicy(ctx, "policyResource", &Identity.PolicyArgs{
	CompartmentId: pulumi.String("string"),
	Description:   pulumi.String("string"),
	Statements: pulumi.StringArray{
		pulumi.String("string"),
	},
	DefinedTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	FreeformTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:        pulumi.String("string"),
	VersionDate: pulumi.String("string"),
})
Copy
var policyResource = new Policy("policyResource", PolicyArgs.builder()
    .compartmentId("string")
    .description("string")
    .statements("string")
    .definedTags(Map.of("string", "string"))
    .freeformTags(Map.of("string", "string"))
    .name("string")
    .versionDate("string")
    .build());
Copy
policy_resource = oci.identity.Policy("policyResource",
    compartment_id="string",
    description="string",
    statements=["string"],
    defined_tags={
        "string": "string",
    },
    freeform_tags={
        "string": "string",
    },
    name="string",
    version_date="string")
Copy
const policyResource = new oci.identity.Policy("policyResource", {
    compartmentId: "string",
    description: "string",
    statements: ["string"],
    definedTags: {
        string: "string",
    },
    freeformTags: {
        string: "string",
    },
    name: "string",
    versionDate: "string",
});
Copy
type: oci:Identity:Policy
properties:
    compartmentId: string
    definedTags:
        string: string
    description: string
    freeformTags:
        string: string
    name: string
    statements:
        - string
    versionDate: string
Copy

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:

CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the compartment containing the policy (either the tenancy or another compartment).
Description This property is required. string
(Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
Statements This property is required. List<string>
(Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
DefinedTags Dictionary<string, string>
(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, string>
(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 Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the compartment containing the policy (either the tenancy or another compartment).
Description This property is required. string
(Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
Statements This property is required. []string
(Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
DefinedTags map[string]string
(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]string
(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 Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
The OCID of the compartment containing the policy (either the tenancy or another compartment).
description This property is required. String
(Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
statements This property is required. List<String>
(Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
definedTags Map<String,String>
(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,String>
(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 Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the compartment containing the policy (either the tenancy or another compartment).
description This property is required. string
(Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
statements This property is required. string[]
(Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
definedTags {[key: string]: string}
(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]: string}
(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 Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
str
The OCID of the compartment containing the policy (either the tenancy or another compartment).
description This property is required. str
(Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
statements This property is required. Sequence[str]
(Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
defined_tags Mapping[str, str]
(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, str]
(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 Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
The OCID of the compartment containing the policy (either the tenancy or another compartment).
description This property is required. String
(Updatable) The description you assign to the policy during creation. Does not have to be unique, and it's changeable.
statements This property is required. List<String>
(Updatable) An array of policy statements written in the policy language. See How Policies Work and Common Policies.
definedTags Map<String>
(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>
(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 Changes to this property will trigger replacement. 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, str]] = None,
        description: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, str]] = 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)
resources:  _:    type: oci:Identity:Policy    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.
The following state arguments are supported:
CompartmentId Changes to this property will trigger replacement. string
The OCID of the compartment containing the policy (either the tenancy or another compartment).
DefinedTags Dictionary<string, string>
(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, string>
(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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The OCID of the compartment containing the policy (either the tenancy or another compartment).
DefinedTags map[string]string
(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]string
(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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The OCID of the compartment containing the policy (either the tenancy or another compartment).
definedTags Map<String,String>
(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,String>
(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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The OCID of the compartment containing the policy (either the tenancy or another compartment).
definedTags {[key: string]: string}
(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]: string}
(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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The OCID of the compartment containing the policy (either the tenancy or another compartment).
defined_tags Mapping[str, str]
(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, str]
(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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The OCID of the compartment containing the policy (either the tenancy or another compartment).
definedTags Map<String>
(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>
(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 Changes to this property will trigger replacement. 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"
Copy

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.