How can the application and environment be deployed and automated in AWS, while allowing for future changes?
Update the runbook to describe how to create the VPC, the EC2 instances, and the RDS instance for the application by using the AWS Console. Make sure that the rest of the steps in the runbook are updated to reflect any changes that may come from the AWS migration.
Write a Python script that uses the AWS API to create the VPC, the EC2 instances, and the RDS instance for the application. Write shell scripts that implement the rest of the steps in the runbook. Have the Python script copy and run the shell scripts on the newly created instances to complete the installation.
Write an AWS CloudFormation template that creates the VPC, the EC2 instances, and the RDS instance for the application. Ensure that the rest of the steps in the runbook are updated to reflect any changes that may come from the AWS migration.
Write an AWS CloudFormation template that creates the VPC, the EC2 instances, and the RDS instance for the application. Include EC2 user data in the AWS CloudFormation template to install and configure the software.
Explanations:
Updating the runbook to describe the AWS Console process does not provide automation or flexibility for future changes. Manual updates are still required, which defeats the purpose of leveraging cloud automation.
While using a Python script to interact with the AWS API allows for some automation, it lacks the infrastructure-as-code benefits provided by CloudFormation. This approach may also complicate management and updates to the infrastructure.
Writing a CloudFormation template is a good start for automating infrastructure setup, but it does not include the necessary steps for software installation and configuration, which are crucial for a complete deployment.
Using a CloudFormation template to create the VPC, EC2 instances, and RDS instance, along with EC2 user data for software installation and configuration, provides a fully automated deployment. This approach allows for easy updates and modifications to the infrastructure and application in the future.