From c27a8120a3aad2b2c3c843f4d97aebc30d3b69ad Mon Sep 17 00:00:00 2001 From: Pat Myron Date: Sun, 25 Apr 2021 20:24:17 -0700 Subject: [PATCH] generate_docs() for conditionalCreateOnlyProperties https://github.com/aws-cloudformation/cloudformation-cli/pull/367#discussion_r395955803 https://github.com/aws-cloudformation/aws-cloudformation-resource-schema/pull/121 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt --- src/rpdk/core/project.py | 6 +++++- src/rpdk/core/templates/docs-readme.md | 3 +++ src/rpdk/core/templates/docs-subproperty.md | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/rpdk/core/project.py b/src/rpdk/core/project.py index 626266513..80a7ef117 100644 --- a/src/rpdk/core/project.py +++ b/src/rpdk/core/project.py @@ -648,7 +648,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"] diff --git a/src/rpdk/core/templates/docs-readme.md b/src/rpdk/core/templates/docs-readme.md index eabb294ef..fe98236aa 100644 --- a/src/rpdk/core/templates/docs-readme.md +++ b/src/rpdk/core/templates/docs-readme.md @@ -76,6 +76,9 @@ _Pattern_: {{ prop.pattern }} {% 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) diff --git a/src/rpdk/core/templates/docs-subproperty.md b/src/rpdk/core/templates/docs-subproperty.md index 02080afa2..9445bb2e2 100644 --- a/src/rpdk/core/templates/docs-subproperty.md +++ b/src/rpdk/core/templates/docs-subproperty.md @@ -71,6 +71,9 @@ _Pattern_: {{ prop.pattern }} {% 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)