32 Commits

Author SHA1 Message Date
Eslam A. Hefnawy
ffd85c6f06 mocking creds for getCredentials tests 2016-10-11 18:00:37 +07:00
Philipp Muens
e2b7fc7973 Stub AWS SDK for getCredentials() tests 2016-10-10 14:16:19 -07:00
Erik Erikson
9a78d181ad Merge Changes 2016-10-04 15:31:30 -07:00
Erik Erikson
97b22e6ee3 Merge branch 'master' into rebuild-credentials
# Conflicts:
#	lib/plugins/aws/tests/index.js
2016-10-04 15:26:57 -07:00
David Tanner
83dfb88302 Fix typos 2016-09-30 05:45:51 -06:00
David Tanner
4f9f173a3c Fix linting issues, and restore deployFunction 2016-09-28 09:09:21 -06:00
David Tanner
68ef4ceab7 Move CF stack configuration to one place.
The stack is now set up in one place.
The S3 bucket isn't created on create if a bucket is already specified.
Working on configurability for the developer.
There is still the possibility of failing to deploy the stack
if the iamRoleArn is set, and a deploymentBucket is specified
2016-09-28 08:27:09 -06:00
Erik Erikson
2cfd611329 Rebuild Credential Handling
(scoped to AWS)
Previously you had a number of options, including legacy options for loading credentials.  Given the 0.x=>1.x change, we can drop a lot of the old approaches.  This PR attempts to bring all the good things.

The options for loading credentials are as follows:
1. define credentials on serverless.yml=>service.provider.credentials = { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey', sessionToken: 'sessionToken' }
2. define a profile from which to get credentials on serverless.yml=>service.provider.profile = 'profile-name' (all profiles loaded using AWS.SharedIniFileCredentials, see http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SharedIniFileCredentials.html)
3. define credentials for all stages using the standard AWS environment variables (see http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EnvironmentCredentials.html)
4. define a profile for all stages using the environment variable AWS_PROFILE
5. define credentials for each stage using the standard AWS environment variables with the STAGE name inserted (e.g. stage='test', envVarName='AWS_TEST_*')
6. define a profile for each stage using an environment variable `AWS_${stageName.toUpperCase()}_PROFILE`

If credentials/profiles are declared in multiple ways, the later cases will override the former.

These use cases previously covered all user requirements but the current implemenation allows for an expansion of mechanisms if more mechanisms are desirable.
2016-09-27 16:08:00 -07:00
David Tanner
d490ed413e Rename to deploymentBucket as recommended by @flomotlik 2016-09-23 08:18:33 -06:00
David Tanner
1a8b94cc4f Upping code coverage.
Found some unused code when looking for throttling errors, added functionality to get code from SDK errors.
Added tests to cover functionality.
Fixed prefix to be serverless/{serviceName}/{stage}
2016-09-22 15:55:52 -06:00
Florian Motlik
47e654fe71 Fix profile handling when other keys are present 2016-09-16 15:38:27 +02:00
Florian Motlik
07a22d0702 Merge pull request #2015 from rowanu/aws-provider-profile
Support provider > profile and profile per stage
2016-09-16 14:05:41 +02:00
Andrew McClenaghan
b92de4ba40 Update to use describeStackResource 2016-09-15 20:56:00 +10:00
rowan
514d06d304 Remove .only usage. 2016-09-05 13:58:24 +10:00
rowan
7ae87ba27e Load AWS profile from provider object. 2016-09-05 13:46:40 +10:00
rowan
45ef6d2a96 Update getCredentials tests to actually test correct property.
See "Using Profiles with the SDK" on
http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html.
2016-09-03 17:26:34 +10:00
Alexander Anich
8d6748b9eb Updates sinon stubbed tests in plugins/aws
Creates test cases to check for correct arugments from sinon stubs
2016-09-02 17:40:42 -10:00
Nick den Engelsman
c2d2152679 Moved monitorStack to shared lib/plugins/aws/lib 2016-09-02 13:35:29 +02:00
Eslam A. Hefnawy
5dafeee388 basic new variable system 2016-08-31 16:37:58 +09:00
Philipp Muens
a0f7bb20d1 Add tests to increase test coverage 2016-08-08 08:27:26 +02:00
Benny Bauer
9f0c506c75 fix 1468 - display endpoints
Display general information on service, functions and endpoints.
Add tests.

partial fix for #1468 - display endpoints

fix 1468 - display endpoints

Display general information on service, functions and endpoints.
Add tests.
2016-07-29 13:01:15 +02:00
Benny
9334097da7 Missing semicolon 2016-07-20 22:02:47 +03:00
Benny
0d2c78cc36 DRY validate 2016-07-20 21:43:20 +03:00
Philipp Muens
4519e0fb32 Rename coreBucket name to be more meaningful 2016-07-12 11:36:46 +02:00
Philipp Muens
eeee34fa5b Make coreBucket name unique 2016-07-12 10:31:38 +02:00
Eslam A. Hefnawy
d2dc0ba58e ZERO linting issues and test coverage of 93% 🎉 🎉 2016-06-23 15:55:57 +02:00
Eslam A. Hefnawy
9b1fad3d9e removed test from sdk class tests 2016-06-21 18:49:10 +02:00
Eslam A. Hefnawy
691e38812b travis is using aws access key id 2016-06-21 18:34:02 +02:00
Eslam A. Hefnawy
6e714bea31 updated handling for travis env var 2016-06-21 18:30:11 +02:00
Eslam A. Hefnawy
1a1ec2103f removed aws api keys handling 2016-06-21 18:21:53 +02:00
Eslam A. Hefnawy
2c4c559dfd removed extra require 2016-06-21 18:04:57 +02:00
Eslam A. Hefnawy
135330995b added tests for aws sdk 2016-06-21 17:27:18 +02:00