Todos os produtos
Search
Central de documentação

:ALIYUN::AgentRun::Template

Última atualização: Aug 27, 2026

O recurso ALIYUN::AgentRun::Template cria um modelo de sandbox.

Sintaxe

{
  "Type": "ALIYUN::AgentRun::Template",
  "Properties": {
    "TemplateName": String,
    "ArmsConfiguration": Map,
    "AllowAnonymousManage": Boolean,
    "Cpu": Integer,
    "CredentialConfiguration": Map,
    "ContainerConfiguration": Map,
    "Description": String,
    "DiskSize": Integer,
    "EnableAgent": Boolean,
    "ExecutionRoleArn": String,
    "EnvironmentVariables": Map,
    "LogConfiguration": Map,
    "Memory": Integer,
    "NetworkConfiguration": Map,
    "NasConfig": Map,
    "OssConfiguration": List,
    "SandboxIdleTimeoutInSeconds": Integer,
    "TemplateConfiguration": Map,
    "TemplateType": String,
    "WorkspaceId": String
  }
}

Propriedades

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

TemplateName

String

Sim

Não

Nome do modelo.

Nenhuma

AllowAnonymousManage

Boolean

Não

Sim

Indica se o gerenciamento anônimo é permitido.

Nenhuma

ArmsConfiguration

Map

Não

Sim

Configuração do ARMS.

Para mais informações, consulte Propriedades de ArmsConfiguration.

ContainerConfiguration

Map

Não

Sim

Configuração do contêiner.

Use apenas imagens baseadas nas imagens base de navegador ou interpretador de código. Para mais informações, consulte Propriedades de ContainerConfiguration.

Cpu

Integer

Não

Sim

Número de núcleos de CPU.

Valor mínimo: 2 núcleos.

CredentialConfiguration

Map

Não

Sim

Configuração de credenciais.

Para mais informações, consulte Propriedades de CredentialConfiguration.

Description

String

Não

Sim

Descrição do modelo.

Nenhuma

DiskSize

Integer

Não

Sim

Tamanho do disco.

Valor mínimo: 512 MB.

EnableAgent

Boolean

Não

Sim

Indica se o agente de sandbox deve ser ativado.

Nenhuma

EnvironmentVariables

Map

Não

Sim

Variáveis de ambiente.

Nenhuma

ExecutionRoleArn

String

Não

Sim

ARN da função de execução.

Nenhuma

LogConfiguration

Map

Não

Sim

Configuração de log.

Para mais informações, consulte Propriedades de LogConfiguration.

Memory

Integer

Não

Sim

Quantidade de memória, em MB.

Valor mínimo: 2048 MB.

NasConfig

Map

Não

Sim

Configuração do NAS.

Para mais informações, consulte Propriedades de NasConfig.

NetworkConfiguration

Map

Não

Sim

Configuração de rede.

Para mais informações, consulte Propriedades de NetworkConfiguration.

OssConfiguration

List

Não

Sim

Configuração do OSS.

Comprimento mínimo: 1. Para mais informações, consulte Propriedades de OssConfiguration.

SandboxIdleTimeoutInSeconds

Integer

Não

Sim

Tempo limite de ociosidade da sandbox, em segundos.

Valor mínimo: 0 segundos.

TemplateConfiguration

Map

Não

Sim

Configuração do modelo.

Estrutura de objeto flexível que varia conforme o tipo de modelo.

TemplateType

String

Não

Não

Tipo do modelo.

Valores válidos:

  • CodeInterpreter

  • AllInOne

  • CustomImage

  • ComputerUse

  • Browser

WorkspaceId

String

Não

Sim

ID do workspace.

Nenhuma

ArmsConfiguration

"ArmsConfiguration": {
  "CmsWorkspace": String,
  "EnableArms": Boolean,
  "ArmsLicenseKey": String
}

Propriedades de ArmsConfiguration

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

ArmsLicenseKey

String

Sim

Sim

Chave de licença do ARMS.

Nenhuma

EnableArms

Boolean

Sim

Sim

Indica se o ARMS deve ser ativado.

Nenhuma

CmsWorkspace

String

Não

Sim

ID do workspace para o CloudMonitor 2.0.

Nenhuma

Sintaxe de CredentialConfiguration

"CredentialConfiguration": {
  "CredentialName": String
}

Propriedades de CredentialConfiguration

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrição

CredentialName

string

true

true

Nome da credencial.

Nenhuma

ContainerConfiguration

"ContainerConfiguration": {
  "AcrInstanceId": String,
  "Command": List,
  "Port": Integer,
  "Image": String,
  "ImageRegistryType": String
}

Parâmetros de ContainerConfiguration

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

ImageRegistryType

String

Sim

Sim

Tipo de registro de imagem.

Valores válidos:

  • ACR

  • ACREE

  • CUSTOM

AcrInstanceId

String

Não

Sim

ID da instância ACR.

Nenhuma

Command

List

Não

Sim

Comando a ser executado no contêiner.

Nenhuma

Image

String

Não

Sim

Endereço da imagem do contêiner.

Nenhuma

Port

Integer

Não

Sim

Porta exposta pelo contêiner.

Valor mínimo: 1

Valor máximo: 65535

LogConfiguration

"LogConfiguration": {
  "Project": String,
  "Logstore": String
}

Propriedades de LogConfiguration

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

Logstore

String

Sim

Sim

Nome do Logstore no Log Service.

Nenhuma

Project

String

Sim

Sim

Nome do Project no Log Service.

Nenhuma

Sintaxe de OssConfiguration

"OssConfiguration": [
  {
    "MountPoint": String,
    "BucketName": String,
    "Permission": String,
    "Region": String,
    "Prefix": String
  }
]

Propriedades de OssConfiguration

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

BucketName

String

Sim

Sim

Nome do bucket do OSS.

Nenhuma

MountPoint

String

Sim

Sim

Caminho do diretório para o ponto de montagem.

Nenhuma

Permission

String

Sim

Sim

Permissão de acesso ao ponto de montagem.

Valores válidos:

  • READ_ONLY

  • READ_WRITE

Prefix

String

Sim

Sim

Prefixo de caminho de objeto dentro do bucket do OSS.

Nenhuma

Region

String

Sim

Sim

Região onde o bucket do OSS está localizado.

Nenhuma

Sintaxe de NetworkConfiguration

"NetworkConfiguration": {
  "VpcId": String,
  "VSwitchIds": List,
  "SecurityGroupId": String,
  "NetworkMode": String
}

NetworkConfiguration

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

NetworkMode

String

Sim

Sim

Modo de rede.

Valores válidos:

  • PRIVATE

  • PUBLIC

  • PUBLIC_AND_PRIVATE

SecurityGroupId

String

Não

Sim

ID do grupo de segurança.

Nenhuma

VpcId

String

Não

Sim

ID da VPC.

Nenhuma

VSwitchIds

List

Não

Sim

Lista de IDs de vSwitch.

Comprimento mínimo: 1

Sintaxe de NasConfig

"NasConfig": {
  "MountPoints": List,
  "UserId": Integer,
  "GroupId": Integer
}

Propriedades de NasConfig

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrição

GroupId

Integer

Não

Sim

ID do grupo NAS.

Nenhuma

MountPoints

List

Não

Sim

Pontos de montagem do NAS.

Comprimento mínimo: 1

UserId

Integer

Não

Sim

ID do usuário NAS.

Nenhuma

Sintaxe de MountPoints

"MountPoints": [
  {
    "EnableTLS": Boolean,
    "ServerAddr": String,
    "MountDir": String
  }
]

Propriedades do ponto de montagem

Parâmetro

Tipo

Obrigatório

Atualizável

Descrição

Restrições

EnableTLS

Boolean

Não

Sim

Indica se o TLS deve ser ativado para o ponto de montagem.

Nenhuma

MountDir

String

Não

Sim

Diretório de montagem no servidor.

Nenhuma

ServerAddr

String

Não

Sim

Endereço do servidor do sistema de arquivos NAS.

Nenhuma

Valor de retorno

Fn::GetAtt

  • TemplateArn: O ARN do modelo.

  • TemplateName: O nome do modelo.

  • TemplateId: O ID do modelo.

Exemplo

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TemplateName:
    Type: String
    Description:
      en: The name of the template.
    Required: true
  TemplateType:
    Type: String
    Description:
      en: The type of the template.
    AllowedValues:
      - CodeInterpreter
      - AllInOne
      - CustomImage
      - ComputerUse
      - Browser
    Default: Null
    Required: false
  Description:
    Type: String
    Description:
      en: The description of the template.
    AssociationProperty: TextArea
    Default: Null
    Required: false
  Cpu:
    Type: Number
    Description:
      en: 'The number of CPU cores.'
    MinValue: 2
    Default: Null
    Required: false
  Memory:
    Type: Number
    Description:
      en: 'The memory size, in MB.'
    MinValue: 2048
    Default: Null
    Required: false
  DiskSize:
    Type: Number
    Description:
      en: 'The disk size, in MB.'
    MinValue: 512
    Default: Null
    Required: false
  ContainerConfiguration:
    Description:
      en: The container configuration. Only images based on the Browser or Code Interpreter base images are allowed.
    Required: false
    Default: Null
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        Image:
          Type: String
          Description:
            en: The address of the container image.
          Default: Null
          Required: false
        ImageRegistryType:
          Type: String
          Description:
            en: The type of the image registry.
          AllowedValues:
            - ACR
            - ACREE
            - CUSTOM
          Required: true
        AcrInstanceId:
          Type: String
          Description:
            en: The ID of the ACR instance.
          Default: Null
          Required: false
        Command:
          Description:
            en: The command to run in the container.
          Required: false
          Default: Null
          Type: Json
          AssociationProperty: List[Parameter]
          AssociationPropertyMetadata:
            Parameter:
              Type: String
              Default: Null
              Required: false
        Port:
          Type: Number
          Description:
            en: The port of the container.
          MinValue: 1
          MaxValue: 65535
          Default: Null
          Required: false
  NetworkConfiguration:
    Description:
      en: The network configuration.
    Required: false
    Default: Null
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        NetworkMode:
          Type: String
          Description:
            en: The network mode.
          AllowedValues:
            - PRIVATE
            - PUBLIC
            - PUBLIC_AND_PRIVATE
          Required: true
        VpcId:
          Type: String
          Description:
            en: The ID of the VPC.
          AssociationProperty: ALIYUN::ECS::VPC::VPCId
          Default: Null
          Required: false
        SecurityGroupId:
          Type: String
          Description:
            en: The ID of the security group.
          AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
          AssociationPropertyMetadata:
            VpcId: ${VpcId}
          Default: Null
          Required: false
        VSwitchIds:
          Description:
            en: The list of vSwitch IDs.
          Required: false
          Default: Null
          Type: Json
          MinLength: 1
          AssociationProperty: List[Parameter]
          AssociationPropertyMetadata:
            Parameter:
              Type: String
              AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
              AssociationPropertyMetadata:
                ZoneId: ${ZoneId}
                VpcId: ${VpcId}
              Default: Null
              Required: false
  CredentialConfiguration:
    Description:
      en: The credential configuration.
    Required: false
    Default: Null
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        CredentialName:
          Type: String
          Description:
            en: The name of the credential.
          Required: true
  LogConfiguration:
    Description:
      en: The log configuration.
    Required: false
    Default: Null
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        Project:
          Type: String
          Description:
            en: The name of the SLS Project.
          Required: true
        Logstore:
          Type: String
          Description:
            en: The name of the SLS Logstore.
          Required: true
  ExecutionRoleArn:
    Type: String
    Description:
      en: The ARN of the execution role.
    Default: Null
    Required: false
  SandboxIdleTimeoutInSeconds:
    Type: Number
    Description:
      en: The sandbox idle timeout, in seconds.
    MinValue: 0
    Default: Null
    Required: false
  ArmsConfiguration:
    Description:
      en: The ARMS configuration.
    Required: false
    Default: Null
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        EnableArms:
          Type: Boolean
          Description:
            en: Whether to enable ARMS.
          Required: true
        ArmsLicenseKey:
          Type: String
          Description:
            en: The license key for ARMS.
          Required: true
        CmsWorkspace:
          Type: String
          Description:
            en: The ID of the CloudMonitor 2.0 workspace.
          Default: Null
          Required: false
  AllowAnonymousManage:
    Type: Boolean
    Description:
      en: Whether to allow anonymous management.
    Default: Null
    Required: false
  NasConfig:
    Description:
      en: The NAS configuration.
    Required: false
    Default: Null
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        GroupId:
          Type: Number
          Description:
            en: The ID of the NAS group.
          Default: Null
          Required: false
        UserId:
          Type: Number
          Description:
            en: The ID of the NAS user.
          Default: Null
          Required: false
        MountPoints:
          Description:
            en: The NAS mount points.
          Required: false
          Default: Null
          Type: Json
          MinLength: 1
          AssociationProperty: List[Parameters]
          AssociationPropertyMetadata:
            Parameters:
              EnableTLS:
                Type: Boolean
                Description:
                  en: Whether to enable TLS.
                Default: Null
                Required: false
              MountDir:
                Type: String
                Description:
                  en: The mount directory.
                Default: Null
                Required: false
              ServerAddr:
                Type: String
                Description:
                  en: The server address of the NAS file system.
                Default: Null
                Required: false
  EnableAgent:
    Type: Boolean
    Description:
      en: Whether to enable the sandbox agent.
    Default: Null
    Required: false
  WorkspaceId:
    Type: String
    Description:
      en: The ID of the workspace.
    Default: Null
    Required: false
  OssConfiguration:
    Description:
      en: The OSS configuration.
    Required: false
    Default: Null
    Type: Json
    MinLength: 1
    AssociationProperty: List[Parameters]
    AssociationPropertyMetadata:
      Parameters:
        BucketName:
          Type: String
          Description:
            en: The name of the OSS bucket.
          Required: true
        Prefix:
          Type: String
          Description:
            en: The OSS prefix.
          Required: true
        MountPoint:
          Type: String
          Description:
            en: The mount point.
          Required: true
        Permission:
          Type: String
          Description:
            en: The permission.
          AllowedValues:
            - READ_ONLY
            - READ_WRITE
          Required: true
        Region:
          Type: String
          Description:
            en: The region.
          Required: true
  EnvironmentVariables:
    Description:
      en: The environment variables.
    Required: false
    Default: Null
    Type: Json
  TemplateConfiguration:
    Description:
      en: The template configuration. The object structure is flexible and depends on the templateType value.
    Required: false
    Default: Null
    Type: Json
Resources:
  Template:
    Type: ALIYUN::AgentRun::Template
    Properties:
      TemplateName:
        Ref: TemplateName
      TemplateType:
        Ref: TemplateType
      Description:
        Ref: Description
      Cpu:
        Ref: Cpu
      Memory:
        Ref: Memory
      DiskSize:
        Ref: DiskSize
      ContainerConfiguration:
        Ref: ContainerConfiguration
      NetworkConfiguration:
        Ref: NetworkConfiguration
      CredentialConfiguration:
        Ref: CredentialConfiguration
      LogConfiguration:
        Ref: LogConfiguration
      ExecutionRoleArn:
        Ref: ExecutionRoleArn
      SandboxIdleTimeoutInSeconds:
        Ref: SandboxIdleTimeoutInSeconds
      ArmsConfiguration:
        Ref: ArmsConfiguration
      AllowAnonymousManage:
        Ref: AllowAnonymousManage
      NasConfig:
        Ref: NasConfig
      EnableAgent:
        Ref: EnableAgent
      WorkspaceId:
        Ref: WorkspaceId
      OssConfiguration:
        Ref: OssConfiguration
      EnvironmentVariables:
        Ref: EnvironmentVariables
      TemplateConfiguration:
        Ref: TemplateConfiguration
Outputs:
  TemplateId:
    Value:
      Fn::GetAtt:
        - Template
        - TemplateId
    Description: The ID of the template.
  TemplateName:
    Value:
      Fn::GetAtt:
        - Template
        - TemplateName
    Description: The name of the template.
  TemplateArn:
    Value:
      Fn::GetAtt:
        - Template
        - TemplateArn
    Description: The ARN of the template.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TemplateName": {
      "Type": "String",
      "Description": {
        "en": "The name of the template."
      },
      "Required": true
    },
    "TemplateType": {
      "Type": "String",
      "Description": {
        "en": "The type of the template."
      },
      "AllowedValues": [
        "CodeInterpreter",
        "AllInOne",
        "CustomImage",
        "ComputerUse",
        "Browser"
      ],
      "Default": null,
      "Required": false
    },
    "Description": {
      "Type": "String",
      "Description": {
        "en": "The description of the template."
      },
      "AssociationProperty": "TextArea",
      "Default": null,
      "Required": false
    },
    "Cpu": {
      "Type": "Number",
      "Description": {
        "en": "The number of CPU cores."
      },
      "MinValue": 2,
      "Default": null,
      "Required": false
    },
    "Memory": {
      "Type": "Number",
      "Description": {
        "en": "The memory size, in MB."
      },
      "MinValue": 2048,
      "Default": null,
      "Required": false
    },
    "DiskSize": {
      "Type": "Number",
      "Description": {
        "en": "The disk size, in MB."
      },
      "MinValue": 512,
      "Default": null,
      "Required": false
    },
    "ContainerConfiguration": {
      "Description": {
        "en": "The container configuration. Only images based on the Browser or Code Interpreter base images are allowed."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Image": {
            "Type": "String",
            "Description": {
              "en": "The address of the container image."
            },
            "Default": null,
            "Required": false
          },
          "ImageRegistryType": {
            "Type": "String",
            "Description": {
              "en": "The type of the image registry."
            },
            "AllowedValues": [
              "ACR",
              "ACREE",
              "CUSTOM"
            ],
            "Required": true
          },
          "AcrInstanceId": {
            "Type": "String",
            "Description": {
              "en": "The ID of the ACR instance."
            },
            "Default": null,
            "Required": false
          },
          "Command": {
            "Description": {
              "en": "The command to run in the container."
            },
            "Required": false,
            "Default": null,
            "Type": "Json",
            "AssociationProperty": "List[Parameter]",
            "AssociationPropertyMetadata": {
              "Parameter": {
                "Type": "String",
                "Default": null,
                "Required": false
              }
            }
          },
          "Port": {
            "Type": "Number",
            "Description": {
              "en": "The port of the container."
            },
            "MinValue": 1,
            "MaxValue": 65535,
            "Default": null,
            "Required": false
          }
        }
      }
    },
    "NetworkConfiguration": {
      "Description": {
        "en": "The network configuration."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "NetworkMode": {
            "Type": "String",
            "Description": {
              "en": "The network mode."
            },
            "AllowedValues": [
              "PRIVATE",
              "PUBLIC",
              "PUBLIC_AND_PRIVATE"
            ],
            "Required": true
          },
          "VpcId": {
            "Type": "String",
            "Description": {
              "en": "The ID of the VPC."
            },
            "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
            "Default": null,
            "Required": false
          },
          "SecurityGroupId": {
            "Type": "String",
            "Description": {
              "en": "The ID of the security group."
            },
            "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
            "AssociationPropertyMetadata": {
              "VpcId": "${VpcId}"
            },
            "Default": null,
            "Required": false
          },
          "VSwitchIds": {
            "Description": {
              "en": "The list of vSwitch IDs."
            },
            "Required": false,
            "Default": null,
            "Type": "Json",
            "MinLength": 1,
            "AssociationProperty": "List[Parameter]",
            "AssociationPropertyMetadata": {
              "Parameter": {
                "Type": "String",
                "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
                "AssociationPropertyMetadata": {
                  "ZoneId": "${ZoneId}",
                  "VpcId": "${VpcId}"
                },
                "Default": null,
                "Required": false
              }
            }
          }
        }
      }
    },
    "CredentialConfiguration": {
      "Description": {
        "en": "The credential configuration."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "CredentialName": {
            "Type": "String",
            "Description": {
              "en": "The name of the credential."
            },
            "Required": true
          }
        }
      }
    },
    "LogConfiguration": {
      "Description": {
        "en": "The log configuration."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Project": {
            "Type": "String",
            "Description": {
              "en": "The name of the SLS Project."
            },
            "Required": true
          },
          "Logstore": {
            "Type": "String",
            "Description": {
              "en": "The name of the SLS Logstore."
            },
            "Required": true
          }
        }
      }
    },
    "ExecutionRoleArn": {
      "Type": "String",
      "Description": {
        "en": "The ARN of the execution role."
      },
      "Default": null,
      "Required": false
    },
    "SandboxIdleTimeoutInSeconds": {
      "Type": "Number",
      "Description": {
        "en": "The sandbox idle timeout, in seconds."
      },
      "MinValue": 0,
      "Default": null,
      "Required": false
    },
    "ArmsConfiguration": {
      "Description": {
        "en": "The ARMS configuration."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "EnableArms": {
            "Type": "Boolean",
            "Description": {
              "en": "Whether to enable ARMS."
            },
            "Required": true
          },
          "ArmsLicenseKey": {
            "Type": "String",
            "Description": {
              "en": "The license key for ARMS."
            },
            "Required": true
          },
          "CmsWorkspace": {
            "Type": "String",
            "Description": {
              "en": "The ID of the CloudMonitor 2.0 workspace."
            },
            "Default": null,
            "Required": false
          }
        }
      }
    },
    "AllowAnonymousManage": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether to allow anonymous management."
      },
      "Default": null,
      "Required": false
    },
    "NasConfig": {
      "Description": {
        "en": "The NAS configuration."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "GroupId": {
            "Type": "Number",
            "Description": {
              "en": "The ID of the NAS group."
            },
            "Default": null,
            "Required": false
          },
          "UserId": {
            "Type": "Number",
            "Description": {
              "en": "The ID of the NAS user."
            },
            "Default": null,
            "Required": false
          },
          "MountPoints": {
            "Description": {
              "en": "The NAS mount points."
            },
            "Required": false,
            "Default": null,
            "Type": "Json",
            "MinLength": 1,
            "AssociationProperty": "List[Parameters]",
            "AssociationPropertyMetadata": {
              "Parameters": {
                "EnableTLS": {
                  "Type": "Boolean",
                  "Description": {
                    "en": "Whether to enable TLS."
                  },
                  "Default": null,
                  "Required": false
                },
                "MountDir": {
                  "Type": "String",
                  "Description": {
                    "en": "The mount directory."
                  },
                  "Default": null,
                  "Required": false
                },
                "ServerAddr": {
                  "Type": "String",
                  "Description": {
                    "en": "The server address of the NAS file system."
                  },
                  "Default": null,
                  "Required": false
                }
              }
            }
          }
        }
      }
    },
    "EnableAgent": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether to enable the sandbox agent."
      },
      "Default": null,
      "Required": false
    },
    "WorkspaceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the workspace."
      },
      "Default": null,
      "Required": false
    },
    "OssConfiguration": {
      "Description": {
        "en": "The OSS configuration."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "MinLength": 1,
      "AssociationProperty": "List[Parameters]",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "BucketName": {
            "Type": "String",
            "Description": {
              "en": "The name of the OSS bucket."
            },
            "Required": true
          },
          "Prefix": {
            "Type": "String",
            "Description": {
              "en": "The OSS prefix."
            },
            "Required": true
          },
          "MountPoint": {
            "Type": "String",
            "Description": {
              "en": "The mount point."
            },
            "Required": true
          },
          "Permission": {
            "Type": "String",
            "Description": {
              "en": "The permission."
            },
            "AllowedValues": [
              "READ_ONLY",
              "READ_WRITE"
            ],
            "Required": true
          },
          "Region": {
            "Type": "String",
            "Description": {
              "en": "The region."
            },
            "Required": true
          }
        }
      }
    },
    "EnvironmentVariables": {
      "Description": {
        "en": "The environment variables."
      },
      "Required": false,
      "Default": null,
      "Type": "Json"
    },
    "TemplateConfiguration": {
      "Description": {
        "en": "The template configuration. The object structure is flexible and depends on the templateType value."
      },
      "Required": false,
      "Default": null,
      "Type": "Json"
    }
  },
  "Resources": {
    "Template": {
      "Type": "ALIYUN::AgentRun::Template",
      "Properties": {
        "TemplateName": {
          "Ref": "TemplateName"
        },
        "TemplateType": {
          "Ref": "TemplateType"
        },
        "Description": {
          "Ref": "Description"
        },
        "Cpu": {
          "Ref": "Cpu"
        },
        "Memory": {
          "Ref": "Memory"
        },
        "DiskSize": {
          "Ref": "DiskSize"
        },
        "ContainerConfiguration": {
          "Ref": "ContainerConfiguration"
        },
        "NetworkConfiguration": {
          "Ref": "NetworkConfiguration"
        },
        "CredentialConfiguration": {
          "Ref": "CredentialConfiguration"
        },
        "LogConfiguration": {
          "Ref": "LogConfiguration"
        },
        "ExecutionRoleArn": {
          "Ref": "ExecutionRoleArn"
        },
        "SandboxIdleTimeoutInSeconds": {
          "Ref": "SandboxIdleTimeoutInSeconds"
        },
        "ArmsConfiguration": {
          "Ref": "ArmsConfiguration"
        },
        "AllowAnonymousManage": {
          "Ref": "AllowAnonymousManage"
        },
        "NasConfig": {
          "Ref": "NasConfig"
        },
        "EnableAgent": {
          "Ref": "EnableAgent"
        },
        "WorkspaceId": {
          "Ref": "WorkspaceId"
        },
        "OssConfiguration": {
          "Ref": "OssConfiguration"
        },
        "EnvironmentVariables": {
          "Ref": "EnvironmentVariables"
        },
        "TemplateConfiguration": {
          "Ref": "TemplateConfiguration"
        }
      }
    }
  },
  "Outputs": {
    "TemplateId": {
      "Value": {
        "Fn::GetAtt": [
          "Template",
          "TemplateId"
        ]
      },
      "Description": "The ID of the template."
    },
    "TemplateName": {
      "Value": {
        "Fn::GetAtt": [
          "Template",
          "TemplateName"
        ]
      },
      "Description": "The name of the template."
    },
    "TemplateArn": {
      "Value": {
        "Fn::GetAtt": [
          "Template",
          "TemplateArn"
        ]
      },
      "Description": "The ARN of the template."
    }
  }
}