Skip to content

Commit

Permalink
Merge pull request #542 from dulajra/feature/aws
Browse files Browse the repository at this point in the history
Feature/aws
  • Loading branch information
agentmilindu authored Oct 28, 2018
2 parents addaf59 + 18cc758 commit bdf1a54
Show file tree
Hide file tree
Showing 5 changed files with 761 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#Deploy Bass with AWS

Bassa can be deployed completely on AWS using theses scripts.
Can be used for both deployment and production.

##Prerequisite
AWS CLI is needed for CloudFormation Templates deployment.
Install AWS CLI with following scipt.

```bash
bash scripts/aws/scripts/install_aws_linux.sh
```

##Infrastructure
Create required resources for deployment.

###Create a ECS cluster
Export following environment variables with appropriate values.
`PROJECT_ROOT` should be the root path of your Bassa project folder.

```bash
export PROJECT_ROOT=.
export STACK_NAME=ScoreLab-ECS-Cluster-NonProd
```

Then run the following scripts.

```bash
bash ${PROJECT_ROOT}/scripts/aws/scripts/deploy_ecs.sh
```
2 changes: 2 additions & 0 deletions scripts/aws/scripts/deploy_ecs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
aws cloudformation create-stack --stack-name ${STACK_NAME} --template-body file://${PROJECT_ROOT}/scripts/aws/stacks/ecs_cluster/template.json --parameters file://${PROJECT_ROOT}/scripts/aws/stacks/ecs_cluster/environments/ecs-cluster-dev.json --capabilities CAPABILITY_IAM
6 changes: 6 additions & 0 deletions scripts/aws/scripts/install_aws_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
export PATH=~/.local/bin:$PATH
pip install awscli --upgrade --user
aws --version
18 changes: 18 additions & 0 deletions scripts/aws/stacks/ecs_cluster/environments/ecs-cluster-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"ParameterKey": "KeyName",
"ParameterValue": "ScoreLab-KeyPair-NonProd"
},
{
"ParameterKey": "InstanceType",
"ParameterValue": "t2.micro"
},
{
"ParameterKey": "VpcId",
"ParameterValue": "vpc-83ced0f8"
},
{
"ParameterKey": "SubnetId",
"ParameterValue": "subnet-9d65b8fa,subnet-3a8ee870,subnet-829c058d"
}
]
Loading

0 comments on commit bdf1a54

Please sign in to comment.