Preparation

To conduct the infrastructure deployment, we will use the AWS CloudFormation service through the AWS Console or AWS CLI.

Template URL

Download the template below:

CloudFormation Stack

The exercise will be set at us-east-1 (North Virginia).

  1. Sign in to AWS Console, access the CloudFormation service
  2. Proceed to create a new Stack by clicking the Create Stack button.
  3. On the Specify template page, we have 2 ways:
    1. Enter the path of Template URL https://s3.amazonaws.com/sa-security-specialist-workshops-us-east-1/secrets-manager-workshop/RDSFargate.yml in the Amazon S3 URL box. (This template is outdated, please use method 2 for practice)
    2. Upload an existing Template using the Upload a template file button.
  4. Continue to click Next.

cloudformation-create-stack-parameters

  1. On the Specify Stack Details page, name it FCAJ-Lab96-SecretsManager and select the Next button.
  2. On the Configure stack options page, proceed to accept (Acknowledge) to allow the Template to create IAM roles, and finally select the Next button.
  3. On the Review and create page, click Submit.

cloudformation-stack-status

The above process will take 5-10 minutes until we see the status of the Stack as CREATE_COMPLETE.

Parameters

The values ​​below have been defined as default values ​​at Template.

IngredientsValue (Required)
NamePrefixsmdemo
ProjectTagsmproj
DBNamesmdemo
DBPort3306
AmazonLinux2AmiId/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2

Stack Outputs

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 KeyDefinition
BastionIPIP Address of Bastion Host
DBInstanceID of RDS Instance
DBUserMaster User of RDS database
DBPasswordMaster User’s Password of RDS database
EC2UserPasswordPassword of ec2-user
ECRRepositoryECR repository
ECSClusterECS cluster

cloudformation-stack-output

We need to note and note the above values ​​because they will be used for the next sections.