[ aws . cloudwatchomni ]

create-access-grant

Description

Creates an AccessGrant that authorizes a principal to perform a set of actions on resources in a space.

Optionally narrow the grant with scoped actions that limit it to specific resources and fields. Use ListAccessGrants and GetAccessGrant to retrieve grants, and DeleteAccessGrant to remove them.

See also: AWS API Documentation

Synopsis

  create-access-grant
--domain-id <value>
--space-id <value>
--name <value>
--principal <value>
--permission <value>
[--scoped-actions <value>]
[--tags <value>]
[--client-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]

Options

--domain-id (string) [required]

The ID of the domain that contains the space.

Constraints:

  • pattern: d-[0-9a-z]{1,25}

--space-id (string) [required]

The ID of the space to scope the grant to.

Constraints:

  • pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

--name (string) [required]

A name that identifies the access grant.

Constraints:

  • min: 1
  • max: 64
  • pattern: [a-zA-Z0-9_-]+

--principal (structure) [required]

The principal receiving the grant.

principalType -> (string) [required]

The type of principal receiving the grant.

Possible values:

  • IDC_USER
  • IDC_GROUP
  • IAM_USER
  • IAM_ROLE
  • IAM_ROOT
  • ACCESS_PROFILE
  • ALERT
  • AGENT

principalId -> (string)

The ID of the principal receiving the grant.

Constraints:

  • min: 1
  • max: 2048
  • pattern: [a-zA-Z0-9][a-zA-Z0-9:/_+=,.@-]*

principalAttributes -> (list)

Attribute conditions for attribute-based access. When provided, the grant targets any principal matching all specified conditions. Supported only for IDC_USER principals.

Constraints:

  • min: 0
  • max: 10

(structure)

A single attribute condition used to match principals for attribute-based access.

key -> (string) [required]

The Identity Center user attribute to match on. One of userName, active, userStatus, displayName, email, name.givenName, name.familyName, enterprise.department, enterprise.division, enterprise.organization, enterprise.costCenter, or enterprise.employeeNumber. Each key may appear only once per grant.

Constraints:

  • min: 1
  • max: 128

value -> (string) [required]

The attribute value.

Constraints:

  • min: 1
  • max: 512

Shorthand Syntax:

principalType=string,principalId=string,principalAttributes=[{key=string,value=string},{key=string,value=string}]

JSON Syntax:

{
  "principalType": "IDC_USER"|"IDC_GROUP"|"IAM_USER"|"IAM_ROLE"|"IAM_ROOT"|"ACCESS_PROFILE"|"ALERT"|"AGENT",
  "principalId": "string",
  "principalAttributes": [
    {
      "key": "string",
      "value": "string"
    }
    ...
  ]
}

--permission (string) [required]

The permission to grant. Exactly one permission is granted per request.

Possible values:

  • SPACE_ADMIN
  • READ
  • READ_WRITE_DELETE
  • CUSTOM

--scoped-actions (list)

Groups of actions to allow, each with the resource scopes and conditions that limit those actions.

Constraints:

  • min: 0
  • max: 20

(structure)

A group of actions within an access grant, together with the resource scopes and context conditions that apply to exactly those actions.

actions -> (list) [required]

The actions this group applies to.

Constraints:

  • min: 1
  • max: 50

(string)

A single scoped action in “vendor-code:Action” form (e.g. “bedrock:InvokeModel”). Wildcards are not permitted.

Constraints:

  • min: 3
  • max: 256
  • pattern: [a-z0-9][a-z0-9-]*:[A-Za-z][A-Za-z0-9]*

resources -> (list)

Optional resource scopes constraining these actions to specific resources.

Constraints:

  • min: 0
  • max: 10

(structure)

A single resource scope entry within an AccessGrant. Associates a resource type with optional ARN patterns, tag conditions, and row-level filters.

resourceType -> (string) [required]

Resource type name (e.g., “DataSet”, “OmniDashboard”).

resourceArns -> (list)

Specific resource ARNs or ARN patterns. When set, actions are limited to these resources. When absent, defaults to “*”.

Constraints:

  • min: 0
  • max: 5

(string)

tags -> (map)

Tag-based conditions for dynamic resource scoping. Access applies only to resources carrying all of the specified tag key/value pairs.

Constraints:

  • min: 0
  • max: 3

key -> (string)

value -> (string)

signalTypes -> (list)

Signal types this scope’s row filtering applies to. Required when rowScopeGroups is set.

Constraints:

  • min: 1
  • max: 3

(string)

Telemetry signal type that row-scoped access control applies to.

Possible values:

  • LOGS
  • TRACES

rowScopeGroups -> (list)

Row-level filters for this scope, as an OR of AND-groups: a row is visible when it matches every filter in any one group. Requires signalTypes.

Row filters are additive across a principal’s matching grants. A signal type with no matching group is unrestricted, and when rowScopeGroups is omitted all rows are visible for all signal types.

Constraints:

  • min: 1
  • max: 20

(list)

A group of row filters that must all match. A row satisfies the group only when it matches every filter in it.

Constraints:

  • min: 1
  • max: 20

(structure)

A single additive row-level filter on an AccessGrant. A row is visible when its value for the given field matches the filter’s values. Row filters are additive: the visible rows are the union of all row filters across a principal’s matching grants.

field -> (string) [required]

The field (column) the allowlist applies to (e.g., “serviceName”, “accountId”).

Constraints:

  • min: 1
  • max: 256

operator -> (string) [required]

Match operator applied to this filter’s values.

Possible values:

  • IN

values -> (list) [required]

The values the field is matched against.

Constraints:

  • min: 1
  • max: 100

(string)

A single allowlist value for a RowScope field.

Constraints:

  • min: 1
  • max: 256

contextConditions -> (map)

Optional context conditions for fine-grained access control on these actions.

Constraints:

  • min: 0
  • max: 10

key -> (string)

value -> (list)

Generic list of strings.

(string)

JSON Syntax:

[
  {
    "actions": ["string", ...],
    "resources": [
      {
        "resourceType": "string",
        "resourceArns": ["string", ...],
        "tags": {"string": "string"
          ...},
        "signalTypes": ["LOGS"|"TRACES", ...],
        "rowScopeGroups": [
          [
            {
              "field": "string",
              "operator": "IN",
              "values": ["string", ...]
            }
            ...
          ]
          ...
        ]
      }
      ...
    ],
    "contextConditions": {"string": ["string", ...]
      ...}
  }
  ...
]

--tags (map)

The tags to associate with the access grant.

Constraints:

  • min: 0
  • max: 50

key -> (string)

Tag key. Must be non-empty; AWS-standard maximum length. Constraining the key (rather than a bare String) rejects empty-key payloads at the edge with a 400 ValidationException instead of faulting downstream as a 500.

Constraints:

  • min: 1
  • max: 128

value -> (string)

Tag value. AWS-standard maximum length; may be empty.

Constraints:

  • min: 0
  • max: 256

Shorthand Syntax:

KeyName1=string,KeyName2=string

JSON Syntax:

{"string": "string"
  ...}

--client-token (string)

Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.

Constraints:

  • min: 1
  • max: 64
  • pattern: [!-~]+

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table
  • yaml
  • yaml-stream
  • off

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64
  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

--cli-error-format (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

  • legacy
  • json
  • yaml
  • text
  • table
  • enhanced

Output

accessGrant -> (structure)

The details of the created access grant.

grantId -> (string) [required]

The unique ID of the access grant.

Constraints:

  • pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

grantArn -> (string) [required]

The Amazon Resource Name (ARN) of the access grant.

Constraints:

  • min: 1
  • max: 2048
  • pattern: arn:.+

name -> (string)

A name that identifies the access grant.

Constraints:

  • min: 1
  • max: 64
  • pattern: [a-zA-Z0-9_-]+

accountId -> (string) [required]

The AWS account ID that owns the grant.

Constraints:

  • min: 12
  • max: 12
  • pattern: [0-9]{12}

domainId -> (string) [required]

The ID of the domain the grant belongs to.

Constraints:

  • pattern: d-[0-9a-z]{1,25}

principal -> (structure) [required]

The principal receiving the grant.

principalType -> (string) [required]

The type of principal receiving the grant.

Possible values:

  • IDC_USER
  • IDC_GROUP
  • IAM_USER
  • IAM_ROLE
  • IAM_ROOT
  • ACCESS_PROFILE
  • ALERT
  • AGENT

principalId -> (string)

The ID of the principal receiving the grant.

Constraints:

  • min: 1
  • max: 2048
  • pattern: [a-zA-Z0-9][a-zA-Z0-9:/_+=,.@-]*

principalAttributes -> (list)

Attribute conditions for attribute-based access. When provided, the grant targets any principal matching all specified conditions. Supported only for IDC_USER principals.

Constraints:

  • min: 0
  • max: 10

(structure)

A single attribute condition used to match principals for attribute-based access.

key -> (string) [required]

The Identity Center user attribute to match on. One of userName, active, userStatus, displayName, email, name.givenName, name.familyName, enterprise.department, enterprise.division, enterprise.organization, enterprise.costCenter, or enterprise.employeeNumber. Each key may appear only once per grant.

Constraints:

  • min: 1
  • max: 128

value -> (string) [required]

The attribute value.

Constraints:

  • min: 1
  • max: 512

permission -> (string) [required]

The permission granted.

Possible values:

  • SPACE_ADMIN
  • READ
  • READ_WRITE_DELETE
  • CUSTOM

grantType -> (string) [required]

Who manages the grant.

Possible values:

  • SERVICE_MANAGED
  • CUSTOMER_MANAGED

createdBy -> (string) [required]

The principal that created the grant.

createdAt -> (timestamp) [required]

The timestamp when the grant was created.

updatedAt -> (timestamp) [required]

The timestamp when the grant was last updated.

spaceId -> (string) [required]

The space this grant applies to. Domain-scoped grants are returned by ListDomainAccessGrantsForOrganization instead.

Constraints:

  • pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

scopedActions -> (list)

Groups of actions allowed by the grant, each with the resource scopes and conditions that limit those actions.

Constraints:

  • min: 0
  • max: 20

(structure)

A group of actions within an access grant, together with the resource scopes and context conditions that apply to exactly those actions.

actions -> (list) [required]

The actions this group applies to.

Constraints:

  • min: 1
  • max: 50

(string)

A single scoped action in “vendor-code:Action” form (e.g. “bedrock:InvokeModel”). Wildcards are not permitted.

Constraints:

  • min: 3
  • max: 256
  • pattern: [a-z0-9][a-z0-9-]*:[A-Za-z][A-Za-z0-9]*

resources -> (list)

Optional resource scopes constraining these actions to specific resources.

Constraints:

  • min: 0
  • max: 10

(structure)

A single resource scope entry within an AccessGrant. Associates a resource type with optional ARN patterns, tag conditions, and row-level filters.

resourceType -> (string) [required]

Resource type name (e.g., “DataSet”, “OmniDashboard”).

resourceArns -> (list)

Specific resource ARNs or ARN patterns. When set, actions are limited to these resources. When absent, defaults to “*”.

Constraints:

  • min: 0
  • max: 5

(string)

tags -> (map)

Tag-based conditions for dynamic resource scoping. Access applies only to resources carrying all of the specified tag key/value pairs.

Constraints:

  • min: 0
  • max: 3

key -> (string)

value -> (string)

signalTypes -> (list)

Signal types this scope’s row filtering applies to. Required when rowScopeGroups is set.

Constraints:

  • min: 1
  • max: 3

(string)

Telemetry signal type that row-scoped access control applies to.

Possible values:

  • LOGS
  • TRACES

rowScopeGroups -> (list)

Row-level filters for this scope, as an OR of AND-groups: a row is visible when it matches every filter in any one group. Requires signalTypes.

Row filters are additive across a principal’s matching grants. A signal type with no matching group is unrestricted, and when rowScopeGroups is omitted all rows are visible for all signal types.

Constraints:

  • min: 1
  • max: 20

(list)

A group of row filters that must all match. A row satisfies the group only when it matches every filter in it.

Constraints:

  • min: 1
  • max: 20

(structure)

A single additive row-level filter on an AccessGrant. A row is visible when its value for the given field matches the filter’s values. Row filters are additive: the visible rows are the union of all row filters across a principal’s matching grants.

field -> (string) [required]

The field (column) the allowlist applies to (e.g., “serviceName”, “accountId”).

Constraints:

  • min: 1
  • max: 256

operator -> (string) [required]

Match operator applied to this filter’s values.

Possible values:

  • IN

values -> (list) [required]

The values the field is matched against.

Constraints:

  • min: 1
  • max: 100

(string)

A single allowlist value for a RowScope field.

Constraints:

  • min: 1
  • max: 256

contextConditions -> (map)

Optional context conditions for fine-grained access control on these actions.

Constraints:

  • min: 0
  • max: 10

key -> (string)

value -> (list)

Generic list of strings.

(string)