aws emr cli failed for InvalidRequestException

Viewed 883

I was able to run the create-cluster cli successfully and launched my EMR cluster, but when I tried to run below command to add a step:

aws emr add-steps --cluster-id j-your-cluster-id --steps Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://mybucket/mytest.jar,Args=arg1,arg2,arg3 Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://mybucket/mytest.jar,MainClass=mymainclass,Args=arg1,arg2,arg3 --profile my-test-account

it failed with this error:

An error occurred (InvalidRequestException) when calling the DescribeCluster operation: Cluster id 'j-your-cluster-id' is not valid.

and I've double checked j-your-cluster-id is matching my cluster-id exactly.

I feel like this is a permission issue, but how come the same profile could let me create a cluster, but cannot let me describe it?

How can I dig further and fix this please?

1 Answers

Based on the comments.

The issue was caused by execution AWS CLI in different region than intended. The solution was to use --region option to provide correct region for the CLI.

Related