Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(obs): fix docs issues #1025

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions docs/data-sources/s3_bucket_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,50 @@ data "flexibleengine_s3_bucket_object" "b" {

The following arguments are supported:

* `bucket` - (Required) The name of the bucket to read the object from
* `key` - (Required) The full path to the object inside the bucket
* `range` - (Optional) Obtains the specified range bytes of an object. The value is a range starting from 0 to
* `bucket` - (Required, String) The name of the bucket to read the object from.

* `key` - (Required, String) The full path to the object inside the bucket.

* `range` - (Optional, String) Obtains the specified range bytes of an object. The value is a range starting from 0 to
maximum object length minus one. If the range is invalid, all object data is returned.
* `version_id` - (Optional) Specific version ID of the object returned (defaults to latest version)

## Attributes Reference
* `version_id` - (Optional, String) Specific version ID of the object returned (defaults to latest version).

## Attribute Reference

The following attributes are exported:

* `body` - Object data (see **limitations above** to understand cases in which this field is actually available)
* `body` - Object data (see **limitations above** to understand cases in which this field is actually available).

* `cache_control` - Specifies caching behavior along the request/reply chain.

* `content_disposition` - Specifies presentational information for the object.
* `content_encoding` - Specifies what content encodings have been applied to the object and thus what decoding mechanisms
must be applied to obtain the media-type referenced by the Content-Type header field.

* `content_encoding` - Specifies what content encodings have been applied to the object and thus what decoding
mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

* `content_language` - The language the content is in.

* `content_length` - Size of the body in bytes.

* `content_type` - A standard MIME type describing the format of the object data.

* `etag` - [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) generated for the object
(an MD5 sum of the object content in case it's not encrypted)
(an MD5 sum of the object content in case it's not encrypted).

* `expiration` - If the object expiration is configured, the field includes this header. It includes the expiry-date and
rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

* `expires` - The date and time at which the object is no longer cacheable.
* `last_modified` - Last modified date of the object in RFC1123 format (e.g. `Mon, 02 Jan 2006 15:04:05 MST`)
* `metadata` - A map of metadata stored with the object in S3
* `server_side_encryption` - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key),
this field includes the chosen encryption and algorithm used.

* `last_modified` - Last modified date of the object in RFC1123 format (e.g. `Mon, 02 Jan 2006 15:04:05 MST`).
* `metadata` - A map of metadata stored with the object in S3.

* `server_side_encryption` - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption
key), this field includes the chosen encryption and algorithm used.

* `sse_kms_key_id` - If present, specifies the ID of the Key Management Service (KMS) master encryption key that
was used for the object.

* `website_redirect_location` - If the bucket is configured as a website, redirects requests for this object to
another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
155 changes: 86 additions & 69 deletions docs/resources/obs_bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ resource "flexibleengine_obs_bucket" "bucket" {

The following arguments are supported:

* `bucket` - (Required) Specifies the name of the bucket. Changing this parameter will create a new resource.
A bucket must be named according to the globally applied DNS naming regulations as follows:
* `region` - (Optional, String, ForceNew) Specifies the region in which to create the bucket resource.
If omitted, the provider-level region will be used. Changing this will create a new bucket resource.

* `bucket` - (Required, String, ForceNew) Specifies the name of the bucket. Changing this parameter will create a new
resource. A bucket must be named according to the globally applied DNS naming regulations as follows:
+ The name must be globally unique in OBS.
+ The name must contain 3 to 63 characters. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.
+ The name cannot start or end with a period (.) or hyphen (-), and cannot contain two consecutive periods (.) or
Expand All @@ -151,58 +154,62 @@ The following arguments are supported:
+ If the name contains any periods (.), a security certificate verification message may appear when you access
the bucket or its objects by entering a domain name.

* `storage_class` - (Optional) Specifies the storage class of the bucket. OBS provides three storage classes:
"STANDARD", "STANDARD_IA" (Infrequent Access) and "GLACIER" (Archive). Defaults to `STANDARD`.
* `storage_class` - (Optional, String) Specifies the storage class of the bucket. OBS provides three storage classes:
"STANDARD", "STANDARD_IA" (Infrequent Access) and "GLACIER" (Archive). Defaults to `STANDARD`.

* `acl` - (Optional) Specifies the ACL policy for a bucket. The predefined common policies are as follows:
"private", "public-read", "public-read-write" and "log-delivery-write". Defaults to `private`.
* `acl` - (Optional, String) Specifies the ACL policy for a bucket. The predefined common policies are as follows:
"private", "public-read", "public-read-write" and "log-delivery-write". Defaults to `private`.

* `versioning` - (Optional) Whether enable versioning. Once you version-enable a bucket,
* `versioning` - (Optional, Bool) Whether enable versioning. Once you version-enable a bucket,
it can never return to an unversioned state. You can, however, suspend versioning on that bucket.

* `encryption` - (Optional) Whether enable default server-side encryption of the bucket in SSE-KMS mode.
* `encryption` - (Optional, Bool) Whether enable default server-side encryption of the bucket in SSE-KMS mode.

* `kms_key_id` - (Optional, String) Specifies the ID of a kms key. If omitted, the default master key will be used.

* `logging` - (Optional, List) A settings of bucket logging. The [logging](#obs_logging) object structure is documented
below.

* `kms_key_id` - (Optional) Specifies the ID of a kms key. If omitted, the default master key will be used.
* `website` - (Optional, List) A website object. The [website](#obs_website) object structure is documented below.

* `logging` - (Optional) A settings of bucket logging (documented below).
* `website` - (Optional) A website object (documented below).
* `cors_rule` - (Optional) A rule of Cross-Origin Resource Sharing (documented below).
* `lifecycle_rule` - (Optional) A configuration of object lifecycle management (documented below).
* `cors_rule` - (Optional, List) A rule of Cross-Origin Resource Sharing. The [cors_rule](#obs_cors_rule) object
structure is documented below.

* `force_destroy` - (Optional) A boolean that indicates all objects should be deleted from the bucket so that
the bucket can be destroyed without error. Default to `false`.
* `lifecycle_rule` - (Optional, List) A configuration of object lifecycle management. The [lifecycle_rule](#obs_lifecycle_rule)
object structure is documented below.

* `multi_az` - (Optional) Whether enable the multi-AZ mode for the bucket. When the multi-AZ mode is enabled,
data in the bucket is duplicated and stored in multiple AZs.
Changing this creates a new bucket.
* `force_destroy` - (Optional, Bool) A boolean that indicates all objects should be deleted from the bucket so that
the bucket can be destroyed without error. Default to `false`.

* `multi_az` - (Optional, Bool, ForceNew) Whether enable the multi-AZ mode for the bucket. When the multi-AZ mode is
enabled, data in the bucket is duplicated and stored in multiple AZs. Changing this creates a new bucket.

* `parallel_fs` - (Optional, Bool, ForceNew) Whether enable a bucket as a parallel file system. Changing this will
create a new bucket.

* `region` - (Optional) If specified, the region this bucket should reside in. Otherwise, the region used by the provider.
Changing this creates a new bucket.

The `logging` object supports the following:
<a name="obs_logging"></a>
The `logging` object supports:

* `target_bucket` - (Required) The name of the bucket that will receive the log objects.
* `target_bucket` - (Required, String) The name of the bucket that will receive the log objects.
The acl policy of the target bucket should be `log-delivery-write`.
* `target_prefix` - (Optional) To specify a key prefix for log objects.
* `target_prefix` - (Optional, String) To specify a key prefix for log objects.

The `website` object supports the following:
<a name="obs_website"></a>
The `website` object supports:

* `index_document` - (Required, unless using `redirect_all_requests_to`) Specifies the default homepage of
the static website, only HTML web pages are supported.
* `index_document` - (Required, String) Specifies the default homepage of the static website, only HTML web pages are
supported. It is **Optional** if using `redirect_all_requests_to`.
OBS only allows files such as `index.html` in the root directory of a bucket to function as the default homepage.
That is to say, do not set the default homepage with a multi-level directory structure (for example, /page/index.html).

* `error_document` - (Optional) Specifies the error page returned when an error occurs during static website access.
Only HTML, JPG, PNG, BMP, and WEBP files under the root directory are supported.
* `error_document` - (Optional, String) Specifies the error page returned when an error occurs during static website
access. Only HTML, JPG, PNG, BMP, and WEBP files under the root directory are supported.

* `redirect_all_requests_to` - (Optional) A hostname to redirect all website requests for this bucket to.
* `redirect_all_requests_to` - (Optional, String) A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (`http://` or `https://`) to use when redirecting requests.
The default is the protocol that is used in the original request.

* `routing_rules` - (Optional) A JSON or XML format containing routing rules describing redirect behavior and
* `routing_rules` - (Optional, String) A JSON or XML format containing routing rules describing redirect behavior and
when redirects are applied.
Each rule contains a `Condition` and a `Redirect` as shown in the following table:

Expand All @@ -211,78 +218,88 @@ The `website` object supports the following:
Condition | KeyPrefixEquals, HttpErrorCodeReturnedEquals
Redirect | Protocol, HostName, ReplaceKeyPrefixWith, ReplaceKeyWith, HttpRedirectCode

The `cors_rule` object supports the following:
<a name="obs_cors_rule"></a>
The `cors_rule` object supports:

* `allowed_origins` (Required) Requests from this origin can access the bucket. Multiple matching rules are allowed.
One rule occupies one line, and allows one wildcard character (*) at most.
* `allowed_origins` (Required, List) Requests from this origin can access the bucket. Multiple matching rules are
allowed. One rule occupies one line, and allows one wildcard character (*) at most.

* `allowed_methods` (Required) Specifies the acceptable operation type of buckets and objects.
* `allowed_methods` (Required, List) Specifies the acceptable operation type of buckets and objects.
The methods include `GET`, `PUT`, `POST`, `DELETE` or `HEAD`.

* `allowed_headers` (Optional) Specifies the allowed header of cross-origin requests.
* `allowed_headers` (Optional, List) Specifies the allowed header of cross-origin requests.
Only CORS requests matching the allowed header are valid.

* `expose_headers` (Optional) Specifies the exposed header in CORS responses, providing additional information for clients.
* `expose_headers` (Optional, List) Specifies the exposed header in CORS responses, providing additional information
for clients.

* `max_age_seconds` (Optional) Specifies the duration that your browser can cache CORS responses, expressed in seconds.
The default value is 100.
* `max_age_seconds` (Optional, Int) Specifies the duration that your browser can cache CORS responses, expressed in
seconds. The default value is 100.

The `lifecycle_rule` object supports the following:
<a name="obs_lifecycle_rule"></a>
The `lifecycle_rule` object supports:

* `name` - (Required) Unique identifier for lifecycle rules. The Rule Name contains a maximum of 255 characters.
* `name` - (Required, String) Unique identifier for lifecycle rules. The Rule Name contains a maximum of 255 characters.

* `enabled` - (Required) Specifies lifecycle rule status.
* `enabled` - (Required, Bool) Specifies lifecycle rule status.

* `prefix` - (Optional) Object key prefix identifying one or more objects to which the rule applies.
* `prefix` - (Optional, String) Object key prefix identifying one or more objects to which the rule applies.
If omitted, all objects in the bucket will be managed by the lifecycle rule.
The prefix cannot start or end with a slash (/), cannot have consecutive slashes (/),
and cannot contain the following special characters: \:*?"<>|.

* `expiration` - (Optional) Specifies a period when objects that have been last updated are automatically deleted.
The object structure is documented below.
* `expiration` - (Optional, List) Specifies a period when objects that have been last updated are automatically deleted.
The [expiration](#obs_expiration) object structure is documented below.

* `transition` - (Optional) Specifies a period when objects that have been last updated are automatically transitioned
to `STANDARD_IA` or `GLACIER` storage class. The object structure is documented below.
* `transition` - (Optional, List) Specifies a period when objects that have been last updated are automatically
transitioned to `STANDARD_IA` or `GLACIER` storage class.
The [transition](#obs_transition) object structure is documented below.

* `noncurrent_version_expiration` - (Optional) Specifies a period when noncurrent object versions are automatically deleted.
The object structure is documented below.
* `noncurrent_version_expiration` - (Optional, List) Specifies a period when noncurrent object versions are automatically
deleted. The [noncurrent_version_expiration](#obs_noncurrent_version_expiration) object structure is documented below.

* `noncurrent_version_transition` - (Optional) Specifies a period when noncurrent object versions are automatically
transitioned to `STANDARD_IA` or `GLACIER` storage class. The object structure is documented below.
* `noncurrent_version_transition` - (Optional, List) Specifies a period when noncurrent object versions are automatically
transitioned to `STANDARD_IA` or `GLACIER` storage class.
The [noncurrent_version_transition](#obs_noncurrent_version_transition) object structure is documented below.

At least one of `expiration`, `transition`, `noncurrent_version_expiration`, `noncurrent_version_transition` must be specified.
At least one of `expiration`, `transition`, `noncurrent_version_expiration`, `noncurrent_version_transition` must
be specified.

The `expiration` object supports the following
<a name="obs_expiration"></a>
The `expiration` object supports:

* `days` (Required) Specifies the number of days when objects that have been last updated are automatically deleted.
* `days` (Required, Int) Specifies the number of days when objects that have been last updated are automatically deleted.
The expiration time must be greater than the transition times.

The `transition` object supports the following
<a name="obs_transition"></a>
The `transition` object supports:

* `days` (Required) Specifies the number of days when objects that have been last updated are automatically
transitioned to the specified storage class.
* `storage_class` - (Required) The class of storage used to store the object. Only "STANDARD_IA" and "GLACIER" are supported.
* `days` (Required, Int) Specifies the number of days when objects that have been last updated are automatically
transitioned to the specified storage class.
* `storage_class` - (Required, String) The class of storage used to store the object. Only "STANDARD_IA" and "GLACIER"
are supported.

The `noncurrent_version_expiration` object supports the following
<a name="obs_noncurrent_version_expiration"></a>
The `noncurrent_version_expiration` object supports:

* `days` (Required) Specifies the number of days when noncurrent object versions are automatically deleted.
* `days` (Required, Int) Specifies the number of days when noncurrent object versions are automatically deleted.

The `noncurrent_version_transition` object supports the following
<a name="obs_noncurrent_version_transition"></a>
The `noncurrent_version_transition` object supports:

* `days` (Required) Specifies the number of days when noncurrent object versions are automatically
transitioned to the specified storage class.
* `storage_class` - (Required) The class of storage used to store the object. Only "STANDARD_IA" and "GLACIER" are supported.
* `days` (Required, Int) Specifies the number of days when noncurrent object versions are automatically
transitioned to the specified storage class.
* `storage_class` - (Required, String) The class of storage used to store the object. Only "STANDARD_IA" and "GLACIER"
are supported.

## Attributes Reference
## Attribute Reference

The following attributes are exported:

* `id` - The name of the bucket.

* `bucket_domain_name` - The bucket domain name. Will be of format `bucketname.oss.region.prod-cloud-ocb.orange-business.com`.

* `region` - The region this bucket resides in.

## Import

OBS bucket can be imported using the `bucket`, e.g.
Expand All @@ -291,10 +308,10 @@ OBS bucket can be imported using the `bucket`, e.g.
terraform import flexibleengine_obs_bucket.bucket bucket-name
```

Note that the imported state may not be identical to your resource definition, due to some attrubutes
Note that the imported state may not be identical to your resource definition, due to some attributes
missing from the API response. The missing attributes include `acl` and `force_destroy`.
It is generally recommended running `terraform plan` after importing an OBS bucket.
Also you can ignore changes as below.
Also, you can ignore changes as below.

```hcl
resource "flexibleengine_obs_bucket" "bucket" {
Expand Down
Loading
Loading