Skip to content

stratumctl custom-policies

Manage custom Cedar policies

Terminal window
stratumctl custom-policies [flags]

Aliases: custom-policy, cpol

Attach a policy to a user, group, or resource

Terminal window
stratumctl custom-policies attach <policy-id> --target-kind <user|group|resource> --target-ref <id-or-arn> [flags]
Terminal window
stratumctl custom-policies attach pol-4k8m2x7q9a --target-kind user --target-ref u-alice
stratumctl custom-policies attach pol-4k8m2x7q9a --target-kind group --target-ref g-5k8m2x7q9a
Flag Type Default Description
--target-kind string user | group | resource (required)
--target-ref string user/group id or resource ARN (required)

List a policy’s attachments

Terminal window
stratumctl custom-policies attachments <policy-id> [flags]
Terminal window
stratumctl custom-policies attachments pol-4k8m2x7q9a
stratumctl custom-policies attachments pol-4k8m2x7q9a --output json

Create a custom policy from a statements file

Terminal window
stratumctl custom-policies create --name <n> --scope-type <t> --scope-id <id> -f <statements.json> [flags]
Terminal window
stratumctl custom-policies create --name ci-deployer --scope-type project --scope-id p-team-a -f statements.json
stratumctl custom-policies create --name ci-deployer --scope-type organization --scope-id o-acme --description "CI deploy rights" -f statements.json
Flag Type Default Description
--description string description
-f, --file string JSON statements array file (‘-’ = stdin)
--name string policy name (required)
--scope-id string org/project id (required)
--scope-type string organization | project (required)

Delete a custom policy (–force cascades attachments)

Terminal window
stratumctl custom-policies delete <policy-id> [--force] [flags]
Terminal window
stratumctl custom-policies delete pol-4k8m2x7q9a
stratumctl custom-policies delete pol-4k8m2x7q9a --force
Flag Type Default Description
--force bool false cascade-delete attachments

Detach a policy from a target

Terminal window
stratumctl custom-policies detach <policy-id> <attachment-id> [flags]
Terminal window
stratumctl custom-policies detach pol-4k8m2x7q9a att-6k2m8x4q7a

Show a custom policy (includes generated Cedar)

Terminal window
stratumctl custom-policies get <policy-id> [flags]
Terminal window
stratumctl custom-policies get pol-4k8m2x7q9a
stratumctl custom-policies get pol-4k8m2x7q9a --output json

List custom policies at a scope

Terminal window
stratumctl custom-policies list --scope-type <organization|project> --scope-id <id> [flags]
Terminal window
stratumctl custom-policies list --scope-type project --scope-id p-team-a
stratumctl custom-policies list --scope-type organization --scope-id o-acme --output json
Flag Type Default Description
--scope-id string org/project id (required)
--scope-type string organization | project (required)