My Python version is 3.9 and I am writing a AWS lambda function using boto3
In addition to assigning all admin access and s3full and datasync full roles, I also created a trust relationship but still receive the following error.
I wonder if anyone has experienced the same issue and solved it.
"errorMessage": "An error occurred (InvalidRequestException) when calling the CreateTask operation: Invalid parameter: ARN account () must match authenticated user.",
import json
import logging
import sys
import boto3
from botocore.exceptions import ClientError
logger = logging.getLogger(__name__)
client = boto3.client('datasync', region_name='us-east-1')
create_location_s3 = client.create_location_s3(
Subdirectory='/',
S3BucketArn='arn:aws:s3:::data-sync-bucket',
S3StorageClass='STANDARD',
S3Config={
'BucketAccessRoleArn': 'arn:aws:iam::XXXX:role/datasync-data-sync-bucket-ARN'
},
AgentArns=[
'',
],
Tags=[
{
'Key': 'name',
'Value': 'datasync-lambda'
},
]
)
I think your error is more related to datasync than IAM or Lambda.
Please go through below links eventhough they are not going to help. https://githubmemory.com/repo/hashicorp/terraform/issues/29593
https://issueexplorer.com/issue/hashicorp/terraform/29593
I would recommend if you have aws support subscription then they can help you better for this issue. else you can go through the documentation provided by AWS on datasync in this link https://docs.aws.amazon.com/datasync/latest/userguide/sync-dg.pdf