I was launching the AWS EC2 from custom AMI named as 'test-ami' using terraform .But i was getting below error for the same .As in the main.tf file first custom ami would be created from known server passing source_instance_id , and then ec2 would be created from this custom AMI .Error is
Error: Error launching source instance: InvalidAMIID.Malformed: Invalid id: "test-ami.id" (expecting "ami-...") status code: 400, request id: 1afd98e1-9d5a-4b1e-b81b-beb24c3da789
on main.tf line 31, in resource "aws_instance" "test-server3": 31: resource "aws_instance" "test-server3" {
Can we created ec2 via custom AMI name as AMI ID is not known to me ?