IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

feat: support configuring trusted profile for authentication #5799

Open JunliWang opened 3 days ago

JunliWang commented 3 days ago

Community Note

Description

today's providee requires ibmcloud_api_key to be configured to authenticate with the cloud and run all service clients. To address security issues from apikey, trusted profile has been introduced in IAM for a few years already and adopted by many cloud services with below benefits.

the primary use case will be: in terraform.tfvars, trusted_profile_id and cr_token_file are configured (ibmcloud_api_key is no longer needed), then iam_token is generated from above two parameters and this token is kept refreshed regularly throughput the client session. https://github.com/IBM/go-sdk-core/blob/main/core/container_authenticator.go is available to implement this support.

trusted profile also supports association with other type of trustees besides of compute resource token, and they can be added after compute resource token is supported.

New or Affected Resource(s)

this is platform level enhancement, not associated with any service or resource. but once this authentication option is available, services supporting trusted profile can adopt and get away with apikey configuration.

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References