yzpilot
yzpilot

Reputation: 1

ssm-agent trying to write to wrong region

When I execute aws SSM-Agent send-command on an instance, the SSM-Agent tries to write the results to an S3 bucket in another region.

How do I specify what region the target S3 bucket is in?

Here's the command and error I'm currently getting.

Execute the following from server A: aws ssm send-command --document-name "AWS-RunShellScript" --document-version "1" --targets '[{"Key":"InstanceIds","Values":[""]}]' --parameters '{"workingDirectory":[""],"executionTimeout":["3600"],"commands":["ps ax"]}' --timeout-seconds 600 --max-concurrency "50" --max-errors "0" --output-s3-bucket-name "" --region us-east-1

And the log on server B shows:

Failed uploading /var/lib/amazon/ssm/<my-instance>/document/orchestration/<command-id>/awsrunShellScript/0.awsrunShellScript/stdout to s3://<my-bucket>/<command-id>/<my-instance>/awsrunShellScript/0.awsrunShellScript/stdout err:BucketRegionError: incorrect region, the bucket is not in 'eu-west-1' region

I don't have any resources in eu-west-1

Upvotes: 0

Views: 564

Answers (1)

Chris Williams
Chris Williams

Reputation: 35238

Use argument --output-s3-region

https://docs.aws.amazon.com/cli/latest/reference/ssm/send-command.html

Upvotes: 0

Related Questions