Skip to content

Commit e3a676e

Browse files
committed
Address PR feedback
1 parent d9aa4e8 commit e3a676e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/connections/functions/aws-apis.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ The [`aws-sdk`](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guid
99

1010
First, you'll need to create an IAM role in your AWS account that your function will assume before making AWS API calls. You need two values ahead of time:
1111

12-
* Principal account ID: This is the ID number for the AWS account that your function runs in. For destination functions, this is `458175278816` and for source functions this is `300240842537`.
12+
* Principal account ID: This is the ID number for the AWS account that your function runs in. For destination functions, this is `458175278816`, and for source functions, this is `300240842537`.
1313

14-
* External ID: This value will be used by your IAM role to ensure that only your functions have the ability to assume the role. We recommend choosing a long string of at least 32 random characters and treating it as if it were an API key or a password.
14+
* External ID: Your IAM role uses this value to restrict who can assume it, in this case, your function. We recommend choosing a long string of at least 32 random characters and treating it as if it were an API key or a password.
1515

1616
Then, create an IAM role in your AWS account with the [minimum set of necessary permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). Add a trust relationship to your role with the following policy, filling in the principal account ID and external ID from above:
1717

@@ -66,9 +66,6 @@ async function getS3(settings) {
6666
secretAccessKey: data.Credentials.SecretAccessKey,
6767
sessionToken: data.Credentials.SessionToken
6868
};
69-
})
70-
.catch(err => {
71-
throw err;
7269
});
7370

7471
return new AWS.S3(creds);
@@ -87,9 +84,6 @@ async function onTrack(event, settings) {
8784
.promise()
8885
.then(data => {
8986
console.log(data);
90-
})
91-
.catch(err => {
92-
throw err;
9387
});
9488
}
9589
```

0 commit comments

Comments
 (0)