Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer AWS build failed with AuthFailure #2166

Closed
sourav82 opened this issue Jun 3, 2015 · 3 comments
Closed

Packer AWS build failed with AuthFailure #2166

sourav82 opened this issue Jun 3, 2015 · 3 comments

Comments

@sourav82
Copy link

sourav82 commented Jun 3, 2015

I was trying to build AMI using below 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-9eaa1cf6",
    "instance_type": "t2.micro",
    "ssh_username": "ubuntu",
    "ami_name": "packer-example {{timestamp}}"
  }],
  "provisioners": [{
    "type": "shell",
    "inline": [
      "sleep 30",
      "sudo apt-get update",
      "sudo apt-get install -y redis-server"
    ]
  }]
}

Executing below command to build it -

packer build -var 'aws_access_key=xxxx' -var 'aws_secret_key=xxxx' /EBS/packer-templates/EC2.json

But always getting error --

==> amazon-ebs: Error querying AMI: AuthFailure: AWS was not able to validate the provided access credentials
==> amazon-ebs: status code: 401, request id: []
Build 'amazon-ebs' errored: Error querying AMI: AuthFailure: AWS was not able to validate the provided access credentials
status code: 401, request id: []

Could anyone please help why I'm getting these error? I'm providing valid access key and secret key.

@sethvargo
Copy link
Contributor

Hi @sourav82

Thank you for opening an issue. We recently did a large triage of Packer and fixed many issues but have not done a release yet. Could you please try building from master and see if this problem still exists? Thanks!

@sourav82
Copy link
Author

sourav82 commented Jun 4, 2015

@sethvargo Thanks for reply. I just built it (make dev) from master and tried but got the same issue.

Except the access key and secret key anything else do I need to provide (like user id/ password) to build image in AWS?

@sourav82
Copy link
Author

sourav82 commented Jun 5, 2015

Regret! Closing the issue. It was an issue of time drift at the server. After setting the time properly able to move ahead.

@sourav82 sourav82 closed this as completed Jun 5, 2015
@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants