TechDocs/AWS: Update tutorial with auth best practices

This commit is contained in:
Himanshu Mishra
2021-01-12 12:22:30 +01:00
parent 16b73697a3
commit f454b9f865
3 changed files with 52 additions and 129 deletions
@@ -50,7 +50,7 @@ export class AwsS3Publish implements PublisherBase {
}
// Credentials is an optional config. If missing, default AWS environment variables
// or AWS config file in ~/.aws/config will be used to authenticate
// or AWS shared credentials file at ~/.aws/credentials will be used to authenticate
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html
const credentials = config.getOptionalConfig(
@@ -64,8 +64,9 @@ export class AwsS3Publish implements PublisherBase {
}
// AWS Region is an optional config. If missing, default AWS env variable AWS_REGION
// or AWS config file in ~/.aws/config will be used. But the AWS SDK v3 client needs
// or AWS shared credentials file at ~/.aws/credentials will be used. Any way, AWS SDK v3 client needs
// to have the AWS Region information for it to work.
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html
const region = config.getOptionalString('techdocs.publisher.awsS3.region');
const storageClient = new S3({