Skip to content

Schema

Source: src/AWS/VerifiedPermissions/Schema.ts

The Cedar schema for a Verified Permissions policy store. The schema declares the entity types and actions your policies reference; with validationMode: "STRICT" on the store, policies and templates are validated against it at submission time.

A policy store has at most one schema — PutSchema is an upsert that fully replaces the previous schema.

import * as AWS from "alchemy/AWS";
const store = yield* AWS.VerifiedPermissions.PolicyStore("Store", {
validationMode: "STRICT",
});
yield* AWS.VerifiedPermissions.Schema("Schema", {
policyStoreId: store.policyStoreId,
cedarJson: JSON.stringify({
PhotoApp: {
entityTypes: {
User: {},
Photo: {},
},
actions: {
viewPhoto: {
appliesTo: {
principalTypes: ["User"],
resourceTypes: ["Photo"],
},
},
},
},
}),
});