Nom du modèle
Le modèle ACS-ECS-RunPacker exécute des modèles Packer.
Description du modèle
Ce modèle exécute un modèle Packer sur les instances ECS spécifiées.
Type de modèle
Automatisé
Propriétaire
Alibaba Cloud
Paramètres d'entrée
|
Paramètre |
Description |
Type |
Obligatoire |
Valeur par défaut |
Limite |
|
targets |
Les instances ECS cibles. |
String |
Oui |
||
|
sourceType |
Le type de service de stockage du fichier. |
String |
Oui |
||
|
sourcePath |
L'URL de l'emplacement de stockage du fichier. |
String |
Oui |
||
|
templateFile |
Le nom du modèle Packer à exécuter. |
String |
Oui |
||
|
regionId |
L'ID de la région. |
String |
Non |
{{ ACS::RegionId }} |
|
|
tokenInfo |
Le jeton utilisé pour télécharger le fichier. |
String |
Non |
||
|
mode |
Le mode d'exécution du modèle. |
String |
Non |
build |
|
|
OOSAssumeRole |
Le rôle RAM (Resource Access Management) endossé par OOS (CloudOps Orchestration Service). |
String |
Non |
"" |
Paramètres de sortie
|
Paramètre |
Description |
Type |
|
result |
String |
Politique d'autorisation requise pour exécuter le modèle
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Pour plus de détails, consultez ACS-ECS-RunPacker.
Contenu du modèle
FormatVersion: OOS-2019-06-01
Description:
en: Run packer template
zh-cn: Run Packer template
name-en: ACS-ECS-RunPacker
name-zh-cn: Run Packer template
categories:
- image_manage
Parameters:
regionId:
Label:
en: RegionId
zh-cn: Region ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: String
Label:
en: TargetInstance
zh-cn: Target Instance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
sourceType:
Type: String
Label:
en: SourceType
zh-cn: Type of file storage
AllowedValues:
- oss
- https
- github
sourcePath:
Type: String
Label:
en: SourcePath
zh-cn: The URL of the file to be stored.
tokenInfo:
Type: String
Description:
en: It is only required when downloading file from GitHub
zh-cn: This parameter is required only when you download a file from GitHub.
Label:
en: TokenInfo
zh-cn: The token used to download the file.
Default: ' '
templateFile:
Label:
en: TemplateFile
zh-cn: The name of the Packer template to be executed.
Type: String
mode:
Type: String
Label:
en: Mode
zh-cn: The mode in which to use the template.
AllowedValues:
- validate
- fix
- build
Default: build
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: The RAM role to be assumed by OOS.
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ECS instances
zh-cn: Retrieves ECS instances.
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceId:
Type: String
ValueSelector: Instances.Instance[].InstanceId
- Name: runPacker
Action: 'ACS::ECS::RunPacker'
Description:
en: Run packer template
zh-cn: Runs the Packer template.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ getInstance.instanceId }}'
sourceType: '{{ sourceType }}'
sourcePath: '{{ sourcePath }}'
tokenInfo: '{{ tokenInfo }}'
templateFile: '{{ templateFile }}'
mode: '{{ mode }}'
Outputs:
commandOutput:
Type: String
ValueSelector: commandOutput
Outputs:
result:
Type: String
Value: '{{ runPacker.commandOutput }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- sourceType
- sourcePath
- tokenInfo
- templateFile
- mode
Label:
default:
zh-cn: Parameter Settings
en: Parameters Options
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Select Instance
en: Select ECS Instance
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: Advanced Options
en: Control Options