Reputation: 1940
I'm following this tutorial https://aws.amazon.com/articles/4926593393724923
to create and launch a simple spark cluster, Im interested in using spark streaming and kinesis so i created a role with the following policy
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "cloudwatch:",
"Effect": "Allow",
"Resource": ""
},
{
"Effect": "Allow",
"Action": "kinesis:",
"Resource": ""
},
{
"Effect": "Allow",
"Action": "sns:",
"Resource": ""
},
{
"Effect": "Allow",
"Action": "s3:",
"Resource": ""
}
]
}
And i get this error when running the --create command from the cli
ruby elastic-mapreduce --create --alive --name "Spark-
Kinesis" --bootstrap-action s3://elasticmapreduce/samples/spark/0.8.1/install-s
park-shark.sh --bootstrap-name "Spark/Shark" --instance-type m1.xlarge --instan
ce-count 3 --jobflow-role spark
Error: Credential should be scoped to a valid region, not 'us-west-2'.
emr-cli/aws/core/client.rb:368:in return_or_raise'
emr-cli/aws/core/client.rb:469:in
client_request'
(eval):3:in get_instance_profile'
emr-cli/iam_client_wrapper.rb:69:in
instance_profile_exists?'
emr-cli/commands.rb:1190:in validate'
emr-cli/commands.rb:45:in
block in validate'
emr-cli/commands.rb:45:in each'
emr-cli/commands.rb:45:in
validate'
emr-cli/commands.rb:2420:in create_and_execute_commands'
emr-cli/elastic-mapreduce-cli.rb:13:in
'
Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require'
Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
elastic-mapreduce:6:in `'
The region for my key-pair is us-west-2, so im not sure whats going wrong.
Upvotes: 1
Views: 899
Reputation: 5811
Try this in us-east-1
. If it works, it means you are using the AWS client which still has the problem where they used the target region for IAM as well. IAM only supports requests scoped to us-east-1
.
I believe there was a fix to this problem: https://github.com/aws/aws-sdk-ruby/issues/508
Upvotes: 0