CreateResourceDataSync - AWS Systems Manager

CreateResourceDataSync

A resource data sync helps you view data from multiple sources in a single location. AWS Systems Manager offers two types of resource data sync: SyncToDestination and SyncFromSource.

You can configure Systems Manager Inventory to use the SyncToDestination type to synchronize Inventory data from multiple AWS Regions to a single Amazon Simple Storage Service (Amazon S3) bucket. For more information, see Configuring resource data sync for Inventory in the AWS Systems Manager User Guide.

You can configure Systems Manager Explorer to use the SyncFromSource type to synchronize operational work items (OpsItems) and operational data (OpsData) from multiple AWS Regions to a single Amazon S3 bucket. This type can synchronize OpsItems and OpsData from multiple AWS accounts and AWS Regions or EntireOrganization by using AWS Organizations. For more information, see Setting up Systems Manager Explorer to display data from multiple accounts and Regions in the AWS Systems Manager User Guide.

A resource data sync is an asynchronous operation that returns immediately. After a successful initial sync is completed, the system continuously syncs data. To check the status of a sync, use the ListResourceDataSync.

Note

By default, data isn't encrypted in Amazon S3. We strongly recommend that you enable encryption in Amazon S3 to ensure secure data storage. We also recommend that you secure access to the Amazon S3 bucket by creating a restrictive bucket policy.

Request Syntax

{ "S3Destination": { "AWSKMSKeyARN": "string", "BucketName": "string", "DestinationDataSharing": { "DestinationDataSharingType": "string" }, "Prefix": "string", "Region": "string", "SyncFormat": "string" }, "SyncName": "string", "SyncSource": { "AwsOrganizationsSource": { "OrganizationalUnits": [ { "OrganizationalUnitId": "string" } ], "OrganizationSourceType": "string" }, "EnableAllOpsDataSources": boolean, "IncludeFutureRegions": boolean, "SourceRegions": [ "string" ], "SourceType": "string" }, "SyncType": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

S3Destination

Amazon S3 configuration details for the sync. This parameter is required if the SyncType value is SyncToDestination.

Type: ResourceDataSyncS3Destination object

Required: No

SyncName

A name for the configuration.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

SyncSource

Specify information about the data sources to synchronize. This parameter is required if the SyncType value is SyncFromSource.

Type: ResourceDataSyncSource object

Required: No

SyncType

Specify SyncToDestination to create a resource data sync that synchronizes data to an S3 bucket for Inventory. If you specify SyncToDestination, you must provide a value for S3Destination. Specify SyncFromSource to synchronize data from a single account and multiple Regions, or multiple AWS accounts and AWS Regions, as listed in AWS Organizations for Explorer. If you specify SyncFromSource, you must provide a value for SyncSource. The default value is SyncToDestination.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

ResourceDataSyncAlreadyExistsException

A sync configuration with the same name already exists.

HTTP Status Code: 400

ResourceDataSyncCountExceededException

You have exceeded the allowed maximum sync configurations.

HTTP Status Code: 400

ResourceDataSyncInvalidConfigurationException

The specified sync configuration is invalid.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of CreateResourceDataSync.

Sample Request

POST / HTTP/1.1 Host: ssm.us-east-2.amazonaws.com Accept-Encoding: identity X-Amz-Target: AmazonSSM.CreateResourceDataSync Content-Type: application/x-amz-json-1.1 User-Agent: aws-cli/1.17.12 Python/3.6.8 Darwin/18.7.0 botocore/1.14.12 X-Amz-Date: 20200327T173437Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20200327/us-east-2/ssm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE Content-Length: 186 { "SyncName": "Example", "S3Destination": { "BucketName": "exampleBucket", "Prefix": "exampleSubDirectory", "SyncFormat": "JsonSerDe", "Region": "us-east-2" }, "SyncType": "SyncToDestination" }

Sample Response

{}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: