Skip to content

Commit 835b12b

Browse files
chore: cleaning
1 parent 4715a1d commit 835b12b

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

src/cloudFormation.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -183,54 +183,7 @@ async function getLambdasInStack(
183183
return allLambdas;
184184
}
185185

186-
/**
187-
* Get CloudFormation stack template
188-
* @param stackName
189-
* @param awsConfiguration
190-
* @returns
191-
*/
192-
async function getStackResourcePhysicalResourceId(
193-
stackName: string,
194-
logicalResourceId: string,
195-
awsConfiguration: AwsConfiguration,
196-
) {
197-
const { DescribeStackResourceCommand } = await import(
198-
'@aws-sdk/client-cloudformation'
199-
);
200-
const command = new DescribeStackResourceCommand({
201-
StackName: stackName,
202-
LogicalResourceId: logicalResourceId,
203-
});
204-
const cloudFormationClient = await getCloudFormationClient(awsConfiguration);
205-
206-
try {
207-
const response = await cloudFormationClient.send(command);
208-
209-
if (!response.StackResourceDetail) {
210-
throw new Error(
211-
`No resource details found in stack ${stackName} for ${logicalResourceId}`,
212-
);
213-
}
214-
215-
const physicalResourceId = response.StackResourceDetail.PhysicalResourceId;
216-
if (!physicalResourceId)
217-
throw new Error(
218-
`No physicalResourceId found in stack ${stackName} for ${logicalResourceId}`,
219-
);
220-
return physicalResourceId;
221-
} catch (error: any) {
222-
if (error.name === 'ValidationError') {
223-
Logger.error(
224-
`Stack ${stackName} and/or ${logicalResourceId} not found. Try specifying a region. Error: ${error.message}`,
225-
error,
226-
);
227-
}
228-
throw error;
229-
}
230-
}
231-
232186
export const CloudFormation = {
233187
getCloudFormationStackTemplate,
234188
getLambdasInStack,
235-
getStackResourcePhysicalResourceId: getStackResourcePhysicalResourceId,
236189
};

0 commit comments

Comments
 (0)