Skip to content

Commit 6da449d

Browse files
authored
Updating the documentation for COS for cross account access. (#6685)
* Adding the documentation for cross account access in COS * Formatting the updated docs
1 parent 0da2983 commit 6da449d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

website/docs/r/cos_bucket.html.markdown

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ resource "ibm_cos_bucket_lifecycle_configuration" "lifecycle" {
491491
**Note:**
492492
To manage changes of Lifecycle rules to an cos bucket, use the ibm_cos_bucket_lifecycle_configuration resource instead. If you use `expire_rule` , `archive_rule` , `noncurrent_version_expiration`, `abort_incomplete_multipart_upload_days` on an ibm_cos_bucket, Terraform will assume management over the full set of Lifecycle rules for the cos bucket, treating additional Lifecycle rules as drift. For this reason, lifecycle_rule cannot be mixed with the external ibm_cos_bucket_lifecycle_configuration resource for a given S3 bucket.
493493

494+
494495
## Argument reference
495496
Review the argument references that you can specify for your resource.
496497

@@ -643,6 +644,33 @@ In addition to all argument reference list, you can access the following attribu
643644
- `s3_endpoint_private` - (string) Private endpoint for cos bucket.
644645
- `s3_endpoint_direct` - (string) Direct endpoint for cos bucket.
645646

647+
648+
## Cross account access for COS
649+
Access to a cos instance across different accounts can be granted using a service ID from source account and adding it to a access group in target account.
650+
651+
**Note:**
652+
Currently granting cross account access using trusted profile and service ID authentication method is not supported.
653+
654+
655+
### Steps to follow
656+
1. Create a service ID in source account Manage > Access > Servics IDs > Create.
657+
2. Create an api key in the service ID.
658+
3. Create an access group in the target account or use an existing one and assign the appropriate access to the access group.
659+
4. Add the service ID to access group.
660+
**Note:**
661+
To add the service ID to the access group use the api key of the target account to authenticate.
662+
**Example**
663+
```
664+
resource "ibm_iam_access_group_members" "accgroupmem" {
665+
access_group_id = "ID of access group" // eg: AccessGroupId-axxxxxxx0-xxxx-xxxx-xxxx-41xxxxxxxxx6
666+
iam_service_ids = ["ID of service ID"] // eg: ServiceId-axxxxxxa-xxxx-xxxx-xxxx-0xxxxxxxx0c
667+
}
668+
```
669+
5. Now use the api key of the service ID to perform the cos operations across accounts.
670+
671+
672+
673+
646674
## Import IBM COS Bucket
647675
The `ibm_cos_bucket` resource can be imported by using the `id`. The ID is formed from the `CRN` (Cloud Resource Name), the `bucket type` which must be `ssl` for single_site_location, `rl` for region_location or `crl` for cross_region_location, and the bucket location. The `CRN` and bucket location can be found on the portal.
648676

0 commit comments

Comments
 (0)