I am automating AWS Datasync task execution for EFS-EFS across different regions. I have written a lambda code in python and want to start the execution of datasync task through CloudWatch event cron expression.
import boto3
client = boto3.client('datasync', region_name='us-west-2')
def lambda_handler(event,context):
response = client.start_task_execution(
TaskArn='arn:aws:datasync:us-west-2:7777777777:task/task-0ede5d4rd8a63338dfd8',
OverrideOptions={
'VerifyMode': 'POINT_IN_TIME_CONSISTENT'|'NONE',
'Atime': 'NONE'|'BEST_EFFORT',
'Mtime': 'NONE'|'PRESERVE',
'Uid': 'NONE'|'INT_VALUE'|'NAME'|'BOTH',
'Gid': 'NONE'|'INT_VALUE'|'NAME'|'BOTH',
'PreserveDeletedFiles': 'PRESERVE'|'REMOVE',
'PreserveDevices': 'NONE'|'PRESERVE',
'PosixPermissions': 'NONE'|'BEST_EFFORT'|'PRESERVE',
'BytesPerSecond': 123
},
)
I am facing error on the above lambda code in python. Could any please help me correct the above code?