Skip to content

Commit

Permalink
docs(object): improve object bucket policy examples (#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsheep committed May 24, 2023
1 parent aeb0c42 commit 5a8cf82
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions docs/resources/object_bucket_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,48 @@ For more information, see [the documentation](https://www.scaleway.com/en/docs/s
## Example Usage

```hcl
resource "scaleway_object_bucket_policy" "bucket" {
resource "scaleway_object_bucket" "bucket" {
name = "some-unique-name"
}
resource "scaleway_object_bucket_policy" "policy" {
bucket = scaleway_object_bucket.bucket.name
policy = jsonencode(
bucket = scaleway_object_bucket.bucket.name
policy = jsonencode(
{
Id = "MyPolicy"
Statement = [
Id = "MyPolicy"
Statement = [
{
Action = [
"s3:ListBucket",
"s3:GetObject",
]
Effect = "Allow"
Principal = {
SCW = "*"
}
Resource = [
"some-unique-name",
"some-unique-name/*",
]
Sid = "GrantToEveryone"
Action = [
"s3:ListBucket",
"s3:GetObject",
]
Effect = "Allow"
Principal = {
SCW = "*"
}
Resource = [
"some-unique-name",
"some-unique-name/*",
]
Sid = "GrantToEveryone"
},
]
Version = "2012-10-17"
]
Version = "2012-10-17"
}
)
)
}
```

## Example with aws provider

```hcl
resource "scaleway_object_bucket_policy" "bucket" {
resource "scaleway_object_bucket" "bucket" {
name = "some-unique-name"
}
resource "scaleway_object_bucket_policy" main {
bucket = scaleway_object_bucket.bucket.name
policy = data.aws_iam_policy_document.policy.json
resource "scaleway_object_bucket_policy" "main" {
bucket = scaleway_object_bucket.bucket.name
policy = data.aws_iam_policy_document.policy.json
}
data "aws_iam_policy_document" "policy" {
Expand Down

0 comments on commit 5a8cf82

Please sign in to comment.