# SCP::VPC::Vpc

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

---

```
SCP::VPC::Vpc
```





## Description
A VPC resource of the SCP VPC service.

## Version
`1.5.0`

## Syntax

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

**JSON**
```json
{
  "Type" : "SCP::VPC::Vpc",
  "Properties" : {
    "Cidrs" : [String],
    "Name" : "String",
    "ZoneType" : "String",
    "Zones" : [String],
    "Description" : "String"
  }
}

```

**YAML**
```yaml
Type: SCP::VPC::Vpc
Properties:
  Cidrs: [String]
  Name: String
  ZoneType: String
  Zones: [String]
  Description: String

```

## Properties


### Cidrs

Desired IPv4 CIDR blocks. At least one CIDR is required.

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






### Name

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

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






### ZoneType

VPC zone type (API 1.5). Defaults to PUBLIC for existing templates.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Allowed values** | PUBLIC \| PRIVATE \| ACCELERATED |
| **Update requires** | Replacement |






### Zones

Creation zones. PUBLIC requires zones when zone selection is enabled and must omit them otherwise. PRIVATE and ACCELERATED require exactly one zone.

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






### Description

A brief explanation or note that identifies the purpose or usage of the VPC, up to 50 characters, for example VPC description.

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







## 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 |
|-----------|-------------|
| **Cidrs** | Desired IPv4 CIDR blocks. At least one CIDR is required. |
| **Name** | The name of the VPC. It must be 3 to 20 characters long and match the pattern ^[a-zA-Z0-9-]+$, for example vpcName. |
| **ZoneType** | VPC zone type (API 1.5). Defaults to PUBLIC for existing templates. |
| **Zones** | Creation zones. PUBLIC requires zones when zone selection is enabled and must omit them otherwise. PRIVATE and ACCELERATED require exactly one zone. |
| **AzMode** | The effective VPC availability zone mode returned by API 1.5. |
| **Description** | A brief explanation or note that identifies the purpose or usage of the VPC, up to 50 characters, for example VPC description. |
| **AccountId** | The identifier of the account that owns the VPC, for example f1e6c81a2b054582878cb9724dc2ce9f. |
| **CidrCount** | The number of CIDR blocks associated with the VPC, for example 20. |
| **State** | The current lifecycle state of the VPC, for example ACTIVE. |


## Sample Template

### Set up a VPC, Subnet, Internet Gateway, and Public IP
Sets up the basic network (VPC, Subnet, Internet Gateway, Public IP)

```yaml
SCPTemplateFormatVersion: '2026-01-01'
Description: 'VPC, Subnet, Internet Gateway, Public IP 템플릿'
Parameters:
  VpcName:
    Type: String
    Default: 'sample-vpc'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'VPC 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  VpcCidr:
    Type: CommaDelimitedList
    Default: '10.0.0.0/16'
    Description: 'VPC의 IP 대역(CIDR)을 입력하세요. (prefix 길이 /16 ~ /24)'
  SubnetName:
    Type: String
    Default: 'sample-subnet'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'Subnet 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  SubnetCidr:
    Type: String
    Default: '10.0.1.0/24'
    Description: 'Subnet의 IP 대역(CIDR)을 입력하세요. (VPC CIDR 범위 내)'
  PublicIpZone:
    Type: String
    Default: 'kr-west1-a'
    Description: 'Public IP가 생성될 Zone을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞는 존으로 수정)'

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  Subnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref Vpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
      Description: 'Sample 리소스 배포용 Private Subnet'
  InternetGateway:
    Type: SCP::VPC::InternetGateway
    Properties:
      Type: IGW
      VpcId: !Ref Vpc
      Description: '외부 인터넷 접속용 Internet Gateway'
  PublicIp:
    Type: SCP::VPC::PublicIp
    DependsOn: InternetGateway
    Properties:
      Type: IGW
      Zone: !Ref PublicIpZone
      Description: 'Sample 리소스용 Public IP'

Outputs:
  VpcId:
    Description: "생성된 VPC의 ID입니다."
    Value: !Ref Vpc
  SubnetId:
    Description: "생성된 Subnet의 ID입니다."
    Value: !Ref Subnet
  InternetGatewayId:
    Description: "생성된 Internet Gateway의 ID입니다."
    Value: !Ref InternetGateway
  PublicIpId:
    Description: "생성된 Public IP의 ID입니다."
    Value: !Ref PublicIp

```
