Skip to content

Add support to grant public access to a COS bucket #988

@ocofaigh

Description

@ocofaigh

Sample code that we should add to our module:

# use a data lookup to get the ID of the "Public Access" IAM access group
data "ibm_iam_access_group" "public_access_group" {
  access_group_name = "Public Access"
}

# create an IAM access policy to granting public access to this bucket
resource "ibm_iam_access_group_policy" "policy" {
  access_group_id = data.ibm_iam_access_group.public_access_group.groups[0].id
  roles           = ["Object Reader"]

  resources {
    service              = "cloud-object-storage"
    resource_type        = "bucket"
    resource_instance_id = local.cos_instance_guid
    resource             = local.cos_bucket_name
  }
}

We should expose a boolean to allow consumers to opt into this

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions