Skip to content

Instantly share code, notes, and snippets.

@cben
Created July 18, 2018 07:49
Show Gist options
  • Save cben/2ab1200592153c4fff64fd63bc77c6ef to your computer and use it in GitHub Desktop.
Save cben/2ab1200592153c4fff64fd63bc77c6ef to your computer and use it in GitHub Desktop.
CentOS non-marketplace image AuthFailure

This was what I got for trying to run non-marketplace image per https://wiki.centos.org/Cloud/AWS:

| CentOS Linux 7 | 1801_01 | 2018-Jan-14 | us-east-1 | ami-4bf3d731 | x86_64 | HVM |

Note that "aws_access_key": null, and "aws_secret_key": null, are not the problem. They're not passed explicitly as module params but the module finds them in ~/.aws/credentials, and this worked later for a marketplace image.

fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"assign_public_ip": true,
"aws_access_key": null,
"aws_secret_key": null,
"count": 1,
"count_tag": "{'Name': 'ami_base'}",
"ebs_optimized": false,
"ec2_url": null,
"exact_count": 1,
"group": [
"default"
],
"group_id": null,
"id": null,
"image": "ami-4bf3d731",
"instance_ids": null,
"instance_initiated_shutdown_behavior": null,
"instance_profile_name": null,
"instance_tags": {
"Name": "ami_base"
},
"instance_type": "m4.xlarge",
"kernel": null,
"key_name": "myuser_key",
"monitoring": false,
"network_interfaces": null,
"placement_group": null,
"private_ip": null,
"profile": null,
"ramdisk": null,
"region": "us-east-1",
"security_token": null,
"source_dest_check": true,
"spot_launch_group": null,
"spot_price": null,
"spot_type": "one-time",
"spot_wait_timeout": "600",
"state": "present",
"tenancy": "default",
"termination_protection": null,
"user_data": null,
"validate_certs": true,
"volumes": [
{
"delete_on_termination": true,
"device_name": "/dev/sda1",
"volume_size": 100,
"volume_type": "gp2"
},
{
"delete_on_termination": true,
"device_name": "/dev/sdb",
"volume_size": 100,
"volume_type": "gp2"
}
],
"vpc_subnet_id": "subnet-04c36c12113097903",
"wait": true,
"wait_timeout": "300",
"zone": null
}
},
"msg": "Instance creation failed => AuthFailure: Not authorized for images: [ami-4bf3d731]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment