oci_identity_policy

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

resource "oci_identity_policy" "test_policy" {
	#Required
	compartment_id = var.tenancy_ocid
	description = var.policy_description
	name = var.policy_name
	statements = var.policy_statements

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	freeform_tags = {"Department"= "Finance"}
	version_date = var.policy_version_date
}

Argument Reference

The following arguments are supported:

** 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

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Policy * update - (Defaults to 20 minutes), when updating the Policy * delete - (Defaults to 20 minutes), when destroying the Policy

Import

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

$ terraform import oci_identity_policy.test_policy "id"