Properties validation failed for resource Lambda with message: #/Role: failed validation constraint for keyword [pattern]
A single character missing caused this error which doesn’t align with the actual problem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I was getting this error and kept staring at it because I couldn’t see what the problem was. I used an ImportValue to get the ARN from the output value of the CloudFormation template that created a role.
I was also using the sub function — so a sub in side an ImportValue. I wrote about that here:
You have to use the long form Fn::ImportValue with !Sub.
Here’s what I was doing wrong. Do you see the problem?
Role:
Fn:ImportValue:
!Sub "${NameParam}LambdaRole"This took me way too long.
Role:
Fn::ImportValue:
!Sub "${NameParam}LambdaRole"Do you see the difference now?
I had one colon between Fn and ImportValue instead of two.
I have the following thoughts on this:
- Why doesn’t a sub just work inside an ImportValue function by default like this:
Fn::ImportValue "${NameParam}LambdaRole"2. Why can’t I use the short form?
!ImportValue "${NameParam}LambdaRole"3. The error message! Align the error message to the problem please.
#awswishlist
Follow for updates.
Teri Radichel | © 2nd Sight Lab 2023
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 LabNeed Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for PresentationFollow 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
