Skip to content

Commit

Permalink
Merge pull request #617 from magieno/add-change-sets-cloudformation
Browse files Browse the repository at this point in the history
- Fixed issue.
  • Loading branch information
etiennenoel authored Nov 28, 2023
2 parents 3f6b10d + 12cdbe5 commit 1940af4
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions packages/aws/src/clients/cloudformation.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,12 @@ export class CloudformationClient implements CloudformationClientInterface {
* @param input The input to describe a change set.
* @param retryNumber
*/
async describeChangeSet(input: DescribeChangeSetCommandInput, retryNumber = 0): Promise<DescribeChangeSetCommandOutput> {
async describeChangeSet(input: DescribeChangeSetCommandInput): Promise<DescribeChangeSetCommandOutput> {
this.logHandler.debug("CLOUDFORMATION CLIENT - Describe Change Set", {input}, AwsModuleKeyname);
const command = new DescribeChangeSetCommand(input)
try {
return await this.getClient().send(command);
} catch (e) {
if(e.code === "Throttling" && retryNumber < 3) {
await new Promise(resolve => setTimeout(resolve, (retryNumber + 1) * 1000));

return this.describeChangeSet(input, retryNumber++);
}
this.logHandler.error("Error describing change set in cloudformation", {error: e}, AwsModuleKeyname);
throw e;
}
Expand All @@ -236,17 +231,12 @@ export class CloudformationClient implements CloudformationClientInterface {
* @param input The input to execute a change set.
* @param retryNumber
*/
async executeChangeSet(input: ExecuteChangeSetCommandInput, retryNumber = 0): Promise<ExecuteChangeSetCommandOutput> {
async executeChangeSet(input: ExecuteChangeSetCommandInput): Promise<ExecuteChangeSetCommandOutput> {
this.logHandler.debug("CLOUDFORMATION CLIENT - Execute Change Set", {input}, AwsModuleKeyname);
const command = new ExecuteChangeSetCommand(input)
try {
return await this.getClient().send(command);
} catch (e) {
if(e.code === "Throttling" && retryNumber < 3) {
await new Promise(resolve => setTimeout(resolve, (retryNumber + 1) * 1000));

return this.executeChangeSet(input, retryNumber++);
}
this.logHandler.error("Error executing change set in cloudformation", {error: e}, AwsModuleKeyname);
throw e;
}
Expand Down Expand Up @@ -364,7 +354,7 @@ export class CloudformationClient implements CloudformationClientInterface {
if (statusCallback) {
statusCallback(CloudformationDeploymentStatusEnum.InProgress, changeSetName);
}
continue;
break;

case ExecutionStatus.EXECUTE_COMPLETE:
case ChangeSetStatus.CREATE_COMPLETE:
Expand Down

0 comments on commit 1940af4

Please sign in to comment.