SCP::VirtualServer::VirtualServer
SCP::VirtualServer::VirtualServer
SCP::VirtualServer::VirtualServer
설명
가상 서버를 제공하는 SCP Virtual Server 서비스의 Virtual Server 리소스입니다.
버전
1.5.0
구문
Infrastructure Builder 템플릿에서 이 엔티티를 선언하려면 다음 구문을 사용하세요:
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
속성
Networks
서버에 연결할 네트워크 목록입니다. 최대 5개 네트워크를 지정할 수 있으며, 최소 1개는 공용 또는 프라이빗 subnet에 속해야 합니다. 전체 목록에서 subnet ID 또는 port ID 중 하나만 사용해야 하며 둘 다 사용할 수 없습니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | Array of Networks |
| 업데이트 조건 | 중단 없음 |
자세한 내용은 Networks을(를) 참조하세요.
ImageId
서버에 사용할 OS 이미지를 지정하는 Image의 식별자입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | String |
| 업데이트 조건 | 교체 필요 |
KeypairName
서버에 SSH 접근에 사용되는 키페어의 이름입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | String |
| 업데이트 조건 | 교체 필요 |
Lock
서버 생성 직후 잠글지 여부입니다. 기본값은 false입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | Boolean |
| 업데이트 조건 | 중단 없음 |
Metadata
플랫폼이 서버에 저장하는 키-값 쌍입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | Metadata |
| 업데이트 조건 | 교체 필요 |
Name
서버의 이름입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | String |
| 패턴 | ^[a-zA-Z0-9-_ ]*$ |
| 길이 제약 | 1–63 |
| 업데이트 조건 | 중단 없음 |
ProductCategory
서버의 제품 카테고리입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | String |
| 업데이트 조건 | 교체 필요 |
ProductOffering
서버의 제품 제공 유형입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | String |
| 업데이트 조건 | 교체 필요 |
SecurityGroups
서버에 연결할 보안 그룹 식별자 목록입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | Array of String |
| 업데이트 조건 | 중단 없음 |
UserData
서버 시작 시 실행되는 사용자 데이터 스크립트로, base64로 인코딩된 값입니다. 일반 텍스트는 템플릿에서 Fn::Base64로 감싸야 합니다. 유효한 base64가 아닌 값은 서비스에 그대로 전달되며 API에서 거부됩니다. maxLength 제한은 base64로 인코딩된 값에 적용됩니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | String |
| 길이 제약 | 최대: 65535 |
| 업데이트 조건 | 교체 필요 |
ServerGroupId
서버가 배치되는 서버 그룹의 식별자입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | String |
| 업데이트 조건 | 교체 필요 |
ServerTypeId
서버의 서버 유형 식별자입니다. (예: s1v1m2).
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | String |
| 업데이트 조건 | 중단 없음 |
BootVolume
OS가 설치되는 루트 디스크를 정의하는 부팅 볼륨 설정입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | BootVolume |
| 업데이트 조건 | 교체 필요 |
자세한 내용은 BootVolume을(를) 참조하세요.
ExtraVolumes
부팅 볼륨 외에 서버에 연결할 추가 볼륨을 정의하는 추가 볼륨 설정입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 아니요 |
| 타입 | Array of ExtraVolumes |
| 업데이트 조건 | 중단 없음 |
자세한 내용은 ExtraVolumes을(를) 참조하세요.
Zone
서버가 위치한 가용 영역입니다.
| 항목 | 값 |
|---|---|
| 필수 여부 | 예 |
| 타입 | String |
| 업데이트 조건 | 교체 필요 |
반환 값
Ref
이 리소스의 논리적 ID를 Ref 함수에 전달하면, Ref는 Id 값을 반환합니다.
Fn::GetAtt
| 속성 | 설명 |
|---|---|
| AccountId | 서버를 소유한 계정의 식별자입니다. |
| Networks | 서버에 연결할 네트워크 목록입니다. 최대 5개 네트워크를 지정할 수 있으며, 최소 1개는 공용 또는 프라이빗 subnet에 속해야 합니다. 전체 목록에서 subnet ID 또는 port ID 중 하나만 사용해야 하며 둘 다 사용할 수 없습니다. |
| AutoScalingGroupId | 서버를 생성한 Auto Scaling Group의 식별자입니다. Auto Scaling Group이 생성한 서버에만 값이 있습니다. |
| DiskConfig | 서버의 디스크 구성 모드입니다. |
| ImageId | 서버에 사용할 OS 이미지를 지정하는 Image의 식별자입니다. |
| KeypairName | 서버에 SSH 접근에 사용되는 키페어의 이름입니다. |
| LaunchConfigurationId | 서버를 생성한 런치 구성의 식별자입니다. Auto Scaling Group이 생성한 서버에만 값이 있습니다. |
| Lock | 서버 생성 직후 잠글지 여부입니다. 기본값은 false입니다. |
| Name | 서버의 이름입니다. |
| PlannedComputeOsType | 서버의 계획된 OS 유형입니다. |
| ProductCategory | 서버의 제품 카테고리입니다. |
| ProductOffering | 서버의 제품 제공 유형입니다. |
| SecurityGroups | 서버에 연결할 보안 그룹 식별자 목록입니다. |
| UserData | 서버 시작 시 실행되는 사용자 데이터 스크립트로, base64로 인코딩된 값입니다. 일반 텍스트는 템플릿에서 Fn::Base64로 감싸야 합니다. 유효한 base64가 아닌 값은 서비스에 그대로 전달되며 API에서 거부됩니다. maxLength 제한은 base64로 인코딩된 값에 적용됩니다. |
| ServerGroupId | 서버가 배치되는 서버 그룹의 식별자입니다. |
| ServerTypeId | 서버의 서버 유형 식별자입니다. (예: s1v1m2). |
| State | 서버의 현재 상태입니다. |
| ExtraVolumes | 부팅 볼륨 외에 서버에 연결할 추가 볼륨을 정의하는 추가 볼륨 설정입니다. |
| VpcId | 서버가 속한 VPC의 식별자입니다. |
| PartitionNumber | 서버의 파티션 번호입니다. 서버 그룹 유형이 partition인 경우에만 사용됩니다. |
| Zone | 서버가 위치한 가용 영역입니다. |
샘플 템플릿
키페어와 Security Group으로 가상 서버 생성
기존 키페어와 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 부트스트랩
서버 부팅 시 실행할 스크립트를 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
다중 인스턴스 배포 (중첩 스택)
동일한 가상 서버 N대를 중첩 스택으로 배포합니다. [중첩 스택용 가상 서버 템플릿] 템플릿과 함께 사용합니다.
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
중첩 스택용 가상 서버 템플릿
[다중 인스턴스 배포 (중첩 스택)] 템플릿이 중첩 스택으로 호출하는 가상 서버 1대 정의입니다.
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