Skip to content

How do I troubleshoot "S3 write failed for bucket" 403 Access Denied errors from Amazon S3 when creating resource data sync for Systems Manager inventory?

3 minute read
0

I want to troubleshoot 403 Access Denied errors from Amazon Simple Storage Service (Amazon S3) when creating a resource data sync.

Resolution

To resolve a "S3 write failed for bucket" error, use one of the following methods to configure resource data sync for AWS Systems Manager inventory:

  • Create a resource data sync for multiple accounts within the same organization.
  • Create a resource data sync for multiple accounts that aren't within the same organization.

Resolve "S3 write failed" errors for multiple accounts within the same organization

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

Make sure that the central Amazon S3 bucket policy has the required permissions to allow multiple AWS accounts to send inventory data to the bucket. The following example policy includes the necessary permissions:

{
  "Version":"2012-10-17",
  "Statement": [
    {
      "Sid": "SSMBucketPermissionsCheck",
      "Effect": "Allow",
      "Principal": {
        "Service": "ssm.amazonaws.com"
      },
      "Action": "s3:GetBucketAcl",
      "Resource": "arn:aws:s3:::example-bucket-name"
    },
    {
      "Sid": " SSMBucketDelivery",
      "Effect": "Allow",
      "Principal": {
        "Service": "ssm.amazonaws.com"
      },
      "Action": "s3:PutObject",
      "Resource": [
        "arn:aws:s3:::example-bucket-name/example-prefix-name/*/accountid=*/*"
      ],
      "Condition": {
        "StringEquals": {
          "s3:x-amz-acl": "bucket-owner-full-control",
          "aws:SourceOrgID": "example-organization-id"
                  }
      }
    },
    {
      "Sid": " SSMBucketDeliveryTagging",
      "Effect": "Allow",
      "Principal": {
        "Service": "ssm.amazonaws.com"
      },
      "Action": "s3:PutObjectTagging",
      "Resource": [
        "arn:aws:s3:::example-bucket-name/example-prefix-name/*/accountid=*/*"
      ]
    }
  ]
}

Note: Replace example- values with your values.

You can't create a resource data sync from the AWS Management Console when the resource data sync is for multiple accounts within the same organization.

To create a resource data sync for multiple accounts within the same organization, run the following CreateResourceDataSync API call in AWS CLI. Be sure to specify the DestinationDataSharing parameter:

aws ssm create-resource-data-sync --sync-name example-name --s3-destination "BucketName=example-bucket-name,Prefix=example-prefix-name,SyncFormat=JsonSerDe,Region=example-region-id,DestinationDataSharing={DestinationDataSharingType=Organization}"

Note: Replace example- values with your values.

To confirm that you included the DestinationDataSharing parameter, in AWS CloudTrail, check the API request for the CreateResourceDataSync event name.

Resolve "S3 write failed" for multiple accounts that aren't within the same organization

To create a resource data sync, confirm that the S3 bucket policy of the target S3 bucket allows the required actions from the source account.

For example, you have Account A and Account B sending the inventory data to an S3 bucket in Account C.

The S3 bucket policy in Account C is similar to the following example policy:

{           
    "Version": "2012-10-17",  
    "Statement": [  
        {  
            "Sid": "SSMBucketPermissionsCheck",  
            "Effect": "Allow",  
            "Principal": {  
                 "Service": "ssm.amazonaws.com"    
            },  
            "Action": "s3:GetBucketAcl",  
            "Resource": "arn:aws:s3:::example-bucket-name"  
         },  
         {  
             "Sid": "SSMBucketDelivery",  
             "Effect": "Allow",  
             "Principal": {  
                 "Service": "ssm.amazonaws.com"  
             },  
             "Action": "s3:PutObject",  
             "Resource": [  
                 "arn:aws:s3:::example-bucket-name/*/accountid=example-account-a-id/*",  
                 "arn:aws:s3:::example-bucket-name/*/accountid=example-account-b-id/*"  
           ],  
           "Condition": {  
               "StringEquals": {  
                   "aws:SourceAccount": [  
                       "example-account-a-id",  
                       "example-account-b-id"  
                    ],  
                    "s3:x-amz-acl": "bucket-owner-full-control"  
                },  
                "ArnLike": {  
                   "aws:SourceArn": [  
                        "arn:aws:ssm:*:example-account-a-id:resource-data-sync/*",  
                        "arn:aws:ssm:*:example-account-b-id:resource-data-sync/*"  
                   ]  
                }  
           }  
        }  
   ]  
}  

Note: Replace example- values with your values.

To encrypt the resource data sync, be sure to update the AWS Key Management Service (AWS KMS) key policy and S3 bucket policy. For more information, see Walkthrough: Use resource data sync to aggregate inventory data.

AWS OFFICIALUpdated a month ago
3 Comments

Ran into the same issue. Following the steps in this article hasn't helped. The solution in my case was to grant also s3:PutObjectTagging in the policy, in a separate block without the s3:x-amz-acl condition.

replied 2 years ago

Missing s3:PutObjectTagging Permission for Organizations-based Sync

The bucket policy example in this article is missing the s3:PutObjectTagging permission for Organizations-based resource data sync.

Solution: Add the following statement to the bucket policy:

{
    "Sid": "SSMBucketDeliveryTagging",
    "Effect": "Allow",
    "Principal": {
        "Service": "ssm.amazonaws.com"
    },
    "Action": "s3:PutObjectTagging",
    "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*/accountid=*/*"
}

⚠️ Important: Do NOT include the s3:x-amz-acl condition on this statement - that condition is only valid for s3:PutObject, not for tagging operations.

Reference: The main documentation has been updated with the correct policy: https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-create-resource-data-sync.html#systems-manager-inventory-resource-data-sync-AWS-Organizations

replied a month ago

This article was reviewed and updated on 2026-10-16.

EXPERT

replied 25 days ago