The page has been translated by Gen AI.

Manage Templates

Users can create and save a template that defines the infrastructure for use in stack creation. Refer to the concept and storage location of templates in 템플릿.

Create a template

Templates are written in JSON or YAML format, defining the resources to be created, input values, and output values by section.

Template format

Templates are written in JSON or YAML format. Since both formats represent the same structure, you can choose the format that is more convenient to write.

CategoryJSONYAML
Structure representationRepresent structure with curly braces ({}) and square brackets ([]).Represent structure with indentation
  • Use spaces for indentation; tab characters cannot be used
CommentNot supportedComments can be written after #
Built-in function notationWrite in full format
  • Example: { "Ref": "VpcName" }
Both full syntax and short syntax can be used
  • Full syntax example: Ref: VpcName
  • Short syntax example: !Ref VpcName
Table. Template format comparison
Reference
In the Console’s Template Creation page, clicking the code type button allows you to convert the written code to YAML or JSON format. For more details, refer to 템플릿 생성하기.

Template structure

The template consists of multiple sections. Only the Resources section is mandatory, and the other sections can be optionally included as needed.

sectionRequired or notExplanation
SCPTemplateFormatVersionSelectVersion of the format that the template follows
DescriptionSelectDescription of the template
MetadataSelectAdditional information about the template
ParametersSelectInput values when creating or updating a stack
RulesSelectRules for validating parameter values entered when creating or updating a stack
MappingsSelectTable of values that can be retrieved by key
ConditionsSelectConditions that determine whether a resource is created or its attribute values
ResourcesRequiredResources to be created and their attributes
OutputsSelectValue to verify after creating the stack or to pass to another stack
Table. Template section
Reference
Transform section is not supported.

The following is the basic structure of the template that includes all sections. It is recommended to write the section in the order below.

Color mode
SCPTemplateFormatVersion: '2026-01-01'
Description: Description of the template
Metadata:
  Metadata definition
Parameters:
  Parameter definition
Rules:
  Rule definition
Mappings:
  Mapping definition
Conditions:
  Condition definition
Resources:
  Resource definition
Outputs:
  Result output definition
SCPTemplateFormatVersion: '2026-01-01'
Description: Description of the template
Metadata:
  Metadata definition
Parameters:
  Parameter definition
Rules:
  Rule definition
Mappings:
  Mapping definition
Conditions:
  Condition definition
Resources:
  Resource definition
Outputs:
  Result output definition
{
  "SCPTemplateFormatVersion": "2026-01-01",
  "Description": "Description of the template",
  "Metadata": {
    Metadata definition
  },
  "Parameters": {
    Parameter definition
  },
  "Rules": {
    Rule definition
  },
  "Mappings": {
    Mapping definition
  },
  "Conditions": {
    Condition definition
  },
  "Resources": {
    Resource definition
  },
  "Outputs": {
    Result output definition
  }
}
{
  "SCPTemplateFormatVersion": "2026-01-01",
  "Description": "Description of the template",
  "Metadata": {
    Metadata definition
  },
  "Parameters": {
    Parameter definition
  },
  "Rules": {
    Rule definition
  },
  "Mappings": {
    Mapping definition
  },
  "Conditions": {
    Condition definition
  },
  "Resources": {
    Resource definition
  },
  "Outputs": {
    Result output definition
  }
}
Code block. Template basic structure

Format version (SCPTemplateFormatVersion)

Specifies the version of the format that the template follows. The only supported value is '2026-01-01', and it can be omitted.

  • In YAML, wrap values in single quotes (') to prevent date-formatted values from being interpreted as dates.
Color mode
SCPTemplateFormatVersion: '2026-01-01'
SCPTemplateFormatVersion: '2026-01-01'
Code block. Example of format version creation

Description(Description)

Write a string that describes the purpose or composition of the template. The description can be up to 1,024 bytes.

Color mode
Description: 'Template that creates VPC and Subnet'
Description: 'Template that creates VPC and Subnet'
Code block. Example of writing a description.

Metadata(Metadata)

Defines additional information about the template. You can record information needed to manage the template, such as the template’s owner or purpose.

Color mode
Metadata:
  Owner: 'network-team'
  Purpose: 'Development environment network configuration'
Metadata:
  Owner: 'network-team'
  Purpose: 'Development environment network configuration'
Code block. Metadata creation example

Define Parameter Group

If you define the SCP::InfrastructureBuilder::Interface key in the metadata, the Console’s stack creation screen will group parameters together and let you specify a label to display instead of the parameter name.

CategoryExplanation
ParameterGroupsList of parameter groups
  • Label.default: group name
  • Parameters: list of parameter names to include in the group
ParameterLabelsLabel to display for each parameter
  • parameter name.default specified in the format
Table. Parameter group components
Color mode
Metadata:
  SCP::InfrastructureBuilder::Interface:
    ParameterGroups:
      - Label:
          default: 'Network Settings'
        Parameters:
          - VpcCidr
          - SubnetCidr
      - Label:
          default: 'Server Settings'
        Parameters:
          - ServerTypeId
          - KeypairName
    ParameterLabels:
      VpcCidr:
        default: 'VPC IP range'
      SubnetCidr:
        default: 'Subnet IP range'
Metadata:
  SCP::InfrastructureBuilder::Interface:
    ParameterGroups:
      - Label:
          default: 'Network Settings'
        Parameters:
          - VpcCidr
          - SubnetCidr
      - Label:
          default: 'Server Settings'
        Parameters:
          - ServerTypeId
          - KeypairName
    ParameterLabels:
      VpcCidr:
        default: 'VPC IP range'
      SubnetCidr:
        default: 'Subnet IP range'
Code block. Example of creating a parameter group
Reference
  • Parameter groups are applied only on the stack creation screen in the Console and do not affect the creation or operation of the stack.
  • Parameters that are not included in any group are displayed separately outside the group.
  • If a parameter not defined in the template is assigned to a group, that parameter is ignored, and groups with no included parameters are not displayed.

Parameter(Parameters)

Defines the values to be received as input when creating or updating a stack. By using parameters, you can input different values for each environment in a single template and reuse it.

Each parameter specifies the following attributes under its parameter name.

attributeRequired or notExplanation
TypeRequiredParameter data type
  • String: string
  • Number: number
  • List<Number>: list of numbers separated by commas
  • CommaDelimitedList: list of strings separated by commas
DefaultSelectDefault value to use when no value is entered
  • If not specified, a value must be provided when creating or updating the stack
DescriptionSelectionDescription of the parameter
  • Displayed on the stack creation screen
AllowedValuesSelectList of values that can be entered
  • applies to the String, Number, CommaDelimitedList types
  • If specified, you can select one of the items from the list in the Console and enter it
AllowedPatternSelectRegular expression pattern that the input value must match
  • String, CommaDelimitedList applied to the types
MinLength, MaxLengthSelectminimum and maximum length of the input value
  • String type only applies
MinValue, MaxValueSelectMinimum and maximum values of the input
  • applies only to the Number type
NoEchoSelectIf set to true, the input value and the retrieved result are masked and displayed
  • used for sensitive information such as passwords
ConstraintDescriptionSelectDescription to display instead of the default error message when the input violates a constraint
  • In the Console’s stack creation screen, replace all constraint violation messages (AllowedValues, AllowedPattern, length, value range) except required value errors with this description
Table. Parameter attributes
Color mode
Parameters:
  EnvName:
    Type: String
    Default: dev
    AllowedValues:
      - dev
      - prod
    Description: 'Select the deployment environment.'
  VpcCidr:
    Type: String
    Default: '10.0.0.0/16'
    AllowedPattern: '^(\d{1,3}\.){3}\d{1,3}/\d{1,2}$'
    Description: 'Enter the VPC's IP range (CIDR).'
    ConstraintDescription: 'Must be entered in CIDR format (e.g., 10.0.0.0/16).'
  BootVolumeSize:
    Type: Number
    Default: 40
    MinValue: 40
    MaxValue: 200
    Description: 'Enter the boot volume size (GB).'
  UserPassword:
    Type: String
    NoEcho: true
    MinLength: 8
    Description: 'Enter the user password.'
  AllowedCidrs:
    Type: CommaDelimitedList
    Default: '10.0.0.0/16,192.168.0.0/24'
    Description: 'Enter the IP ranges to allow access, separated by commas.'
Parameters:
  EnvName:
    Type: String
    Default: dev
    AllowedValues:
      - dev
      - prod
    Description: 'Select the deployment environment.'
  VpcCidr:
    Type: String
    Default: '10.0.0.0/16'
    AllowedPattern: '^(\d{1,3}\.){3}\d{1,3}/\d{1,2}$'
    Description: 'Enter the VPC's IP range (CIDR).'
    ConstraintDescription: 'Must be entered in CIDR format (e.g., 10.0.0.0/16).'
  BootVolumeSize:
    Type: Number
    Default: 40
    MinValue: 40
    MaxValue: 200
    Description: 'Enter the boot volume size (GB).'
  UserPassword:
    Type: String
    NoEcho: true
    MinLength: 8
    Description: 'Enter the user password.'
  AllowedCidrs:
    Type: CommaDelimitedList
    Default: '10.0.0.0/16,192.168.0.0/24'
    Description: 'Enter the IP ranges to allow access, separated by commas.'
Code block. Parameter creation example

The defined parameters are referenced in the Resources and Outputs sections using !Ref parameter name. Parameters of list types (List<Number>, CommaDelimitedList) can be used by extracting a value at a specific position with !Select or concatenating them into a single string with !Join.

Reference
  • A template can define up to 200 parameters, and each parameter value can be up to 4,096 bytes.
  • Do not write sensitive information such as passwords directly in the template; instead, receive it as a parameter with NoEcho specified.
  • Refer to Create a stack for how parameters are displayed in the Console when creating a stack.

Rules(Rules)

Validates whether the parameter values entered when creating or updating a stack meet the conditions. The value of a single parameter is validated using parameter attributes (AllowedValues, AllowedPattern, etc.), and combinations of multiple parameter values are validated by rules.

Each rule consists of the following elements.

CategoryRequired or notExplanation
RuleConditionSelectthe condition to apply the rule
  • if not specified, always apply the rule
AssertionsRequiredList of validation items that the parameter value must satisfy
AssertRequiredThe condition that must be true for each item of Assertions
  • written as a function that returns true or false
AssertDescriptionSelectThe message displayed when validation fails for each item of Assertions
Table. Rule components

The rules allow the use of the following function.

Categoryfunction
Condition functionFn::Equals, Fn::Not, Fn::And, Fn::Or
Reference functionRef
Rule-specific functionFn::Contains, Fn::EachMemberEquals, Fn::EachMemberIn
Table. Functions that can be used in rules

The rule-specific function is as follows.

functionformatExplanation
Fn::ContainsFn::Contains: [list of strings, string]Returns true if the specified string is contained in the list of strings.
Fn::EachMemberEqualsFn::EachMemberEquals: [list of strings, string]Returns true if all values in the string list are equal to the specified string.
Fn::EachMemberInFn::EachMemberIn: [list of strings, list of allowed values]Returns true if all values in the string list are included in the allowed values list.
Table. Rule-specific function
Color mode
Rules:
  ProdServerType:
    RuleCondition: !Equals [!Ref EnvName, prod]
    Assertions:
      - Assert: !Not [!Equals [!Ref ServerTypeId, s1v1m2]]
        AssertDescription: 'The s1v1m2 server type cannot be used in a production environment.'
Rules:
  ProdServerType:
    RuleCondition: !Equals [!Ref EnvName, prod]
    Assertions:
      - Assert: !Not [!Equals [!Ref ServerTypeId, s1v1m2]]
        AssertDescription: 'The s1v1m2 server type cannot be used in a production environment.'
Code block. Example of rule creation

The above example validates that when the value of the EnvName parameter is prod, the ServerTypeId parameter cannot be set to s1v1m2. Rules are evaluated when creating or updating a stack, and if validation fails, the stack cannot be created or updated.

Mapping(Mappings)

Define a table that can look up values by key. When you need to use different values depending on the environment or region, define the values as a mapping and retrieve them using a key.

A mapping consists of three steps: the mapping name, the top-level key, and the second key and value.

Color mode
Mappings:
  EnvironmentMap:
    dev:
      ServerTypeId: s1v1m2
    prod:
      ServerTypeId: s1v2m4
Mappings:
  EnvironmentMap:
    dev:
      ServerTypeId: s1v1m2
    prod:
      ServerTypeId: s1v2m4
code block. mapping creation example

The value of a mapping is retrieved in the !FindInMap [mapping name, top-level key, second key] format. For example, !FindInMap [EnvironmentMap, !Ref EnvName, ServerTypeId] returns the server type ID based on the value of the EnvName parameter.

Reference
A template can define up to 200 mappings, and each mapping can specify up to 200 mapping properties.

Conditions(Conditions)

Defines a condition that evaluates to true or false based on parameter values, etc. Using conditions, you can specify whether resources are created or assign different property values in a single template based on the environment.

Conditions are defined using the !Equals, !Not, !And, !Or functions, and within a function you can use value reference functions such as !Ref. The defined condition is used as follows.

  • If you specify a condition name in the resource’s Condition property, the resource is created only when the condition is true.
  • If you use the !If function, you can assign property values differently based on conditions.
Color mode
Conditions:
  IsProd: !Equals [!Ref EnvName, prod]

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !If [IsProd, 'prod-vpc', 'dev-vpc']
      Cidrs: ['10.0.0.0/16']

  ProdPublicIp:
    Type: SCP::VPC::PublicIp
    Condition: IsProd
    Properties:
      Type: IGW
      Zone: 'kr-west1-a'
Conditions:
  IsProd: !Equals [!Ref EnvName, prod]

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !If [IsProd, 'prod-vpc', 'dev-vpc']
      Cidrs: ['10.0.0.0/16']

  ProdPublicIp:
    Type: SCP::VPC::PublicIp
    Condition: IsProd
    Properties:
      Type: IGW
      Zone: 'kr-west1-a'
Code block. Example of writing a condition.

In the above example, the Vpc resource’s name is set to prod-vpc if the EnvName parameter value is prod; otherwise, it is set to dev-vpc. The ProdPublicIp resource is created only when the value of the EnvName parameter is prod.

Resources(Resources)

Define the resources to be created and their properties. It is the only required section in the template, and you must define at least one resource.

Each resource consists of the following elements.

CategoryRequired or notExplanation
Logical IDRequiredName that identifies a resource within the template
  • Can be up to 255 characters, using only letters and numbers
  • Must be unique within the template
  • Reference the resource by this name in other resources or output results
TypeRequiredThe type of resource to create
  • SCP::Service::Resource specify in the format (e.g., SCP::VPC::Vpc)
  • Only resource types supported by Infrastructure Builder can be used
PropertiesRequiredResource attributes
  • The assignable attributes and required attributes differ for each resource type
  • Built-in functions can be used in attribute values
  • Nested stack resources (SCP::InfrastructureBuilder::Stack) can be omitted
Table. Resource components
Color mode
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
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
Code block. Example of resource creation

In the above example, the Subnet resource references the Vpc resource’s ID with !Ref Vpc.

In addition to Type and Properties, you can specify the following attributes for a resource to control its creation conditions, order, and behavior upon deletion.

attributeExplanation
DependsOnCreate this resource after the specified resource has been created
  • When specifying multiple resources, list them
ConditionCreate the resource only when the specified condition is true
  • Specify the condition name defined in the Conditions section
DeletionPolicySpecify how the actual resource is handled when a resource is deleted from the stack
  • Delete(default): delete the actual resource
  • Retain: the stack removes the resource but preserves the actual resource without deleting it
UpdateReplacePolicySpecify how to handle existing resources when a resource is replaced during a stack update
  • Delete(default): delete the existing resource
  • Retain: the stack removes the existing resource, but the actual resource is not deleted and is retained
Table. Resource attributes
Color mode
Resources:
  InternetGateway:
    Type: SCP::VPC::InternetGateway
    Properties:
      Type: IGW
      VpcId: !Ref Vpc

  PublicIp:
    Type: SCP::VPC::PublicIp
    DependsOn: InternetGateway
    DeletionPolicy: Retain
    Properties:
      Type: IGW
      Zone: 'kr-west1-a'
Resources:
  InternetGateway:
    Type: SCP::VPC::InternetGateway
    Properties:
      Type: IGW
      VpcId: !Ref Vpc

  PublicIp:
    Type: SCP::VPC::PublicIp
    DependsOn: InternetGateway
    DeletionPolicy: Retain
    Properties:
      Type: IGW
      Zone: 'kr-west1-a'
Code block. Example of writing resource properties.

In the above example, the PublicIp resource does not reference the InternetGateway resource, but because DependsOn is specified, it is created after the InternetGateway resource is created. Also, since the DeletionPolicy is set to Retain, the actual Public IP is not deleted and is retained even if the stack is deleted.

Reference
  • Refer to the Template Reference for available resource types and their attributes.
  • A template can define up to 500 resources.
  • Keypairs cannot be created from a template. Provide the name of the pre‑created Keypair as a parameter and reference it.
  • To create a stack with a template that includes IAM resources, you must approve the creation of IAM resources. In the Console, select the Approve to allow Infrastructure Builder to create IAM resources. option, and specify CAPABILITY_IAM in OpenAPI or CLI.
  • Resources retained with Retain are no longer managed by the stack. Delete unused resources directly in the respective service.
Caution
If you change the logical ID of a resource in an already deployed stack, the existing resource may be deleted and a new resource may be created. Check the change type with the change set before modifying the logical ID.

Result Output (Outputs)

Define the values to verify after creating the stack or to pass to another stack. The defined value can be viewed in the Result Information tab of the stack details.

Each result output specifies the following attributes under the output name.

attributeRequired or notExplanation
ValueRequiredvalue to be returned as output
  • built-in functions that reference resources or parameters can be used
DescriptionSelectExplanation of the result output
ExportSelectWhen exporting a value so that it can be referenced from another stack, specify
  • the export name in Name
  • The export name can use !Sub and !Ref, and only parameters and pseudo‑parameters can be referenced
Table. Result output attribute
Color mode
Outputs:
  VpcId:
    Description: 'The ID of the created VPC.'
    Value: !Ref Vpc
    Export:
      Name: !Sub '${EnvName}-VpcId'
Outputs:
  VpcId:
    Description: 'The ID of the created VPC.'
    Value: !Ref Vpc
    Export:
      Name: !Sub '${EnvName}-VpcId'
Code block. Example of writing result output

The exported value is referenced in another stack using !ImportValue ExportName.

Color mode
Resources:
  Subnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: 'app-subnet'
      VpcId: !ImportValue dev-VpcId
      Cidr: '10.0.2.0/24'
      Type: PRIVATE
      Category: PRIMARY
Resources:
  Subnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: 'app-subnet'
      VpcId: !ImportValue dev-VpcId
      Cidr: '10.0.2.0/24'
      Type: PRIVATE
      Category: PRIMARY
Code block. Example of referencing exported values.
Reference
  • A template can define up to 200 result outputs.
  • Export names can be up to 255 characters using letters, numbers, colons (:), and hyphens (-), and must be unique within the same Account and region.
  • The exported value can be up to 1,024 characters.
  • Exports can only be referenced from other stacks in the same account and region. For more details, refer to 내보내기.
  • Exports referenced in another stack cannot be deleted or modified.

built-in function

Built-in functions are used within templates to reference the values of parameters or other resources, combine values, and evaluate conditions. In YAML, you can write using the short form with ! instead of Fn::.

Built-in functions are classified as follows based on where they are used.

CategoryUsage location
value functionLocation where you specify values such as resource attributes and result output
Condition functionConditions section
Rule-specific functionRules section
Table. Built-in function classification

value function

The following are functions used when referencing or combining values.

functionYAML shorthand syntaxExplanation
Ref!Ref nameReference a parameter, resource, or pseudo‑parameter
  • When referencing a parameter, it returns the input value
  • When referencing a resource, it returns the resource’s identifier (ID or name, depending on the resource type)
  • When referencing a pseudo‑parameter, it returns its value (e.g., !Ref SCP::Region)
Fn::GetAtt!GetAtt LogicalID.AttributeReturns the attribute value of a resource
  • Since a resource’s identifier cannot be retrieved with !GetAtt, use !Ref
  • Example: !GetAtt NetworkStack.Outputs.VpcId (retrieve output from a nested stack)
Fn::Sub!Sub 'string'
!Sub ['string', {variable: value}]
Replace ${name} in the string with the value of a parameter, resource, or pseudo‑parameter
  • Example: !Sub '${EnvName}-vpc'
  • If you also specify a variable map, you can use variables within the string
  • If you prefix with ! as in ${!Literal}, it is not substituted and ${Literal} is used as‑is
Fn::Join!Join [delimiter, [value1, value2, ...]]Returns a string that joins a list of values with a delimiter
  • Example: !Join ['-', [!Ref EnvName, 'vpc']]
Fn::Split!Split [delimiter, string]Returns a list split by the delimiter
  • Example: !Split [',', '10.0.1.0/24,10.0.2.0/24']
Fn::Select!Select [index, list]Returns the value at the index position in the list
  • Index starts at 0
  • Example: !Select [0, !Ref AllowedCidrs]
Fn::If!If [condition name, value when true, value when false]Returns one of two values based on the condition result
  • Specify the condition name defined in the Conditions section
Fn::FindInMap!FindInMap [mapping name, top-level key, second key]Retrieve values from the mapping defined in the Mappings section
Fn::Base64!Base64 stringReturns the value of the string encoded in Base64
  • Used for properties that require input of a Base64-encoded value, such as the UserData of a Virtual Server
Fn::ImportValue!ImportValue export nameReturn the value exported from another stack
  • Can reference only exports from the same Account and Region
Fn::Cidr!Cidr [IP range, count, host bit size]Returns a list of CIDR blocks that split the specified IP range into the given number
  • Supports IPv4 only
  • Example: !Cidr ['10.0.0.0/16', 2, 8] returns 10.0.0.0/24, 10.0.1.0/24
Fn::Length!Length listReturn the number of items in the list
Fn::ToJsonString!ToJsonString objectConvert an object or list to a JSON string and return it.
Table. Value function
Reference
For each resource type, see the Template Reference for the identifiers returned by !Ref and the attributes you can retrieve with !GetAtt.

Conditional function

The following is a function used to define conditions in the Conditions section. Within condition functions, you can use value functions such as !Ref.

functionYAML short formExplanation
Fn::Equals!Equals [value1, value2]Returns true if the two values are equal
Fn::Not!Not [condition]Returns false when the condition is true, and true when it is false.
Fn::And!And [condition1, condition2, ...]Returns true if all conditions are true
Fn::Or!Or [condition1, condition2, ...]Returns true if at least one condition is true.
Table. Condition function

Doctor parameter

A pseudo-parameter is a parameter predefined by Infrastructure Builder that can be used without being separately defined in the template. Reference using !Ref or !Sub.

Doctor parameterreturn value
SCP::RegionRegion where the stack is created
SCP::AccountIdAccount ID where the stack is created
SCP::StackIdStack ID
SCP::StackNameStack name
SCP::Partitionpartition
  • scp
SCP::URLSuffixURL suffix
  • samsungsdscloud.com
SCP::NoValueNo value
  • When used with !If, it is treated as not specifying the attribute depending on the condition
Table. Doctor parameter
Color mode
Conditions:
  IsProd: !Equals [!Ref EnvName, prod]

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Sub '${SCP::StackName}-vpc'
      Cidrs: ['10.0.0.0/16']

  PublicIp:
    Type: SCP::VPC::PublicIp
    Properties:
      Type: IGW
      Zone: 'kr-west1-a'
      Description: !If [IsProd, 'Production environment Public IP', !Ref SCP::NoValue]
Conditions:
  IsProd: !Equals [!Ref EnvName, prod]

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Sub '${SCP::StackName}-vpc'
      Cidrs: ['10.0.0.0/16']

  PublicIp:
    Type: SCP::VPC::PublicIp
    Properties:
      Type: IGW
      Zone: 'kr-west1-a'
      Description: !If [IsProd, 'Production environment Public IP', !Ref SCP::NoValue]
Code block. Example of writing a dummy parameter

In the above example, the Vpc resource name is specified by appending -vpc to the stack name. The Description of the PublicIp resource is set only when the IsProd condition is true.

Template creation example

The following is an example template that includes parameters, resources, and result output. Accepts an environment name, creates a VPC and subnet, and exports the ID of the created VPC.

Color mode
SCPTemplateFormatVersion: '2026-01-01'
Description: 'Template that creates VPC and Subnet'

Parameters:
  EnvName:
    Type: String
    Default: dev
    AllowedValues:
      - dev
      - prod
    Description: 'Select the deployment environment.'
  VpcCidr:
    Type: String
    Default: '10.0.0.0/16'
    Description: 'Enter the VPC IP range (CIDR).'
  SubnetCidr:
    Type: String
    Default: '10.0.1.0/24'
    Description: 'Enter the IP range (CIDR) of the Subnet.' (within VPC CIDR range)

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Sub '${EnvName}-vpc'
      Cidrs: [!Ref VpcCidr]

  Subnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Sub '${EnvName}-subnet'
      VpcId: !Ref Vpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY

Outputs:
  VpcId:
    Description: 'The ID of the created VPC.'
    Value: !Ref Vpc
    Export:
      Name: !Sub '${EnvName}-VpcId'
  SubnetId:
    Description: 'The ID of the created Subnet.'
    Value: !Ref Subnet
SCPTemplateFormatVersion: '2026-01-01'
Description: 'Template that creates VPC and Subnet'

Parameters:
  EnvName:
    Type: String
    Default: dev
    AllowedValues:
      - dev
      - prod
    Description: 'Select the deployment environment.'
  VpcCidr:
    Type: String
    Default: '10.0.0.0/16'
    Description: 'Enter the VPC IP range (CIDR).'
  SubnetCidr:
    Type: String
    Default: '10.0.1.0/24'
    Description: 'Enter the IP range (CIDR) of the Subnet.' (within VPC CIDR range)

Resources:
  Vpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Sub '${EnvName}-vpc'
      Cidrs: [!Ref VpcCidr]

  Subnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Sub '${EnvName}-subnet'
      VpcId: !Ref Vpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY

Outputs:
  VpcId:
    Description: 'The ID of the created VPC.'
    Value: !Ref Vpc
    Export:
      Name: !Sub '${EnvName}-VpcId'
  SubnetId:
    Description: 'The ID of the created Subnet.'
    Value: !Ref Subnet
{
  "SCPTemplateFormatVersion": "2026-01-01",
  "Description": "Template for creating VPC and Subnet",
  "Parameters": {
    "EnvName": {
      "Type": "String",
      "Default": "dev"
      "AllowedValues": ["dev", "prod"],
      "Description": "Select the deployment environment."
    },
    "VpcCidr": {
      "Type": "String",
      "Default": "10.0.0.0/16",
      "Description": "Enter the VPC's IP range (CIDR)."
    },
    "SubnetCidr": {
      "Type": "String",
      "Default": "10.0.1.0/24",
      "Description": "Enter the IP range (CIDR) of the Subnet." (within the VPC CIDR range)
    }
  },
  "Resources": {
    "Vpc": {
      "Type": "SCP::VPC::Vpc"
      "Properties": {
        "Name": { "Fn::Sub": "${EnvName}-vpc" },
        "Cidrs": [{ "Ref": "VpcCidr" }]
      }
    },
    "Subnet": {
      "Type": "SCP::VPC::Subnet",
      "Properties": {
        "Name": { "Fn::Sub": "${EnvName}-subnet" },
        "VpcId": { "Ref": "Vpc" },
        "Cidr": { "Ref": "SubnetCidr" },
        "Type": "PRIVATE"
        "Category": "PRIMARY"
      }
    }
  },
  "Outputs": {
    "VpcId": {
      "Description": "The ID of the created VPC.",
      "Value": { "Ref": "Vpc" },
      "Export": {
        "Name": { "Fn::Sub": "${EnvName}-VpcId" }
      }
    },
    "SubnetId": {
      "Description": "The ID of the created Subnet."
      "Value": { "Ref": "Subnet" }
    }
  }
}
{
  "SCPTemplateFormatVersion": "2026-01-01",
  "Description": "Template for creating VPC and Subnet",
  "Parameters": {
    "EnvName": {
      "Type": "String",
      "Default": "dev"
      "AllowedValues": ["dev", "prod"],
      "Description": "Select the deployment environment."
    },
    "VpcCidr": {
      "Type": "String",
      "Default": "10.0.0.0/16",
      "Description": "Enter the VPC's IP range (CIDR)."
    },
    "SubnetCidr": {
      "Type": "String",
      "Default": "10.0.1.0/24",
      "Description": "Enter the IP range (CIDR) of the Subnet." (within the VPC CIDR range)
    }
  },
  "Resources": {
    "Vpc": {
      "Type": "SCP::VPC::Vpc"
      "Properties": {
        "Name": { "Fn::Sub": "${EnvName}-vpc" },
        "Cidrs": [{ "Ref": "VpcCidr" }]
      }
    },
    "Subnet": {
      "Type": "SCP::VPC::Subnet",
      "Properties": {
        "Name": { "Fn::Sub": "${EnvName}-subnet" },
        "VpcId": { "Ref": "Vpc" },
        "Cidr": { "Ref": "SubnetCidr" },
        "Type": "PRIVATE"
        "Category": "PRIMARY"
      }
    }
  },
  "Outputs": {
    "VpcId": {
      "Description": "The ID of the created VPC.",
      "Value": { "Ref": "Vpc" },
      "Export": {
        "Name": { "Fn::Sub": "${EnvName}-VpcId" }
      }
    },
    "SubnetId": {
      "Description": "The ID of the created Subnet."
      "Value": { "Ref": "Subnet" }
    }
  }
}
code block. Template creation example
Reference
For service-specific usage examples, refer to the Sample Template.

Template limit

Check the following limits when creating a template.

CategoryLimit
Description(Description) size1,024 bytes or less
Number of resourcesUp to 500 per template
Logical ID lengthMaximum 255 characters
Number of parametersUp to 200 per template
Parameter value size4,096 bytes or less
Result countUp to 200 per template
ExportExport name up to 255 characters, value up to 1,024 characters
Number of mappingsUp to 200 per template
  • Each mapping can have up to 200 mapping properties
Template size51,200 bytes or less
  • Object Storage URL, file upload, creation in the Console, etc., apply uniformly regardless of the template specification method
Nested stack depthMaximum 5 steps
Table. Template limit

Please refer to the Constraints for all constraints.

Create Template

You can create it after directly writing and reviewing the template in the console. The created template is stored in the Object Storage bucket ib-templates-{random 12-character string}-{region}. For more details, please refer to 템플릿 저장 위치. To create a template, follow these steps.

  1. All Services > Management > Infrastructure Builder Click the menu. Navigate to the Service Home page.
  2. Service Home page, click the Stack > Stack List menu. Navigate to the Stack List page.
  3. Click the Create Template button on the Stack List page. Go to the Create Template page.
  4. Template Creation page, select the code type and then write the template code.
    • You can choose YAML (default) or JSON.
    • Click the code type button to check for errors in the written code. If there are no errors, convert the existing code to the selected type; if there are errors, display the error message.
  5. Click the Review button to verify the template’s syntax and structure.
    • The Review button is enabled only when code has been entered.
    • If there is an error, check the error message and modify the template.
    • If there are no errors, a message indicating that the template is valid is displayed and the Create button is enabled.
  6. Click the Create button. A confirmation popup is displayed.
  7. In the popup, click the Confirm button. The template is created, and the template’s Object Storage URL is displayed in the top flash bar.
    • If creation fails, the current screen remains and an error message is displayed.
Reference
  • If you do not click the Create button, the template will not be saved.
  • The template size can be up to 51,200 bytes.
  • If you do not have permission to create the Object Storage bucket to store the template, template creation will fail. For more details, please refer to 템플릿 저장 위치.
  • Refer to Template Writing for guidance and examples on writing each section of the template. Refer to the Template Reference for available resource types and properties.

Configure a Nested Stack Template

If the template becomes large and difficult to manage, you can separate it by functional units and configure it as a nested stack.

information
The nested stack’s template must be stored in Object Storage because it is referenced by URL. Nested stacks cannot be used with local file uploads.

To configure a nested stack, follow these steps.

  1. Create sub-templates separated by functional units.
    • Define the value to be passed to the upper stack as the result output.
    • Define the value received from the upper stack as a parameter.
  2. Save each created sub-template to Object Storage.
  3. Create a root template that calls a subtemplate.
    • Define the substack as a SCP::InfrastructureBuilder::Stack resource.
    • Specify the URL of the subtemplate and pass the required values as parameters.
    • Referencing the output of a child stack automatically determines the creation order between stacks.
  4. After storing the root template in Object Storage, create a stack using that template.

The SCP::InfrastructureBuilder::Stack resource can specify the following properties.

attributeExplanation
TemplateURLObject Storage URL where the sub‑template is stored
ParametersValue to pass to the subtemplate’s parameter
TimeoutInMinutesSubstack task timeout (minutes)
Table. Nested stack resource properties
Color mode
Resources:
  NetworkStack:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: '<네트워크 템플릿의 Object Storage URL>'
      Parameters:
        VpcCidr: '10.0.0.0/16'
      TimeoutInMinutes: 30

  AppStack:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: '<애플리케이션 템플릿의 Object Storage URL>'
      Parameters:
        VpcId: !GetAtt NetworkStack.Outputs.VpcId
Resources:
  NetworkStack:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: '<네트워크 템플릿의 Object Storage URL>'
      Parameters:
        VpcCidr: '10.0.0.0/16'
      TimeoutInMinutes: 30

  AppStack:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: '<애플리케이션 템플릿의 Object Storage URL>'
      Parameters:
        VpcId: !GetAtt NetworkStack.Outputs.VpcId
Code block. Root template creation example

The result outputs of a nested stack are referenced in the !GetAtt LogicalID.Outputs.OutputName format. You can also write it in list format, like !GetAtt [LogicalID, 'Outputs.OutputName'].

In the above example, AppStack receives NetworkStack’s output (VpcId) as a parameter, so it is created after NetworkStack is created. The result outputs of a child stack can also be referenced in the root template’s result outputs (Outputs).

Reference
  • The name of a child stack is automatically generated in the {parent stack name}-{logical ID}-{8-character random identifier} format.
  • Subtemplates are also validated in the same way as the parent template when creating a stack.
  • You can define up to 2,500 resources across the entire nested stack hierarchy, and up to 500 per template.

For detailed information about nested stack configuration, please refer to Nested Stack. For an example of creating multiple Virtual Servers with a nested stack, refer to the Create Multiple Virtual Servers at Once (Nested Stack) sample.

How-to guides
Manage Change Sets