Skip to content

Commit 0e06d65

Browse files
SDK and documentation updates for GetTemplateSummary API (unrecognized resources)
1 parent 5330db5 commit 0e06d65

File tree

10 files changed

+333
-3
lines changed

10 files changed

+333
-3
lines changed

generator/ServiceModels/cloudformation/cloudformation-2010-05-15.api.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,8 @@
21732173
"TemplateURL":{"shape":"TemplateURL"},
21742174
"StackName":{"shape":"StackNameOrId"},
21752175
"StackSetName":{"shape":"StackSetNameOrId"},
2176-
"CallAs":{"shape":"CallAs"}
2176+
"CallAs":{"shape":"CallAs"},
2177+
"TemplateSummaryConfig":{"shape":"TemplateSummaryConfig"}
21772178
}
21782179
},
21792180
"GetTemplateSummaryOutput":{
@@ -2187,7 +2188,8 @@
21872188
"Version":{"shape":"Version"},
21882189
"Metadata":{"shape":"Metadata"},
21892190
"DeclaredTransforms":{"shape":"TransformsList"},
2190-
"ResourceIdentifierSummaries":{"shape":"ResourceIdentifierSummaries"}
2191+
"ResourceIdentifierSummaries":{"shape":"ResourceIdentifierSummaries"},
2192+
"Warnings":{"shape":"Warnings"}
21912193
}
21922194
},
21932195
"HandlerErrorCode":{
@@ -4099,6 +4101,12 @@
40994101
"Processed"
41004102
]
41014103
},
4104+
"TemplateSummaryConfig":{
4105+
"type":"structure",
4106+
"members":{
4107+
"TreatUnrecognizedResourceTypesAsWarnings":{"shape":"TreatUnrecognizedResourceTypesAsWarnings"}
4108+
}
4109+
},
41024110
"TemplateURL":{
41034111
"type":"string",
41044112
"max":1024,
@@ -4158,6 +4166,7 @@
41584166
"type":"list",
41594167
"member":{"shape":"TransformName"}
41604168
},
4169+
"TreatUnrecognizedResourceTypesAsWarnings":{"type":"boolean"},
41614170
"Type":{"type":"string"},
41624171
"TypeArn":{
41634172
"type":"string",
@@ -4465,6 +4474,12 @@
44654474
"PUBLIC",
44664475
"PRIVATE"
44674476
]
4477+
},
4478+
"Warnings":{
4479+
"type":"structure",
4480+
"members":{
4481+
"UnrecognizedResourceTypes":{"shape":"ResourceTypes"}
4482+
}
44684483
}
44694484
}
44704485
}

generator/ServiceModels/cloudformation/cloudformation-2010-05-15.docs.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,8 @@
21222122
"CreateChangeSetInput$ResourceTypes": "<p>The template resource types that you have permissions to work with if you execute this change set, such as <code>AWS::EC2::Instance</code>, <code>AWS::EC2::*</code>, or <code>Custom::MyCustomInstance</code>.</p> <p>If the list of resource types doesn't include a resource type that you're updating, the stack update fails. By default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM) uses this parameter for condition keys in IAM policies for CloudFormation. For more information, see <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html\">Controlling access with Identity and Access Management</a> in the CloudFormation User Guide.</p>",
21232123
"CreateStackInput$ResourceTypes": "<p>The template resource types that you have permissions to work with for this create stack action, such as <code>AWS::EC2::Instance</code>, <code>AWS::EC2::*</code>, or <code>Custom::MyCustomInstance</code>. Use the following syntax to describe template resource types: <code>AWS::*</code> (for all Amazon Web Services resources), <code>Custom::*</code> (for all custom resources), <code>Custom::<i>logical_ID</i> </code> (for a specific custom resource), <code>AWS::<i>service_name</i>::*</code> (for all resources of a particular Amazon Web Services service), and <code>AWS::<i>service_name</i>::<i>resource_logical_ID</i> </code> (for a specific Amazon Web Services resource).</p> <p>If the list of resource types doesn't include a resource that you're creating, the stack creation fails. By default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM) uses this parameter for CloudFormation-specific condition keys in IAM policies. For more information, see <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html\">Controlling Access with Identity and Access Management</a>.</p>",
21242124
"GetTemplateSummaryOutput$ResourceTypes": "<p>A list of all the template resource types that are defined in the template, such as <code>AWS::EC2::Instance</code>, <code>AWS::Dynamo::Table</code>, and <code>Custom::MyCustomInstance</code>.</p>",
2125-
"UpdateStackInput$ResourceTypes": "<p>The template resource types that you have permissions to work with for this update stack action, such as <code>AWS::EC2::Instance</code>, <code>AWS::EC2::*</code>, or <code>Custom::MyCustomInstance</code>.</p> <p>If the list of resource types doesn't include a resource that you're updating, the stack update fails. By default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM) uses this parameter for CloudFormation-specific condition keys in IAM policies. For more information, see <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html\">Controlling Access with Identity and Access Management</a>.</p>"
2125+
"UpdateStackInput$ResourceTypes": "<p>The template resource types that you have permissions to work with for this update stack action, such as <code>AWS::EC2::Instance</code>, <code>AWS::EC2::*</code>, or <code>Custom::MyCustomInstance</code>.</p> <p>If the list of resource types doesn't include a resource that you're updating, the stack update fails. By default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM) uses this parameter for CloudFormation-specific condition keys in IAM policies. For more information, see <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html\">Controlling Access with Identity and Access Management</a>.</p>",
2126+
"Warnings$UnrecognizedResourceTypes": "<p>A list of all of the unrecognized resource types. This is only returned if the <code>TemplateSummaryConfig</code> parameter has the <code>TreatUnrecognizedResourceTypesAsWarning</code> configuration set to <code>True</code>.</p>"
21262127
}
21272128
},
21282129
"ResourcesToImport": {
@@ -2911,6 +2912,12 @@
29112912
"StageList$member": null
29122913
}
29132914
},
2915+
"TemplateSummaryConfig": {
2916+
"base": "<p>Options for the <code>GetTemplateSummary</code> API action.</p>",
2917+
"refs": {
2918+
"GetTemplateSummaryInput$TemplateSummaryConfig": "<p>Specifies options for the <code>GetTemplateSummary</code> API action.</p>"
2919+
}
2920+
},
29142921
"TemplateURL": {
29152922
"base": null,
29162923
"refs": {
@@ -3010,6 +3017,12 @@
30103017
"ValidateTemplateOutput$DeclaredTransforms": "<p>A list of the transforms that are declared in the template.</p>"
30113018
}
30123019
},
3020+
"TreatUnrecognizedResourceTypesAsWarnings": {
3021+
"base": null,
3022+
"refs": {
3023+
"TemplateSummaryConfig$TreatUnrecognizedResourceTypesAsWarnings": "<p>If set to <code>True</code>, any unrecognized resource types generate warnings and not an error. Any unrecognized resource types are returned in the <code>Warnings</code> output parameter.</p>"
3024+
}
3025+
},
30133026
"Type": {
30143027
"base": null,
30153028
"refs": {
@@ -3293,6 +3306,12 @@
32933306
"DescribeTypeOutput$Visibility": "<p>The scope at which the extension is visible and usable in CloudFormation operations.</p> <p>Valid values include:</p> <ul> <li> <p> <code>PRIVATE</code>: The extension is only visible and usable within the account in which it is registered. CloudFormation marks any extensions you register as <code>PRIVATE</code>.</p> </li> <li> <p> <code>PUBLIC</code>: The extension is publicly visible and usable within any Amazon Web Services account.</p> </li> </ul>",
32943307
"ListTypesInput$Visibility": "<p>The scope at which the extensions are visible and usable in CloudFormation operations.</p> <p>Valid values include:</p> <ul> <li> <p> <code>PRIVATE</code>: Extensions that are visible and usable within this account and Region. This includes:</p> <ul> <li> <p>Private extensions you have registered in this account and Region.</p> </li> <li> <p>Public extensions that you have activated in this account and Region.</p> </li> </ul> </li> <li> <p> <code>PUBLIC</code>: Extensions that are publicly visible and available to be activated within any Amazon Web Services account. This includes extensions from Amazon Web Services, in addition to third-party publishers.</p> </li> </ul> <p>The default is <code>PRIVATE</code>.</p>"
32953308
}
3309+
},
3310+
"Warnings": {
3311+
"base": "<p>Contains any warnings returned by the <code>GetTemplateSummary</code> API action.</p>",
3312+
"refs": {
3313+
"GetTemplateSummaryOutput$Warnings": "<p>An object containing any warnings returned.</p>"
3314+
}
32963315
}
32973316
}
32983317
}

generator/ServiceModels/cloudformation/cloudformation-2010-05-15.normal.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,6 +3191,10 @@
31913191
"CallAs":{
31923192
"shape":"CallAs",
31933193
"documentation":"<p>[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p> <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for stack sets with self-managed permissions.</p> <ul> <li> <p>If you are signed in to the management account, specify <code>SELF</code>.</p> </li> <li> <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p> <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html\">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p> </li> </ul>"
3194+
},
3195+
"TemplateSummaryConfig":{
3196+
"shape":"TemplateSummaryConfig",
3197+
"documentation":"<p>Specifies options for the <code>GetTemplateSummary</code> API action.</p>"
31943198
}
31953199
},
31963200
"documentation":"<p>The input for the <a>GetTemplateSummary</a> action.</p>"
@@ -3233,6 +3237,10 @@
32333237
"ResourceIdentifierSummaries":{
32343238
"shape":"ResourceIdentifierSummaries",
32353239
"documentation":"<p>A list of resource identifier summaries that describe the target resources of an import operation and the properties you can provide during the import to identify the target resources. For example, <code>BucketName</code> is a possible identifier property for an <code>AWS::S3::Bucket</code> resource.</p>"
3240+
},
3241+
"Warnings":{
3242+
"shape":"Warnings",
3243+
"documentation":"<p>An object containing any warnings returned.</p>"
32363244
}
32373245
},
32383246
"documentation":"<p>The output for the <a>GetTemplateSummary</a> action.</p>"
@@ -6368,6 +6376,16 @@
63686376
"Processed"
63696377
]
63706378
},
6379+
"TemplateSummaryConfig":{
6380+
"type":"structure",
6381+
"members":{
6382+
"TreatUnrecognizedResourceTypesAsWarnings":{
6383+
"shape":"TreatUnrecognizedResourceTypesAsWarnings",
6384+
"documentation":"<p>If set to <code>True</code>, any unrecognized resource types generate warnings and not an error. Any unrecognized resource types are returned in the <code>Warnings</code> output parameter.</p>"
6385+
}
6386+
},
6387+
"documentation":"<p>Options for the <code>GetTemplateSummary</code> API action.</p>"
6388+
},
63716389
"TemplateURL":{
63726390
"type":"string",
63736391
"max":1024,
@@ -6446,6 +6464,7 @@
64466464
"type":"list",
64476465
"member":{"shape":"TransformName"}
64486466
},
6467+
"TreatUnrecognizedResourceTypesAsWarnings":{"type":"boolean"},
64496468
"Type":{"type":"string"},
64506469
"TypeArn":{
64516470
"type":"string",
@@ -7039,6 +7058,16 @@
70397058
"PUBLIC",
70407059
"PRIVATE"
70417060
]
7061+
},
7062+
"Warnings":{
7063+
"type":"structure",
7064+
"members":{
7065+
"UnrecognizedResourceTypes":{
7066+
"shape":"ResourceTypes",
7067+
"documentation":"<p>A list of all of the unrecognized resource types. This is only returned if the <code>TemplateSummaryConfig</code> parameter has the <code>TreatUnrecognizedResourceTypesAsWarning</code> configuration set to <code>True</code>.</p>"
7068+
}
7069+
},
7070+
"documentation":"<p>Contains any warnings returned by the <code>GetTemplateSummary</code> API action.</p>"
70427071
}
70437072
},
70447073
"documentation":"<fullname>CloudFormation</fullname> <p>CloudFormation allows you to create and manage Amazon Web Services infrastructure deployments predictably and repeatedly. You can use CloudFormation to leverage Amazon Web Services products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store, Amazon Simple Notification Service, Elastic Load Balancing, and Auto Scaling to build highly reliable, highly scalable, cost-effective applications without creating or configuring the underlying Amazon Web Services infrastructure.</p> <p>With CloudFormation, you declare all your resources and dependencies in a template file. The template defines a collection of resources as a single unit called a stack. CloudFormation creates and deletes all member resources of the stack together and manages all dependencies between the resources for you.</p> <p>For more information about CloudFormation, see the <a href=\"http://aws.amazon.com/cloudformation/\">CloudFormation product page</a>.</p> <p>CloudFormation makes use of other Amazon Web Services products. If you need additional technical information about a specific Amazon Web Services product, you can find the product's technical documentation at <a href=\"https://docs.aws.amazon.com/\">docs.aws.amazon.com</a>.</p>"

sdk/src/Services/CloudFormation/Generated/Model/GetTemplateSummaryRequest.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public partial class GetTemplateSummaryRequest : AmazonCloudFormationRequest
5252
private string _stackName;
5353
private string _stackSetName;
5454
private string _templateBody;
55+
private TemplateSummaryConfig _templateSummaryConfig;
5556
private string _templateURL;
5657

5758
/// <summary>
@@ -169,6 +170,24 @@ internal bool IsSetTemplateBody()
169170
return this._templateBody != null;
170171
}
171172

173+
/// <summary>
174+
/// Gets and sets the property TemplateSummaryConfig.
175+
/// <para>
176+
/// Specifies options for the <code>GetTemplateSummary</code> API action.
177+
/// </para>
178+
/// </summary>
179+
public TemplateSummaryConfig TemplateSummaryConfig
180+
{
181+
get { return this._templateSummaryConfig; }
182+
set { this._templateSummaryConfig = value; }
183+
}
184+
185+
// Check to see if TemplateSummaryConfig property is set
186+
internal bool IsSetTemplateSummaryConfig()
187+
{
188+
return this._templateSummaryConfig != null;
189+
}
190+
172191
/// <summary>
173192
/// Gets and sets the property TemplateURL.
174193
/// <para>

sdk/src/Services/CloudFormation/Generated/Model/GetTemplateSummaryResponse.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public partial class GetTemplateSummaryResponse : AmazonWebServiceResponse
4242
private List<ResourceIdentifierSummary> _resourceIdentifierSummaries = new List<ResourceIdentifierSummary>();
4343
private List<string> _resourceTypes = new List<string>();
4444
private string _version;
45+
private Warnings _warnings;
4546

4647
/// <summary>
4748
/// Gets and sets the property Capabilities.
@@ -221,5 +222,23 @@ internal bool IsSetVersion()
221222
return this._version != null;
222223
}
223224

225+
/// <summary>
226+
/// Gets and sets the property Warnings.
227+
/// <para>
228+
/// An object containing any warnings returned.
229+
/// </para>
230+
/// </summary>
231+
public Warnings Warnings
232+
{
233+
get { return this._warnings; }
234+
set { this._warnings = value; }
235+
}
236+
237+
// Check to see if Warnings property is set
238+
internal bool IsSetWarnings()
239+
{
240+
return this._warnings != null;
241+
}
242+
224243
}
225244
}

sdk/src/Services/CloudFormation/Generated/Model/Internal/MarshallTransformations/GetTemplateSummaryRequestMarshaller.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ public IRequest Marshall(GetTemplateSummaryRequest publicRequest)
7474
{
7575
request.Parameters.Add("TemplateBody", StringUtils.FromString(publicRequest.TemplateBody));
7676
}
77+
if(publicRequest.IsSetTemplateSummaryConfig())
78+
{
79+
if(publicRequest.TemplateSummaryConfig.IsSetTreatUnrecognizedResourceTypesAsWarnings())
80+
{
81+
request.Parameters.Add("TemplateSummaryConfig" + "." + "TreatUnrecognizedResourceTypesAsWarnings", StringUtils.FromBool(publicRequest.TemplateSummaryConfig.TreatUnrecognizedResourceTypesAsWarnings));
82+
}
83+
}
7784
if(publicRequest.IsSetTemplateURL())
7885
{
7986
request.Parameters.Add("TemplateURL", StringUtils.FromString(publicRequest.TemplateURL));

sdk/src/Services/CloudFormation/Generated/Model/Internal/MarshallTransformations/GetTemplateSummaryResponseUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetTemplate
140140
response.Version = unmarshaller.Unmarshall(context);
141141
continue;
142142
}
143+
if (context.TestExpression("Warnings", targetDepth))
144+
{
145+
var unmarshaller = WarningsUnmarshaller.Instance;
146+
response.Warnings = unmarshaller.Unmarshall(context);
147+
continue;
148+
}
143149
}
144150
}
145151

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the cloudformation-2010-05-15.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Net;
24+
using System.Text;
25+
using System.Xml.Serialization;
26+
27+
using Amazon.CloudFormation.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
namespace Amazon.CloudFormation.Model.Internal.MarshallTransformations
33+
{
34+
/// <summary>
35+
/// Response Unmarshaller for Warnings Object
36+
/// </summary>
37+
public class WarningsUnmarshaller : IUnmarshaller<Warnings, XmlUnmarshallerContext>, IUnmarshaller<Warnings, JsonUnmarshallerContext>
38+
{
39+
/// <summary>
40+
/// Unmarshaller the response from the service to the response class.
41+
/// </summary>
42+
/// <param name="context"></param>
43+
/// <returns></returns>
44+
public Warnings Unmarshall(XmlUnmarshallerContext context)
45+
{
46+
Warnings unmarshalledObject = new Warnings();
47+
int originalDepth = context.CurrentDepth;
48+
int targetDepth = originalDepth + 1;
49+
50+
if (context.IsStartOfDocument)
51+
targetDepth += 2;
52+
53+
while (context.ReadAtDepth(originalDepth))
54+
{
55+
if (context.IsStartElement || context.IsAttribute)
56+
{
57+
if (context.TestExpression("UnrecognizedResourceTypes/member", targetDepth))
58+
{
59+
var unmarshaller = StringUnmarshaller.Instance;
60+
var item = unmarshaller.Unmarshall(context);
61+
unmarshalledObject.UnrecognizedResourceTypes.Add(item);
62+
continue;
63+
}
64+
}
65+
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
66+
{
67+
return unmarshalledObject;
68+
}
69+
}
70+
71+
return unmarshalledObject;
72+
}
73+
74+
/// <summary>
75+
/// Unmarshaller error response to exception.
76+
/// </summary>
77+
/// <param name="context"></param>
78+
/// <returns></returns>
79+
public Warnings Unmarshall(JsonUnmarshallerContext context)
80+
{
81+
return null;
82+
}
83+
84+
85+
private static WarningsUnmarshaller _instance = new WarningsUnmarshaller();
86+
87+
/// <summary>
88+
/// Gets the singleton.
89+
/// </summary>
90+
public static WarningsUnmarshaller Instance
91+
{
92+
get
93+
{
94+
return _instance;
95+
}
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)