AWS Systems Manager Resource Data Sync
This page shows how to write Terraform and CloudFormation for Systems Manager Resource Data Sync and write them securely.
aws_ssm_resource_data_sync (Terraform)
The Resource Data Sync in Systems Manager can be configured in Terraform with the resource name aws_ssm_resource_data_sync
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_ssm_resource_data_sync" "this" {
name = var.name
dynamic "s3_destination" {
for_each = var.s3_destination
content {
resource "aws_ssm_resource_data_sync" "test-datasync" {
name = "sandbox-aws-data-sync"
s3_destination {
bucket_name = aws_s3_bucket.test-bucket.bucket
region = aws_s3_bucket.test-bucket.region
Parameters
-
id
optional computed - string -
name
required - string -
s3_destination
list block-
bucket_name
required - string -
kms_key_arn
optional - string -
prefix
optional - string -
region
required - string -
sync_format
optional - string
-
Explanation in Terraform Registry
Provides a SSM resource data sync.
AWS::SSM::ResourceDataSync (CloudFormation)
The ResourceDataSync in SSM can be configured in CloudFormation with the resource name AWS::SSM::ResourceDataSync
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: "AWS::SSM::ResourceDataSync"
Properties:
BucketName: !Ref BucketName
BucketRegion: !Ref AWS::Region
SyncFormat: JsonSerDe
SyncName: DemoResourceDataSync
Type: AWS::SSM::ResourceDataSync
Properties:
SyncName: inventory-ssm-workshop
S3Destination:
BucketName: !Ref ResouceSyncBucket
BucketPrefix: inventory
Type: AWS::SSM::ResourceDataSync
Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html
Properties:
SyncName: !Ref 'SyncName'
Type: AWS::SSM::ResourceDataSync
Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html
Properties:
SyncName: !Ref 'SyncName'
Type: AWS::SSM::ResourceDataSync
Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html
Properties:
SyncName: !Ref 'SyncName'
"AWS::SSM::ResourceDataSync": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html",
"Properties": {
"KMSKeyArn": {
"Required": false,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html#cfn-ssm-resourcedatasync-kmskeyarn",
"AWS::SSM::ResourceDataSync": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html",
"Properties": {
"KMSKeyArn": {
"Required": false,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html#cfn-ssm-resourcedatasync-kmskeyarn",
"AWS::SSM::ResourceDataSync.S3Destination": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-resourcedatasync-s3destination.html",
"Properties": {
"KMSKeyArn": {
"Required": false,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-resourcedatasync-s3destination.html#cfn-ssm-resourcedatasync-s3destination-kmskeyarn",
"AWS::SSM::ResourceDataSync": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html",
"Properties": {
"KMSKeyArn": {
"Required": false,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html#cfn-ssm-resourcedatasync-kmskeyarn",
"AWS::SSM::ResourceDataSync": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html",
"Properties": {
"KMSKeyArn": {
"Required": false,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-resourcedatasync.html#cfn-ssm-resourcedatasync-kmskeyarn",
Parameters
-
S3Destination
optional - S3Destination -
KMSKeyArn
optional - String -
SyncSource
optional - SyncSource -
BucketName
optional - String -
BucketRegion
optional - String -
SyncFormat
optional - String -
SyncName
required - String -
SyncType
optional - String -
BucketPrefix
optional - String
Explanation in CloudFormation Registry
The
AWS::SSM::ResourceDataSync
resource creates, updates, or deletes a resource data sync for AWS Systems Manager. A resource data sync helps you view data from multiple sources in a single location. Systems Manager offers two types of resource data sync:SyncToDestination
andSyncFromSource
.You can configure Systems Manager Inventory to use the
SyncToDestination
type to synchronize Inventory data from multiple AWS Regions to a single Amazon S3 bucket. You can configure Systems Manager Explorer to use theSyncFromSource
type to synchronize operational work items (OpsItems) and operational data (OpsData) from multiple AWS Regions. This type can synchronize OpsItems and OpsData from multiple AWS accounts and Regions or from anEntireOrganization
by using AWS Organizations.A resource data sync is an asynchronous operation that returns immediately. After a successful initial sync is completed, the system continuously syncs data.
By default, data is not 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. For more information, see Configuring Inventory Collection and Setting Up Systems Manager Explorer to Display Data from Multiple Accounts and Regions in the AWS Systems Manager User Guide.
Important: The following Syntax section shows all fields that are supported for a resource data sync. The Examples section below shows the recommended way to specify configurations for each sync type. Please see the Examples section when you create your resource data sync.
Frequently asked questions
What is AWS Systems Manager Resource Data Sync?
AWS Systems Manager Resource Data Sync is a resource for Systems Manager of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Systems Manager Resource Data Sync?
For Terraform, the niveklabs/aws and ciwen3/OSCP source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the rajjeet/CloudformationStarters, aws-samples/aws-cloud-and-hybrid-operations-workshop and awslabs/aws-service-catalog-products source code examples are useful. See the CloudFormation Example section for further details.