Skip to content

add_permission

Operation

add_permission

add_permission(request: AddPermissionInput | AddPermissionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[AddPermissionInputDict]) -> AddPermissionOutput

Adds a statement to a topic's access control policy, granting access for the specified Amazon Web Services accounts to the specified actions.

Note

To remove the ability to change topic permissions, you must deny permissions to the AddPermission, RemovePermission, and SetTopicAttributes actions in your IAM policy.

Parameters:

Name Type Description Default
request AddPermissionInput | AddPermissionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[AddPermissionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
AddPermissionOutput

An instance of AddPermissionOutput.

add_permission async

add_permission(request: AddPermissionInput | AddPermissionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[AddPermissionInputDict]) -> AddPermissionOutput

Adds a statement to a topic's access control policy, granting access for the specified Amazon Web Services accounts to the specified actions.

Note

To remove the ability to change topic permissions, you must deny permissions to the AddPermission, RemovePermission, and SetTopicAttributes actions in your IAM policy.

Parameters:

Name Type Description Default
request AddPermissionInput | AddPermissionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[AddPermissionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
AddPermissionOutput

An instance of AddPermissionOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

AddPermissionInputDict

Bases: TypedDict

Dictionary form of AddPermissionInput.

Attributes

action_name instance-attribute
action_name: Required[Sequence[str]]

The action you want to allow for the specified principal(s).

Valid values: Any Amazon SNS action name, for example Publish.

aws_account_id instance-attribute
aws_account_id: Required[Sequence[str]]

The Amazon Web Services account IDs of the users (principals) who will be given access to the specified actions. The users must have Amazon Web Services account, but do not need to be signed up for this service.

label instance-attribute
label: Required[str]

A unique identifier for the new policy statement.

topic_arn instance-attribute
topic_arn: Required[str]

The ARN of the topic whose access control policy you wish to modify.

AddPermissionInput dataclass

Bases: _SerdeShape

Dataclass for AddPermissionInput structure.

Attributes

action_name class-attribute instance-attribute
action_name: list[str] | None = ...

The action you want to allow for the specified principal(s).

Valid values: Any Amazon SNS action name, for example Publish.

aws_account_id class-attribute instance-attribute
aws_account_id: list[str] | None = ...

The Amazon Web Services account IDs of the users (principals) who will be given access to the specified actions. The users must have Amazon Web Services account, but do not need to be signed up for this service.

label class-attribute instance-attribute
label: str | None = ...

A unique identifier for the new policy statement.

topic_arn class-attribute instance-attribute
topic_arn: str | None = ...

The ARN of the topic whose access control policy you wish to modify.

Output

AddPermissionOutput dataclass

Bases: _SerdeShape

Dataclass for AddPermissionOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.