Local development uses a Docker localstack to emulate AWS services. Run the command below to download the Docker image and to run the container. Change the `yml` file according to your needs. The default configuration is always set to run unless stopped. Please note that secrets and messages do not persist between server restarts.`docker-compose -f docker-compose-localstack.yml up -d`
The property FC-CONNECTOR value must match the connector configuration name found at `application-connector.yml` (example below).`connector-name: <FC-CONNECTOR>`
Note
If the command above doesn’t work for Windows machines, then try the following.First run this command to open a session with the localstack container`docker exec -it localstack /bin/bash`Then use an alternative template:`awslocal secretsmanager create-secret --name fc/connect/<FC-CONNECTOR>/api/fluent/activeAccounts --secret-string "{\"accounts\":[{\"name\":\"<FLUENT-ACCOUNT>\", \"region\":\"<FC-ACCOUNT-REGION>\" , \"retailers\":[<FLUENT-RETAILER1>,<FLUENT-RETAILER2>]}]}" ;`Use ctrl + d to exit the localstack session.
AWS CLI Configuration (Optional)
This is required when sending events to the queues or managing secrets in localstack directly from your terminal window.
Run the AWS configuration and set your localstack profile.
The access key values can be anything but empty
The region has to be us-east-1
`aws configure --profile localstack` `export AWS_PROFILE=localstack`Please note that localstack region is defaulted to "us-east-1".
IntelliJ Setup
Create a run configuration setting the spring profiles and environment variables and selecting the correct pre-configured localstack AWS profile. The application runs precisely the same way as it would in production, which is achieved by the properties below.
Active Profiles: connector,dev-aws
`connector` profile is always required, and it can be followed by the environment the application runs on (dev, test, QA, or production).
`dev-aws` is a handy profile for local development with AWS. It enables the SDK to auto-start the queue and use some pre-configured values for development.