avatarTeri Radichel

Summarize

(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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️ Check out my series on Automating Cybersecurity Metrics | Code.

🔒 Related Stories: Bugs | AWS Security | Secure Code

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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.

Follow for updates.

Teri Radichel | © 2nd Sight Lab 2022

About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
Invalidkeyid
Systemsmanager
AWS
Error Message
Kms
Recommended from ReadMedium