CmdID / aws / aws iotsitewise
aws iotsitewise create-access-policy
The IoT SiteWise Monitor feature will no longer be open to new customers starting November 7, 2025. AWS CLI reference
2 examples 5 options Its page in the AWS CLI reference
Examples
Example 1: To grant a user administrative access to a portal
The following create-access-policy example creates an access policy that grants a user administrative access to a web portal for a wind farm company.
aws iotsitewise create-access-policy --cli-input-json file://create-portal-administrator-access-policy.jsonIdentifyContents of create-portal-administrator-access-policy.json:
{
"accessPolicyIdentity": {
"user": {
"id": "a1b2c3d4e5-a1b2c3d4-5678-90ab-cdef-bbbbbEXAMPLE"
}
},
"accessPolicyPermission": "ADMINISTRATOR",
"accessPolicyResource": {
"portal": {
"id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
}
}
}
Its output
{
"accessPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
"accessPolicyArn": "arn:aws:iotsitewise:us-west-2:123456789012:access-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222"
}For more information, see Adding or removing portal administrators in the AWS IoT SiteWise User Guide.
Example 2: To grant a user read-only access to a project
The following create-access-policy example creates an access policy that grants a user read-only access to a wind farm project.
aws iotsitewise create-access-policy --cli-input-json file://create-project-viewer-access-policy.jsonIdentifyContents of create-project-viewer-access-policy.json:
{
"accessPolicyIdentity": {
"user": {
"id": "a1b2c3d4e5-a1b2c3d4-5678-90ab-cdef-bbbbbEXAMPLE"
}
},
"accessPolicyPermission": "VIEWER",
"accessPolicyResource": {
"project": {
"id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
}
}
}
Its output
{
"accessPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE44444",
"accessPolicyArn": "arn:aws:iotsitewise:us-west-2:123456789012:access-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE44444"
}For more information, see Assigning project viewers in the AWS IoT SiteWise Monitor Application Guide.
Options
--access-policy-identityThe identity for this access policy.--access-policy-permissionThe permission level for this access policy.--access-policy-resourceThe IoT SiteWise Monitor resource for this access policy.--client-tokenA unique case-sensitive identifier that you can provide to ensure the idempotency of the request.--tagsA list of key-value pairs that contain metadata for the access policy.