This is the terraform project to create JRCMS infrastructure.
-
use
aws configure
to configure your AWS credential If you haven't configure, please configure it. -
make sure you have
id_rsa.pub
file in your~/.ssh
folder You should be able to list the below file.
ls ~/.ssh/id_rsa.pub
If not, please create the key by ssh-keygen
.
execute ./setup_all.sh
execute ./cleanup_all.sh
and remove the s3 bucket: s3-terraform-state-storage-*
This terraform project creates a S3 bucket to store terraform states.
Global AWS resources that should be created only once-off.
- vpc
- s3 to store Terraform state
- security group
ELK infrastructure
The stack exports ports below.
5000
: Logstash TCP input9200
: Elasticsearch HTTP9300
: Elasticsearch TCP transport80
: Kibana (Username: elastic, Password: changeme)
Query Example:
type: request and response_status: 429
CMS application (can be replaced by other apps)
The application exports port 80
.
Prometheus and Grafana
The application exports port ports below.
9090
: prometheus9100
: node-exporter80
: grafana (Username: admin, Password: changeme)
Query Example:
request_count
rate(request_count[5m])
request_count{http_status="500"}
cd to individual folder and use ../terraform.sh apply
to execute.
For example:
cd 1.s3-state
../terraform.sh init
../terraform.sh apply
ssh to the host and execute cat /var/log/cloud-init-output.log