On Windows, install below software
- Java 1.8.0_241 (Spring-boot-2.2.5)
- Maven - 3.6.2
- Terraform_0.12.21_windows_amd64
- Jenkins
- Ansible - use to configure any software installations
- PostgreSQL - only if you need to test on local machine
- AWS CLI - to configure the credentials
- AWS - Elasticbeanstalk
https://github.com/jyothi-kasturi/vf-assignment/documentation/Architecture.pdf
-
How to run it with Jenkins Pipelines ?
Access https://github.com/jyothi-kasturi/vf-assignment/documentation/How_to_run_Jenkins_pipeline_jobs.pdf
and setup the jenkins jobs as described in that documentation.
https://github.com/jyothi-kasturi/vf-assignment/jenkins
- Jenkinsfile.buildSpringBoot - Build the spring boot applications, with spring profiles
- Jenkinsfile.createOrDestroyInfra - This will call terraform scripts to create or destroy infrastructure in AWS
- Jenkinsfile deploySpringBoot - Create a Jenkins freestyle job with Jenkins Plugin AWS ElasticBeanstalk.
-
Terraform (Infrastructure As Code)
https://github.com/jyothi-kasturi/vf-assignment/terraform
cd dev
terraform init
terraform plan
terraform apply
-
Spring boot application Rest API
https://github.com/jyothi-kasturi/vf-assignment/spring-boot/assignment
On Local machine, build with
mvn clean install -Pdev -DskipTests=true
GET - http://localhost:5000/timeStamps
GET - http://localhost:5000/timeStamps/1
POST - http://localhost:5000/timeStamps
DELETE - http://localhost:5000/timeStamps/1
-
AWS
- Edit the below file on local machine username/.aws/credentials
[dev]
aws_access_key_id=
aws_secret_access_key=
- Make sure vf.keypair.pem and vf.keypair.pub exists at C://assignment
Use free tier where possible
Here, NAT gateways incur costs so please destory the infrastructure once done or comment that code in vpc.tf
1. dev
Configure spring boot profiles with ../resources/application-dev.properties
Terraform modules - cd ../terraform/dev
Jenkins - Select dev as environment option
2. test
Configure spring boot profiles with ../resources/application-test.properties
Terraform modules - cd ../terraform/test
Jenkins - Select test as environment option
3. prod
Configure spring boot profiles with ../resources/application-prod.properties
Terraform modules - cd ../terraform/prod
Jenkins - Select prod as environment option