To deploy VideoHeadline in AWS there are two alternatives. The first involves using a stable VideoHeadline version (main), so there is already a built image that exists in docker-hub and the deploy process will use this image. The second alternative involves building VideoHeadline image before performing deploy process, this can be used to make changes locally and to perform a deploy without depending on the version of main
- AWS account (it's not necessary to have any profile configured locally).
- Docker running on your machine.
-
Build deployment image:
docker build -t video-headline-deploy .
-
Run deployment:
docker run -e AWS_ACCESS_KEY_ID=... -e AWS_SECRET_ACCESS_KEY=... -e AWS_SESSION_TOKEN=... -e PROCESS=deploy -it video-headline-deploy
- AWS_ACCESS_KEY_ID: AWS access key identifier.
- AWS_SECRET_ACCESS_KEY: AWS secret access key.
- AWS_SESSION_TOKEN: AWS session token (if required).
These variables can be found in AWS Command line or programmatic access.
-
Once the implementation process has started through the console, you may be asked to confirm with a y/n, please confirm it.
-
The url of the application will be displayed in the console
-
At the end of this deploy process, a superuser will be created to use in the application, you will be asked via console for the data you want to use.
Once the app is deployed you can access the web through the previously mentioned url. If you want to access the Admin web you need to add /admin to the Distribution domain name.
- AWS CLI installed and configured with at least one profile.
- Docker running on your machine.
-
Install the required dependencies:
yarn install
. -
Build the project:
yarn run build
. -
Bootstrap the CDK app:
yarn cdk bootstrap
.- If you are using a specific AWS profile, include the
--profile
flag:yarn cdk bootstrap --profile [...]
(replace[...]
with your AWS profile). If no profile flag is specified, the default profile will be used.
- If you are using a specific AWS profile, include the
-
Deploy the app:
yarn cdk deploy '*'
- If you are using a specific AWS profile, include the
--profile
flag:yarn cdk deploy '*' --profile [...]
(replace[...]
with your AWS profile). If no profile flag is specified, the default profile will be used.
- If you are using a specific AWS profile, include the
-
Once the implementation process has started through the console, you may be asked to confirm with a y/n, please confirm it.
-
The url of the application will be displayed in the console
- You need to install AWS Session manager plugin (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html).
- You need to configure your AWS_PROFILE env variable.
To create a superuser, run python create_super_user.py
A superuser with the data configured in create_super_user.sh will be created.
You can edit the file to create the superuser as desired. Take into account you need to edit it before delploying, since the script that gets executed is the one that is copied to the container.
Once the app is deployed you can access the web through the previously mentioned url. If you want to access the Admin web you need to add /admin to the Distribution domain name.
-
If you want to remove all the resources deployed you can run:
docker run -e AWS_ACCESS_KEY_ID=... -e AWS_SECRET_ACCESS_KEY=... -e AWS_SESSION_TOKEN=... -e PROCESS=destroy -it video-headline-deploy
- AWS_ACCESS_KEY_ID: AWS access key identifier.
- AWS_SECRET_ACCESS_KEY: AWS secret access key.
- AWS_SESSION_TOKEN: AWS session token (if required).
These variables can be found in AWS Command line or programmatic access.
- If you want to remove all the resources deployed you can run:
yarn cdk destroy '*' --profile [...]
yarn run build
compile typescript to jsyarn run watch
watch for changes and compileyarn run test
perform the jest unit testsyarn cdk deploy
deploy this stack to your default AWS account/regionyarn cdk diff
compare deployed stack with current stateyarn cdk synth
emits the synthesized CloudFormation template