Skip to content

- the plugin gets the region from the aws.config and thus the region … #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/aws-sigv4.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const aws = require('aws-sdk')
const URL = require('url').URL

const PLUGIN_NAME = 'aws-sigv4'
const AWS_REGION = "region"

const messages = {
pluginConfigRequired: `The ${PLUGIN_NAME} plugin requires configuration under [script].config.plugins.${PLUGIN_NAME}.`,
Expand Down Expand Up @@ -114,8 +115,10 @@ const impl = {
// Implement plugin to be consumed by Artillery.
const AwsSigV4Plugin = function (scriptConfig, eventEmitter) {
// Collect configuration from the environment and validate.

const inputConfigAWSRegion = scriptConfig.plugins[PLUGIN_NAME][AWS_REGION]
const credentials = aws.config.credentials
const region = aws.config.region
const region = (inputConfigAWSRegion === undefined || inputConfigAWSRegion === '') ? aws.config.region : inputConfigAWSRegion
const sdkConfigurationIsValid = impl.validateSdkConfig(credentials, region)

if (!sdkConfigurationIsValid) {
Expand Down