packer-plugin-alicloud

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

packer-plugin-alicloud

Inputs

Required:
Name Type
access_key string
secret_key string
region_id string
Optional:
Name Type Valid Value Description
image_id string any string ID of the image.
image_name string any string Name of the image.
image_family string any string Famaily of the image.
os_type string windows, linux OS type of the image.
architecture string i386, x86_64, arm64 Architectre of the images.
usage string instance, none - Instance: The image is already in use and running on an ECS instance.
- None: The image is idle.
tags map map of string Tags of the image.

Outputs

Name Type
images
list of object([{
image_id = string
image_name = string
image_family = string
os_type = string
architecture = string
tags = list of object([{
key = string
value = string
}])
}])

Example

packer {
  required_plugins {
     st-alicloud = {
      source  = "github.com/myklst/alicloud"
      version = "~> 0.1"
    }
  }
}

data "st-alicloud-images" "ecs_images" {
  access_key = "v1-gastisthisisnotmyaccesskey"
  secret_key = "v9-adftthisfathisisnotmysecretkey"
  region  = "cn-hongkong"
  image_name = "ThisIsMyImageName_*.vhd"

  tags = {
    status = "activated"
  }
}

locals {
  prodImageID = compact(flatten([for v in data.st-alicloud-image.ecs_images.images : [
    for tag in v.tags : [
     tag.key == "env" && tag.value == "prod"? v.image_id : null
    ]
  ]]))

  devImageID = compact(flatten([for v in data.st-alicloud-image.ecs_images.images : [
    for tag in v.tags : [
     tag.key == "env" && tag.value == "dev"? v.image_id : null
    ]
  ]]))
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
datasource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL