133 Commits

Author SHA1 Message Date
Kenneth Falck
828e4ae212 Remove automatic AWS_SDK_LOAD_CONFIG=true for backwards compatibility in tests 2018-11-01 13:09:09 +02:00
Daniel Schep
a75b5640c8 Store cachedCredential in AwsProvider instance instead of a global
and fix lint error
2018-10-31 14:38:15 -04:00
Kenneth Falck
c064edef19 Support role_arn, source_profile and mfa_serial in ~/.aws/config
This sets the AWS_SDK_LOAD_CONFIG environment variable which allows
AWS SDK to read ~/.aws/config, and implements the tokenCodeFn
callback which asks the user to enter a MFA code. Credentials are
also cached to avoid creating the object multiple times, which
makes MFA work properly when multiple requests are made.

With these changes Serverless Framework should be compatible with
AWS CLI, so that these instructions for assuming a role work
out-of-the-box:
https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html
2018-10-30 21:18:25 +02:00
weeniearms
b5da4d09ed Added possibility to specify custom S3 key prefix instead of the standard 'serverless' 2018-09-17 09:35:40 +02:00
Eslam A. Hefnawy
5b7ccbccaa support more than 100 resources in dashboard 2018-08-03 16:55:58 +03:00
Eslam A. Hefnawy
41c44a29d6 added resources data 2018-07-23 16:05:45 +03:00
Eslam A. Hefnawy
4bd4c3f5a9 tested deployment and subscription 2018-07-23 16:05:45 +03:00
Gavin McQuistin
9bd47e1e3b
Update awsProvider.js 2018-05-30 00:55:38 +01:00
Frank Schmid
c713f439e5
Add retry unit tests, check credential errors for one retry. 2018-05-22 12:35:50 +02:00
Frank Schmid
1d21373d9c
Do not retry credential errors 2018-05-21 14:01:35 +02:00
Frank Schmid
1ca9dde95d
Fixed ESLint 2018-05-17 22:07:21 +02:00
Frank Schmid
24e7ceb558
Limit request retries on errors 2018-05-17 22:05:13 +02:00
Frank Schmid
6b2eb9f126
Add unit test for 429 and retryable = false 2018-05-17 15:22:37 +02:00
Frank Schmid
898911eeba
Retry with 429 error unconditionally 2018-05-17 11:29:48 +02:00
Joshua Rose
8d9cda2fc7 Removed call to secureEndpoint in https-proxy-agent 2018-05-10 09:13:29 -04:00
horike37
04a8d17041 revived getAccountId 2018-05-05 17:23:37 +09:00
Mariusz Nowak
9f3e7f92cf Comment reasoning for single then usage 2018-04-06 14:32:31 +02:00
Mariusz Nowak
495afd1ee9 Remove reduntant promise chain step 2018-04-05 16:41:41 +02:00
Mariusz Nowak
80c00b91e8 Recognize recoverable errors by retryable property 2018-04-05 16:40:45 +02:00
Takahiro Horike
5c886b5b2c
Merge branch 'master' into sls-govcloud 2018-03-13 06:02:22 +09:00
Frank Schmid
39caddc404
Merge pull request #4713 from erikerikson/fix-4687-cyclic-variable-dependencies
Eliminate/Report Hung Promises (#4687), Prepopulate Stage and Region (#4311), Handle Quoted Strings (#4734)
2018-02-20 13:56:27 +01:00
Erik Erikson
4400ffc9e4 fix #4311 & #4734, separate PromiseTracker, minutiae
#4311
  see prepopulateService - attempts to pre-populate the region and stage settings necessary for making a request to AWS, rejecting and dependencies thereon it runs into during that process
  see the `deep` variable work.  this was a knock-on effect of providing pre-population.  it actually represents an obscure class of bugs where the recursive population previously in getDeepValue caused the caller not to be in charge of population choices (thus fixing for pre-population) but also caused potential deadlocks resulting from getDeepValue creating circular dependencies.

#4734
  see splitByComma - a regex to do the splitting but ignore quoted commas was getting very deep and involved.  Instead, identify quoted string boundaries, then identify commas (including white space around them) and take those commas not contained by quotes as the locations for splitting the given string.  Trim the string as well (removing leading and trailing white space).
  add sophistication to the overwrite syntax, allowing for whitespace and repetitions (for robustness)
  add sophistication to the string ref syntax, allowing for use in identifying multiple quoted strings in a variable (i.e. for overwrites)

#NotCreated
  fix a bug I created earlier in the branch that caused reporting to be less informative (see renderMatches)

separate PromiseTracker
  move this class into its own file for the purpose of increasing testability and offering reuse

minutiae
  filter the properties given to populateVariables so as to avoid attempting resolution on non-variables.  Efficiency and noise reduction change.  Also cleans up the code (e.g. see populateObject and its use)
  cleaning of overwrite as a side effect
  offer variable cleaning as a idiom
  reorder the Variables.js `require`s to be in alphabetical order
2018-02-16 17:13:03 -08:00
Christopher Osborn
edd863be01
Wraps Poorly Parsing URL in Angle Brackets
As suggested by <https://tools.ietf.org/html/rfc3986?#appendix-C>.

[#4674]
2018-02-12 16:54:00 -05:00
Mike Pugh
7b6a8ff262 Lodash and test updates 2018-02-07 19:50:24 -05:00
Mike Pugh
52cc8be45a Move geetS3EndpointForRegion to utils, change to regex.test instead of string.match for authorizer ARNs 2018-02-03 08:04:21 -05:00
Mike Pugh
3af17717d7 Fix managed lambda vpc access exec role, update readability of awsProvider partition detection 2018-01-26 10:47:29 -05:00
CuongLe
0283af7a3e remove aws credentials.signatureVersion in enableS3TransferAcceleration
Fix error: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

See more: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
2018-01-23 12:38:05 +07:00
Mike Pugh
2e925af0b4 Fixing lint errors 2018-01-19 17:49:37 -05:00
Mike Pugh
113ec4cceb Updae tests 2018-01-19 14:59:49 -05:00
Mike Pugh
b921d2656e Rename provider getAccountId() to getAccountInfo() since it now returns the caller identity object including partition based on ARN 2018-01-19 13:56:00 -05:00
Mike Pugh
16debac62e Replace AWS Partition strings with CF Pseudo Param or from STS 2018-01-19 13:52:29 -05:00
Mike Pugh
3bc45becc9 Support GovCloud and China region deployments 2018-01-18 10:04:11 -05:00
Alex Casalboni
a9b82e538c Added new no-aws-s3-accelerate argument to explicitly disable S3 Transfer Acceleration (updated doc too) 2018-01-07 17:29:54 +01:00
Takahiro Horike
c0967caf14
Merge branch 'master' into sls-shared-api 2017-12-12 13:15:44 +09:00
Frank Schmid
e4a5a1d43c
Do not log warning if no options are given 2017-12-11 12:33:40 +01:00
Frank Schmid
81c896bc12
Removed reintroduction of stage+region in request. Added options.
Delete bucket was still using them

Hopefully all :)

Further test fixes.

.... worked too long yesterday

Fixed Variable tests

Remove not used parameters from request() and add options with warning
2017-12-11 12:33:35 +01:00
Frank Schmid
5526802a1b
Added request cache and queue to AWS provider
Make sure that requests are throttled. Use a queue for the requests.

Added new expected parameter to request() call in variables test

Added request cache tests
Check that request is indeed called 1000 times

Cache promises, not values

Use request cache for AWS variable requests

Use fromCallback instead of "new Promise" anti-pattern.

Added request cache to AWS provider
2017-12-05 12:39:39 +01:00
Rafal Wilinski
8a02d2a4a3
Merge pull request #4118 from geofflancaster/master
Updated awsProvider to allow manual specification of certificate auth…
2017-12-03 09:00:47 +01:00
Alex Casalboni
5c5f893e69 Added tests (increased coverage) 2017-10-28 01:51:42 +02:00
Alex Casalboni
64ccb046a7
Merge branch 'master' into issue4252-s3-transfer-acceleration 2017-10-28 00:59:18 +02:00
Alex Casalboni
07e89c72e1 Using new custom output to disable S3 Transfer Acceleration during first enabling deployment 2017-10-28 00:55:48 +02:00
Alex Casalboni
61a9d433dc removed enableBucketAcceleration (no API call should be needed -> CloudFormation support!) 2017-10-27 15:58:44 +02:00
Geoffrey Lancaster
de342e9044 resolved merge issues 2017-10-18 22:50:34 -06:00
Geoffrey Lancaster
39274ed8e1 resolved eslint issues 2017-10-18 22:15:03 -06:00
Geoffrey Lancaster
3a0be84201 fixed typo 2017-10-18 22:09:28 -06:00
Geoffrey Lancaster
2a524aaf9c updated test suite per requests 2017-10-18 21:54:08 -06:00
horike37
4b623b0e18 change position which false is assigned 2017-10-07 18:54:09 +09:00
Alex Casalboni
f7ac728d36 node<6 compatibility (no Array.includes) 2017-09-22 17:59:42 -04:00
Alex Casalboni
2c93221e9b jslint 2017-09-22 17:53:17 -04:00
Alex Casalboni
c7a7ceeb87 100% coverage for awsProvider.js (refactor & new tests, plus a minor test nesting fix) 2017-09-22 17:49:19 -04:00