access_key#
- async idem_aws.states.aws.iam.access_key.present(hub, ctx, name: str, user_name: str, resource_id: str = None, status: str = 'Active', pgp_key: str = None, secret_access_key: str = None) Dict[str, Any] [source]#
Ensures an AWS key has the assigned status.
This will create a new access key for a user if no access_key_id is passed for this state, either via access_key_id or resource_id.
If a new access key is created, the secret access key will also be returned. This can optionally be encrypted with a base 64 encoded PGP public key.
- Parameters:
name (str) – An Idem name describing the resource.
user_name (str) – AWS IAM user name that the key belongs to.
resource_id (str, Optional) – AWS IAM access key ID.
status (str, Optional) – “Active” or “Inactive”; Active keys are valid for API calls. Defaults to “Active”.
pgp_key (str, Optional) – A base 64 encode PGP public key, used to encrypt the secret access key if a new key is created.
- Returns:
Dict[str, Any]
Examples
name_describing_key: aws.iam.access_key.present: - user_name: aws_user - status: Active
- async idem_aws.states.aws.iam.access_key.absent(hub, ctx, name: str, user_name: str = None, resource_id: str = None) Dict[str, Any] [source]#
Ensure the specified access key does not exist. Both user_name and resource_id must be passed in.
- Parameters:
- Returns:
Dict[str, Any]
Examples
name_describing_key: aws.iam.access_key.absent: - user_name: value - resource_id: value
- async idem_aws.states.aws.iam.access_key.describe(hub, ctx) Dict[str, Dict[str, Any]] [source]#
Describe access keys and their current status in a way that can be managed via the “present” function.
We describe all access keys for all users the logged in user can list.
- Returns:
Dict[str, Any]
Examples
$ idem describe aws.iam.access_key