This directory implements a north-south API frontend for communication into the east-west VPC Lattice service network.
Copy etc/environment.template
to etc/environment.sh
and update accordingly.
PROFILE
: your AWS CLI profile with the appropriate credentials to deployACCOUNTID
: your AWS account idREGION
: your AWS regionBUCKET
: your configuration bucket
For the infrastructure stack, update the following accordingly.
P_VPC_ID
: your VPC idP_HOSTEDZONE_DOMAIN
: root domain name for the private hosted zoneP_DOMAINNAME
: domain name to be used for your certificate and alias for the load balancer.
For the Cognito stack, update the following accordingly.
P_USERPOOL_DOMAIN
: the custom domain name used in https://.auth..amazoncognito.comP_USER_NAME
: sample user nameP_USER_EMAIL
: associated email address, to which a temporary password will be emailed
For the Lambda and API Gateway stack, update the following accordingly.
P_STAGE
: stage name for API GatewayP_FN_MEMORY
: amount of memory in MB for the Lambda functionP_FN_TIMEOUT
: timeout in seconds for the Lambda function
Deploy the infrastructure resources using makefile
: make infrastructure
After completing the deployment, update the following outputs:
O_HOSTEDZONE_ID
: output hosted zone idO_CERT_ARN
: output certificate ARN
Deploy the Cognito resources: make cognito
After completing the deployment, update the following outputs:
O_USERPOOL_ID
: output user pool idO_USERPOOL_PROVIDERNAME
: output provider nameO_USERPOOL_PROVIDERURL
: output provider endpoint urlO_USERPOOL_CLIENTID
: output client id, used for getting a jwt tokenO_USERPOOL_DOMAIN
: output confirming the user pool domainO_IDENTITYPOOL_ID
: output identity pool id
Deploy the Lambda and API Gateway resources: make lambda
After completing the deployment, update the following outputs:
O_FN
: output Lambda function nameO_API_ENDPOINT
: output API Gateway endpoint URL, e.g. https://<api_id>.execute-api..amazonaws.com/O_LAYER_ARN
: output layer ARNO_SGROUP
: output security group id
To setup the user that you created, update the following parameters:
P_COGNITO_USERTEMPPW
: temporary password that was emailed to the email address that you enteredP_COGNITO_USERPERMPW
: permanent password that you select and is configured for your user
Update the temporary password to a permanent password and get a fresh set of credentials: make cognito.admin
Once updated with a permanent password, you can subsequently get a fresh set of credentials using the CLI: make cognito.user
Alternatively, you can get a fresh set of credentials making an API request: make api.auth
Test the API endpoint with the JWT token that you get from Cognito: make api.invoke