Skip to content

Commit

Permalink
[Object Storage] update: docs for resource and data source tf
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanglm committed Nov 18, 2024
1 parent 92b2df3 commit 2b1e32b
Show file tree
Hide file tree
Showing 20 changed files with 879 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/data-sources/object_storage_bucket_acl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
page_title: "fptcloud_object_storage_bucket_acl Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves Access Control List (ACL) information for a specific bucket in FPT Cloud Object Storage.
---

# fptcloud_object_storage_bucket_acl (Data Source)

Retrieves the Access Control List (ACL) details for a specific bucket in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_bucket_acl" "example" {
vpc_id = "vpc-12345"
bucket_name = "my-bucket"
region_name = "HCM-02"
}
output "bucket_acl" {
value = data.fptcloud_object_storage_bucket_acl.example
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC where the bucket is located
- `bucket_name` (String) Name of the bucket to retrieve ACL information
- `region_name` (String) The region name for the S3 service (e.g., HCM-01, HCM-02, HN-01, HN-02)

### Read-Only

- `canned_acl` (String) The Access Control List (ACL) status of the bucket (private, public-read, default is private)
- `status` (Boolean) The status of the ACL configuration
- `bucket_acl` (List) Details of the bucket's Access Control List
- `owner` (List)
- `display_name` (String)
- `id` (String)
- `grants` (List)
- `grantee` (List)
- `display_name` (String)
- `id` (String)
- `type` (String)
- `permission` (String)

## Attributes Reference

The following attributes are exported:

- `canned_acl`: Indicates the predefined ACL status of the bucket
- `status`: Confirms whether the ACL retrieval was successful
- `bucket_acl`: Provides detailed ACL information including owner and grant details
45 changes: 45 additions & 0 deletions docs/data-sources/object_storage_bucket_cors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
page_title: "fptcloud_object_storage_bucket_cors Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves CORS (Cross-Origin Resource Sharing) configuration for a specific bucket in FPT Cloud Object Storage.
---

## Example Usage

```terraform
data "fptcloud_object_storage_bucket_cors" "example" {
vpc_id = "vpc-12345"
bucket_name = "my-bucket"
region_name = "HCM-02"
page = 1
page_size = 10
}
output "cors_rules" {
value = data.fptcloud_object_storage_bucket_cors.example.cors_rule
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC
- `bucket_name` (String) Name of the bucket
- `region_name` (String) The region name for the S3 service (HCM-01, HCM-02, HN-01, HN-02)

### Optional

- `page` (Number) Page number for pagination (default: 1)
- `page_size` (Number) Number of items per page (default: 25)

### Read-Only

- `cors_rule` (List) CORS rules for the bucket with the following attributes:
- `id` (String) Unique identifier for the CORS rule
- `allowed_headers` (List of Strings) HTTP headers allowed in preflight requests
- `allowed_methods` (List of Strings) HTTP methods allowed
- `allowed_origins` (List of Strings) Origins allowed to make cross-origin requests
- `expose_headers` (List of Strings, Optional) Headers exposed to the browser
- `max_age_seconds` (Number, Optional) Maximum time browser can cache preflight response
55 changes: 55 additions & 0 deletions docs/data-sources/object_storage_bucket_lifecycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
page_title: "fptcloud_object_storage_bucket_lifecycle Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves lifecycle configuration for a specific bucket in FPT Cloud Object Storage.
---

# fptcloud_object_storage_bucket_lifecycle (Data Source)

Retrieves lifecycle configuration for a specific bucket in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_bucket_lifecycle" "example" {
vpc_id = "vpc-12345"
bucket_name = "my-bucket"
region_name = "HCM-02"
page = 1
page_size = 10
}
output "lifecycle_rules" {
value = data.fptcloud_object_storage_bucket_lifecycle.example.life_cycle_rules
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC
- `bucket_name` (String) Name of the bucket
- `region_name` (String) The region name for the S3 service (HCM-01, HCM-02, HN-01, HN-02)

### Optional

- `page` (Number) Page number for pagination (default: 1)
- `page_size` (Number) Number of items per page (default: 25)

### Read-Only

- `life_cycle_rules` (List) Lifecycle rules for the bucket with the following attributes:
- `id` (String) Unique identifier for the lifecycle rule
- `filter` (List) Optional filter for rule application
- `prefix` (String) Prefix to filter objects
- `status` (String) Status of the lifecycle rule
- `prefix` (String) Prefix for the rule
- `expiration` (List) Rules for object expiration
- `days` (Number) Number of days before object expiration
- `expired_object_delete_marker` (Boolean) Whether to remove delete markers
- `noncurrent_version_expiration` (List) Rules for non-current version expiration
- `noncurrent_days` (Number) Number of days before non-current version expires
- `abort_incomplete_multipart_upload` (List) Rules for aborting incomplete multipart uploads
- `days_after_initiation` (Number) Days after which to abort incomplete uploads
47 changes: 47 additions & 0 deletions docs/data-sources/object_storage_bucket_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
page_title: "fptcloud_object_storage_bucket Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves a list of buckets in FPT Cloud Object Storage.
---

# fptcloud_object_storage_bucket (Data Source)

Retrieves a list of buckets in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_bucket" "example" {
vpc_id = "vpc-12345"
region_name = "HCM-02"
page = 1
page_size = 10
}
output "buckets" {
value = data.fptcloud_object_storage_bucket.example.list_bucket_result
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC
- `region_name` (String) The region name for the S3 service (HCM-01, HCM-02, HN-01, HN-02)

### Optional

- `page` (Number) Page number for pagination (default: 1)
- `page_size` (Number) Number of items per page (default: 25)

### Read-Only

- `list_bucket_result` (List) List of buckets with the following attributes:
- `endpoint` (String) The endpoint of the bucket
- `is_enabled_logging` (Boolean) Whether logging is enabled for the bucket
- `bucket_name` (String) The name of the bucket
- `creation_date` (String) The date when the bucket was created
- `s3_service_id` (String) The S3 service ID
- `is_empty` (Boolean) Whether the bucket is empty
36 changes: 36 additions & 0 deletions docs/data-sources/object_storage_bucket_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
page_title: "fptcloud_object_storage_bucket_policy Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves the policy configuration for a specific bucket in FPT Cloud Object Storage.
---

# fptcloud_object_storage_bucket_policy (Data Source)

Retrieves the policy configuration for a specific bucket in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_bucket_policy" "example" {
vpc_id = "vpc-12345"
bucket_name = "my-bucket"
region_name = "HCM-02"
}
output "bucket_policy" {
value = data.fptcloud_object_storage_bucket_policy.example.policy
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC
- `bucket_name` (String) Name of the bucket to retrieve policy
- `region_name` (String) The region name for the S3 service (HCM-01, HCM-02, HN-01, HN-02)

### Read-Only

- `policy` (String) The bucket policy in JSON format
37 changes: 37 additions & 0 deletions docs/data-sources/object_storage_bucket_static_website.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
page_title: "fptcloud_object_storage_bucket_static_website Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves static website configuration for a specific bucket in FPT Cloud Object Storage.
---

# fptcloud_object_storage_bucket_static_website (Data Source)

Retrieves static website configuration for a specific bucket in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_bucket_static_website" "example" {
vpc_id = "vpc-12345"
bucket_name = "my-website-bucket"
region_name = "HCM-02"
}
output "index_document" {
value = data.fptcloud_object_storage_bucket_static_website.example.index_document_suffix
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC
- `bucket_name` (String) Name of the bucket with static website configuration
- `region_name` (String) The region name for the S3 service (HCM-01, HCM-02, HN-01, HN-02)

### Optional/Computed

- `index_document_suffix` (String) Suffix for index documents (e.g., "index.html")
- `error_document_key` (String) Key for error documents
42 changes: 42 additions & 0 deletions docs/data-sources/object_storage_bucket_versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
page_title: "fptcloud_object_storage_bucket_versioning Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves the versioning configuration for a specific bucket in FPT Cloud Object Storage.
---

# fptcloud_object_storage_bucket_versioning (Data Source)

Retrieves the versioning configuration for a specific bucket in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_bucket_versioning" "example" {
vpc_id = "vpc-12345"
region_name = "HCM-01"
bucket_name = "my-bucket"
}
output "versioning_status" {
value = data.fptcloud_object_storage_bucket_versioning.example.versioning_status
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC
- `region_name` (String) The region name for the S3 service (e.g., HCM-01, HCM-02, HN-01, HN-02)
- `bucket_name` (String) Name of the bucket

### Read-Only

- `versioning_status` (String) Status of the versioning, either "Enabled" or "Suspended"

## Attributes Reference

The following attributes are exported:

- `versioning_status`: The current versioning configuration of the bucket
41 changes: 41 additions & 0 deletions docs/data-sources/object_storage_service_enable .md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
page_title: "fptcloud_object_storage_service_enable Data Source - terraform-provider-fptcloud"
subcategory: "Object Storage"
description: |-
Retrieves the enabled S3 services for a specific VPC in FPT Cloud Object Storage.
---

# fptcloud_object_storage_service_enable (Data Source)

Retrieves the enabled S3 services for a specific VPC in FPT Cloud Object Storage.

## Example Usage

```terraform
data "fptcloud_object_storage_service_enable" "example" {
vpc_id = "vpc-12345"
}
output "enabled_services" {
value = data.fptcloud_object_storage_service_enable.example.s3_enable_services
}
```

## Schema

### Required

- `vpc_id` (String) The ID of the VPC

### Read-Only

- `s3_enable_services` (List) List of enabled S3 services
- `s3_service_name` (String) The name of the S3 service (region name)
- `s3_service_id` (String) The unique identifier of the S3 service
- `s3_platform` (String) The platform of the S3 service

## Attributes Reference

The following attributes are exported:

- `s3_enable_services`: A list of enabled S3 services with their details
Loading

0 comments on commit 2b1e32b

Please sign in to comment.