Prepare resources with AWS CloudFormation
To conduct the infrastructure deployment, we will use the AWS CloudFormation service through the AWS Console or AWS CLI.
Content
The exercise will be set at us-east-1 (North Virginia).
Create Stack
button.Specify template
page, we have 2 ways:
Amazon S3 URL
box.Upload a template file
button.Parameters
page, we will enter some required information.Specify Stack Details
page, select the Next
button.Configure stack options
page, select the Next
button.Capabilities
page, proceed to accept (Acknowledge) to allow the Template to create IAM roles, and finally select the Create Stack
button.The above process will take 5-10 minutes until we see the status of the Stack as CREATE_COMPLETE
.
Ingredients | Value (Required) |
---|---|
Stack Name | smdemo |
Template URL | RDSFargate.yml |
Or download the template below:
The values below have been defined as default values at Template.
Ingredients | Value (Required) |
---|---|
NamePrefix | smdemo |
ProjectTag | smproj |
DBName | smdemo |
DBPort | 3306 |
AmazonLinux2AmiId | /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 |
After the CloudFormation Stack has been prepared, we proceed to note all the values in the Outputs section.
The following Output Keys will be used:
Output Key | Definition |
---|---|
BastionIP | IP Address of Bastion Host |
DBInstance | ID of RDS Instance |
DBUser | Master User of RDS database |
DBPassword | Master User’s Password of RDS database |
EC2UserPassword | Password of ec2-user |
ECRRepository | ECR repository |
ECSCluster | ECS cluster |
We need to note and note the above values because they will be used for the next sections.