access_key#

async idem_aws.exec.aws.iam.access_key.list_(hub, ctx, user_name: str, access_key_id: str = None, status: str = None) Dict[str, Any][source]#

Returns a list of access keys for a user_name, optionally filtering by status and access_key_id.

Parameters:
  • user_name (str) – The user_name to list keys for.

  • access_key_id (str, Optional) – match exact access key to return

  • status (str, Optional) – match “Active” or “Inactive” keys; “Active” means the key is valid for API calls.

Returns:

Returns a list of access keys for the user

Return type:

dict[str, Any]

Examples

Calling this exec module function from the cli

idem exec aws.iam.access_key.list user_name="a_user"

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.iam.access_key.list
    - kwargs:
        user_name: a_user
async idem_aws.exec.aws.iam.access_key.update(hub, ctx, user_name: str, access_key_id: str, status: str) Dict[str, Any][source]#

Updates the status of an existing access key. Does not execute if ctx[“test”] is True.

Parameters:
  • user_name (str) – Exact user that owns the key

  • access_key_id (str) – Exact access key to update

  • status (str) – “Active” or “Inactive”, meaning it is valid for API calls

Returns:

Status of the update

Return type:

dict[str, Any]

Examples

Calling this exec module function from the cli

idem exec aws.iam.access_key.update user_name="a_user" access_key_id="ABCDEF0123456789ABCD" status="Active"

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.iam.access_key.update
    - kwargs:
        user_name: a_user
        access_key_id: ABCDEF0123456789ABCD
        status: Active
async idem_aws.exec.aws.iam.access_key.delete(hub, ctx, user_name: str, access_key_id: str) Dict[str, Any][source]#

Deletes an existing access key, does not execute if ctx[“test”] is set.

“result” is True if delete succeeded or no such key or user exists. “result” is False if there is an error deleting the key

Parameters:
  • user_name (str) – Exact user owning the key

  • access_key_id (str) – Exact access key to delete

Returns:

Status of the deletion

Return type:

dict[str, Any]

Examples

Calling this exec module function from the cli

idem exec aws.iam.access_key.delete user_name="a_user" access_key_id="ABCDEF0123456789ABCD"

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.iam.access_key.delete
    - kwargs:
        user_name: a_user
        access_key_id: ABCDEF0123456789ABCD
async idem_aws.exec.aws.iam.access_key.create(hub, ctx, user_name: str, pgp_key: str = None) Dict[str, Any][source]#

Creates a new access key for the specified user.

Parameters:
  • user_name (str) – Exact user the key will be created for.

  • pgp_key (str, Optional) – Base 64 encoded public pgp key with which we will encrypt the returned secret_access_key.

Returns:

Access key ID, Secret access key, status

Return type:

dict[str, Any]

Examples

Calling this exec module function from the cli

idem exec aws.iam.access_key.create user_name="a_user" pgp_key="-----BEGIN PGP PUBLIC KEY BLOCK-----0123456789ABCDEFxxxETC-----END PGP PUBLIC KEY BLOCK-----"

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.iam.access_key.create
    - kwargs:
        user_name: a_user
        pgp_key:
            -----BEGIN PGP PUBLIC KEY BLOCK-----
            0123456789ABCDEFxxxETC
            -----END PGP PUBLIC KEY BLOCK-----