-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Altering validation for property of AWS resource type #3460
Comments
PR on doc changes incoming. I had to change how the patching works because the massive change to the structure of the schema files. We still support the ability to add/remove resource types but to patch a schema you need to do this. Patches/ResourceType and then a list of patches in json patch format. {
"Patches": {
"AWS::EC2::Instance": [
{
"op": "remove",
"path": "/properties/ImageId/format",
"value": "true"
}
]
}
} I'm not sure I get the pattern you are trying to put there
|
Made an initial swipe at updating the docs to talk about how to do the patching. We can make improvements from there. |
Thank you, That helped out tremendously. We use a cloudformation macro to resolve our AMI IDs at the point of deploying the template due to the complexity of managing specific images in our environment and our desire to keep templates from being updated every time an AMI ID changes. The macro looks for a specific regex pattern in order to replace: "{resolveEC2ImageID:windowsServer}" for example. Thankfully the feedback you provided was enough for me to realize my folly and this override spec solved my problem:
I will probably update that property to look for either a valid EC2 image ID OR this regex string but for now I'm quite happy with this. Thanks again! |
version 1.5.0
We've been working through the lint errors since the 1.0 update and and are running into an issue trying to alter the AWS::EC2::Instance resource type to change the validation of ImageId to a regex pattern. I have been able to get the validation to properly change by providing a full schema file (using the one AWS provides as a base) but this would require us to maintain this merged version of the schema file. I have been unable to find a combination of custom rules or override specifications that allowed me to change the validation.
Here's the only part of the resource schema we changed to get the change we want:
From:
To:
If I pare down the schema file, it appears to break all sorts of things. I have tried this with/without merge-configs but am not sure it applies in this scenario.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: