Skip to content

Commit

Permalink
generate docs & fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp committed Nov 8, 2024
1 parent af51fe9 commit 6c3aa25
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 4 deletions.
41 changes: 41 additions & 0 deletions docs/data-sources/sos_bucket_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "exoscale_sos_bucket_policy Data Source - terraform-provider-exoscale"
subcategory: ""
description: |-
Fetch Exoscale SOS Bucket Policies https://community.exoscale.com/documentation/storage/bucketpolicy/.
---

# exoscale_sos_bucket_policy (Data Source)

Fetch Exoscale [SOS Bucket Policies](https://community.exoscale.com/documentation/storage/bucketpolicy/).



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `bucket` (String) The name of the bucket to which the policy is to be applied.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `policy` (String) The content of the policy

<a id="nestedblock--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).


40 changes: 40 additions & 0 deletions docs/resources/sos_bucket_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "exoscale_sos_bucket_policy Resource - terraform-provider-exoscale"
subcategory: ""
description: |-
Manage Exoscale SOS Bucket Policies https://community.exoscale.com/documentation/storage/bucketpolicy/.
---

# exoscale_sos_bucket_policy (Resource)

Manage Exoscale [SOS Bucket Policies](https://community.exoscale.com/documentation/storage/bucketpolicy/).



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `bucket` (String) ❗ The name of the bucket to which the policy is to be applied.
- `policy` (String) The content of the policy
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

<a id="nestedblock--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).

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.


2 changes: 1 addition & 1 deletion pkg/resources/sos_bucket_policy/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ const (
AttrPolicy = "policy"
attrPolicyDescription = "The content of the policy"
AttrZone = "zone"
attrZoneDescription = "The Exoscale [Zone](https://www.exoscale.com/datacenters/) name."
attrZoneDescription = "The Exoscale [Zone](https://www.exoscale.com/datacenters/) name."
)
6 changes: 3 additions & 3 deletions pkg/resources/sos_bucket_policy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (r *ResourceSOSBucketPolicy) Schema(ctx context.Context, req resource.Schem
MarkdownDescription: ResourceSOSBucketPolicyDescription,
Attributes: map[string]schema.Attribute{
AttrBucket: schema.StringAttribute{
Description: attrBucketDescription,
Description: "❗ " + attrBucketDescription,
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
Expand All @@ -72,7 +72,7 @@ func (r *ResourceSOSBucketPolicy) Schema(ctx context.Context, req resource.Schem
Required: true,
},
AttrZone: schema.StringAttribute{
MarkdownDescription: attrZoneDescription,
MarkdownDescription: "❗ " + attrZoneDescription,
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
Expand Down Expand Up @@ -107,7 +107,7 @@ func (r *ResourceSOSBucketPolicy) NewSOSClient(ctx context.Context, zone string)
func pollBucket(ctx context.Context, sosClient *s3.Client, bucket string) error {
var err error = nil

for _ = range 10 {
for range 10 {
time.Sleep(500 * time.Millisecond)
if _, err = sosClient.GetBucketPolicy(ctx, &s3.GetBucketPolicyInput{
Bucket: &bucket,
Expand Down

0 comments on commit 6c3aa25

Please sign in to comment.