This guide makes several assumptions.
-
That you're using this Serverless application in conjunction with TIBET
-
This is a NodeJS project.
git clone http://github.com/TechnicalPursuit/aws-passthrough-tibet
If you haven't done so, install the AWS CLI.
Mac OS X instructions using Brew:
brew install awscli
For other OS platforms or packaging systems, refer to their documentation.
npm install serverless -g
For development purposes, we recommend using the serverless config credentials
command:
serverless config credentials --provider aws --key <<your_key>> --secret <<your_secret>>
If you already have credentials in your ~/.aws/credentials
file, we recommend
adding another profile with your development keys in it:
[development]
aws_access_key_id = <<your_key>>
aws_secret_access_key = <<your_secret>>
and then exporting the name of the profile:
export AWS_PROFILE="development"
Note that the --verbose
setting here is required to see output values that you will need below to properly configure your TIBET application.
serverless deploy --stage test --verbose
This will output 3 values:
- The user pool ID
- The user pool client (also called 'app') ID
- The identity pool ID
aws cognito-idp sign-up \
--region <<your_cognito_region>> \
--client-id <<your_user_pool_client_id>> \
--username [email protected] \
--password Passw0rd! \
--user-attributes Name=email,[email protected]
aws cognito-idp admin-confirm-sign-up \
--region <<your_cognito_region>> \
--user-pool-id <<your_user_pool_id>> \
--username [email protected]
Over in your TIBET application, configure the following AWS Passthrough configuration parameters using the values that were logged out above.
aws.passthrough.userPoolID
aws.passthrough.appID
aws.passthrough.identityPoolID
You can add these directly to the project's tibet.json
file:
<yourproject>/public/tibet.json
:
{
"NOTE" : "TIBET project file. Set configuration parameters here.",
"project": {
"name": "myproject"
},
"tibet": {
"dna": "default"
},
"boot": {
"use_login": false
},
"aws": {
"passthrough": {
"userPoolID": <<your_user_pool_id>>,
"appID": <<your_user_pool_client_id>>,
"identityPoolID": <<your_identity_pool_id>>
}
}
}
You can also configure these by executing the following commands inside of the TIBET project:
tibet config aws.passthrough.userPoolID=<<your_user_pool_id>>
tibet config aws.passthrough.appID=<<your_user_pool_client_id>>
tibet config aws.passthrough.identityPoolID=<<your_identity_pool_id>>
Note that TIBET also allows you to configure the following 2 values, although they have defaults:
aws.passthrough.region (default is: 'us-east-1');
aws.passthrough.apiVersion (default is: '2015-03-31');
- Go into the Sherpa Inspector
- Click
REST
>AWS
>S3
- Log in using the user that you added to the user pool above using the AWS CLI tools.