Skip to content

Commit

Permalink
feat: allow user set roleArn
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Mar 17, 2021
1 parent 644159c commit 7159ec7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/api-client-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ApiClientHelpers {
if (axios) {
axiosInstance = axios
} else {
const { accessToken, credentials, region } = parameters
const { accessToken, credentials, region, roleArn } = parameters

axiosInstance = globalAxios.create({
headers: {
Expand All @@ -27,6 +27,7 @@ export class ApiClientHelpers {
{
region: region.awsRegion,
service: 'execute-api',
assumeRoleArn: roleArn,
},
credentials,
),
Expand Down
8 changes: 8 additions & 0 deletions src/types/api-clients/api-configuration-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@ export interface APIConfigurationParameters {
* @memberof APIConfigurationParameters
*/
isSandbox?: boolean

/**
* ARN of the IAM Role to be assumed to get the credentials from.
*
* @type {string}
* @memberof APIConfigurationParameters
*/
roleArn?: string
}

0 comments on commit 7159ec7

Please sign in to comment.