Skip to content

Commit f3cc700

Browse files
committed
feat: allow a specific profile to be used
1 parent c450a89 commit f3cc700

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/index.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,26 @@ export const templateTags = [
2222
type: "string",
2323
defaultValue: "us-east-1",
2424
},
25+
{
26+
displayName: "Profile",
27+
description: "Name of the AWS CLI Profile to use",
28+
type: "string",
29+
},
2530
],
26-
async run(context, StackName, output, region): Promise<string> {
27-
const cf = new AWS.CloudFormation({ region: region });
31+
async run(
32+
context,
33+
StackName: string,
34+
output: string,
35+
region: string,
36+
profile: string
37+
): Promise<string> {
38+
let credentials;
39+
40+
if (profile) {
41+
credentials = new AWS.SharedIniFileCredentials({ profile });
42+
}
43+
44+
const cf = new AWS.CloudFormation({ region: region, credentials });
2845
const stackDescriptions = await cf
2946
.describeStacks({
3047
StackName,

0 commit comments

Comments
 (0)