Skip to content

Commit eff43f2

Browse files
IBM-DeekshaDeeksha Sharma
and
Deeksha Sharma
authored
update documentation with instructions to provide public access to … (#5359)
* update documentation with instaructions to provide public access to a bucket * rectify id value in example * add group policy link * update to use guid --------- Co-authored-by: Deeksha Sharma <[email protected]>
1 parent f5a3dc5 commit eff43f2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

website/docs/r/cos_bucket.html.markdown

+18
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,25 @@ resource "ibm_cos_bucket" "objectversioning" {
251251
}
252252
}
253253
254+
### Give public access to a bucket
255+
256+
data "ibm_iam_access_group" "public_access_group" {
257+
access_group_name = "Public Access" # public access group name
258+
}
259+
260+
resource "ibm_iam_access_group_policy" "public-access-policy" {
261+
access_group_id = data.ibm_iam_access_group.public_access_group.groups[0].id
262+
roles = ["Content Reader"] # ["Content Reader", "Object Reader"]
263+
resources {
264+
resource = ibm_cos_bucket.cos_bucket.bucket_name
265+
resource_instance_id = ibm_resource_instance.cos_instance.guid
266+
resource_type = "bucket"
267+
service = "cloud-object-storage"
268+
}
269+
}
270+
254271
```
272+
For more information on access group policies, please refer to [this link](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_access_group_policy)
255273

256274
# cos satellite bucket
257275

0 commit comments

Comments
 (0)