AWS: Can't make searching among custom (private) AMIs work

Hi team! I am building coder workspaces in my AWS account based on EC2 virtual machines. I have built a custom AMI (thanks to EC2 Image Builder). Now I want to use it in a Coder template. I have deployed a Coder instance by subscribing to the official item in AWS Marketplace. Then I created a teamplate based on AWS EC2 starter template. When I use the AMI ID directly, it works! However, when I want to use "aws_ami" to search among my AMIs, it does not find anything. What am I doing wrong?
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["self"]
}
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["self"]
}
I tried without any filter, I tried with the AWS account number directly for the owners field... no luck. Any help appreciated! Thanks!
8 Replies
Codercord
Codercord2w ago
<#1293200669632626788>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys2w ago
hi, maybe using "*" for the name is too broad? maybe try with a more restrictive filter
Rejome
Rejome2w ago
OK found it! Your AMIs have to be in the AWS Region: us-east-1 (North Virginia)
Phorcys
Phorcys2w ago
oh that's weird it doesn't even mention that anywhere
Phorcys
Phorcys2w ago
I think you should open an issue over at hashicorp/terraform-provider-aws
GitHub
Issues · hashicorp/terraform-provider-aws
The AWS Provider enables Terraform to manage AWS resources. - Issues · hashicorp/terraform-provider-aws
Rejome
Rejome2w ago
GitHub
Allow aws_ami to fetch AMIs from other AWS Regions than us-east-1 ·...
Description I am using coder (www.coder.com) to deploy dev environments on EC2 instances thanks to Terraform. When searching for AMIs to deploy, the data "aws_ami" is looking into us-east...
Phorcys
Phorcys2w ago
thanks!
Codercord
Codercord2w ago
@Phorcys closed the thread.
Want results from more Discord servers?
Add your server