-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
22 changed files
with
1,884 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
```release-note:new-resource | ||
`resource/cloudavenue_s3_bucket_website_configuration`- Allow to configure website on your S3 Bucket. | ||
``` | ||
|
||
```release-note:new-data-source | ||
`datasource/cloudavenue_s3_bucket_website_configuration`- Allow to read website configuration on your S3 Bucket. | ||
``` | ||
|
||
```release-note:dependency | ||
deps: bumps github.com/FrangipaneTeam/terraform-plugin-framework-superschema from 1.6.0 to 1.6.1 | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
page_title: "cloudavenue_s3_bucket_website_configuration Data Source - cloudavenue" | ||
subcategory: "S3 (Object Storage)" | ||
description: |- | ||
The cloudavenue_s3_bucket_website_configuration data source allows you to retrieve information about a configuration of static websites content. For more information https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html | ||
--- | ||
|
||
# cloudavenue_s3_bucket_website_configuration (Data Source) | ||
|
||
The `cloudavenue_s3_bucket_website_configuration` data source allows you to retrieve information about a configuration of static websites content. [For more information](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html) | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `bucket` (String) The name of the bucket. | ||
|
||
### Optional | ||
|
||
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) | ||
|
||
### Read-Only | ||
|
||
- `error_document` (Attributes) The name of the error document for the website. (see [below for nested schema](#nestedatt--error_document)) | ||
- `id` (String) The ID of the bucket website. This is the same as the bucket name. | ||
- `index_document` (Attributes) The name of the index document. (see [below for nested schema](#nestedatt--index_document)) | ||
- `redirect_all_requests_to` (Attributes) Redirect behavior for every request to this bucket's website endpoint. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#redirect_all_requests_to). (see [below for nested schema](#nestedatt--redirect_all_requests_to)) | ||
- `routing_rules` (Attributes Set) Rules that define when a redirect is applied and the redirect behavior. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#routing_rule). (see [below for nested schema](#nestedatt--routing_rules)) | ||
- `website_endpoint` (String) The website endpoint. | ||
|
||
<a id="nestedatt--timeouts"></a> | ||
### Nested Schema for `timeouts` | ||
|
||
Optional: | ||
|
||
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). | ||
|
||
|
||
<a id="nestedatt--error_document"></a> | ||
### Nested Schema for `error_document` | ||
|
||
Read-Only: | ||
|
||
- `key` (String) The key of the error document. | ||
|
||
|
||
<a id="nestedatt--index_document"></a> | ||
### Nested Schema for `index_document` | ||
|
||
Read-Only: | ||
|
||
- `suffix` (String) The suffix of the index document. | ||
|
||
|
||
<a id="nestedatt--redirect_all_requests_to"></a> | ||
### Nested Schema for `redirect_all_requests_to` | ||
|
||
Read-Only: | ||
|
||
- `hostname` (String) Name of the host where requests will be redirected. | ||
- `protocol` (String) Protocol to use when redirecting requests. The default is the protocol that is used in the original request. | ||
|
||
|
||
<a id="nestedatt--routing_rules"></a> | ||
### Nested Schema for `routing_rules` | ||
|
||
Read-Only: | ||
|
||
- `condition` (Attributes) Configuration block for describing a condition that must be met for the specified redirect to apply. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#condition). (see [below for nested schema](#nestedatt--routing_rules--condition)) | ||
- `redirect` (Attributes) Configuration block for redirecting all requests to another host instead of the original host. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#redirect). (see [below for nested schema](#nestedatt--routing_rules--redirect)) | ||
|
||
<a id="nestedatt--routing_rules--condition"></a> | ||
### Nested Schema for `routing_rules.condition` | ||
|
||
Read-Only: | ||
|
||
- `http_error_code_returned_equals` (String) The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element `key_prefix_equals` is specified and parent element `http_redirect` is not. | ||
- `key_prefix_equals` (String) The object key name prefix when the redirect is applied. For example, to redirect requests for `ExamplePage.html`, the key prefix will be `ExamplePage.html`. To redirect request for all pages with the prefix `docs/`, the key prefix will be `docs`, which identifies all objects in the docs/ folder. | ||
|
||
|
||
<a id="nestedatt--routing_rules--redirect"></a> | ||
### Nested Schema for `routing_rules.redirect` | ||
|
||
Read-Only: | ||
|
||
- `hostname` (String) Name of the host where requests will be redirected. | ||
- `http_redirect_code` (String) HTTP redirect code to use on the response. | ||
- `protocol` (String) Protocol to use when redirecting requests. The default is the protocol that is used in the original request. | ||
- `replace_key_prefix_with` (String) . | ||
- `replace_key_with` (String) . | ||
|
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,183 @@ | ||
--- | ||
page_title: "cloudavenue_s3_bucket_website_configuration Resource - cloudavenue" | ||
subcategory: "S3 (Object Storage)" | ||
description: |- | ||
The cloudavenue_s3_bucket_website_configuration resource allows you to manage a configuration to host static websites content. For more information https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html | ||
--- | ||
|
||
# cloudavenue_s3_bucket_website_configuration (Resource) | ||
|
||
The `cloudavenue_s3_bucket_website_configuration` resource allows you to manage a configuration to host static websites content. [For more information](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html) | ||
|
||
## Examples Usage | ||
|
||
### Simple routing rule | ||
|
||
```hcl | ||
resource "cloudavenue_s3_bucket_website_configuration" "example" { | ||
bucket = cloudavenue_s3_bucket.example.name | ||
index_document = { | ||
suffix = "index.html" | ||
} | ||
error_document = { | ||
key = "error.html" | ||
} | ||
routing_rules = [{ | ||
condition = { | ||
key_prefix_equals = "docs/" | ||
} | ||
redirect = { | ||
replace_key_prefix_with = "documents/" | ||
} | ||
}] | ||
} | ||
``` | ||
|
||
### Multiple routing rules | ||
|
||
```hcl | ||
resource "cloudavenue_s3_bucket_website_configuration" "example" { | ||
bucket = cloudavenue_s3_bucket.example.name | ||
index_document = { | ||
suffix = "home.html" | ||
} | ||
error_document = { | ||
key = "errors.html" | ||
} | ||
routing_rules = [{ | ||
condition = { | ||
key_prefix_equals = "img/" | ||
} | ||
redirect = { | ||
replace_key_prefix_with = "imgs/" | ||
hostname = "www.example.com" | ||
http_redirect_code = "302" | ||
protocol = "https" | ||
} | ||
}, | ||
{ | ||
condition = { | ||
http_error_code_returned_equals = "404" | ||
} | ||
redirect = { | ||
replace_key_with = "errors.html" | ||
hostname = "www.example.com" | ||
http_redirect_code = "301" | ||
protocol = "https" | ||
} | ||
}] | ||
} | ||
``` | ||
|
||
### Redirect all requests to a specific hostname | ||
|
||
```hcl | ||
resource "cloudavenue_s3_bucket_website_configuration" "example" { | ||
bucket = cloudavenue_s3_bucket.example.name | ||
redirect_all_requests_to = { | ||
hostname = "example.com" | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `bucket` (String) (ForceNew) The name of the bucket. | ||
|
||
### Optional | ||
|
||
- `error_document` (Attributes) The name of the error document for the website. (see [below for nested schema](#nestedatt--error_document)) | ||
- `index_document` (Attributes) The name of the index document. (see [below for nested schema](#nestedatt--index_document)) | ||
- `redirect_all_requests_to` (Attributes) Redirect behavior for every request to this bucket's website endpoint. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#redirect_all_requests_to). Ensure that if an attribute is set, these are not set: "[index_document,error_document,routing_rules]". (see [below for nested schema](#nestedatt--redirect_all_requests_to)) | ||
- `routing_rules` (Attributes Set) Rules that define when a redirect is applied and the redirect behavior. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#routing_rule). Ensure that if an attribute is set, these are not set: "[redirect_all_requests_to]". (see [below for nested schema](#nestedatt--routing_rules)) | ||
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the bucket website. This is the same as the bucket name. | ||
- `website_endpoint` (String) The website endpoint. | ||
|
||
<a id="nestedatt--error_document"></a> | ||
### Nested Schema for `error_document` | ||
|
||
Required: | ||
|
||
- `key` (String) The key of the error document. Ensure that if an attribute is set, these are not set: "[redirect_all_requests_to]". | ||
|
||
|
||
<a id="nestedatt--index_document"></a> | ||
### Nested Schema for `index_document` | ||
|
||
Required: | ||
|
||
- `suffix` (String) The suffix of the index document. Ensure that if an attribute is set, these are not set: "[redirect_all_requests_to]". | ||
|
||
|
||
<a id="nestedatt--redirect_all_requests_to"></a> | ||
### Nested Schema for `redirect_all_requests_to` | ||
|
||
Required: | ||
|
||
- `hostname` (String) Name of the host where requests will be redirected. | ||
|
||
Optional: | ||
|
||
- `protocol` (String) Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Value must be one of : `http`, `https`. | ||
|
||
|
||
<a id="nestedatt--routing_rules"></a> | ||
### Nested Schema for `routing_rules` | ||
|
||
Required: | ||
|
||
- `redirect` (Attributes) Configuration block for redirecting all requests to another host instead of the original host. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#redirect). (see [below for nested schema](#nestedatt--routing_rules--redirect)) | ||
|
||
Optional: | ||
|
||
- `condition` (Attributes) Configuration block for describing a condition that must be met for the specified redirect to apply. [For more information](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration#condition). (see [below for nested schema](#nestedatt--routing_rules--condition)) | ||
|
||
<a id="nestedatt--routing_rules--redirect"></a> | ||
### Nested Schema for `routing_rules.redirect` | ||
|
||
Optional: | ||
|
||
- `hostname` (String) Name of the host where requests will be redirected. | ||
- `http_redirect_code` (String) HTTP redirect code to use on the response. Value must be one of : `301`, `302`. | ||
- `protocol` (String) Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Value must be one of : `http`, `https`. | ||
- `replace_key_prefix_with` (String) . | ||
- `replace_key_with` (String) . Ensure that if an attribute is set, these are not set: "[<.replace_key_prefix_with]". | ||
|
||
|
||
<a id="nestedatt--routing_rules--condition"></a> | ||
### Nested Schema for `routing_rules.condition` | ||
|
||
Optional: | ||
|
||
- `http_error_code_returned_equals` (String) The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element `key_prefix_equals` is specified and parent element `http_redirect` is not. Ensure that if an attribute is set, these are not set: "[redirect_all_requests_to]". | ||
- `key_prefix_equals` (String) The object key name prefix when the redirect is applied. For example, to redirect requests for `ExamplePage.html`, the key prefix will be `ExamplePage.html`. To redirect request for all pages with the prefix `docs/`, the key prefix will be `docs`, which identifies all objects in the docs/ folder. Ensure that if an attribute is set, these are not set: "[redirect_all_requests_to]". | ||
|
||
|
||
|
||
<a id="nestedatt--timeouts"></a> | ||
### Nested Schema for `timeouts` | ||
|
||
Optional: | ||
|
||
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). | ||
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. | ||
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. | ||
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
```shell | ||
terraform import cloudavenue_s3_bucket_website_configuration.example bucket-name | ||
``` |
3 changes: 3 additions & 0 deletions
3
examples/data-sources/cloudavenue_s3_bucket_versioning_configuration copy/data-source.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,3 @@ | ||
data "cloudavenue_s3_bucket_website_configuration" "example" { | ||
bucket = cloudavenue_s3_bucket.example.name | ||
} |
1 change: 1 addition & 0 deletions
1
examples/resources/cloudavenue_s3_bucket_website_configuration/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 cloudavenue_s3_bucket_website_configuration.example bucket-name |
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
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
Oops, something went wrong.