I am making cloud9 by terraform according to the article here
However this code shows the error like this
│ Error: Your query returned no results. Please change your search criteria and try again. │ │ with module.cloud9.data.aws_ami.cloud9_ami, │ on ../../cloud9/main.tf line 1, in data "aws_ami" "cloud9_ami": │ 1: data "aws_ami" "cloud9_ami" {
I think this means there is not appropriate AMI.
How can I fix this ?
data "aws_ami" "cloud9_ami" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["aws-cloud9-*-x86_64"] # Adjust pattern based on desired Cloud9 AMI
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
}
resource "aws_cloud9_environment_ec2" "my_cloud9_environment" {
name = "my-cloud9-env"
instance_type = "t2.micro"
image_id = data.aws_ami.cloud9_ami.id
owner_arn = "arn:aws:iam::123456789012:user/your-user"
automatic_stop_time_minutes = 60
}