hashicorp / hashicorp/boundary
boundary cli is not using AWS_PROFILE
- Dominant language
- Go
- Stars
- 4.1k
- Forks
- 317
- Avg merge
- 5h 10m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
boundary cli is not using Env AWS_PROFILE
**To Reproduce**
Steps to reproduce the behavior:
boundary controller is using AWS KMS as its kms, boundary server can access the aws kms key fine
on the client side, use boundary cli to do the [Recovery KMS Workflow](https://www.boundaryproject.io/docs/oss/installing/no-gen-resources#recovery-kms-workflow)
recovery.hcl as below
```
kms "awskms" {
purpose = "recovery"
region = "cn-northwest-1"
kms_key_id = "****(my kms key id)"
}
```
in my local machine which run boundary cli, has the ~/.aws/config set
```
[profile my_profile]
region = cn-northwest-1
source_profile =
role_arn =
```
run the command:
```
$ export AWS_PROFILE=my_profile
$ boundary users list -recovery-config recovery.hcl
```
Result in error as :
_Error creating API client: Error configuring kms: error setting configuration on the kms plugin: rpc error: code = Unknown desc = error fetching AWS KMS wrapping key information: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors_
**Expected behavior**
according to https://www.boundaryproject.io/docs/configuration/kms/awskms, boundary should support AWS_PROFILE to use aws profile configured in local.
**Additional context**
boundary version 0.10.3
looks like it is not giving any option to the GenerateCredentialChain() https://github.com/hashicorp/go-kms-wrapping/blob/8942ada7037b3ff2c04d213dbf64c439e61d3a58/wrappers/awskms/awskms.go#L296
so the AWS_PROFILE is ignored, https://github.com/hashicorp/go-secure-stdlib/blob/f7bda984abfc12ada776e1495d8f4c94a9afc5fa/awsutil/generate_credentials.go#L188
Contributor guide
Assessment
This issue has not been assessed yet.