user_ssh_key#

State module for managing IAM User SSH Keys.

async idem_aws.states.aws.iam.user_ssh_key.present(hub, ctx, name: str, user_name: str, ssh_public_key_body: str, resource_id: str = None, status: str = None) Dict[str, Any][source]#

Uploads an SSH public key and associates it with the specified IAM user.

The SSH public key uploaded by this operation can be used only for authenticating the associated IAM user to an CodeCommit repository.

Parameters:
  • name (str) – A name of the ssh public key to be added/modified.

  • user_name (str) – The name (friendly name, not ARN) of the IAM user to associate the SSH public key with. 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: _+=,.@-

  • ssh_public_key_body (str) – The SSH public key. The public key must be encoded in ssh-rsa format or PEM format. The minimum bit-length of the public key is 2048 bits. For example, you can generate a 2048-bit key, and the resulting PEM file is 1679 bytes long.

  • resource_id (str, Optional) – The Id of the ssh public key to be added/modified.

  • status (str, Optional) – The status of the SSH public key. The value can be ‘Acitve’ or ‘Inactive’. Defaults ‘Active’.

Request Syntax:
[iam-user-ssh-key-name]:
  aws.iam.user_ssh_key.present:
    - user_name: 'string'
    - ssh_public_key_body: 'string'
    - resource_id: 'string'
    - status: 'string'
Returns:

Dict[str, Any]

Examples

APKASYLXZO1EQCR0ZAL7:
  aws.iam.user_ssh_key.present:
    - user_name:  my-iam-user-1
    - ssh_public_key_body: ssh-rsa AAAB3adeaadasdamasdasdasdsadsdasdadasda8ad800q3q3=
    - resource_id: my-iam-user-id
    - status: Active
async idem_aws.states.aws.iam.user_ssh_key.absent(hub, ctx, name: str, user_name: str = None, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified SSH public key.

The SSH public key deleted by this operation is used only for authenticatingthe associated IAM user to an CodeCommit repository.

Parameters:
  • name (str) – The name of the ssh public key to be deleted.

  • user_name (str, Optional) – The name (friendly name, not ARN) of the IAM user to delete the ssh public key from.

  • resource_id (str, Optional) – The ID of the ssh public key to be deleted.

Request Syntax:
[iam-user-ssh-key-id]:
  aws.iam.user_ssh_key.absent:
    - name: 'string'
    - user_name: 'string'
    - resource_id: 'string'
Returns:

Dict[str, Any]

Examples

APKASYLXZO1EQCR0ZAL7:
  aws.iam.user_ssh_key.absent:
    - user_name:  my-iam-user-1
    - name: APKASYLXZO1EQCR0ZAL7
    - resource_id: APKASYLXZO1EQCR0ZAL7
async idem_aws.states.aws.iam.user_ssh_key.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function

Lists all ssh public keys of all IAM users.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.iam.user_ssh_key