我在 aws 中有一个 KMS,我需要从 ansible 脚本中获取数据。脚本如下,
name: encryption key
hosts: localhost
connection: local
tasks:
- name: get kms
community.aws.aws_kms_info:
filters:
"tag:Name": kms-key
在 KMS 中添加了一个标签,名称为 Name = kms-key,并且密钥为 SYMMETRIC_DEFAULT 类型。我收到一条错误消息
ClientError: An error occurred (AccessDeniedException) when calling the DescribeKey operation: User: arn:aws:iam::1234567:user/devRange is not authorized to perform: kms:DescribeKey on resource: arn:aws:kms:us-east-2:1234567:key/34343423444545
问题是错误中指定的资源 arn 不是我想从中获取信息的 kms 键。标签(kms-key)在另一个kms中。它是否需要获得帐户中所有 kms 密钥的权限才能从特定 kms 中检索数据。kms: DescribeKey
为从 kms 检索数据的用户授予权限。