Allow using KMS alias ARN for EKS encryption
#3,096 opened on Jan 22, 2022
Repository metrics
- Stars
- (723 stars)
- PR merge metrics
- (PR metrics pending)
Description
/kind feature /area provider/eks /triage accepted /priority important-soon
Describe the solution you'd like
If i enable EKS encryption using the ARN of the alias in AWSManagedControlPlane:
encryptionConfig:
provider: "arn:aws:kms:eu-west-2:1234567890:key/351f5544-6130-42e4-8786-2c85e546fc2d"
resources:
- "secrets"
The EKS cluster will actually be created with the key ARN of the KMS key for the supplied alias. When we later get the details of the cluster it returns the key arn and not the alias arn. This causes the compare encryption config to because the ARNs don't match...even though they relate to the same KMS key.
We need to change the comparison so if a alias arn is supplied in AWSManagedControlPlane that we check if this is for the same key as the key ARN.
Anything else you would like to add:
We can use ListAliases to get the aliases for a key and use that in the comparision.....is an alias is used.
A follow on from #3092
Environment:
- Cluster-api-provider-aws version: 1.2.0