I've created a Glue Job and am using the boto3 Sagemaker client to create a Sagemaker processing job. For one of my processing inputs I need to use an query results from an Athena table. I'm receiving an error saying that the table is not located in the same region as the Processing Job. I've made sure to create my boto3 session in the correct region 'us-east-1'
session = boto3.session.Session(region_name='us-east-1')
and I've verified that the S3 bucket, and Athena table are in fact in the 'us-east-1' region. I have also been able to successfully create a processing job without the input03, and that processing job gets created in 'us-east-1'. So if the bucket and processing job are both in 'us-east-1', then this error might be getting generated because of insufficient permissions, and is giving the wrong error message.
Here is the policy regarding s3 permissions:
And the processing input 'input03':
ProcessingInputs=[
{
'InputName': 'input03',
'DatasetDefinition': {
'AthenaDatasetDefinition': {
'Catalog': data_catalog,
'Database': database,
'QueryString': f'select * from {table} limit 10',
'WorkGroup': 'primary',
'OutputS3Uri': f's3://{s3bucket}/sagemaker/results',
'OutputFormat': 'TEXTFILE'
},
'LocalPath': f'/opt/ml/processing/input/',
'DataDistributionType': 'FullyReplicated',
'InputMode': 'File'
}
}
]
Full error message: ClientError: An error occurred (ValidationException) when calling the CreateProcessingJob operation: S3 bucket "bucket-name" given in input data source "input03" is not in the same region as Processing job. Please ensure that the bucket exists in the selected region (us-east-1) Error message from S3: Access Denied.
Has anyone else encountered this error and found a solution?