Skip to content

data "aws_ami" for arm64 consistently fails with "Your query returned no results" #83

@phamduchongan93

Description

@phamduchongan93

Problem Description

The aws_ami data source in the provided main.tf example fails to find a matching AMI when the name_regex is modified to search for arm64 images. This consistently results in a Your query returned no results error, preventing the cluster from being provisioned on Graviton instances. The same AMI is verifiable via manual search in the AWS Console.

Steps to Reproduce

  1. Use the main.tf from the siderolabs/contrib repository.
  2. Change the data "aws_ami" "talos" block to search for arm64 images.
  3. Run terraform plan.

Expected Behavior

The data "aws_ami" block should successfully find the latest arm64 AMI and proceed with the Terraform plan.

Actual Behavior

The terraform plan command fails with the following error:

╷
│ Error: Your query returned no results. Please change your search criteria and try again.
│
│   with data.aws_ami.talos,
│   on main.tf line 55, in data "aws_ami" "talos":
│   55: data "aws_ami" "talos" {
│
╵

Environment

  • AWS Region: us-west-2
  • Terraform Version: 1.8.x
  • AWS AMI Owner ID: 502334860662 (Sidero Labs)

Suggested Solution

The issue appears to be with the specificity of the name_regex filter. A more robust regex, or a simpler filter, seems to resolve the issue.

Current data block that fails:

data "aws_ami" "talos" {
  owners      = ["502334860662"]
  most_recent = true
  name_regex  = "^talos-v[0-9.]+-arm64$"
}

Proposed Solution:
The data block should be updated to a more reliable search, or the name_regex should be made more flexible to account for naming variations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions