Closed
Description
When using KMSMasterKeyProvider, can a CMK key alias be used as the key_id instead of the arn?
The KMS API GenerateDataKey
operation accepts alias as the key_id. But it looks like the sdk expects the key_id to be an arn. If the key_id is not an arn, the init fails with the below error -
The below fails with an exception -
kwargs = dict(
key_ids=["alias/cmk-alias"],
region_names=["us-east-1"],
botocore_session=existing_session
)
aws_encryption_sdk.KMSMasterKeyProvider(**kwargs)
UnknownRegionError: No default region found and no region determinable from key id: alias/cmk-alias
/usr/local/lib/python2.7/site-packages/aws_encryption_sdk/key_providers/kms.py:50:UnknownRegionError