File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -410,6 +410,11 @@ resource "ibm_cos_bucket" "cos_bucket_website_configuration" {
410410 storage_class = var. standard_storage_class
411411
412412}
413+
414+ data "ibm_iam_access_group" "public_access_group" {
415+ access_group_name = " Public Access"
416+ }
417+
413418# Give public access to above mentioned bucket
414419resource "ibm_iam_access_group_policy" "policy" {
415420 depends_on = [ibm_cos_bucket . cos_bucket_website_configuration ]
@@ -419,8 +424,8 @@ resource "ibm_iam_access_group_policy" "policy" {
419424 resources {
420425 service = " cloud-object-storage"
421426 resource_type = " bucket"
422- resource_instance_id = " COS instance guid"
423- resource = data . ibm_cos_bucket . cos_bucket_website_configuration . bucket_name
427+ resource_instance_id = " COS instance guid" # eg : 94xxxxxx-3xxx-4xxx-8xxx-7xxxxxxxxx7
428+ resource = ibm_cos_bucket. cos_bucket_website_configuration . bucket_name
424429 }
425430}
426431
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ resource "ibm_cos_bucket" "cos_bucket_website_configuration" {
4040 storage_class = var.standard_storage_class
4141
4242}
43+
44+ data "ibm_iam_access_group" "public_access_group" {
45+ access_group_name = "Public Access"
46+ }
47+
4348# Give public access to above mentioned bucket
4449
4550resource "ibm_iam_access_group_policy" "policy" {
@@ -50,8 +55,8 @@ resource "ibm_iam_access_group_policy" "policy" {
5055 resources {
5156 service = "cloud-object-storage"
5257 resource_type = "bucket"
53- resource_instance_id = "COS instance guid"
54- resource = data. ibm_cos_bucket.cos_bucket_website_configuration.bucket_name
58+ resource_instance_id = "COS instance guid" # eg : 94xxxxxx-3xxx-4xxx-8xxx-7xxxxxxxxx7
59+ resource = ibm_cos_bucket.cos_bucket_website_configuration.bucket_name
5560 }
5661}
5762
You can’t perform that action at this time.
0 commit comments