Deploying an ec2 instance without using aws secret access key and aws access key id

137 Views Asked by At

My workstation and server are both RHEL ec2 instances and whenever I run the command:-

knife ec2 server create -r “role[----------]” -I ami-XXXXXXXX -f t2.small -S knife -i ~/.ssh/XXXXXXXXXXX.ppk –ssh-user ec2-user –region us-east-1 -Z us-east-1a

I am getting the error as ERROR: You did not provide a valid ‘AWS Access Key Id’ value. ERROR: You did not provide a valid ‘AWS Secret Access Key’ value.

Nor I want to use the secret access key and access key id and neither I want to save them on the workstation. Is there any other way to deploy a new ec2 instance(node) ,perhaps using IAM role . thank you

1

There are 1 best solutions below

1
On

AFAIK we don't support role credentials in knife-ec2, you'll have to use something else to start the machine (like the aws command line). Once created, you can use knife bootstrap to set up Chef.