Khởi tạo CloudFormation Template

Khởi tạo CloudFormatuon Templates

Bước này sẽ hướng dẫn chi tiết cách tạo My VPC bằng CloudFormation Template. Bạn có thể lặp lại bước này để tạo thêm HG VPC. Một stack có thể cần tới 5 phút để hoàn tất khởi tạo.

  1. Đăng nhập vào AWS Management Console

    • Tìm CloudFormation
    • Chọn CloudFormation

Launch CloudFormation

Trong workshop này, chúng ta sẽ sử dụng Region Singapore ( ap-southeast-1 ). Nếu bạn muốn sử dụng Region khác , hãy đảm bảo chuyển Region về Region bạn muốn sử dụng khi tạo các tài nguyên liên quan tới workshop.

Launch CloudFormation

  1. Trong giao diện CloudFormation, chọn Stack

Launch CloudFormation

  1. Trong giao diện Stack, chọn Create stack

Launch CloudFormation

  1. Trong trang Create stack chọn các thông số sau và chọn Next:
    • Prerequisite - Prepare template:
      • Prerequisite template: Template is ready
    • Specify template:
      • Template source*: Upload a template file
      • Chọn Choose file rồi chọn tập tin VPCTempalte.yaml vừa được tải về trước đó .
    • Chọn Next

Launch CloudFormation

  1. Trong trang Specify stack details, bạn sẽ nhập các thông số được yêu cầu trong VPCTempalte.yaml như sau:
    • Stack name:
      • Stack name: My-VPC-Stack
    • Parameters:
      • EnvironmentName: My VPC
      • PrivateSubnet1CIDR: 172.31.3.0/24
      • PrivateSubnet2CIDR: 172.31.4.0/24
      • PublicSubnet1CIDR: 172.31.1.0/24
      • PublicSubnet2CIDR: 172.31.2.0/24
      • VpcCIDR: 172.31.0.0/16
    • Kiểm tra và chọn Next

Launch CloudFormation

  1. Tại trang Configure stack options, chọn Next

Launch CloudFormation

  1. Tại trang Review, kiểm tra và chọn Submit ở cuối trang.

Launch CloudFormation

  1. Đợi 10 phút sau, Stack tạo thành công.

Launch CloudFormation

  1. Xem Ouput của Stack vừa tạo.

Launch CloudFormation

  1. Thực hiện các bước lặp lại để tạo HG VPC
  • Ở thanh bên trái, chọn Stacks. Sau đó, chọn Create stack và chọn With new resources (standard).

Launch CloudFormation

  1. Trong trang Create stack chọn các thông số sau và chọn Next:
    • Prerequisite - Prepare template:
    • Prerequisite template: Template is ready
    • Specify template:
    • Template source: Upload a template file
    • Chọn Choose file rồi chọn tập tin VPCTempalte.yaml vừa được tải về trước đó.

Launch CloudFormation

  1. Stack name:

    • Stack name: HG-VPC-Stack
    • Parameters:
      • EnvironmentName: HG VPC
      • PrivateSubnet1CIDR: 10.10.3.0/24
      • PrivateSubnet2CIDR: 10.10.4.0/24
      • PublicSubnet1CIDR: 10.10.1.0/24
      • PublicSubnet2CIDR: 10.10.2.0/24
      • VpcCIDR: 10.10.0.0/16

Launch CloudFormation

  1. Tại trang Configure stack options, chọn Next

Launch CloudFormation

  1. Tại trang Review, kiểm tra và chọn Submit ở cuối trang. Đợi 10 phút sau hoàn thành tạo stack.

Launch CloudFormation

  1. Xem Output stack vừa tạo.

Launch CloudFormation