tfwriter

Terraform HCL code generator.

Download as .zip Download as .tar.gz View on GitHub

alicloud_copy_image

back

Index

Terraform

terraform {
  required_providers {
    alicloud = ">= 1.120.0"
  }
}

top

Example Usage

module "alicloud_copy_image" {
  source = "./modules/alicloud/r/alicloud_copy_image"

  # description - (optional) is a type of string
  description = null
  # encrypted - (optional) is a type of bool
  encrypted = null
  # force - (optional) is a type of bool
  force = null
  # image_name - (optional) is a type of string
  image_name = null
  # kms_key_id - (optional) is a type of string
  kms_key_id = null
  # name - (optional) is a type of string
  name = null
  # source_image_id - (required) is a type of string
  source_image_id = null
  # source_region_id - (required) is a type of string
  source_region_id = null
  # tags - (optional) is a type of map of string
  tags = {}

  timeouts = [{
    create = null
    delete = null
  }]
}

top

Variables

variable "description" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "encrypted" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "force" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "image_name" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "kms_key_id" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "name" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "source_image_id" {
  description = "(required)"
  type        = string
}

variable "source_region_id" {
  description = "(required)"
  type        = string
}

variable "tags" {
  description = "(optional)"
  type        = map(string)
  default     = null
}

variable "timeouts" {
  description = "nested block: NestingSingle, min items: 0, max items: 0"
  type = set(object(
    {
      create = string
      delete = string
    }
  ))
  default = []
}

top

Resource

resource "alicloud_copy_image" "this" {
  # description - (optional) is a type of string
  description = var.description
  # encrypted - (optional) is a type of bool
  encrypted = var.encrypted
  # force - (optional) is a type of bool
  force = var.force
  # image_name - (optional) is a type of string
  image_name = var.image_name
  # kms_key_id - (optional) is a type of string
  kms_key_id = var.kms_key_id
  # name - (optional) is a type of string
  name = var.name
  # source_image_id - (required) is a type of string
  source_image_id = var.source_image_id
  # source_region_id - (required) is a type of string
  source_region_id = var.source_region_id
  # tags - (optional) is a type of map of string
  tags = var.tags

  dynamic "timeouts" {
    for_each = var.timeouts
    content {
      # create - (optional) is a type of string
      create = timeouts.value["create"]
      # delete - (optional) is a type of string
      delete = timeouts.value["delete"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = alicloud_copy_image.this.id
}

output "image_name" {
  description = "returns a string"
  value       = alicloud_copy_image.this.image_name
}

output "name" {
  description = "returns a string"
  value       = alicloud_copy_image.this.name
}

output "this" {
  value = alicloud_copy_image.this
}

top