Member-only story

Troubleshooting and Resolving the InvalidAMIID.Malformed Error in Terraform

Mastering Terraform: Resolving the InvalidAMIID.Malformed Error

Luca Berton
5 min readFeb 4, 2024

Introduction

In the world of cloud computing and infrastructure as code, Terraform stands out as a popular tool for automating the deployment of resources in cloud environments like AWS. However, even experienced developers can encounter errors. A common issue is the InvalidAMIID.Malformed error, which can be a stumbling block for many. This article aims to dissect and provide solutions to this error, drawing from a real-world example.

The Problem

While I was going through a Terraform tutorial, I encountered an error when trying to launch a source instance in AWS. The error message was:

Error: Error launching source instance: InvalidAMIID.NotFound: The image id '[ami-830c94e3]' does not exist
status code: 400, request id: 4c3e0252-c3a5-471e-8b57-3f6e349628af

This error occurred after changing the AWS region from us-west-2 to eu-central-1 in his Terraform configuration.

provider "aws" {
region = "eu-central-1"
}

The Cause

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet