# ionoscloud\_auto\_certificate

Manages a [CM AutoCertificate](https://docs.ionos.com/cloud/network-services/certificate-manager/auto-certificate/create-auto-certificate).

## Example Usage

```hcl
resource "ionoscloud_auto_certificate_provider" "example" {
  name = "Let's Encrypt"
  email = "user@ionos.com"
  location = "de/fra"
  server = "https://acme-v02.api.letsencrypt.org/directory"
  external_account_binding {
    key_id = "some-key-id"
    key_secret = "secret"
  }
}

resource "ionoscloud_auto_certificate" "example" {
  provider_id = ionoscloud_auto_certificate_provider.example.id
  common_name = "www.example.com"
  location = ionoscloud_auto_certificate_provider.example.location
  key_algorithm = "rsa4096"
  name = "My Auto renewed certificate"
  subject_alternative_names = ["app.example.com"]
}
```

## Argument reference

* `provider_id` - (Required)\[string] The certificate provider used to issue the certificates.
* `location` - (Required)\[string] The location of the auto-certificate. Available locations: `de/fra`, `de/fra/2`.
* `common_name` - (Required)\[string] The common name (DNS) of the certificate to issue. The common name needs to be part of a zone in IONOS CLOUD DNS.
* `key_algorithm` - (Required)\[string] The key algorithm used to generate the certificate.
* `name` - (Required)\[string] A certificate name used for management purposes.
* `subject_alternative_names` - (Optional)\[list]\[string] Optional additional names to be added to the issued certificate. The additional names needs to be part of a zone in IONOS CLOUD DNS.
* `last_issued_certificate_id` - (Computed)\[string] The ID of the last certificate that was issued.

## Import

The resource can be imported using the `auto_certificate_id` and the `location`, separated by `:`, e.g.

```shell
terraform import ionoscloud_auto_certificate.example location:auto_certificate_id
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/terraform-provider/resources/certificate_manager_auto_certificate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
