Create an IAM role for your use cases e.g. serverless-admin
You don't want to give the serverless-admin access to all feature of aws. Therefore you create a new IAM user that only has the rights a serverless developer needs e.g. access to AWS Lambda, Dynamodb, S3, API Gateway, CloudDeployment and Logs. You use this user for the AWS CLI and the Serverless framework.
sudo pip install awscli
# use the access key id and secret access ky as describe above
aws configure
# AWS Access Key ID [None]: AKIAI44QH8DHBEXAMPLE
# AWS Secret Access Key [None]: je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY
# Default region name [None]: eu-central-1
# Default output format [None]:
# for the man pages do
aws configure help
Securely store your keys and secrets in your rsh file
Installation
brew install lastpass-cli --with-pinentry
Set variables in lastpass
Just create a secret note within lastpass:
Login to lpass in the command line
# login to lastpass
# check first if I am allready loggedin and finded the "access-token" folder
if [[ $(lpass ls) != *"access-token"* ]]; then
lpass login your@email.com
fi
Set environment variable (e.g. key_id (username) and secret(password)
export AWS_ACCESS_KEY_ID=$(lpass show aws-serverless-devops --username)
export AWS_SECRET_ACCESS_KEY=$(lpass show aws-serverless-devops --password)
Getting started with GCP
Create a Google Cloud Billing Account
Create a new Google Cloud Project
Enable the necessary APIs
Get credentials
For serverless: Update the provider config in serverless.yml
Accessing files in lpass
lpass show xxx-dev-gcp --attach att-7942806310206912061-56085
Setup an ecrypted folder and sync with google drive
You don't want to store your secrets in plain text in a file like .rshrc therefore you can use lpass cli [ / ] and store your secrets in your osx keychain and access them only by reference.