ByCloud Docs
GuidesCLIAPISDK

Create policy

bycloud iam policies create --name <name> --document <document> [flags]

Create a new policy in the current organization

Options

--output

(-o)

stringoptional

Output format: text, json, or yaml

Values: "text", "json", "yaml"

Default: "text"

Body Options

--document

objectrequired

IAM-style policy document

--name

stringrequired

--description

stringoptional

Command

bycloud iam policies create \
--name "my-resource" \
--document "value"

Output

ID 550e8400-e29b-41d4-a716-446655440000
CRN crn::iam:policy:550e8400-e29b-41d4-a716-446655440000
NAME S3BucketAccess
DESCRIPTION Allow read/write access to specific S3 bucket
DOCUMENT
VERSION 2024-01-01
STATEMENTS
[0]
SID AllowS3Read
EFFECT allow
ACTIONS s3:GetObject, s3:ListBucket
RESOURCES my-bucket/*, my-bucket
CONDITIONS
[0]
OPERATOR equals
KEY s3:prefix
VALUES home/, shared/
[1]
SID AllowS3Read
EFFECT allow
ACTIONS s3:GetObject, s3:ListBucket
RESOURCES my-bucket/*, my-bucket
CONDITIONS
[0]
OPERATOR equals
KEY s3:prefix
VALUES home/, shared/
CREATED_AT 2024-01-15T10:30:00Z
UPDATED_AT 2024-01-15T10:30:00Z