Skip to content

Commit

Permalink
Merge pull request #615 from magieno/add-change-sets-cloudformation
Browse files Browse the repository at this point in the history
- Update.
  • Loading branch information
etiennenoel authored Nov 28, 2023
2 parents c372d71 + 338bd4e commit adbe350
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/aws/src/clients/cloudformation.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {moduleScoped, tag} from "@pristine-ts/common";
import {AwsModuleKeyname} from "../aws.module.keyname";
import {
Capability,
ChangeSetStatus,
ChangeSetType,
CloudFormationClient as AWSCloudformationClient,
CloudFormationClientConfig,
CreateChangeSetCommand,
Expand All @@ -26,6 +28,7 @@ import {
ExecuteChangeSetCommand,
ExecuteChangeSetCommandInput,
ExecuteChangeSetCommandOutput,
ExecutionStatus,
ListChangeSetsCommand,
ListChangeSetsCommandInput,
ListChangeSetsCommandOutput,
Expand All @@ -34,9 +37,6 @@ import {
UpdateStackCommand,
UpdateStackCommandInput,
UpdateStackCommandOutput,
ChangeSetType,
ExecutionStatus,
ChangeSetStatus,
} from "@aws-sdk/client-cloudformation";
import {CloudformationClientInterface} from "../interfaces/cloudformation-client.interface";
import {v4 as uuid} from "uuid";
Expand Down Expand Up @@ -359,11 +359,14 @@ export class CloudformationClient implements CloudformationClientInterface {
case ChangeSetStatus.DELETE_COMPLETE:
return CloudformationDeploymentStatusEnum.Completed;

case ExecutionStatus.EXECUTE_FAILED:
case ChangeSetStatus.FAILED:
if(response.StatusReason == "The submitted information didn't contain changes. Submit different information to create a change set.") {
return CloudformationDeploymentStatusEnum.NoChangesToPerform;
}
case ExecutionStatus.EXECUTE_FAILED:
case ExecutionStatus.OBSOLETE:
case ExecutionStatus.UNAVAILABLE:
case ChangeSetStatus.DELETE_FAILED:
case ChangeSetStatus.FAILED:
this.logHandler.error("Error with the ChangeSet.", {response}, AwsModuleKeyname)
return CloudformationDeploymentStatusEnum.Failed;
}
Expand Down

0 comments on commit adbe350

Please sign in to comment.