81 Commits

Author SHA1 Message Date
Craig R Webster
271b45009d Fix typo in 'syntax' 2018-01-03 19:15:41 +08: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
Erik Erikson
8c1fe6dfcc Refactor, simplify, correct, add tests
Increase name consistency
Improve names to be-what-they-are
Reduce cyclomatic complexity
Include overrides population fix
Add variable methods documentation
Add more tests around significant variable patterns/risky cases
2017-12-06 15:59:07 -08:00
Frank Schmid
bce1264d7b
Fixed merge 2017-12-07 00:35:13 +01:00
Frank Schmid
8f70c13a9c
Merge branch 'master' into circular-vars 2017-12-07 00:22:55 +01:00
Frank Schmid
2e09606f13
Merge remote-tracking branch 'remotes/upstream/master' into circular-vars 2017-12-06 13:20:51 +01:00
Frank Schmid
8ff661835e
Merge branch 'master' into populate-default-objects 2017-12-06 12:34:50 +01:00
Frank Schmid
8cd604cd41
Wrap cached value into promise (addresses issue mentioned in #4509) 2017-12-05 12:39:48 +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
Frank Schmid
37340467ed
Populate objects if default syntax targets an object 2017-12-04 18:08:39 +01:00
e-e-e
f90c6d2782 return resolver promise; fix lint 2017-12-03 21:25:22 +11:00
e-e-e
57d898d39e replace promise in cache with cached result once resolved. 2017-12-02 12:03:33 +11:00
Benjamin Forster
6e6fea3fa2 update ssm cache to generic variable cache. 2017-12-01 10:33:30 +11:00
Benjamin Forster
e780a59b66 fix linter 2017-11-29 17:21:41 +11:00
Benjamin Forster
de22ae698b add cache to ssm variables 2017-11-29 17:10:05 +11:00
Erik Erikson
143a2aa65b Account for duplicate copies without populating more than once. As a result, populate in place. 2017-11-17 17:30:15 -08:00
Eslam A. Hefnawy
bebcdf3057 added support for circular references in variable system 2017-11-17 00:00:57 +01:00
Farley
80c9442794 Fixing linting, finally? 2017-11-06 13:25:38 +01:00
Farley
2080ce9ec1 Fixing linting 2017-11-06 13:19:23 +01:00
Farley
5b786e8914 Fixing linting 2017-11-06 13:14:57 +01:00
Farley
113e7b93a9 Fixing #4435 2017-11-06 12:43:13 +01:00
Basile Trujilllo [L0gIn]
c6d204bd88 Remove realpathSync second arg to fix unit tests 2017-10-17 14:51:25 +02:00
Basile Trujilllo [L0gIn]
08d62af899 Resolve file path before read file 2017-10-17 11:33:23 +02:00
Loren Gordon
da782b85f4 Escapes the hyphen in the ssm variable syntax
Fixes #4248
2017-09-12 13:57:52 -04:00
Loren Gordon
b00ad4e773 Removes escaping of double-quotes around string value 2017-09-07 07:32:06 -04:00
Loren Gordon
5a7d14af09 Adds overwrite syntax support to SSM variable syntax
Check for the expected error message in the case the SSM parameter
does not exist and return `undefined`. Any other (unexpected) error
message still throws an exception.
2017-09-01 15:10:00 -04:00
Loren Gordon
a266d4f224 Supports ssm: variable references
Adds support for specifying SSM parameters as serverless variables.
Basic syntax is `${ssm:<foo>}`. To support decryption of SecureString
parameters, the extended syntax is `${ssm:<foo>~true|false}`. The `~`
is a delimiter; `true|false` is evaluated and passed to the
`WithDecryption` option of the SSM API.
2017-09-01 12:54:04 -04:00
Toby Hede
33431cb45a Allow double-quoted and single-quoted variables
Empty string is now valid
2017-08-20 11:05:15 +10:00
Toby Hede
2b3181c362 Handle both single and double quoted strings 2017-08-18 09:13:01 +10:00
Toby Hede
a1c8a37b9a Allow use of string as default values in variables 2017-08-18 09:07:29 +10:00
Rafal Wilinski
fea41a0ddf Fix Variables.s3RefSyntax typo 2017-08-11 20:01:09 +02:00
indieisaconcept
71f1aa09cb preserve context when executing exported function from .js file
The change ensures that when a .js file exported function is executed,
the original execution context is supplied in order to maintain "this".
2017-07-26 11:21:09 +10:00
Philipp Muens
c67d60f5d6 Merge pull request #3888 from mangas/3629-fix-file-absolute-path
handle absolute paths in file()
2017-07-07 14:55:02 +02:00
Filipe Azevedo
aab492f079 handle absolute paths with ~ in file() 2017-07-03 18:19:23 +01:00
Filipe Azevedo
e9e21dbd8e handle absolute paths in file() 2017-07-03 13:43:39 +01:00
Luke Herrington
1264dd015c
Improve usage and error handling of javascript variables. 2017-06-23 10:49:38 -07:00
Philipp Muens
0e4aceb704 Update error message 2017-06-11 21:14:12 +02:00
Philipp Muens
ee14ce9f36 Minor code changes and test improvements 2017-06-08 09:54:46 +02:00
Jeremy Benoist
ca202c5672
Throw an Error when requested variable does not exist
When we define a cf variable in serverless.yml and that variable wasn't output from the Cloudformation Outputs
a useless error was throw:

> Cannot read property 'OutputValue' of undefined

Now the error give more information:

> Trying to request a non variable from Cloudformation.
> Stack name: "some-stack" Requested variable: "DoestNotExist"
2017-06-06 17:18:33 +02:00
Sam Marks
aef89a51c7 Another follow-up on async vars. 2017-05-31 00:18:10 -04:00
Eslam λ Hefnawy
ddb99af627 Merge pull request #3592 from aoskotsky-amplify/master
Add support for S3 variables
2017-05-18 21:28:02 +07:00
Eslam A. Hefnawy
7503fa0bc5 fixed bug when using dot notation in yml keys 2017-05-15 22:05:04 +07:00
Eslam A. Hefnawy
971a27994c fixed bug when referencing vars from other vars object values 2017-05-12 13:34:11 +07:00
Alex Oskotsky
2945880e68 Add support for S3 variables 2017-05-10 23:31:43 -04:00
Eslam A. Hefnawy
f7b26a492c added cross service communication feature via cf variable source 2017-05-09 19:04:30 +07:00
Eslam A. Hefnawy
9b10da6dc8 fixed all unit tests 2017-05-05 00:36:32 +07:00
Eslam A. Hefnawy
bd33c98e7f fixed variables tests 2017-05-03 22:23:25 +07:00
Eslam A. Hefnawy
4810719601 renamed promises 2017-05-03 19:28:16 +07:00
Eslam A. Hefnawy
7cadf28444 supported promises in the variable system 2017-05-02 23:54:09 +07:00
Erik Erikson
93c7afb3f5 Resolve PR Comments
1. Improve wording of documentation.  Note the concrete object that will be written in its entirety
2. Expand documentation.  Note a potential security risk for secrets
3. Move, without changes, the `warnIfNotFound` method because it was putting space between `getValueFromSource` and the various source type specific functions it uses
4. Implement unit tests for `warnIfNotFound`
5. Implement unit tests for `logWarning`
2017-02-10 18:31:02 -08:00