SCP::VPC::Vpc

SCP::VPC::Vpc

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

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

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.

AttributeValue
RequiredYes
TypeArray of String
Update requiresNo 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.

AttributeValue
RequiredYes
TypeString
Pattern^[a-zA-Z0-9-]*$
Length constraints3–20
Update requiresReplacement

ZoneType

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

AttributeValue
RequiredNo
TypeString
Allowed valuesPUBLIC | PRIVATE | ACCELERATED
Update requiresReplacement

Zones

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

AttributeValue
RequiredNo
TypeArray of String
Update requiresReplacement

Description

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

AttributeValue
RequiredNo
TypeString
Length constraintsMax: 50
Update requiresNo 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

AttributeDescription
CidrsDesired IPv4 CIDR blocks. At least one CIDR is required.
NameThe name of the VPC. It must be 3 to 20 characters long and match the pattern ^[a-zA-Z0-9-]+$, for example vpcName.
ZoneTypeVPC zone type (API 1.5). Defaults to PUBLIC for existing templates.
ZonesCreation zones. PUBLIC requires zones when zone selection is enabled and must omit them otherwise. PRIVATE and ACCELERATED require exactly one zone.
AzModeThe effective VPC availability zone mode returned by API 1.5.
DescriptionA brief explanation or note that identifies the purpose or usage of the VPC, up to 50 characters, for example VPC description.
AccountIdThe identifier of the account that owns the VPC, for example f1e6c81a2b054582878cb9724dc2ce9f.
CidrCountThe number of CIDR blocks associated with the VPC, for example 20.
StateThe 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)

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