Troubleshooting AWS IAM permissions in CDP Public Cloud
Error: Failed to create HDFS directory., Command [CreateRangerAuditDir], with id [1546333865] failed: Failed to create HDFS directory s3a://<bucketname>/data/ranger/audit/hdfs., Command [RangerPluginCreateAuditDir].
To get to the root cause of the issue, check the S3 permissions on the IAM role. If you want to further troubleshoot, then you can assume the role from the ID Broker's instance profile and use AWS CLI to reproduce and troubleshoot the issue. To do this, use the following troubleshooting steps:
- Log in to the ID broker host as a Cloudbreak user using the pem file provided during the environment build
- Download this script
wget https://raw.githubusercontent.com/karthikeyanvijay/cdp-publiccloud/main/aws/scripts/get-dladmin-access.sh
chmod u+x get-dladmin-access.sh - Modify the role_arn in the script to point to the data lake admin role
- Execute the script
The temporary AWS credentials for the role are now exported to the AWS profile dladmin./get-dladmin-access.sh - Use the AWS CLI to troubleshoot S3 IAM issues
You should now be able to reproduce the same error that occurred during the CDP deployment using AWS CLI.aws s3 -cp sample.txt s3://<bucketname-path>/<path> --profile dladmin - You can now tweak the permissions and come up with the right IAM permissions for the role. Resume the CDP deployment after fixing the permission issues.
Conclusion
Using the above process, you can accelerate troubleshooting and help narrow down permission issues. The example above shows troubleshooting issues with the data lake admin role, but the same process can be used to troubleshoot any AWS IAM roles.
-------------
Vijay Anand Karthikeyan

