Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Update. #581

Merged
merged 3 commits into from
Oct 18, 2023
Merged

- Update. #581

merged 3 commits into from
Oct 18, 2023

Conversation

etiennenoel
Copy link
Collaborator

No description provided.

@etiennenoel etiennenoel requested a review from mathieugh October 16, 2023 17:35
this.logHandler.debug("CLOUDFORMATION CLIENT - Getting stack information", {stackName}, AwsModuleKeyname);
const command = new DescribeStacksCommand({
StackName: stackName,
})
try {
const response: DescribeStacksCommandOutput = await this.getClient().send(command);
if(!response.Stacks || response.Stacks.length < 1){
throw new Error("No stacks were returned from cloudformation");
return undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we should log a warning here as well ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because it's the only way to know if a stack already exists, it's to query it.

/**
* Gets the description and all its details from all the CloudFormation stacks.
*/
async listStacks(): Promise<Stack[] | undefined> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this command really return undefined or just an empty array ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently undefined but you are right I prefer an empty array.

@etiennenoel etiennenoel merged commit 50da005 into master Oct 18, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants