Now we need to Terminate the EC2 instance of mysql but our back end is up and running.
Now we gonna do Elastic Beanstalk
Software, Instance, Capacity, Load Balancer,Rolling updates and Deployments, Security, Monitoring, Notification,
Create application
Name: vprofile tags-- project vprofile-java-app--platform: Tomcat---platform branch: tomcat 8.5 --- platform version: 4.1---sample application---Create application
Modify Instances:
Edit--Root Volume Type: General purpose (SSD)---size 8-- EC2 Security Group : vprofile-backend-SG---- Save
Modify Capacity:
Auto scaling group
Environment type: Load balance---instance : t2 micro---Ami ID: Choose default---Availability zone: Any-- Metric: Network ---Click save
Load balancer:
choose default load balancer Application Load balancer --- listeners: 80 HTTP---Processes: health check we need to update but we need to update after its up and running.--save
Modify Rolling updates nd deployments:
Deployment policy: Rolling-- batch size: 25% -- save
Security:
EC2key pair : we already created a key pair choose that -- IAM instance choose the one we created--save
Monitoring:
Health reporting
System: Enhance-- log streaming: Enabled-- Retention 7days --- Lifecycle: Delete logs upon termination ---Save.
Tags:
Name:project--value:vprofile---save
Create app
Wait for sometime until we get healthy. we need to run artifacts before that we need to change backend security group .
Ec2 instance-- security group---- backend security group-- security group--- edit inbound rules--add-- mysql/aurora-- port number:3306 -- Beanstalk security group.
Add rules--Custom TCP----11211 Beanstalk security group
Add rules--Custom TCP----5671 Beanstalk security group ---save rules
Next we need to upload artifact to beanstalk environment. but before that we have to change the health check and add 443 of HHTPS load balancer Connection.
vprofile-env---configuration--- load balancer-- Add listener: port:443 protocol: HTTPS SSL certificate: add DNS.
Processes
edit health check add / login to this.--- Apply.
Github
clone into repo--- cd vprofile-project-cd src/main/resources/ls application.properties---vi application.properties change all the endpoints here in the application --- mvn install(installing artifacts) check our artifact in target dir --- we gonna copy this artifact into beanstalk environment
Go to amazon console-- health sever transfer to server click upload in right corner-- choose repo target dir and click upload-- once its upload - select that and select deploy. wait for sometime health is ok .
Now time to checkout login page
copy the endpoint from beanstalk--- before that will add DNS so go to godaddy----dns--type: CNAM--host : vprofile--- point to: paste the endpoint here --- Save
https://vprofile.myprojectinc.com this is will bring it to login page user name: admin_vp password :admin_vp
CloudFront
Search for cloudfront : And its a content delivery network from AWS. and it has more than 200 edge locations.
CREATE DISTRIBUTION:
Get started-- Domain name: pointing to url vprofile.myprojectinc.com-- origin ID: Custom-vprofile.myprojectinc.com--- Minimum origin SSL Protocol: TLSv1---Origin protocol policy: Match viewer-- Origin connection Attempts: 3-- Connection timeout:10-- response Timeout: 30 -- origin keep-alive Timeout: 5 HTTP Port:80 HTTPS port:443 --- others are default
Default Cache Behaviour Setting:
viewer protocol policy: HTTP and Https---Allowed HTTP Methods: GET, HEAD, OPTIONS, PT, POST, PATCH, DELETE---Change distribution settings: as per your needs.--- Create Distribution