aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.58k stars 4.13k forks source link

AWS CLI v2.15.30 needs --policy-name as required argument instead of optional when performing `kms get-key-policy` #8835

Closed TejasRGitHub closed 3 months ago

TejasRGitHub commented 3 months ago

Describe the bug

While performing aws kms get-key-policy, for all the other CLI versions, the --policy-name is an optional argument but for v2.15.30 this is a required argument.

Also I couldn't find the documentation of v2.15.30.

For the latest aws cli v2, this is an optional argument as well. Thus, I think it is a bug in AWS CLI v2.15.30

Expected Behavior

--policy-name arg should be optional

Current Behavior

--policy-name arg is required

Reproduction Steps

  1. Create a KMS key
  2. Install AWS CLI v2.15.30 ( https://docs.aws.amazon.com/cli/latest/userguide/getting-started-version.html )
  3. Open terminal , perform aws kms get-key-policy --key-id <YOUR_KEY_ID>
  4. This should fail with the usage instructions

Possible Solution

No response

Additional Information/Context

No response

CLI version used

2.15.30

Environment details (OS name and version, etc.)

mac

tim-finnigan commented 3 months ago

Thanks for reaching out. It looks like this was change introduced in 2.15.31:

  • api-change:kms: Adds the ability to use the default policy name by omitting the policyName parameter in calls to PutKeyPolicy and GetKeyPolicy

So from 2.15.31 onward the policyName can be omitted. Closing as not a bug but expected behavior based on the version. Will also link documentation for reference:

github-actions[bot] commented 3 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.