You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform-provider-decort/samples/cloudapi/resource_image/main.tf

109 lines
2.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#Расскомментируйте этот код,
#и внесите необходимые правки в версию и путь,
#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
/*
terraform {
required_providers {
decort = {
source = "basis/decort/decort"
version = "<VERSION>"
}
}
}
*/
provider "decort" {
authenticator = "decs3o"
#controller_url = <DECORT_CONTROLLER_URL>
controller_url = "https://ds1.digitalenergy.online"
#oauth2_url = <DECORT_SSO_URL>
oauth2_url = "https://sso.digitalenergy.online"
allow_unverified_ssl = true
}
resource "decort_image" "img" {
# Наименование образа
# Обязательный параметр
# string
name = "image_name"
# grid ID платформы
# Обязательный параметр
# int
gid = 2002
# Драйверы компьютов, подходящие для данного образа
# Обязательный параметр
# []string
drivers = ["KVM_X86"]
# Тип образа (linux, windows и др.)
# Обязательный параметр
# string
type = "linux"
# Прямая ссылка на образ
# Обязательный параметр
# string
url = "https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso"
# Тип загрузчика (bios/uefi)
# Обязательный параметр
# string
boot_type = "bios"
# ID аккаунта
# Опциональный параметр
# int
account_id = 138
# Поддержка hot resize
# Опциональный параметр
# bool
hot_resize = true
# Юзернейм для образа
# Опциональный параметр
# string
username = "userx"
# Пароль для образа
# Опциональный параметр
# string
password = "passx"
# Юзернейм для загрузки binary media
# Опциональный параметр
# string
username_dl = "userxdl"
# Пароль для загрузки binary media
# Опциональный параметр
# string
password_dl = "passxdl"
# Storage endpoint provider ID
# Опциональный параметр
# int
sep_id = 1
# Pool для образа
# Опциональный параметр
# string
pool_name = "pool"
# Архитектура обраща (X86_64 / PPC64_LE)
# Опциональный параметр
# string
architecture = "PPC64_LE"
# Флаг окончательного удаления
# Опциональный параметр
# булев тип
permanently = true
}
output "img_out" {
value = decort_image.img
}