You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
IAM policies
IAM policy examples
Copy page
Download PDF
IAM policy examples
This topic provides examples of common IAM policies for your reference.​
Allow policies​
Grant an IAM user all permissions for the test bucket​
​
{ ​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"tos:*"​
],​
"Resource": [​
"trn:tos:::test",​
"trn:tos:::test/*"​
]​
}​
]​
}​
​
Grant an IAM user read-only permission on the test bucket​
​
{​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"tos:Get*"​
],​
"Resource": [​
"trn:tos:::test",​
"trn:tos:::test/*"​
]​
}​
]​
}​
​
Grant an IAM user permission to create buckets​
​
{​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"tos:CreateBucket"​
],​
"Resource": [​
"trn:tos:::*"​
]​
}​
]​
}​
​
Grant an IAM user permission to list buckets​
​
{​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"tos:ListBuckets"​
],​
"Resource": [​
"trn:tos:::*"​
]​
}​
]​
}​
​
Grant an IAM user permission to list objects in the abc directory of the test bucket​
​
{​
"Statement": [​
{​
"Effect": "Allow",​
"Action": [​
"tos:ListBucket"​
],​
"Resource": [​
"trn:tos:::test"​
],​
"Condition": {​
"StringLike": {​
"tos:prefix": [​
"abc/*"​
]​
}​
}​
}​
]​
}​
​
Deny policies​
warning​
In an IAM policy, a Deny statement takes precedence over an Allow statement for the same action.​
Deny an IAM user permission to upload objects to the test bucket​
​
{​
"Statement": [​
{​
"Effect": "Deny",​
"Action": [​
"tos:PutObject"​
],​
"Resource": [​
"trn:tos:::test/*"​
]​
}​
]​
}​
​
Deny an IAM user permission to delete the test bucket​
​
{​
"Statement": [​
{​
"Effect": "Deny",​
"Action": [​
"tos:DeleteBucket"​
],​
"Resource": [​
"trn:tos:::test"​
]​
}​
]​
}​
​
Deny an IAM user permission to delete objects with the abc prefix in the test bucket​
​
{​
"Statement": [​
{​
"Effect": "Deny",​
"Action": [​
"tos:DeleteObject"​
],​
"Resource": [​
"trn:tos:::test/abc*"​
]​
}​
]​
}​
​
​
Last updated: 2026.08.18 18:07:12