跳到主要內容

發表文章

目前顯示的是 3月, 2017的文章

why create at least two subnets in different AZs is a must have practice?

今天遇到了一個有趣的問題,在 AWS VPC 裡要 create RDS DB instance 遇到了一個無解的問題。 原本的 VPC 規劃時只有兩個 subnet,而且無法再加進其他 subnet。 VPC CIDR: 192.168.1.0/24 Subnet 1 CIDR: 192.168.1.0/25 Subnet 2 CIDR: 192.168.1.128/25 更悲劇的是,這兩個 subnet 都是屬於同一個 Availability Zone (AZ)..... 雖然在 VPC 裡 create RDS instance 時可以選擇 "Multiple AZ deployment = No" 但接下來卻還是一定要 create DB subnet group. 而 DB subnet group 則是至少要有兩個 subnet 要在不同的 AZ, 我原本以為如果我選擇只要 single AZ deployment,那 create DB subnet group 應該就不是必要的,但看起來 AWS 是不允許的。去翻了一下 Working with an Amazon RDS DB Instance in a VPC 第一條真的寫了 " Your VPC must have at least one subnet in at least two of the Availability Zones in the region where you want to deploy your DB instance. A subnet is a segment of a VPC's IP address range that you can specify and that lets you group instances based on your security and operational needs. " 雖然我不知道怎麼只有一個 subnet 但是可以有兩個 AZ,但就我的理解應該就是指,你的 VPC 下要有兩個以上的 subnet,然後至少有兩個 subnet 是屬於不同 AZ。 這個故事告訴我們: 創建 VPC 時,可大,不可以小。雖然目前只有兩個 su