

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 网络服务描述符模板
<a name="nsd-template"></a>

定义网络服务描述文件（NSD）模板。

## 语法
<a name="nsd-template-syntax"></a>

```
tosca_definitions_version: tnb_simple_yaml_1_0

vnfds:
  - descriptor\_id: String
    namespace: String

topology_template:

  inputs:
    SampleInputParameter:
      type: String
      description: "Sample parameter description"
      default: "DefaultSampleValue"

  node\_templates:
    SampleNode1: tosca.nodes.AWS.NS
```

## 使用已定义的参数
<a name="using-defined-parameters"></a>

当您想要动态传递参数（例如 VPC 节点的 CIDR 块）时，可以使用 `{ get_input: {{input-parameter-name}} }` 语法在 NSD 模板中定义参数。然后即可在同一 NSD 模板中重复使用该参数。

以下示例演示了如何定义和使用参数：

```
tosca_definitions_version: tnb_simple_yaml_1_0

topology_template:

  inputs:
    cidr_block:
      type: String
      description: "CIDR Block for VPC"
      default: "10.0.0.0/24"

  node_templates:
    ExampleSingleClusterNS:
      type: tosca.nodes.AWS.NS
      properties:
        descriptor_id: "{{a1b2c3d4-5678-90ab-cdef-EXAMPLE11111}}"
         .....

    ExampleVPC:
      type: tosca.nodes.AWS.Networking.VPC
      properties:
        cidr_block: { get_input: cidr_block }
```

## VNFD 导入
<a name="vnfd-import"></a>

 `descriptor_id`    
描述文件的 UUID。  
必需：是  
类型：字符串  
模式：`[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}`

 `namespace`    
唯一名称。  
必需：是  
类型：字符串

## 拓扑模板
<a name="nsd-topology-template"></a>

 `node_templates`    
可能的 TOSCA AWS 节点有：  
+ [AWS.NS](node-ns.md)
+ [AWS.Compute.EKS](node-eks.md)
+ [AWS.compute.eks。 AuthRole](node-eks-authrole.md)
+ [AWS.Compute。 EKSManaged节点](node-eks-managed-node.md)
+ [AWS.Compute。 EKSSelfManagedNode](node-eks-self-managed.md)
+ [AWS.Compute。 PlacementGroup](node-compute-placement-group.md)
+ [AWS.Compute。 UserData](node-compute-user-data.md)
+ [AWS. 联网。 SecurityGroup](node-networking-security-group.md)
+ [AWS. 联网。 SecurityGroupEgressRule](node-networking-security-group-egress-rule.md)
+ [AWS. 联网。 SecurityGroupIngressRule](node-networking-security-group-ingress-rule.md)
+ [AWS.Resource.Import](node-resource-import.md)
+ [AWS.Networking.ENI](node-eni.md)
+ [AWS.HookExecution](node-hook-execution.md)
+ [AWS. 联网。 InternetGateway](node-internet-gateway.md)
+ [AWS. 联网。 RouteTable](node-route-table.md)
+ [AWS.Networking.Subnet](node-subnet.md)
+ [AWS. 部署。 VNFDeployment](node-vnf-deployment.md)
+ [AWS.Networking.VPC](node-vpc.md)
+ [AWS. 联网。 NATGateway](node-nat-gateway.md)
+ [AWS.Networking.Route](node-route.md)