Feature: CDN distribution resource and data source (#786)
* add datasource * finish data source * implement resource * add unit tests * add examples * acceptance test * review comments * review comments 2 --------- Co-authored-by: Malte Ehrlen <malte.ehrlen@freiheit.com>
This commit is contained in:
parent
3c20b7743f
commit
855d3040ef
14 changed files with 1520 additions and 0 deletions
70
docs/data-sources/cdn_distribution.md
Normal file
70
docs/data-sources/cdn_distribution.md
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_cdn_distribution Data Source - 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 (Data Source)
|
||||
|
||||
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
|
||||
data "stackit_cdn_distribution" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `distribution_id` (String) STACKIT project ID associated with the distribution
|
||||
- `project_id` (String) STACKIT project ID associated with the distribution
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `config` (Attributes) The distribution configuration (see [below for nested schema](#nestedatt--config))
|
||||
- `created_at` (String) Time when the distribution was created
|
||||
- `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`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `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
|
||||
|
||||
<a id="nestedatt--config--backend"></a>
|
||||
### Nested Schema for `config.backend`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `origin_request_headers` (Map of String) The configured origin request headers for the backend
|
||||
- `origin_url` (String) The configured backend type for the distribution
|
||||
- `type` (String) The configured backend type
|
||||
|
||||
|
||||
|
||||
<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
|
||||
|
|
@ -153,6 +153,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
|
|||
|
||||
- `argus_custom_endpoint` (String, Deprecated) Custom endpoint for the Argus service
|
||||
- `authorization_custom_endpoint` (String) Custom endpoint for the Membership service
|
||||
- `cdn_custom_endpoint` (String) Custom endpoint for the CDN service
|
||||
- `credentials_path` (String) Path of JSON from where the credentials are read. Takes precedence over the env var `STACKIT_CREDENTIALS_PATH`. Default value is `~/.stackit/credentials.json`.
|
||||
- `default_region` (String) Region will be used as the default location for regional services. Not all services require a region, some are global
|
||||
- `dns_custom_endpoint` (String) Custom endpoint for the DNS service
|
||||
|
|
|
|||
80
docs/resources/cdn_distribution.md
Normal file
80
docs/resources/cdn_distribution.md
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
---
|
||||
# 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
|
||||
# Create a CDN distribution
|
||||
resource "stackit_cdn_distribution" "example_distribution" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
config = {
|
||||
backend = {
|
||||
type = "http"
|
||||
origin_url = "mybackend.onstackit.cloud"
|
||||
}
|
||||
regions = ["EN", "US", "ASIA", "AF", "SA"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- 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) STACKIT project ID associated with the distribution
|
||||
- `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
|
||||
|
||||
<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
|
||||
|
||||
Optional:
|
||||
|
||||
- `origin_request_headers` (Map of String) The configured origin request headers for the backend
|
||||
|
||||
|
||||
|
||||
<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
|
||||
Loading…
Add table
Add a link
Reference in a new issue