schemas
Creates, updates, deletes, gets or lists a schemas resource.
Overview
| Name | schemas |
| Type | Resource |
| Id | aws.verifiedpermissions.schemas |
Fields
The following fields are returned by SELECT queries:
- get_schema
| Name | Datatype | Description |
|---|---|---|
created_date | string (date-time) | The date and time that the schema was originally created. |
last_updated_date | string (date-time) | The date and time that the schema was most recently updated. |
namespaces | array | The namespaces of the entities referenced by this schema. |
policy_store_id | string | The ID of the policy store that contains the schema. (pattern: <code>[a-zA-Z0-9-/_]*</code>) |
schema | string | The body of the schema, written in Cedar schema JSON. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_schema | select | region | Retrieve the details for the specified schema in the specified policy store. | |
put_schema | replace | region, policyStoreId, definition | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_schema
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
- put_schema
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;