Bugs That Bite
Published in

Bugs That Bite

(InvalidKeyId) when calling the PutParameter operation: Invalid keyId xxxxxxxxxxx (Service: AWSKMS; Status Code: 400; Error Code: NotFoundException; Request ID: xxxxx Proxy: null)

Getting an InvalidKeyID error when trying to add a parameter to AWS Systems Manager Parameter Store — but the key exists

This error is confusing because the key passed into the key-id parameter in this command does exist:

aws ssm put-parameter --name $ami_latest --value $image_id --type SecureString --key-id $key --overwrite

The problem I had in this particular case was that I had two variables with the same name, which became apparent when I printed out the key value.

Normally, this error would indicate there’s a typo in the key name, it’s not set, or it does not exist for some other reason. Also make sure you pass in the full ARN, not just the key name. The best thing you can do to prevent typos is to navigate to the KMS service, click on the key, copy the ARN, and paste it into your code to prevent typos.

Teri Radichel

If you liked this story please clap and follow:

Medium: Teri Radichel or Email List: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests services via LinkedIn: Teri Radichel or IANS Research

© 2nd Sight Lab 2022

____________________________________________

About this blog:

Want to learn more about Cybersecurity and Cloud Security? Check out: Cybersecurity for Executives in the Age of Cloud on Amazon

Need Cloud Security Training? 2nd Sight Lab Cloud Security Training

Is your cloud secure? Hire 2nd Sight Lab for a penetration test or security assessment.

Have a Cybersecurity or Cloud Security Question? Ask Teri Radichel by scheduling a call with IANS Research.

Cybersecurity & Cloud Security Resources by Teri Radichel: Cybersecurity and Cloud security classes, articles, white papers, presentations, and podcasts

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Teri Radichel

Teri Radichel

1.1K Followers

Cloud Security Training and Penetration Testing | GSE, GSEC, GCIH, GCIA, GCPM, GCCC, GREM, GPEN, GXPN | AWS Hero | Infragard | IANS Faculty | 2ndSightLab.com