scooper4711 / foundryvtt-terraform

terraform code to deploy foundryvtt
5 stars 7 forks source link

First-time apply: Your query returned no results. Please change your search criteria and try again. #2

Open SpurlockAnalytics opened 3 years ago

SpurlockAnalytics commented 3 years ago

I'm getting two errors when running for the first time, it prevents me from running apply. I've tried a few different variable configurations to no avail

| Error: Your query returned no results. Please change your search criteria and try again. │ │ with data.aws_ami.foundry_ami, │ on ec2.tf line 6, in data "aws_ami" "foundry_ami": │ 6: data "aws_ami" "foundry_ami" { │ │ Error: Your query returned no results. Please change your search criteria and try again. │ │ with data.aws_ebs_snapshot.latest_snapshot["www"], │ on ec2.tf line 15, in data "aws_ebs_snapshot" "latest_snapshot": │ 15: data "aws_ebs_snapshot" "latest_snapshot" {

scooper4711 commented 3 years ago

Yes, I updated the terraform to re-create the ec2 instance from a snapshot, but that assumes a snapshot is available. I'm rewriting this code to instead use packer to create the AMI. In the meanwhile, I can offer a workaround for you.

Copy the official AWS ec2 instance amzn2-ami-hvm-2.0.20210326.0-x86_64-gp2 (owner id is 063843753876). Give it a name that starts with foundryvtt, e.g. foundryvtt-base

If you want, you can ping me on Discord (Coop#7652) and I'll help you.

brebory commented 2 years ago

I had to use the following source_ami_filter settings to get this to work:

source_ami_filter {
    filters = {
      name                = "amzn2-ami-hvm-2.0.*.0-x86_64-gp2"
      root-device-type    = "ebs"
      virtualization-type = "hvm"
    }
    most_recent = true
    owners      = ["137112412989"]
  }

Has the owner id for the official EC2 images changed? When I used aws ec2 describe-images. the owner id for amazon owned images is always "137112412989"

SpurlockAnalytics commented 2 years ago

hey guys, checkout my fork, I have built out the packer functionality and updated the readme: https://github.com/SpurlockAnalytics/foundryvtt-terraform