aws-cloudformation / aws-cloudformation/cloudformation-cli

CreateOnly properties changing on update causing contract tests fail on wrong error

Open
#1,080 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
336
Forks
172
Avg merge
3d 5m
Merged PRs (30d)
3

Description

While trying to update a CreateOnlyProperty on the update contract, the expectation is to get the following error:
AssertionError: Any createOnlyProperties specified in update handler input MUST NOT be different from their previous state

When the CreateOnlyProperty is an object and one of its fields was modified in the update contract I'm getting the following error:
AssertionError: All properties specified in the request MUST be present in the model returned, and they MUST match exactly, with the exception of properties defined as writeOnlyProperties in the resource schema

updating a primitive property (e.g. string) for example:

"prop": {
"type": "string",
},

will lead to the expected error.

updating an object property field for example:

"prop": {
"type": "object",
"properties": {
"a": {
"type": "string"
},
"b": {
"type": "string"
}
},
"additionalProperties": false
},
in case the update contract updates "a" or "b" the second error is issued.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.