Skip to content

Commit

Permalink
generate_docs() for conditionalCreateOnlyProperties (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatMyron authored Nov 15, 2022
1 parent 0da76d2 commit b8ddac7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rpdk/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,11 @@ def _set_docs_properties( # noqa: C901
and proppath_ptr in self.schema["createOnlyProperties"]
):
prop["createonly"] = True

if (
"conditionalCreateOnlyProperties" in self.schema
and proppath_ptr in self.schema["conditionalCreateOnlyProperties"]
):
prop["conditionalCreateOnly"] = True
if (
"readOnlyProperties" in self.schema
and proppath_ptr in self.schema["readOnlyProperties"]
Expand Down
3 changes: 3 additions & 0 deletions src/rpdk/core/templates/docs-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ _Pattern_: <code>{{ prop.pattern }}</code>
{% if prop.createonly %}

_Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)
{% elif prop.conditionalCreateOnly %}

_Update requires_: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)
{% else %}

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)
Expand Down
3 changes: 3 additions & 0 deletions src/rpdk/core/templates/docs-subproperty.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ _Pattern_: <code>{{ prop.pattern }}</code>
{% if prop.createonly %}

_Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)
{% elif prop.conditionalCreateOnly %}

_Update requires_: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)
{% else %}

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)
Expand Down
3 changes: 3 additions & 0 deletions tests/data/schema/valid/valid_type_complex.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@
"createOnlyProperties": [
"/properties/str2"
],
"conditionalCreateOnlyProperties": [
"/properties/obj1"
],
"additionalProperties": false
}

0 comments on commit b8ddac7

Please sign in to comment.