Triển khai CloudFormation Stack

Triển khai CloudFormation Stack

  1. Truy cập EC2.
    • Chọn Key Pairs và chọn Create key pair.

AWS CloudFormation

  1. Tại Name, nhập cfn-keypair.
    • Chọn Key pair type RSA.
    • Chọn Private key file format .pem.
    • Chọn Create key pair.
    • Key pair này sẽ được dùng khi tạo CloudFormation stack.

AWS CloudFormation

  1. Tạo key pair thành công, file cfn-keypair.pem được tải về máy tính của bạn.

AWS CloudFormation

Lưu file cfn-keypair.pem ở nơi an toàn và không chia sẻ file này. Bạn sẽ dùng file này để SSH vào Bastion Host ở phần tiếp theo.

  1. Truy cập CloudFormation:
    • Chọn Create stack
    • Chọn With new resources (standard)

AWS CloudFormation

  1. Tạo stack:
    • Chọn Choose an existing template
    • Chọn Upload a template file
    • Tải file template cfn-aws-three-tier-demo.yaml về máy
    • Chọn Choose file
    • Chọn file vừa tải về
    • Chọn Next

AWS CloudFormation

  1. Tại Stack name, nhập cfn-aws-three-tier-demo.
    • KeyPair: chọn cfn-keypair

AWS CloudFormation

  1. Hoàn thành các thông tin trong phần Parameters:
    • MasterUsername: nhập tên đăng nhập database, ví dụ admin
    • MasterUserPassword: nhập mật khẩu có ít nhất 8 ký tự, không chứa /, @, " hoặc khoảng trắng
    • SSHLocation: nên đổi thành <your_public_ip>/32 để chỉ cho phép SSH từ máy tính của bạn
    • Các tham số còn lại để mặc định

AWS CloudFormation

  1. Chọn Next.

AWS CloudFormation

  1. Tại Configure stack options, giữ cấu hình mặc định.
    • Chọn Next.

AWS CloudFormation

  1. Kiểm tra lại thông tin.
    • Chọn Submit.

AWS CloudFormation

  • Đợi stack đạt trạng thái CREATE_COMPLETE.
  1. Chọn tab Outputs.
    • Sao chép giá trị WebTierLoadBalancerURL.
    • Dán vào trình duyệt.

AWS CloudFormation