Skip to main content

schemas

Creates, updates, deletes, gets or lists a schemas resource.

Overview

Nameschemas
TypeResource
Idaws.verifiedpermissions.schemas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_datestring (date-time)The date and time that the schema was originally created.
last_updated_datestring (date-time)The date and time that the schema was most recently updated.
namespacesarrayThe namespaces of the entities referenced by this schema.
policy_store_idstringThe ID of the policy store that contains the schema. (pattern: <code>[a-zA-Z0-9-/_]*</code>)
schemastringThe body of the schema, written in Cedar schema JSON.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_schemaselectregionRetrieve the details for the specified schema in the specified policy store.
put_schemareplaceregion, policyStoreId, definitionCreates or updates the policy schema in the specified policy store. The schema is used to validate any Cedar policies and policy templates submitted to the policy store. Any changes to the schema validate only policies and templates submitted after the schema change. Existing policies and templates are not re-evaluated against the changed schema. If you later update a policy, then it is evaluated against the new schema at that time. Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieve the details for the specified schema in the specified policy store.

SELECT
created_date,
last_updated_date,
namespaces,
policy_store_id,
schema
FROM aws.verifiedpermissions.schemas
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Creates or updates the policy schema in the specified policy store. The schema is used to validate any Cedar policies and policy templates submitted to the policy store. Any changes to the schema validate only policies and templates submitted after the schema change. Existing policies and templates are not re-evaluated against the changed schema. If you later update a policy, then it is evaluated against the new schema at that time. Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

REPLACE aws.verifiedpermissions.schemas
SET
policyStoreId = '{{ policyStoreId }}',
definition = '{{ definition }}'
WHERE
region = '{{ region }}' --required
AND policyStoreId = '{{ policyStoreId }}' --required
AND definition = '{{ definition }}' --required
RETURNING
created_date,
last_updated_date,
namespaces,
policy_store_id;