'Running aws kms decrypt from Ansible shell module

When running the following command from an ansible shell module task:

aws kms decrypt --key-id *key* --region *region* --ciphertext-blob fileb://"D:\path\to\my\Key.key" --output text --encryption-context *context* --query Plaintext > "D:\decrypted.key.base64"

I get the following error:

Error parsing parameter '--ciphertext-blob': Unable to load paramfile fileb://D:\path\to\my\Key.key: [Errno 2] No such file or directory: 'D:\path\to\my\Key.key'

I also tried to wrap "fileb://D:\path\to\my\Key.key" in quotes, but got the same error.

What is a correct way to define this path?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source