You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to deploy an invalid template we should get an error. For example running cfn-lint returns:
$ cfn-lint template.json
E3002 Additional properties are not allowed ('asdfasdf' was unexpected)
final_template.json:7:9
E3002 Additional properties are not allowed ('qweqweqwe' was unexpected)
final_template.json:8:9
E3001 Additional properties are not allowed ('Foo' was unexpected)
final_template.json:10:7
Trying to deploy this template to a real account returns
An error occurred (ValidationError) when calling the UpdateStack operation: Invalid template resource property 'Foo'
Additional info
If I modify the template slightly by removing the top-level Foo:
and try to deploy the stack to a real account, the CLI doesn't return an error anymore, but the creation is triggered and fails with the following CREATE_FAILED event:
The first issue should be a simple enhancement. We already use the cfn_lint library when the user explicitly calls validate_template - it makes sense to also call this validation when creating a stack.
The second, to validate the supplied parameters, is probably also doable. The botocore library already lists all parameters for each request, so we should be able to extract that information. This is just a bit more work, as I don't think we have anything in place for that yet.
PR's are welcome, if you want to take a stab at either and/or both!
Running
moto v5.0.28
Replication Steps
moto_server
where
template.json
is:Expectation
When trying to deploy an invalid template we should get an error. For example running cfn-lint returns:
Trying to deploy this template to a real account returns
Additional info
If I modify the template slightly by removing the top-level
Foo
:and try to deploy the stack to a real account, the CLI doesn't return an error anymore, but the creation is triggered and fails with the following
CREATE_FAILED
event:The text was updated successfully, but these errors were encountered: