Skip to content

Commit

Permalink
feat: allow a specific profile to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
theBenForce committed Apr 23, 2020
1 parent c450a89 commit f3cc700
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
const cf = new AWS.CloudFormation({ region: region });
async run(
context,
StackName: string,
output: string,
region: string,
profile: string
): Promise<string> {
let credentials;

if (profile) {
credentials = new AWS.SharedIniFileCredentials({ profile });
}

const cf = new AWS.CloudFormation({ region: region, credentials });
const stackDescriptions = await cf
.describeStacks({
StackName,
Expand Down

0 comments on commit f3cc700

Please sign in to comment.