The new AMI is Building But Not Visible Using describe-images. Any ideas?

13 views
Skip to first unread message

David Medinets

unread,
Aug 12, 2019, 9:51:38 PM8/12/19
to Packer
I am using the following JSON file to build an AMI which should be a copy of the Amazon Linux 2 AMI. The messages say the new AMI is built but it is not found when using describe-images - even five minutes later. I am passing the AWS credentials using the AWS_PROFILE env variable.

The process seems dead simple. What am I doing wrong?

-- example.json --
{
  "variables": {
    "aws_access_key": "",
    "aws_secret_key": ""
  },
  "builders": [{
    "type": "amazon-ebs",
    "access_key": "{{user `aws_access_key`}}",
    "secret_key": "{{user `aws_secret_key`}}",
    "region": "us-east-1",
    "source_ami": "ami-0b898040803850657",
    "instance_type": "t2.micro",
    "ssh_username": "ec2-user",
    "ami_name": "dmm-packer-example-{{timestamp}}"
  }]
}

The output from is:

-- packer build example.json --
amazon-ebs output will be in this color.

==> amazon-ebs: Prevalidating AMI Name...
    amazon-ebs: Found Image ID: ami-0b898040803850657
==> amazon-ebs: Creating temporary keypair: packer_5d52168d-886b-7207-f14a-79d068c30677
==> amazon-ebs: Creating temporary security group for this instance: packer_5d52168e-2e7b-01b3-b40a-b3461f6d2e04
==> amazon-ebs: Authorizing access to port 22 on the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
    amazon-ebs: Instance ID: i-080c2485a8759a2c7
==> amazon-ebs: Waiting for instance (i-080c2485a8759a2c7) to become ready...
==> amazon-ebs: Adding tags to source instance
    amazon-ebs: Adding tag: "Name": "Packer Builder"
==> amazon-ebs: Waiting for SSH to become available...
==> amazon-ebs: Connected to SSH!
==> amazon-ebs: Stopping the source instance...
    amazon-ebs: Stopping instance, attempt 1
==> amazon-ebs: Waiting for the instance to stop...
==> amazon-ebs: Creating the AMI: dmm-packer-example-1565660813
    amazon-ebs: AMI: ami-0b1ff7d63a5da8f06
==> amazon-ebs: Waiting for AMI to become ready...
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' finished.

==> Builds finished. The artifacts of successful builds are:
--> amazon-ebs: AMIs were created:

us-east-1: ami-0b1ff7d63a5da8f06

-- aws ec2 describe-images --region us-east-1 --image-ids ami-0b1ff7d63a5da8f06
{
    "Images": []
}

Rickard von Essen

unread,
Aug 13, 2019, 12:21:27 PM8/13/19
to packe...@googlegroups.com
This is 99% sure a permission issue with the credentials you are using to run the aws cli. Double check that. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/52728485-195c-47af-9576-d6aae04e312c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages