File tree Expand file tree Collapse file tree 5 files changed +13
-15
lines changed
dynamicResources/explorer/nodes Expand file tree Collapse file tree 5 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 55
66import * as vscode from 'vscode'
77import * as nls from 'vscode-nls'
8- import { CloudFormationClient , CloudFormationClient } from '../../../shared/clients/cloudFormation'
8+ import { CloudFormationClient } from '../../../shared/clients/cloudFormation'
99import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
1010import { PlaceholderNode } from '../../../shared/treeview/nodes/placeholderNode'
1111import { makeChildrenNodes } from '../../../shared/treeview/utils'
Original file line number Diff line number Diff line change 44 */
55
66import { CloudFormation } from 'aws-sdk'
7+ import * as CloudFormationV3 from '@aws-sdk/client-cloudformation'
78import globals from '../extensionGlobals'
89import { AsyncCollection } from '../utilities/asyncCollection'
910import { pageableToCollection } from '../utilities/collectionUtils'
1011import { isNonNullable } from '../utilities/tsUtils'
12+ import { ClientWrapper } from './clientWrapper'
1113
12- export class CloudFormationClient {
13- public constructor ( public readonly regionCode : string ) { }
14-
15- public async deleteStack ( name : string ) : Promise < void > {
16- const client = await this . createSdkClient ( )
14+ export class CloudFormationClient extends ClientWrapper < CloudFormationV3 . CloudFormationClient > {
15+ public constructor ( regionCode : string ) {
16+ super ( regionCode , CloudFormationV3 . CloudFormationClient )
17+ }
1718
18- await client
19- . deleteStack ( {
20- StackName : name ,
21- } )
22- . promise ( )
19+ public async deleteStack ( name : string ) : Promise < CloudFormationV3 . DeleteStackCommandOutput > {
20+ return await this . makeRequest ( CloudFormationV3 . DeleteStackCommand , { StackName : name } )
2321 }
2422
2523 public async describeType ( typeName : string ) : Promise < CloudFormation . DescribeTypeOutput > {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { ResourceNode } from '../../dynamicResources/explorer/nodes/resourceNode
1313import { ResourceTypeNode } from '../../dynamicResources/explorer/nodes/resourceTypeNode'
1414import { formatResourceModel , AwsResourceManager } from '../../dynamicResources/awsResourceManager'
1515import { CloudControlClient , DefaultCloudControlClient } from '../../shared/clients/cloudControlClient'
16- import { CloudFormationClient , CloudFormationClient } from '../../shared/clients/cloudFormation'
16+ import { CloudFormationClient } from '../../shared/clients/cloudFormation'
1717import { makeTemporaryToolkitFolder , readFileAsString } from '../../shared/filesystemUtilities'
1818import { FakeExtensionContext } from '../fakeExtensionContext'
1919import { existsSync } from 'fs' // eslint-disable-line no-restricted-imports
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ describe('SAM DeployWizard', async function () {
5353
5454 // Simulate return of deployed stacks
5555 mockDefaultCFNClient = sandbox . createStubInstance ( CloudFormationClientModule . CloudFormationClient )
56- sandbox . stub ( CloudFormationClientModule , 'DefaultCloudFormationClient ' ) . returns ( mockDefaultCFNClient )
56+ sandbox . stub ( CloudFormationClientModule , 'CloudFormationClient ' ) . returns ( mockDefaultCFNClient )
5757 mockDefaultCFNClient . listAllStacks . returns ( intoCollection ( stackSummaries ) )
5858
5959 // Simulate return of list bucket
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ describe('SAM SyncWizard', async () => {
144144
145145 // Simulate return of deployed stacks
146146 mockDefaultCFNClient = sandbox . createStubInstance ( CloudFormationClientModule . CloudFormationClient )
147- sandbox . stub ( CloudFormationClientModule , 'DefaultCloudFormationClient ' ) . returns ( mockDefaultCFNClient )
147+ sandbox . stub ( CloudFormationClientModule , 'CloudFormationClient ' ) . returns ( mockDefaultCFNClient )
148148 mockDefaultCFNClient . listAllStacks . returns ( intoCollection ( stackSummaries ) )
149149
150150 // Simulate return of list bucket
@@ -1094,7 +1094,7 @@ describe('SAM runSync', () => {
10941094
10951095 // Simulate return of deployed stacks
10961096 mockDefaultCFNClient = sandbox . createStubInstance ( CloudFormationClientModule . CloudFormationClient )
1097- sandbox . stub ( CloudFormationClientModule , 'DefaultCloudFormationClient ' ) . returns ( mockDefaultCFNClient )
1097+ sandbox . stub ( CloudFormationClientModule , 'CloudFormationClient ' ) . returns ( mockDefaultCFNClient )
10981098 mockDefaultCFNClient . listAllStacks . returns ( intoCollection ( stackSummaries ) )
10991099
11001100 // Simulate return of list bucket
You can’t perform that action at this time.
0 commit comments