#
proxy [deploy]
:
Deploy Proxy for Commercetools
#
Introduction
If you use rocket ignite
you will be asked if you want to create a Commercetools proxy with AWS.
If you want to create a Commercetools proxy on its own, you can do this with:
rocket aws proxy deploy
For more information on how the proxies are set up, have a look at the concept documentation of the proxy.
#
Usage
#
Step 1: Create clients in Commercetools
In order to create the proxy, the proxy needs certain environment variables to execute the request to Commercetools.
These environments are created in the clients step. Once the step has been successfully executed, the proxy has all the information it needs for Commercetools from the .env
file.
Info
If you want to change the environments after the proxy has been created, you can do this on the lambda function in AWS under Configuration
-> Environment variables
.
Here you also can change the CTP_COOKIE_KEY
if you want to.
#
Step 2: Choose your AWS profile
To deploy something to AWS you need config files. You can find out how this works in the AWS documentation.
You can select a AWS profile with the following command:
export AWS_PROFILE=your-profile
set AWS_PROFILE=your-profile
#
Step 3: Deploy the Proxy
To deploy the proxy, you can use the following command:
rocket aws proxy deploy
This command will create 2 proxies with a lambda function in AWS and a API Gateway. Depending on the profile you have selected, the proxy will be created in the corresponding AWS account.
The proxy URLs are displayed in the console and saved in the .env
file after all steps have been successfully executed.
These are saved as CTP_READ_PROXY_URL
and CTP_ME_PROXY_URL
.