Skip to content

Commit

Permalink
feat(client-cloudformation): SDK and documentation updates for GetTem…
Browse files Browse the repository at this point in the history
…plateSummary API (unrecognized resources)
  • Loading branch information
awstools committed Jul 19, 2023
1 parent 4de12dc commit 99e559f
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export interface GetTemplateSummaryCommandOutput extends GetTemplateSummaryOutpu
* StackName: "STRING_VALUE",
* StackSetName: "STRING_VALUE",
* CallAs: "SELF" || "DELEGATED_ADMIN",
* TemplateSummaryConfig: { // TemplateSummaryConfig
* TreatUnrecognizedResourceTypesAsWarnings: true || false,
* },
* };
* const command = new GetTemplateSummaryCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -97,6 +100,11 @@ export interface GetTemplateSummaryCommandOutput extends GetTemplateSummaryOutpu
* // ],
* // },
* // ],
* // Warnings: { // Warnings
* // UnrecognizedResourceTypes: [
* // "STRING_VALUE",
* // ],
* // },
* // };
*
* ```
Expand Down
81 changes: 58 additions & 23 deletions clients/client-cloudformation/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1780,31 +1780,31 @@ export interface CreateChangeSetInput {

/**
* <p>Determines what action will be taken if stack creation fails. If this parameter is specified, the
* <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API operation must not
* be specified. This must be one of these values:</p>
* <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API operation must not
* be specified. This must be one of these values:</p>
* <ul>
* <li>
* <p>
* <code>DELETE</code> - Deletes the change set if the stack creation fails. This is only valid when the
* <code>ChangeSetType</code> parameter is set to <code>CREATE</code>. If the deletion of the stack fails, the status
* of the stack is <code>DELETE_FAILED</code>.</p>
* <code>ChangeSetType</code> parameter is set to <code>CREATE</code>. If the deletion of the stack fails, the status
* of the stack is <code>DELETE_FAILED</code>.</p>
* </li>
* <li>
* <p>
* <code>DO_NOTHING</code> - if the stack creation fails, do nothing. This is equivalent to specifying
* <code>true</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* <code>true</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* </li>
* <li>
* <p>
* <code>ROLLBACK</code> - if the stack creation fails, roll back the stack. This is equivalent to specifying
* <code>false</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* <code>false</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* </li>
* </ul>
* <p>For nested stacks, when the <code>OnStackFailure</code> parameter is set to <code>DELETE</code> for the change
* set for the parent stack, any failure in a child stack will cause the parent stack creation to fail and all stacks to
* be deleted.</p>
* set for the parent stack, any failure in a child stack will cause the parent stack creation to fail and all stacks to
* be deleted.</p>
*/
OnStackFailure?: OnStackFailure | string;
}
Expand Down Expand Up @@ -3267,26 +3267,26 @@ export interface DescribeChangeSetOutput {

/**
* <p>Determines what action will be taken if stack creation fails. When this parameter is specified, the
* <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API operation must not
* be specified. This must be one of these values:</p>
* <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API operation must not
* be specified. This must be one of these values:</p>
* <ul>
* <li>
* <p>
* <code>DELETE</code> - Deletes the change set if the stack creation fails. This is only valid when the
* <code>ChangeSetType</code> parameter is set to <code>CREATE</code>. If the deletion of the stack fails, the status
* of the stack is <code>DELETE_FAILED</code>.</p>
* <code>ChangeSetType</code> parameter is set to <code>CREATE</code>. If the deletion of the stack fails, the status
* of the stack is <code>DELETE_FAILED</code>.</p>
* </li>
* <li>
* <p>
* <code>DO_NOTHING</code> - if the stack creation fails, do nothing. This is equivalent to specifying
* <code>true</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* <code>true</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* </li>
* <li>
* <p>
* <code>ROLLBACK</code> - if the stack creation fails, roll back the stack. This is equivalent to specifying
* <code>false</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* <code>false</code> for the <code>DisableRollback</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html">ExecuteChangeSet</a> API
* operation.</p>
* </li>
* </ul>
*/
Expand Down Expand Up @@ -6071,19 +6071,19 @@ export interface ExecuteChangeSetInput {

/**
* <p>Preserves the state of previously provisioned resources when an operation
* fails. This parameter can't be specified when
* the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation was
* specified.</p>
* fails. This parameter can't be specified when
* the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation was
* specified.</p>
* <ul>
* <li>
* <p>
* <code>True</code> - if the stack creation fails, do nothing. This is equivalent to specifying
* <code>DO_NOTHING</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p>
* <code>DO_NOTHING</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p>
* </li>
* <li>
* <p>
* <code>False</code> - if the stack creation fails, roll back the stack. This is equivalent to specifying
* <code>ROLLBACK</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p>
* <code>ROLLBACK</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p>
* </li>
* </ul>
* <p>Default: <code>True</code>
Expand Down Expand Up @@ -6191,6 +6191,18 @@ export interface GetTemplateOutput {
StagesAvailable?: (TemplateStage | string)[];
}

/**
* @public
* <p>Options for the <code>GetTemplateSummary</code> API action.</p>
*/
export interface TemplateSummaryConfig {
/**
* <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>
*/
TreatUnrecognizedResourceTypesAsWarnings?: boolean;
}

/**
* @public
* <p>The input for the <a>GetTemplateSummary</a> action.</p>
Expand Down Expand Up @@ -6248,6 +6260,11 @@ export interface GetTemplateSummaryInput {
* </ul>
*/
CallAs?: CallAs | string;

/**
* <p>Specifies options for the <code>GetTemplateSummary</code> API action.</p>
*/
TemplateSummaryConfig?: TemplateSummaryConfig;
}

/**
Expand Down Expand Up @@ -6323,6 +6340,19 @@ export interface ResourceIdentifierSummary {
ResourceIdentifiers?: string[];
}

/**
* @public
* <p>Contains any warnings returned by the <code>GetTemplateSummary</code> API action.</p>
*/
export interface Warnings {
/**
* <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>
*/
UnrecognizedResourceTypes?: string[];
}

/**
* @public
* <p>The output for the <a>GetTemplateSummary</a> action.</p>
Expand Down Expand Up @@ -6380,6 +6410,11 @@ export interface GetTemplateSummaryOutput {
* is a possible identifier property for an <code>AWS::S3::Bucket</code> resource.</p>
*/
ResourceIdentifierSummaries?: ResourceIdentifierSummary[];

/**
* <p>An object containing any warnings returned.</p>
*/
Warnings?: Warnings;
}

/**
Expand Down
42 changes: 42 additions & 0 deletions clients/client-cloudformation/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ import {
Tag,
TemplateParameter,
TemplateStage,
TemplateSummaryConfig,
TestTypeInput,
TestTypeOutput,
TokenAlreadyExistsException,
Expand All @@ -403,6 +404,7 @@ import {
UpdateTerminationProtectionOutput,
ValidateTemplateInput,
ValidateTemplateOutput,
Warnings,
} from "../models/models_0";

/**
Expand Down Expand Up @@ -6256,6 +6258,13 @@ const se_GetTemplateSummaryInput = (input: GetTemplateSummaryInput, context: __S
if (input.CallAs != null) {
entries["CallAs"] = input.CallAs;
}
if (input.TemplateSummaryConfig != null) {
const memberEntries = se_TemplateSummaryConfig(input.TemplateSummaryConfig, context);
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `TemplateSummaryConfig.${key}`;
entries[loc] = value;
});
}
return entries;
};

Expand Down Expand Up @@ -7259,6 +7268,17 @@ const se_Tags = (input: Tag[], context: __SerdeContext): any => {
return entries;
};

/**
* serializeAws_queryTemplateSummaryConfig
*/
const se_TemplateSummaryConfig = (input: TemplateSummaryConfig, context: __SerdeContext): any => {
const entries: any = {};
if (input.TreatUnrecognizedResourceTypesAsWarnings != null) {
entries["TreatUnrecognizedResourceTypesAsWarnings"] = input.TreatUnrecognizedResourceTypesAsWarnings;
}
return entries;
};

/**
* serializeAws_queryTestTypeInput
*/
Expand Down Expand Up @@ -8747,6 +8767,9 @@ const de_GetTemplateSummaryOutput = (output: any, context: __SerdeContext): GetT
context
);
}
if (output["Warnings"] !== undefined) {
contents.Warnings = de_Warnings(output["Warnings"], context);
}
return contents;
};

Expand Down Expand Up @@ -11065,6 +11088,25 @@ const de_ValidateTemplateOutput = (output: any, context: __SerdeContext): Valida
return contents;
};

/**
* deserializeAws_queryWarnings
*/
const de_Warnings = (output: any, context: __SerdeContext): Warnings => {
const contents: any = {};
if (output.UnrecognizedResourceTypes === "") {
contents.UnrecognizedResourceTypes = [];
} else if (
output["UnrecognizedResourceTypes"] !== undefined &&
output["UnrecognizedResourceTypes"]["member"] !== undefined
) {
contents.UnrecognizedResourceTypes = de_ResourceTypes(
__getArrayIfSingleItem(output["UnrecognizedResourceTypes"]["member"]),
context
);
}
return contents;
};

const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
httpStatusCode: output.statusCode,
requestId:
Expand Down
Loading

0 comments on commit 99e559f

Please sign in to comment.