本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
子網路是 VPC 中的 IP 地址範圍,且必須完全位於一個可用區域內。您必須為子網路指定 VPC、CIDR 區塊、可用區域和路由表。您也必須定義子網路是私有還是公有。
語法
tosca.nodes.AWS.Networking.Subnet:
properties:
type: String
availability_zone: String
cidr_block: String
ipv6_cidr_block: String
ipv6_cidr_block_suffix: String
outpost_arn: String
tags: List
requirements:
vpc: String
route_table: String
屬性
-
type
-
指示在此子網路中啟動的執行個體是否會收到公有 IPv4 地址。
必要:是
類型:字串
可能的值:
PUBLIC
|PRIVATE
-
availability_zone
-
子網路的可用區域。此欄位支援 AWS 區域內的 AWS 可用區域,例如
us-west-2
(美國西部 (奧勒岡))。它也支援可用區域內的 AWS Local Zones,例如us-west-2-lax-1a
。必要:是
類型:字串
-
cidr_block
-
子網路的 CIDR 區塊。
必要:否
類型:字串
-
ipv6_cidr_block
-
用來建立 IPv6 子網路的 CIDR 區塊。如果您包含此屬性,請勿包含
ipv6_cidr_block_suffix
。必要:否
類型:字串
-
ipv6_cidr_block_suffix
-
透過 Amazon VPC 建立之子網路的 IPv6 CIDR 區塊的 2 位數十六進位尾碼。使用下列格式:
2-digit hexadecimal
::/subnetMask
如果您包含此屬性,請勿包含
ipv6_cidr_block
。必要:否
類型:字串
-
outpost_arn
-
要在 AWS Outposts 其中建立子網路的 ARN。如果您想要在 上啟動 Amazon EKS 自我管理節點,請將此屬性新增至 NSD 範本 AWS Outposts。如需詳細資訊,請參閱《Amazon EKS 使用者指南 AWS Outposts》中的 上的 Amazon EKS。
如果您將此屬性新增至 NSD 範本,則必須將
availability_zone
屬性的值設定為 的可用區域 AWS Outposts。必要:否
類型:字串
-
tags
-
要連接到資源的標籤。
必要:否
類型:清單
要求
-
vpc
-
必要:是
類型:字串
-
route_table
-
必要:是
類型:字串
範例
SampleSubnet01:
type: tosca.nodes.AWS.Networking.Subnet
properties:
type: "PUBLIC"
availability_zone: "us-east-1a"
cidr_block: "10.100.50.0/24"
ipv6_cidr_block_suffix: "aa::/64"
outpost_arn: "arn:aws:outposts:region:accountId:outpost/op-11223344EXAMPLE"
tags:
- "Name=SampleVPC"
- "Environment=Testing"
requirements:
vpc: SampleVPC
route_table: SampleRouteTable
SampleSubnet02:
type: tosca.nodes.AWS.Networking.Subnet
properties:
type: "PUBLIC"
availability_zone: "us-west-2b"
cidr_block: "10.100.50.0/24"
ipv6_cidr_block: "2600:1f14:3758:ca00::/64"
requirements:
route_table: SampleRouteTable
vpc: SampleVPC