Skip to content

Commit

Permalink
Update CDN resource docs
Browse files Browse the repository at this point in the history
  • Loading branch information
paaanic committed Dec 28, 2024
1 parent b0a5d9b commit 16e4410
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 11 deletions.
37 changes: 32 additions & 5 deletions docs/resources/cdn_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,39 @@ In addition to all arguments above, the following attributes are exported:



## Notes
## Using a Let's Encrypt certificate

### Specifying an ACL option
All ACL (Access Control List) options follow the same structure, and its meaning depends on `policy_type` value. When `policy_type`
is "allow", it means that CDN will allow access for all possible values of ACL subject except for those specified in `excepted_values` argument, and when `policy_type` is
"deny", CDN will deny access for all values of ACL subject except for values listed in `excepted_values` argument.
To issue a free [Let's Encrypt](https://letsencrypt.org/) certificate, specify "lets_encrypt" as
the value for `ssl_certificate.type` argument. The certificate will be issued after the CDN
resource is established, once the origin servers are available and DNS changes involving the
CNAME records for personal domains have propagated.

~> **Note:** The option is only available for an active CDN resource, to achieve this, set the
value of `active` argument to "true".

## Configuring ACLs

To enhance security, you can specify Access Control Lists (ACLs) options. All of the follow the
same principles: when `policy_type` is "allow", it means that CDN server will allow access for all
possible values of ACL subject except for those specified in `excepted_values` argument, and when
`policy_type` is "deny", CDN will deny access with the same logic for excepted values.

### Example Configuration

For example, to protect content from unauthorized access from certain countries, you could use
`country_acl` option:

```hcl
resource "vkcs_cdn_resource" "resource" {
...
options = {
country_acl = {
policy_type = "allow"
excepted_values = ["GB", "DE"]
}
}
...
}
## Import
Expand Down
39 changes: 33 additions & 6 deletions templates/cdn/resources/vkcs_cdn_resource.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,39 @@ description: |-

{{ .SchemaMarkdown }}

## Notes

### Specifying an ACL option
All ACL (Access Control List) options follow the same structure, and its meaning depends on `policy_type` value. When `policy_type`
is "allow", it means that CDN will allow access for all possible values of ACL subject except for those specified in `excepted_values` argument, and when `policy_type` is
"deny", CDN will deny access for all values of ACL subject except for values listed in `excepted_values` argument.
## Using a Let's Encrypt certificate

To issue a free [Let's Encrypt](https://letsencrypt.org/) certificate, specify "lets_encrypt" as
the value for `ssl_certificate.type` argument. The certificate will be issued after the CDN
resource is established, once the origin servers are available and DNS changes involving the
CNAME records for personal domains have propagated.

~> **Note:** The option is only available for an active CDN resource, to achieve this, set the
value of `active` argument to "true".

## Configuring ACLs

To enhance security, you can specify Access Control Lists (ACLs) options. All of the follow the
same principles: when `policy_type` is "allow", it means that CDN server will allow access for all
possible values of ACL subject except for those specified in `excepted_values` argument, and when
`policy_type` is "deny", CDN will deny access with the same logic for excepted values.

### Example Configuration

For example, to protect content from unauthorized access from certain countries, you could use
`country_acl` option:

```hcl
resource "vkcs_cdn_resource" "resource" {
...
options = {
country_acl = {
policy_type = "allow"
excepted_values = ["GB", "DE"]
}
}
...
}

## Import

Expand Down

0 comments on commit 16e4410

Please sign in to comment.