ECS Fargate with advanced Cloudformation Templates
In the ECS Fargate with Pre-built Jenkins CI/CD pipeline manual, we have provided a manual for the first template in which you can build your source code, test, and deploy in ECS Fargate with a database using Jenkins. So all these can be done using our cloud formation template. In this additional manual, we have provided manuals for the next two cloud formation templates for different scenarios. We have provided the use cases, some sample applications for practice, and a manual for each cloud formation template.
Technical Usage Manual
2. Cloudformation Template for ECS Fargate with Jenkins:
Use Cases:
This is the Infrastructure without the database attached. This Infrastructure is suitable for your own Static Application, in which you build your code to docker image using Jenkins and deploy it in ECS Fargate. We have provided a sample source code for your reference.
User Instructions:
2.1 VPC Configuration:
Enter the cluster name and CIDR Ranges for VPC and Subnets
Select the Availability Zones for the Subnets
Select the SSH Key Pair for cluster

2.2 Container Configuration:
Enter the TaskCpu and TaskMemory in MiB with the supported values. To know the supported values refer to ECS Fargate Cpu and Memory
Leave the Docker image ID and Container port as default (Note: It will create a cluster with an empty image, while using Jenkins, replace this empty image with the actual ECR image created).
Enter the Mail ID to receive the alarm notification.

2.3 After the stack is created successfully, go to the outputs of the stack and copy the public ip and paste it into the browser with 8080. So now it opens the Jenkins login page.
Please refer to our manual for Jenkins configuration.
2.4 After the Jenkins configuration, execute the pipeline.
Jenkins_ECS_Fargate_Pipeline_For_CodeTesting_with_OWASP+SonarQube
2.5 Enter the Essential Parameters of Github Url for the source code, AWS Account ID, Mail ID, name of the Dockerfile and Endpoint Url which is in cloudformation outputs (Eg: http://<Endpoint_URL>/ ).
2.6 Check the other parameters which is in default and change it if needed (Note: Check the stack name in Jenkins pipeline is same as stackname in cloudformation stack)
2.7 Once the Pipeline is completed, allow the target application to be deployed successfully and check it by using the same Endpoint URL cloudformation stack.

3. Cloudformation Template for ECS Fargate:
Use Cases:
In this Infrastructure template , you can directly deploy the application with Docker Image. We have provided some samples below and please refer to them.
Examples:
Application | Image Id | Port |
Wordpress | wordpress:latest | 80 |
Magento | vulhub/magento:2.2.7 | 80 |
Drupal | drupal:latest | 80 |
Ghost | ghost:latest | 2368 |
Matomo | matomo:latest | 80 |
You can use the above applications and other than the above you can also use the similar applications.
User Instructions:
3.1 VPC Configuration:
Enter the cluster name and CIDR Ranges for VPC and Subnets
Select the Availability Zones for the Subnets
Select the SSH Key Pair for cluster

3.2 Database Configuration:
Enter the Database details such as DB Name, Username, Password
Enter the CIDR value for the DBSubnet and select the Availability Zone for DBSubnet(Note: AZ must be different from subnet selected in VPC configuration
In EnvironmentvariableKey, Enter the Database Keys which you have configured for your Application (Eg: DB_HOST, DB_NAME, DB_USER, DB_PASSWORD) should be in same order as shown
3.3 Container Configuration:
Enter the TaskCpu and TaskMemory in MiB with the supported values. To know the supported values refer to ECS Fargate Cpu and Memory
Enter the Docker Image Id for the Application (Eg: WordPress:latest) and the Container port on which it listens
Enter the Mail ID to receive the alarm notification


Insights & Support:
For further details about Jenkins and its uses, refer to the Jenkins website
Yobitel will do our best to respond to your questions within the next 24 hours in business days. For any technical support or query, you can drop a mail to support@yobitel.com.
Check our other Containerized Cloud-Native application stacks as EKS, ECS, Cloud Formation, and AMI - Amazon Machine Images in AWS Marketplace.