Add techdocs.publisher.awsS3.endpoint config option

Signed-off-by: r.bideau <7304827+rbideau@users.noreply.github.com>
This commit is contained in:
r.bideau
2021-03-08 13:54:08 +01:00
parent 29e98205f1
commit ca4a904f6b
4 changed files with 27 additions and 3 deletions
@@ -94,11 +94,16 @@ export class AwsS3Publish implements PublisherBase {
// or AWS shared credentials file at ~/.aws/credentials will be used.
const region = config.getOptionalString('techdocs.publisher.awsS3.region');
// AWS endpoint is an optional config. If missing, the default endpoint is built from
// the configured region.
const endpoint = config.getOptionalString(
'techdocs.publisher.awsS3.endpoint',
);
const storageClient = new aws.S3({
credentials,
...(region && {
region,
}),
...(region && { region }),
...(endpoint && { endpoint }),
});
// Check if the defined bucket exists. Being able to connect means the configuration is good