This section supposes that you already have an active AWS account.
- node: install docs;
- nvm: install docs;
- yarn: install docs;
- AWS cli: install docs.
If you only want to run the example, you can skip this section.
If you want to take is as an example to start your own projet,
- Go to the shared configuration file;
- Change the
projectName
variable to the name of your project (note that this name must not be too long); - Change the dev profile name to one that suits you;
- Search and replace "sls-monorepo" and replace it with the same project name
nvm use
: use the version of node set in.nvmrc
;yarn
: install node dependencies in all packages;yarn package
: compile the common packages;yarn upgrade-interactive --latest
in order to bump all dependencies to their latest version. Be careful as it may introduce breaking changes;
At the root of the project:
yarn test:all
In order to deploy the stack on a development environment, you will need to setup a user on the stack.
- Head to the IAM console;
- Add a new user, give it a name;
- In "AWS access type", select "Programmatic access", then click on "Next: permissions";
- Click on the "Attach existing policy directly", then select "AdministratorAccess" and click on "Next: tags";
- Click "Next: review", then "Create user";
- Do not close the window yet;
- Open a terminal and run:
aws configure --profile <your-profile>
(the value of<your-profile>
depends of your choice in the personalisation section. By default it will besls-monorepo-developer
); - Fill in the Access Key Id and the Secret Access Key from your user;
- For the region, use the AWS region chosen for your project. See the list of AWS regions.
At the root of the project, run yarn deploy
. This will compile and deploy all the stacks in order.
You can follow the creation of the stacks on the Cloudformation console