Skip to content

Redshift problem when creating external schema

0

When I was trying to create external schema, there is an error of unauthorization.

create external schema eth
from data catalog
database 'eth' 
iam_role 'arn:aws:iam::***:role/service-role/AmazonRedshift-CommandsAccessRole-***'
create external database if not exists;

The error appears like this:

ERROR: Unknown std exception when calling external catalog API: ----------------------------------------------- error: exception name : UnauthorizedException, error type : 136, message: Not authorized to get credentials of role arn:aws:iam:::role/service-role/AmazonRedshift-CommandsAccessRole-, should retry : 0 code: 30000 context: query: -1[child_sequence:1] location: xen_aws_credentials_mgr.cpp:613 process: padbmaste*r [pid=1073783024] ----------------------------------------------- [ErrorId: 1-66549971-2b6981ba2c76f75314dc246c]

I have tried updating trust policy, but the error remains. Please help to solve this problem.

1 Answer
0

Hello Yuze, hope you're doing good.

I noticed you're using DATA CATALOG in paramenter. Could you please check it?

"DATA CATALOG indicates that the external database is defined in the Athena data catalog or the AWS Glue Data Catalog. If the external database is defined in an external Data Catalog in a different AWS Region, the REGION parameter is required. DATA CATALOG is the default.

"IF NOT EXISTS A clause that indicates that if the specified schema already exists, the command should make no changes and return a message that the schema exists, rather than terminating with an error. This clause is useful when scripting, so the script doesn't fail if CREATE EXTERNAL SCHEMA tries to create a schema that already exists." https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_SCHEMA.html#r_CREATE_EXTERNAL_SCHEMA-parameters

Please accept this answer if it is helpful to you

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.