SCP::VirtualServer::VirtualServer

SCP::VirtualServer::VirtualServer

SCP::VirtualServer::VirtualServer

Description

A Virtual Server resource of the SCP Virtual Server service that provides a virtual server.

Version

1.5.0

Syntax

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

JSON

{
  "Type" : "SCP::VirtualServer::VirtualServer",
  "Properties" : {
    "Networks" : [Networks, ...],
    "ImageId" : "String",
    "KeypairName" : "String",
    "Lock" : "Boolean",
    "Metadata" : "Metadata",
    "Name" : "String",
    "ProductCategory" : "String",
    "ProductOffering" : "String",
    "SecurityGroups" : [String],
    "UserData" : "String",
    "ServerGroupId" : "String",
    "ServerTypeId" : "String",
    "BootVolume" : "BootVolume",
    "ExtraVolumes" : [ExtraVolumes, ...],
    "Zone" : "String"
  }
}

YAML

Type: SCP::VirtualServer::VirtualServer
Properties:
  Networks: 
    - Networks
  ImageId: String
  KeypairName: String
  Lock: Boolean
  Metadata: Metadata
  Name: String
  ProductCategory: String
  ProductOffering: String
  SecurityGroups: [String]
  UserData: String
  ServerGroupId: String
  ServerTypeId: String
  BootVolume: BootVolume
  ExtraVolumes: 
    - ExtraVolumes
  Zone: String

Properties

Networks

The list of networks to connect to the server. Up to 5 networks can be specified, and at least one must belong to a public or private subnet. Use either subnet IDs or port IDs across the whole list, never both.

AttributeValue
RequiredYes
TypeArray of Networks
Update requiresNo interruption

For more information, see Networks.

ImageId

The identifier of the Image that specifies the OS image to use for the server.

AttributeValue
RequiredYes
TypeString
Update requiresReplacement

KeypairName

The name of the keypair used for SSH access to the server.

AttributeValue
RequiredYes
TypeString
Update requiresReplacement

Lock

Whether to lock the server immediately after it is created. Defaults to false.

AttributeValue
RequiredNo
TypeBoolean
Update requiresNo interruption

Metadata

Key-value pairs that the platform stores on the server.

AttributeValue
RequiredNo
TypeMetadata
Update requiresReplacement

Name

The name of the server.

AttributeValue
RequiredYes
TypeString
Pattern^[a-zA-Z0-9-_ ]*$
Length constraints1–63
Update requiresNo interruption

ProductCategory

The product category of the server.

AttributeValue
RequiredNo
TypeString
Update requiresReplacement

ProductOffering

The product offering of the server.

AttributeValue
RequiredNo
TypeString
Update requiresReplacement

SecurityGroups

The list of security group identifiers to associate with the server.

AttributeValue
RequiredNo
TypeArray of String
Update requiresNo interruption

UserData

The user data script that runs on the server at startup, base64-encoded. Plain text must be wrapped with Fn::Base64 in the template. Values that are not valid base64 are passed to the service as-is and rejected by the API. The maxLength limit applies to the base64-encoded value.

AttributeValue
RequiredNo
TypeString
Length constraintsMax: 65535
Update requiresReplacement

ServerGroupId

The identifier of the server group in which the server is placed.

AttributeValue
RequiredNo
TypeString
Update requiresReplacement

ServerTypeId

The identifier of the server type of the server, for example s1v1m2.

AttributeValue
RequiredYes
TypeString
Update requiresNo interruption

BootVolume

Boot volume settings that define the root disk where the OS is installed.

AttributeValue
RequiredYes
TypeBootVolume
Update requiresReplacement

For more information, see BootVolume.

ExtraVolumes

Extra volume settings that define additional volumes to attach to the server besides the boot volume.

AttributeValue
RequiredNo
TypeArray of ExtraVolumes
Update requiresNo interruption

For more information, see ExtraVolumes.

Zone

The availability zone in which the server is located.

AttributeValue
RequiredYes
TypeString
Update requiresReplacement

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
AccountIdThe identifier of the account that owns the server.
NetworksThe list of networks to connect to the server. Up to 5 networks can be specified, and at least one must belong to a public or private subnet. Use either subnet IDs or port IDs across the whole list, never both.
AutoScalingGroupIdThe identifier of the Auto Scaling Group that created the server. It has a value only for servers created by an Auto Scaling Group.
DiskConfigThe disk configuration mode of the server.
ImageIdThe identifier of the Image that specifies the OS image to use for the server.
KeypairNameThe name of the keypair used for SSH access to the server.
LaunchConfigurationIdThe identifier of the launch configuration that created the server. It has a value only for servers created by an Auto Scaling Group.
LockWhether to lock the server immediately after it is created. Defaults to false.
NameThe name of the server.
PlannedComputeOsTypeThe planned OS type of the server.
ProductCategoryThe product category of the server.
ProductOfferingThe product offering of the server.
SecurityGroupsThe list of security group identifiers to associate with the server.
UserDataThe user data script that runs on the server at startup, base64-encoded. Plain text must be wrapped with Fn::Base64 in the template. Values that are not valid base64 are passed to the service as-is and rejected by the API. The maxLength limit applies to the base64-encoded value.
ServerGroupIdThe identifier of the server group in which the server is placed.
ServerTypeIdThe identifier of the server type of the server, for example s1v1m2.
StateThe current state of the server.
ExtraVolumesExtra volume settings that define additional volumes to attach to the server besides the boot volume.
VpcIdThe identifier of the VPC that the server belongs to.
PartitionNumberThe partition number of the server. It is only used when the server group type is partition.
ZoneThe availability zone in which the server is located.

Sample Template

Create a virtual server with a keypair and security group

Creates a virtual server with an existing keypair and security group

SCPTemplateFormatVersion: '2026-01-01'
Description: '표준(공용) 이미지를 사용하는 가상 서버(Compute) 생성 템플릿'
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의 CIDR 블록을 입력하세요. (/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의 CIDR 블록을 입력하세요. (VPC CIDR 범위 내)'
  SecurityGroupName:
    Type: String
    Default: 'sample-sg'
    MinLength: 1
    MaxLength: 255
    Description: 'Security Group 이름을 입력하세요. (1~255자)'
  ServerName:
    Type: String
    Default: 'sample-server'
    MinLength: 1
    MaxLength: 63
    AllowedPattern: '^[a-zA-Z0-9-_ ]*$'
    Description: '가상 서버 이름을 입력하세요. (1~63자, 영문/숫자/하이픈/언더스코어/공백 허용)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버에 사용할 표준(공용) 이미지 ID를 입력하세요. (플랫폼의 표준 이미지 목록(가상 서버 서비스 콘솔의 이미지 화면)에서 ID 확인, 필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: 'SSH 접속에 사용할 키페어 이름을 입력하세요. (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID를 입력하세요. (예: s1v1m2. ※ 예시 값 - 리전/이미지에 맞는 타입으로 수정)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가상 서버가 생성될 존을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞는 존으로 수정)'

Resources:
  MyVpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  MySubnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref MyVpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
  MySecurityGroup:
    Type: SCP::SecurityGroup::SecurityGroup
    Properties:
      Name: !Ref SecurityGroupName
  MySecurityGroupIngressSsh:
    Type: SCP::SecurityGroup::SecurityGroupRule
    Properties:
      SecurityGroupId: !Ref MySecurityGroup
      Direction: ingress
      Ethertype: IPv4
      Protocol: tcp
      PortRangeMin: 22
      PortRangeMax: 22
      RemoteIpPrefix: 0.0.0.0/0
  MyServer:
    Type: SCP::VirtualServer::VirtualServer
    Properties:
      Name: !Ref ServerName
      ImageId: !Ref ImageId
      KeypairName: !Ref KeypairName
      ServerTypeId: !Ref ServerTypeId
      Zone: !Ref Zone
      Networks:
        - SubnetId: !Ref MySubnet
      SecurityGroups:
        - !Ref MySecurityGroup
      BootVolume:
        Size: 40
        Type: SSD

Outputs:
  ServerId:
    Description: "생성된 가상 서버의 ID입니다."
    Value: !Ref MyServer

UserData bootstrap

Passes a script to run at server boot via UserData

SCPTemplateFormatVersion: '2026-01-01'
Description: 'UserData 부트스트랩 스크립트를 사용하는 가상 서버 생성 템플릿'
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의 CIDR 블록을 입력하세요. (/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의 CIDR 블록을 입력하세요. (VPC CIDR 범위 내)'
  SecurityGroupName:
    Type: String
    Default: 'sample-sg'
    MinLength: 1
    MaxLength: 255
    Description: 'Security Group 이름을 입력하세요. (1~255자)'
  ServerName:
    Type: String
    Default: 'sample-server'
    MinLength: 1
    MaxLength: 63
    AllowedPattern: '^[a-zA-Z0-9-_ ]*$'
    Description: '가상 서버 이름을 입력하세요. (1~63자, 영문/숫자/하이픈/언더스코어/공백 허용)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버에 사용할 표준(공용) 이미지 ID를 입력하세요. (플랫폼의 표준 이미지 목록(가상 서버 서비스 콘솔의 이미지 화면)에서 ID 확인, 필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: 'SSH 접속에 사용할 키페어 이름을 입력하세요. (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID를 입력하세요. (예: s1v1m2. ※ 예시 값 - 리전/이미지에 맞는 타입으로 수정)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가상 서버가 생성될 존을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞는 존으로 수정)'
  UserDataScript:
    Type: String
    Description: '서버 부팅 시 실행할 부트스트랩 스크립트(일반 텍스트)를 입력하세요. (base64 인코딩된 값 기준 최대 65,535자)'

Resources:
  MyVpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  MySubnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref MyVpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
  MySecurityGroup:
    Type: SCP::SecurityGroup::SecurityGroup
    Properties:
      Name: !Ref SecurityGroupName
  MySecurityGroupIngressSsh:
    Type: SCP::SecurityGroup::SecurityGroupRule
    Properties:
      SecurityGroupId: !Ref MySecurityGroup
      Direction: ingress
      Ethertype: IPv4
      Protocol: tcp
      PortRangeMin: 22
      PortRangeMax: 22
      RemoteIpPrefix: 0.0.0.0/0
  MyServer:
    Type: SCP::VirtualServer::VirtualServer
    Properties:
      Name: !Ref ServerName
      ImageId: !Ref ImageId
      KeypairName: !Ref KeypairName
      ServerTypeId: !Ref ServerTypeId
      Zone: !Ref Zone
      UserData:
        Fn::Base64: !Ref UserDataScript
      Networks:
        - SubnetId: !Ref MySubnet
      SecurityGroups:
        - !Ref MySecurityGroup
      BootVolume:
        Size: 40
        Type: SSD

Outputs:
  ServerId:
    Description: "생성된 가상 서버의 ID입니다."
    Value: !Ref MyServer

Deploy multiple instances with a nested stack

Deploys N identical virtual servers using nested stacks. Used together with the [Nested stack virtual server template] template.

SCPTemplateFormatVersion: '2026-01-01'
Description: '동일 가상 서버를 여러 대 중첩 스택으로 배포하는 템플릿'
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의 CIDR 블록을 입력하세요. (/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의 CIDR 블록을 입력하세요. (VPC CIDR 범위 내)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버에 사용할 표준(공용) 이미지 ID를 입력하세요. (필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: 'SSH 접속에 사용할 키페어 이름을 입력하세요. (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID를 입력하세요. (예: s1v1m2. ※ 예시 값 - 리전/이미지에 맞게 수정)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가상 서버가 생성될 존을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞게 수정)'

Resources:
  MyVpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  MySubnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref MyVpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
  Server1:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: 'https://<자식 템플릿 배포 URL>/nested-server-template.yaml'
      Parameters:
        SubnetId: !Ref MySubnet
        ServerName: 'sample-server-1'
        ImageId: !Ref ImageId
        KeypairName: !Ref KeypairName
        ServerTypeId: !Ref ServerTypeId
        Zone: !Ref Zone
  Server2:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: 'https://<자식 템플릿 배포 URL>/nested-server-template.yaml'
      Parameters:
        SubnetId: !Ref MySubnet
        ServerName: 'sample-server-2'
        ImageId: !Ref ImageId
        KeypairName: !Ref KeypairName
        ServerTypeId: !Ref ServerTypeId
        Zone: !Ref Zone

Outputs:
  VpcId:
    Description: "생성된 VPC의 ID입니다."
    Value: !Ref MyVpc
  SubnetId:
    Description: "생성된 Subnet의 ID입니다."
    Value: !Ref MySubnet
  Server1Id:
    Description: "첫 번째 가상 서버의 ID입니다."
    Value: !GetAtt Server1.Outputs.ServerId
  Server2Id:
    Description: "두 번째 가상 서버의 ID입니다."
    Value: !GetAtt Server2.Outputs.ServerId

Nested stack virtual server template

Defines a single virtual server invoked as a nested stack by the [Deploy multiple instances with a nested stack] template.

SCPTemplateFormatVersion: '2026-01-01'
Description: '중첩 스택으로 배포되는 가상 서버 1대 (다중 인스턴스 샘플 자식 템플릿)'
Parameters:
  SubnetId:
    Type: String
    Description: 서버를 생성할 Subnet의 ID
  ServerName:
    Type: String
    Default: 'sample-server'
    MinLength: 1
    MaxLength: 63
    Description: '가상 서버 이름 (1~63자)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버 이미지 ID (필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: '키페어 이름 (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID (예: s1v1m2)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가용존 (예: kr-west1-a)'

Resources:
  MyServer:
    Type: SCP::VirtualServer::VirtualServer
    Properties:
      Name: !Ref ServerName
      ImageId: !Ref ImageId
      KeypairName: !Ref KeypairName
      ServerTypeId: !Ref ServerTypeId
      Zone: !Ref Zone
      Networks:
        - SubnetId: !Ref SubnetId
      BootVolume:
        Size: 40
        Type: SSD

Outputs:
  ServerId:
    Description: "생성된 가상 서버의 ID입니다."
    Value: !Ref MyServer