2 Answers
- Newest
- Most votes
- Most comments
0
Hello.
I was able to create a serverless cluster using the AWS CLI with the following command:
Therefore, I think you can create it from the API without any problems.
aws elasticache create-serverless-cache \
--serverless-cache-name CacheName \
--engine valkey \
--kms-key-id 12345678-1234-1234-1234-123456789012
By the way, what kind of error is output?
0
turns out, For ElastiCache to accept that key, the caller's IAM Role needs permission
"kms:DescribeKey",
"kms:CreateGrant"
solved.
answered 8 months ago
Relevant content
asked a year ago
- AWS OFFICIALUpdated 2 years ago

I am creating a cluster from a service using an assumed IAM role for authentication.
When the KmsKeyId field is set to the KMS ARN, I get the following error: operation error ElastiCache: CreateServerlessCache, https response error StatusCode: 400, RequestID: 516c580e-cc06-4a8c-a600-ad73224d6ee8, InvalidParameterValue: KMS key access is denied with key id: arn:aws:kms:us-west-2:12345678:key/f91d56a2-11b7-1234-1234-123456789012
When the KmsKeyId field is set to the KMS key ID directly, I get this error: operation error ElastiCache: CreateServerlessCache, https response error StatusCode: 400, RequestID: 5fca33f1-874d-4919-881a-77df3f6ae722, InvalidParameterValue: KMS key access is denied with key id: f91d56a2-11b7-1234-1234-123456789012
However, I am able to create the cluster successfully using the same KMS key via the AWS Console.
Go SDK reference used https://github.com/aws/aws-sdk-go-v2/blob/service/elasticache/v1.51.9/service/elasticache/api_op_CreateServerlessCache.go#L30