Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "tencentcloud-image" data source for querying images #139

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Jalle19
Copy link

@Jalle19 Jalle19 commented Nov 8, 2024

Fixes #68

Example usage:

# Use filters to find an image
data "tencentcloud-image" "test-image" {
  filters = {
    image-type = "PUBLIC_IMAGE"
    platform = "Rocky Linux"
    image-name = "Rocky Linux 9.4 64bit"
  }
  most_recent = true
}

# Use image family to find an image
data "tencentcloud-image" "test-image2" {
  image_family = "custom-image-x86"
}

locals {
  id = data.tencentcloud-image.test-image.id
  name = data.tencentcloud-image.test-image.name
}

source "null" "basic-example" {
  communicator = "none"
}

build {
  sources = [
    "source.null.basic-example"
  ]

  provisioner "shell-local" {
    inline = [
      "echo id: ${local.id}",
      "echo name: ${local.name}",
    ]
  }
}

@Jalle19 Jalle19 requested a review from a team as a code owner November 8, 2024 14:03
The value is "<unknown>" when running "packer validate" with a datasource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find source image by filters
1 participant