# 

# exoscale_iam_api_key (Resource)

Manage Exoscale [IAM](https://community.exoscale.com/documentation/iam/) API Keys.

!> **WARNING:** This resource stores sensitive information in your Terraform state. Please be sure to correctly understand implications and how to mitigate potential risks before using it.

## Example Usage

```terraform
resource "exoscale_iam_role" "my_role" {
  name = "my-role"
  description = "Example role"
  editable = true
  
  policy = {
    default_service_strategy = "deny"
    services = {
      sos = {
        type = "allow"
      }
    }
  }

}


resource "exoscale_iam_api_key" "my_api_key" {
  name = "my-api-key"
  role_id = exoscale_iam_role.my_role.id
}
```

Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) ❗ IAM API Key name.
- `role_id` (String) ❗ IAM API role ID.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `key` (String) The IAM API Key to match.
- `secret` (String, Sensitive) Secret for the IAM API Key.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.



