diff --git a/src/index.ts b/src/index.ts index f8cc2e3..cfbde47 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,9 +22,26 @@ export const templateTags = [ type: "string", defaultValue: "us-east-1", }, + { + displayName: "Profile", + description: "Name of the AWS CLI Profile to use", + type: "string", + }, ], - async run(context, StackName, output, region): Promise { - const cf = new AWS.CloudFormation({ region: region }); + async run( + context, + StackName: string, + output: string, + region: string, + profile: string + ): Promise { + let credentials; + + if (profile) { + credentials = new AWS.SharedIniFileCredentials({ profile }); + } + + const cf = new AWS.CloudFormation({ region: region, credentials }); const stackDescriptions = await cf .describeStacks({ StackName,