terraform-provider-stackitp.../docs/resources/cdn_distribution.md
Politano 6f33262e8c
feat: implement image optimizer in cdn service (#895)
* implement image optimizer in cdn service

* add documentation

* add optimizer in cdn acc test

* add example

---------

Co-authored-by: Matheus Politano <matheus.correia_politano@mail.schwarz>
Co-authored-by: Marcel Jacek <72880145+marceljk@users.noreply.github.com>
2025-07-15 09:05:19 +02:00

94 lines
3.3 KiB
Markdown

---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_cdn_distribution Resource - stackit"
subcategory: ""
description: |-
CDN distribution data source schema.
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
---
# stackit_cdn_distribution (Resource)
CDN distribution data source schema.
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
## Example Usage
```terraform
resource "stackit_cdn_distribution" "example_distribution" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
config = {
backend = {
type = "http"
origin_url = "mybackend.onstackit.cloud"
}
regions = ["EU", "US", "ASIA", "AF", "SA"]
optimizer = {
enabled = true
}
}
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `config` (Attributes) The distribution configuration (see [below for nested schema](#nestedatt--config))
- `project_id` (String) STACKIT project ID associated with the distribution
### Read-Only
- `created_at` (String) Time when the distribution was created
- `distribution_id` (String) CDN distribution ID
- `domains` (Attributes List) List of configured domains for the distribution (see [below for nested schema](#nestedatt--domains))
- `errors` (List of String) List of distribution errors
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`distribution_id`".
- `status` (String) Status of the distribution
- `updated_at` (String) Time when the distribution was last updated
<a id="nestedatt--config"></a>
### Nested Schema for `config`
Required:
- `backend` (Attributes) The configured backend for the distribution (see [below for nested schema](#nestedatt--config--backend))
- `regions` (List of String) The configured regions where content will be hosted
Optional:
- `optimizer` (Attributes) Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience. (see [below for nested schema](#nestedatt--config--optimizer))
<a id="nestedatt--config--backend"></a>
### Nested Schema for `config.backend`
Required:
- `origin_url` (String) The configured backend type for the distribution
- `type` (String) The configured backend type. Supported values are: `http`.
Optional:
- `origin_request_headers` (Map of String) The configured origin request headers for the backend
<a id="nestedatt--config--optimizer"></a>
### Nested Schema for `config.optimizer`
Optional:
- `enabled` (Boolean)
<a id="nestedatt--domains"></a>
### Nested Schema for `domains`
Read-Only:
- `errors` (List of String) List of domain errors
- `name` (String) The name of the domain
- `status` (String) The status of the domain
- `type` (String) The type of the domain. Each distribution has one domain of type "managed", and domains of type "custom" may be additionally created by the user