The attached additional IAM role conflicts with the specified IAM credentials and AWS region

45 Views Asked by At

I have an EC2 instance in us-east-1 in US East (N. Virginia). The EC2 instance is attached with an IAM role (us-east-1 region) that has permission to run codedeploy. Now you need to run the CloudWatch log agent and codedeploy agent. CloudWatch log agent uploads logs to cloudwatch of us-gov-West-1. It requires configuring AWS CLI credentials. Modify the "/root/.aws/credentials" file to specify the IAM credentials and AWS region (us-gov-West-1), but codedeploy The agent needs to delete the "/root/.aws/credentials" file to connect to the console's codedeploy for deployment. How can I resolve this conflict?

I deleted the "/root/.aws/credentials" file, the codedeploy agent can connect to the codedeploy console for deployment, but the cloudwatch logs agent cannot upload the logs to the cloudwatch log group, I am in "/root/.aws/credentials" The file configuration can upload logs to the credentials of cloudwatch, but codedeploy cannot connect to the console for deployment.

I also configured multiple credentials, but the codedeploy agent will have conflicts and cannot connect to codedeploy

How to configure so that both codedeploy agent and cloudwatch logs agent work properly?

0

There are 0 best solutions below