Stop source/destination check of an Instance

I am calling a global role in the main file to spin up an ec2 instance in the aws then i want to use local role to stop the source/destination check for that instance. I am not finding a way to do it using any of the ansible module. Could you please suggest me the module if there is any module. The error i get is

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.NoCredentialsError: Unable to locate credentials
fatal: [localhost → 54.149.210.58]: FAILED! => {“boto3_version”: “1.28.11”, “botocore_version”: “1.31.11”, “changed”: false, “msg”: “Failed to get vpc_id for subnet-A1B2c34: Unable to locate credentials”}

I used amazon.aws.ec2_instance, amazon.aws.ec2_eni and command as well in below mentioned way;

  • name: Stop Source/Destination Check for EC2 instance
    become: true
    command: “aws ec2 modify-instance-attribute --instance-id {{ instance_id }} --no-source-dest-check”
    One thing to be noted is the ansible-server and the new server which i am deploying are in the same subnet. Also the ansible-server has admin access.