Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle committed Nov 29, 2023
1 parent 6dabee6 commit 159d3a1
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions packages/integration-tests/src/find_deployed_resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,42 +59,3 @@ export class DeployedResourcesFinder {
return resourcePhysicalIds;
};
}

/**
* Returns the physical IDs of the resources of type "resourceType" in the stack defined by "backendId"
* Traverses nested stacks as well
*/
export const findDeployedResources = async (
cfnClient: CloudFormationClient,
backendId: BackendIdentifier,
resourceType: string
): Promise<string[]> => {
const stackName = BackendIdentifierConversions.toStackName(backendId);

const queue = [stackName];

const resourcePhysicalIds: string[] = [];

while (queue.length > 0) {
const currentStack = queue.pop();
const response = await cfnClient.send(
new DescribeStackResourcesCommand({ StackName: currentStack })
);

for (const resource of response.StackResources || []) {
if (
resource.ResourceType === 'AWS::CloudFormation::Stack' &&
resource.PhysicalResourceId
) {
queue.unshift(resource.PhysicalResourceId);
} else if (
resource.ResourceType === resourceType &&
resource.PhysicalResourceId
) {
resourcePhysicalIds.push(resource.PhysicalResourceId);
}
}
}

return resourcePhysicalIds;
};

0 comments on commit 159d3a1

Please sign in to comment.