amazon-ssm-agent icon indicating copy to clipboard operation
amazon-ssm-agent copied to clipboard

Output to S3 in GovCloud

Open HewittJC opened this issue 7 years ago • 2 comments

I have been unable to get the SSM agent to write output to our S3 buckets. I have tried many combinations of permissions attached to the instances themselves as well as several bucket policies. All to no avail. I have looked at the logs of the SSM agent and I only see that the upload failed due to a 403 error but it does not say what exactly I am lacking.

I have searched high and low to try to find the proper permissions configuration that I need in order to allow my SSM agents to write to S3 and there seems to be little to no documentation on the matter. I am using the us-gov-west-1 region and I suspect that may be part of the issue but I am unsure.

Here is the actual output from the SSM log:

2019-01-28 17:14:32 ERROR [ssm-document-worker] [xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx] [DataBackend] [pluginName=aws:runShellScript] Failed uploading /var/lib/amazon/ssm/i-xxxxxxxxxxxxxxxxx/document/orchestration/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/awsrunShellScript/PatchLinux/stdout to s3://ssmoutput/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/i-xxxxxxxxxxxxxxxxx/awsrunShellScript/PatchLinux/stdout err:AccessDenied: Access Denied
        status code: 403, request id: Dxxxxxx9, host id: 9xxxxxxxxxxD/LxxxxxxY=

HewittJC avatar Jan 28 '19 17:01 HewittJC

Hi @HewittJC, can you check in the amazon agent logs to see if your output s3 bucket is the same as the one you pass in as parameter? We are investigate an issue that may be related where the s3 bucket path is getting transformed in gov-cloud for some reason.

Also, make sure to check the IAM role that the agent is using has correct permission to s3.

hiimtu avatar Jul 02 '19 21:07 hiimtu

Hi @HewittJC, please update to the latest agent. If you are still seeing this issue in the latest agent, please let us know and open a new issue.

hiimtu avatar Aug 19 '19 20:08 hiimtu