Created 02-28-2017 06:58 AM
Hi,
I am trying to do something very basic in cloudbreak and am keep getting this error and hence I am wondering if someone can point me in right direction.
I am trying to add credentials in cloudbreak for cluster provisioning. So far I have done is that
This is how my role looks like { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "AWS": "${aws_iam_user.cloudbreak.arn}" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "provision-ambari" } } } ] }
CBD Shell Command credential create --AWS --name cloudbreak --roleArn "arn:aws:iam::xxxx:role/cloudbreak-access" --accessKey xxxxx --secretKey "xxxxxx" --sshKeyString "xxxxx" --publicInAccount true Command failed java.lang.RuntimeException: Failed to verify the credential: Could not verify credential [credential: 'cloudbreak'], detailed message: The 'AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY' environment variables must be set or an instance profile role should be available.
I have been stuck on this for few days now. Any help around this will be really appreciated.
Thanks & Regards,
Atul Aggarwal
Created 02-28-2017 03:45 PM
Hi @Atul Aggarwal,
You have 2 options: using key-based or role-based credentials.
Key-based credential:
export AWS_ACCESS_KEY_ID=AKIA**************W7SA export AWS_SECRET_ACCESS_KEY=RWCT4Cs8******************/*skiOkWD
cbd aws generate-role - Generates an AWS IAM role for Cloudbreak provisioning on AWS cbd aws show-role - Show assumers and policies for an AWS role cbd aws delete-role - Deletes an AWS IAM role, removes all inline policies
credential create --AWS --name cloudbreak --roleArn "arn:aws:iam::xxxx:role/cbreak-deployer" --sshKeyString "xxxxx" --publicInAccount true
If you use the roleArn for credential creation, you don't need to use the accesskey and secretkey in the command.
Role-based credential:
You can find the details in the documentation here:
http://sequenceiq.com/cloudbreak-docs/latest/aws/#configure-role-based-credentials
Created 02-28-2017 03:45 PM
Hi @Atul Aggarwal,
You have 2 options: using key-based or role-based credentials.
Key-based credential:
export AWS_ACCESS_KEY_ID=AKIA**************W7SA export AWS_SECRET_ACCESS_KEY=RWCT4Cs8******************/*skiOkWD
cbd aws generate-role - Generates an AWS IAM role for Cloudbreak provisioning on AWS cbd aws show-role - Show assumers and policies for an AWS role cbd aws delete-role - Deletes an AWS IAM role, removes all inline policies
credential create --AWS --name cloudbreak --roleArn "arn:aws:iam::xxxx:role/cbreak-deployer" --sshKeyString "xxxxx" --publicInAccount true
If you use the roleArn for credential creation, you don't need to use the accesskey and secretkey in the command.
Role-based credential:
You can find the details in the documentation here:
http://sequenceiq.com/cloudbreak-docs/latest/aws/#configure-role-based-credentials
Created 02-28-2017 08:59 PM
thanks @fschneider! I am trying to follow the steps you gave. It is almost what I did for role based credentials, except I didnt have assigned user the assume role policy. But I think hortonworks S3 is not working from past couple of hours for me to try it again after the recommendations.
This is giving me internal error.
curl -Ls s3.amazonaws.com/public-repo-1.hortonworks.com/HDP/cloudbreak/cloudbreak-deployer_1.6.3_$(uname)_x86_64.tgz
I will try when this will start working.
Thanks & Regards, Atul Aggarwal
Created 03-01-2017 10:04 PM
Thanks @fschneider! I was doing role based credentials and I was able to get around with error, but I had to put the access keys in the profile file. If I don't do it, I always get the error. From my previous steps I realized I forgot to add policy for the user
Thanks & Regards
Atul Aggarwal