-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c94fee1
commit 841e977
Showing
7 changed files
with
256 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
examples/resources/baiducloud_abroad_cdn_domain_config_cache/import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import baiducloud_abroad_cdn_domain_config_cache.example example1.domain.com |
28 changes: 28 additions & 0 deletions
28
examples/resources/baiducloud_abroad_cdn_domain_config_cache/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
resource "baiducloud_abroad_cdn_domain" "default" { | ||
domain = "test.cdn.com" | ||
|
||
origin { | ||
backup = false | ||
type = "IP" | ||
addr = "1.2.3.4" | ||
} | ||
tags = { | ||
terraform = "terraform-test2" | ||
} | ||
} | ||
|
||
resource "baiducloud_abroad_cdn_domain_config_cache" "example" { | ||
domain = baiducloud_abroad_cdn_domain.default.domain | ||
cache_ttl { | ||
type = "suffix" | ||
value = ".png" | ||
ttl = 36000 | ||
weight = 30 | ||
} | ||
cache_ttl { | ||
type = "path" | ||
value = "/to/my/file" | ||
ttl = 1800 | ||
weight = 5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "baiducloud_abroad_cdn_domain_config_cache Resource - terraform-provider-baiducloud" | ||
subcategory: "Content Delivery Network (CDN) (abroad version)" | ||
description: |- | ||
Use this resource to manage cache-related configuration of the abroad acceleration domain. | ||
More information can be found in the Developer Guide https://cloud.baidu.com/doc/CDN-ABROAD/s/Zkbstm0vg. | ||
~> NOTE: Creating a resource will overwrite current cache-related configuration. Deleting a resource won't change current configuration. | ||
--- | ||
|
||
# baiducloud_abroad_cdn_domain_config_cache (Resource) | ||
|
||
Use this resource to manage cache-related configuration of the abroad acceleration domain. | ||
|
||
More information can be found in the [Developer Guide](https://cloud.baidu.com/doc/CDN-ABROAD/s/Zkbstm0vg). | ||
|
||
~> **NOTE:** Creating a resource will overwrite current cache-related configuration. Deleting a resource won't change current configuration. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "baiducloud_abroad_cdn_domain" "default" { | ||
domain = "test.cdn.com" | ||
origin { | ||
backup = false | ||
type = "IP" | ||
addr = "1.2.3.4" | ||
} | ||
tags = { | ||
terraform = "terraform-test2" | ||
} | ||
} | ||
resource "baiducloud_abroad_cdn_domain_config_cache" "example" { | ||
domain = baiducloud_abroad_cdn_domain.default.domain | ||
cache_ttl { | ||
type = "suffix" | ||
value = ".png" | ||
ttl = 36000 | ||
weight = 30 | ||
} | ||
cache_ttl { | ||
type = "path" | ||
value = "/to/my/file" | ||
ttl = 1800 | ||
weight = 5 | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `domain` (String) Name of the abroad acceleration domain. | ||
|
||
### Optional | ||
|
||
- `cache_full_url` (Boolean) Whether caching of full url is enabled. Defaults to `true` | ||
- `cache_ttl` (Block Set) Cache expiration rules of the abroad acceleration domain. (see [below for nested schema](#nestedblock--cache_ttl)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--cache_ttl"></a> | ||
### Nested Schema for `cache_ttl` | ||
|
||
Required: | ||
|
||
- `ttl` (Number) Cache duration in seconds. | ||
- `type` (String) Cache rule type. Valid values: `suffix`(file name suffix), `path`(directory in the url), `origin`(origin server rule. There is only one such rule, and only `weight` is required. Set `value` to `-`, `ttl` to `0`), `exactPath`(path is completely matched). | ||
- `value` (String) Configuration rule for the specified type. | ||
|
||
Optional: | ||
|
||
- `override_origin` (Boolean) Whether to override the origin site’s caching rules. Defaults to `true` | ||
- `weight` (Number) The origin server weight. Must be between `0` and `100`. Defaults to `0`. The higher the weight, the higher the priority. No effect when `type` is `code`. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import baiducloud_abroad_cdn_domain_config_cache.example example1.domain.com | ||
``` |
Oops, something went wrong.