I have a python app running in fargate ECS which sends emails. I have a verified SES in another account. I am trying to use these credentials in the python app , which runs in a different aws account than the verified SES. It uses the aws python sdk's ses module to create the boto3 ses object. The mailing works if I create a boto3 ses object within the main app , without using the sdk. But when I use the sdk it seems to be using the SES in the main account (which is sandboxed) although I pass the verified SES account's endpoint, access and secret access keys (these are stored as secure strings in my main account's parameter store).
What is the reason the sdk keeps using the main account's SES even if I supply it with credentials of the verified SES account? How can I fix this?