# SCP::VPC::Subnet

LLMS index: [llms.txt](https://docs.e.samsungsdscloud.com/en/templatereference/networking/vpc/llms.txt)

---

```
SCP::VPC::Subnet
```





## Description
A subnet of a VPC that provides an IP address range for network resources.

## Version
`1.3.0`

## Syntax

To declare this entity in your Infrastructure Builder template, use the following syntax:

**JSON**
```json
{
  "Type" : "SCP::VPC::Subnet",
  "Properties" : {
    "Name" : "String",
    "VpcId" : "String",
    "Cidr" : "String",
    "Type" : "String",
    "Category" : "String",
    "Description" : "String",
    "DhcpIpAddress" : "String",
    "AllocationPools" : [AllocationPools, ...],
    "HostRoutes" : [HostRoutes, ...],
    "GatewayIpAddress" : "String",
    "DnsNameservers" : "String",
    "PrimarySubnetId" : "String"
  }
}

```

**YAML**
```yaml
Type: SCP::VPC::Subnet
Properties:
  Name: String
  VpcId: String
  Cidr: String
  Type: String
  Category: String
  Description: String
  DhcpIpAddress: String
  AllocationPools: 
    - AllocationPools
  HostRoutes: 
    - HostRoutes
  GatewayIpAddress: String
  DnsNameservers: String
  PrimarySubnetId: String

```

## Properties


### Name

The name of the subnet. It must be 3 to 20 characters long and match the pattern ^[a-zA-Z0-9-]*$, for example subnetName.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Pattern** | `^[a-zA-Z0-9-]*$` |
| **Length constraints** | 3–20 |
| **Update requires** | Replacement |






### VpcId

The identifier of the VPC that the subnet belongs to.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### Cidr

The IP address range of the subnet in CIDR notation.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### Type

The type of the subnet.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### Category

The category of the subnet.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### Description

A brief explanation or note that identifies the purpose or usage of the subnet, up to 50 characters.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Length constraints** | Max: 50 |
| **Update requires** | No interruption |






### DhcpIpAddress

The IP address automatically assigned by DHCP.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | No interruption |






### AllocationPools

The ranges of IP addresses available for allocation within the subnet.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Array of AllocationPools |
| **Update requires** | Replacement |




> For more information, see [AllocationPools](/en/templatereference/networking/vpc/scp_vpc_subnet/allocationpools/).



### HostRoutes

The static host routes configured for the subnet.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Array of HostRoutes |
| **Update requires** | Replacement |




> For more information, see [HostRoutes](/en/templatereference/networking/vpc/scp_vpc_subnet/hostroutes/).



### GatewayIpAddress

The gateway IP address of the subnet.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### DnsNameservers

The DNS name server address of the subnet, up to one address.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### PrimarySubnetId

The identifier of the primary subnet of the VPC to which the subnet belongs.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |







## Return Values

### Ref

When you pass the logical ID of this resource to the `Ref` function, Ref returns the value of the **Id**.


### Fn::GetAtt

| Attribute | Description |
|-----------|-------------|
| **Name** | The name of the subnet. It must be 3 to 20 characters long and match the pattern ^[a-zA-Z0-9-]*$, for example subnetName. |
| **VpcId** | The identifier of the VPC that the subnet belongs to. |
| **Cidr** | The IP address range of the subnet in CIDR notation. |
| **Type** | The type of the subnet. |
| **Category** | The category of the subnet. |
| **Description** | A brief explanation or note that identifies the purpose or usage of the subnet, up to 50 characters. |
| **DhcpIpAddress** | The IP address automatically assigned by DHCP. |
| **AllocationPools** | The ranges of IP addresses available for allocation within the subnet. |
| **HostRoutes** | The static host routes configured for the subnet. |
| **GatewayIpAddress** | The gateway IP address of the subnet. |
| **DnsNameservers** | The DNS name server address of the subnet, up to one address. |
| **PrimarySubnetId** | The identifier of the primary subnet of the VPC to which the subnet belongs. |
| **AccountId** | The identifier of the account that owns the subnet. |
| **State** | The current lifecycle state of the subnet. |
| **VpcName** | The name of the VPC that the subnet belongs to. |
| **SecondarySubnetIds** | The list of secondary subnet IDs of the VPC to which the subnet belongs. |
| **Zones** | The list of availability zones where the subnet is located. |

---

Section pages:

- [AllocationPools](/en/templatereference/networking/vpc/scp_vpc_subnet/allocationpools/index.md)
- [HostRoutes](/en/templatereference/networking/vpc/scp_vpc_subnet/hostroutes/index.md)
