Rickard,

I appreciate all your help. 

We've determined, after all this, that we can use the Amazon Linux 2 AMI 
without modification unlike the Centos 7 AMIs which require the addition of 
enhanced networking drivers.

I hope something in this thread is helpful to the next person.

Greg

On Thursday, July 11, 2019 at 1:32:16 PM UTC-6, Rickard von Essen wrote:
>
> Don't really know why you get this problem, this works for me:
>
> $ cat template.json
> {
>   "builders": [{
>     "type": "amazon-ebs",
>     "region": "us-east-1",
>     "source_ami": "ami-0b898040803850657",
>     "instance_type": "t2.micro",
>     "ssh_username": "ec2-user",
>     "ami_name": "REDACTED"
>   }]
> }
> $ packer version
> Packer v1.4.3-dev (39076f82e+CHANGES)
> $ env AWS_PROFILE=packer-demo packer build --force template.json
> amazon-ebs output will be in this color.
>
> ==> amazon-ebs: Force Deregister flag found, skipping prevalidating AMI 
> Name
>     amazon-ebs: Found Image ID: ami-0b898040803850657
> ==> amazon-ebs: Creating temporary keypair: 
> packer_5d277b09-f8c4-1256-af38-998b9f3cc52b
> ==> amazon-ebs: Creating temporary security group for this instance: 
> packer_5d277b0b-65bf-5d08-1a2f-e63c32edd759
> ==> amazon-ebs: Authorizing access to port 22 from [0.0.0.0/0] in the 
> temporary security groups...
> ==> amazon-ebs: Launching a source AWS instance...
> ==> amazon-ebs: Adding tags to source instance
>     amazon-ebs: Adding tag: "Name": "Packer Builder"
>     amazon-ebs: Instance ID: i-0f5e792c4b313ab4f
> ==> amazon-ebs: Waiting for instance (i-0f5e792c4b313ab4f) to become 
> ready...
> ==> amazon-ebs: Using ssh communicator to connect: 52.90.41.137
> ==> amazon-ebs: Waiting for SSH to become available...
> ==> amazon-ebs: Connected to SSH!
> ==> amazon-ebs: Stopping the source instance...
>     amazon-ebs: Stopping instance
> ==> amazon-ebs: Waiting for the instance to stop...
> ==> amazon-ebs: Deregistered AMI REDACTED, id: ami-08cbc649096e89485
> ==> amazon-ebs: Creating AMI REDACTED from instance i-0f5e792c4b313ab4f
>     amazon-ebs: AMI: ami-048281d412997f871
> ==> 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-048281d412997f871
>
> I suggest that you remove most things from your template or start with 
> mine above and add thinks, and rebuild until you find what change 
> introduces the error.
>
> On Thu, Jul 11, 2019 at 7:29 PM Greg Coit <[email protected] 
> <javascript:>> wrote:
>
>> Good suggestion.  Unfortunately, I'm getting the same error still.  
>> Here's the json file:
>>
>> {
>>   "variables": {
>>     "aws_access_key_id": "",
>>     "aws_secret_access_key": ""
>>   },
>>   "builders": [{
>>     "type": "amazon-ebs",
>>     "access_key": "{{user `aws_access_key_id`}}",
>>     "secret_key": "{{user `aws_secret_access_key`}}",
>>     "region": "us-east-1",
>>     "vpc_id": "REDACTED",
>>     "subnet_id": "REDACTED",
>>     "source_ami": "ami-0b898040803850657",
>>     "instance_type": "t2.micro",
>>     "ssh_username": "ec2-user",
>>     "ami_name": "REDACTED",
>>     "ami_description": "REDACTED",
>>     "ami_regions": [
>>       "us-east-1",
>>       "us-west-1",
>>       "us-west-2",
>>       "ap-northeast-1",
>>       "ap-southeast-1",
>>       "ap-southeast-2",
>>       "eu-west-1",
>>       "sa-east-1"
>>     ],
>>     "ami_users": [
>>       "REDACTED"
>>     ]
>>   }],
>>   "provisioners":[
>>     {
>>     "type": "shell",
>>     "inline": [
>>       "sleep 30"
>>       ]
>>     },
>>     {
>>     "type": "shell",
>>     "script": "01_system_repos_and_kernels.sh"
>>     },
>>     {
>>     "type": "shell",
>>     "inline": [
>>       "sudo /sbin/reboot"
>>       ]
>>     },
>>     {
>>     "type": "shell",
>>     "pause_before": "30s",
>>     "script": "02_userland_packages.sh"
>>     },
>>     {
>>     "type": "shell",
>>     "inline": [
>>       "sudo /sbin/reboot"
>>       ]
>>     },
>>     {
>>     "type": "shell",
>>     "pause_before": "30s",
>>     "scripts": [
>>       "91_cleanup.sh"
>>       ]
>>     }
>>   ]
>> }
>>  
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/88fc8c5e-3940-4f49-b0b7-d454206cd2fd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/88fc8c5e-3940-4f49-b0b7-d454206cd2fd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/d90cc4c1-3c4e-41dc-af80-cd77b48d6ae0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to