# S3 Key

## s3key

This is a simple module that supports creating or removing S3Keys.

### Example Syntax

```yaml

name: Create an s3key
ionoscloudsdk.ionoscloud.s3key:
  user: ''
register: s3key_create_result


name: Update an s3key no change
ionoscloudsdk.ionoscloud.s3key:
  user: ''
  key_id: ''
  active: true
  state: update
register: s3key_update_nochange_result


name: Remove an s3key 1
ionoscloudsdk.ionoscloud.s3key:
  user: ''
  key_id: ''
  state: absent

```

&#x20; &#x20;

### Returned object

```json
{
    "changed": true,
    "failed": false,
    "action": "create",
    "s3key": {
        "href": "https://api.ionos.com/cloudapi/v6/um/users/<USER_ID>/s3keys/<ID>",
        "id": "<ID>",
        "metadata": {
            "created_date": "2023-05-31T13:49:52",
            "etag": "26c5aad97d5bb95cc0c1ed99addde9fe"
        },
        "properties": {
            "active": true,
            "secret_key": "<SECRET_KEY>"
        },
        "type": "s3key"
    }
}

```

#### For more examples please check out the tests [here](https://github.com/ionos-cloud/module-ansible/tree/master/tests/user-management).

&#x20;

&#x20;

## state: **present**

```yaml
  
name: Create an s3key
ionoscloudsdk.ionoscloud.s3key:
  user: ''
register: s3key_create_result

```

#### Available parameters for state **present**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>active<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Denotes weather the Object storage key is active.</td></tr><tr><td>user<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or email of the user</td></tr><tr><td>key_id<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The ID of the S3 key.</td></tr><tr><td>idempotency<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Flag that dictates respecting idempotency. If an s3key already exists, returns with already existing key instead of creating more.<br>Default: False<br>Options: [True, False]</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **absent**

```yaml
  
name: Remove an s3key 1
ionoscloudsdk.ionoscloud.s3key:
  user: ''
  key_id: ''
  state: absent

```

#### Available parameters for state **absent**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>user<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or email of the user</td></tr><tr><td>key_id<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID of the S3 key.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **update**

```yaml
  
name: Update an s3key no change
ionoscloudsdk.ionoscloud.s3key:
  user: ''
  key_id: ''
  active: true
  state: update
register: s3key_update_nochange_result

```

#### Available parameters for state **update**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>active<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Denotes weather the Object storage key is active.</td></tr><tr><td>user<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or email of the user</td></tr><tr><td>key_id<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID of the S3 key.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update']</td></tr></tbody></table>

&#x20;

&#x20;
