Skip to content

delete_role

Operation

delete_role

delete_role(request: DeleteRoleInput | DeleteRoleInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[DeleteRoleInputDict]) -> DeleteRoleOutput

Deletes the specified role. Unlike the Amazon Web Services Management Console, when you delete a role programmatically, you must delete the items attached to the role manually, or the deletion fails. For more information, see Deleting an IAM role. Before attempting to delete a role, remove the following attached items:

Warning

Make sure that you do not have any Amazon EC2 instances running with the role you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

Parameters:

Name Type Description Default
request DeleteRoleInput | DeleteRoleInputDict | 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[DeleteRoleInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
DeleteRoleOutput

An instance of DeleteRoleOutput.

delete_role async

delete_role(request: DeleteRoleInput | DeleteRoleInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[DeleteRoleInputDict]) -> DeleteRoleOutput

Deletes the specified role. Unlike the Amazon Web Services Management Console, when you delete a role programmatically, you must delete the items attached to the role manually, or the deletion fails. For more information, see Deleting an IAM role. Before attempting to delete a role, remove the following attached items:

Warning

Make sure that you do not have any Amazon EC2 instances running with the role you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

Parameters:

Name Type Description Default
request DeleteRoleInput | DeleteRoleInputDict | 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[DeleteRoleInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
DeleteRoleOutput

An instance of DeleteRoleOutput.

Input

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

DeleteRoleInputDict

Bases: TypedDict

Dictionary form of DeleteRoleInput.

Attributes

role_name instance-attribute
role_name: Required[str]

The name of the role to delete.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

DeleteRoleInput dataclass

Bases: _SerdeShape

Dataclass for DeleteRoleInput structure.

Attributes

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

The name of the role to delete.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Output

DeleteRoleOutput dataclass

Bases: _SerdeShape

Dataclass for DeleteRoleOutput 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.