Skip to content

create_resource_data_sync

create_resource_data_sync(
    sync_name: ResourceDataSyncName,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    s3_destination: Optional[ResourceDataSyncS3Destination] = None,
    sync_type: Optional[ResourceDataSyncType] = None,
    sync_source: Optional[ResourceDataSyncSource] = None,
) -> CreateResourceDataSyncResult

A resource data sync helps you view data from multiple sources in a single location. Amazon Web Services 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 Amazon Web Services Regions to a single Amazon Simple Storage Service (Amazon S3) bucket. For more information, see Creating a resource data sync for Inventory in the Amazon Web Services 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 Amazon Web Services Regions to a single Amazon S3 bucket. This type can synchronize OpsItems and OpsData from multiple Amazon Web Services accounts and Amazon Web Services Regions or EntireOrganization by using Organizations. For more information, see Setting up Systems Manager Explorer to display data from multiple accounts and Regions in the Amazon Web Services 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.

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.

Parameters:

  • sync_name (ResourceDataSyncName) –

    A name for the configuration.

  • s3_destination (Optional[ResourceDataSyncS3Destination], default: None ) –

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

  • sync_type (Optional[ResourceDataSyncType], default: None ) –

    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 Amazon Web Services accounts and Amazon Web Services Regions, as listed in Organizations for Explorer. If you specify SyncFromSource, you must provide a value for SyncSource. The default value is SyncToDestination.

  • sync_source (Optional[ResourceDataSyncSource], default: None ) –

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

Raises:

Source code in docs_src/capo_ssm/_services/ssm.py
def create_resource_data_sync(
    self,
    sync_name: "capo_ssm.types.resource_data_sync_name.ResourceDataSyncName",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    s3_destination: Optional[
        "capo_ssm.types.resource_data_sync_s3_destination.ResourceDataSyncS3Destination"
    ] = None,
    sync_type: Optional[
        "capo_ssm.types.resource_data_sync_type.ResourceDataSyncType"
    ] = None,
    sync_source: Optional[
        "capo_ssm.types.resource_data_sync_source.ResourceDataSyncSource"
    ] = None,
) -> "capo_ssm.types.create_resource_data_sync_result.CreateResourceDataSyncResult":
    """<p>A resource data sync helps you view data from multiple sources in a single location. Amazon Web Services Systems Manager offers two types of resource data sync: <code>SyncToDestination</code> and <code>SyncFromSource</code>.</p> <p>You can configure Systems Manager Inventory to use the <code>SyncToDestination</code> type to synchronize Inventory data from multiple Amazon Web Services Regions to a single Amazon Simple Storage Service (Amazon S3) bucket. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-create-resource-data-sync.html">Creating a resource data sync for Inventory</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p> <p>You can configure Systems Manager Explorer to use the <code>SyncFromSource</code> type to synchronize operational work items (OpsItems) and operational data (OpsData) from multiple Amazon Web Services Regions to a single Amazon S3 bucket. This type can synchronize OpsItems and OpsData from multiple Amazon Web Services accounts and Amazon Web Services Regions or <code>EntireOrganization</code> by using Organizations. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p> <p>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 <a>ListResourceDataSync</a>.</p> <note> <p>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. </p> </note>

    Args:
        sync_name: <p>A name for the configuration.</p>
        s3_destination: <p>Amazon S3 configuration details for the sync. This parameter is required if the <code>SyncType</code> value is SyncToDestination.</p>
        sync_type: <p>Specify <code>SyncToDestination</code> to create a resource data sync that synchronizes data to an S3 bucket for Inventory. If you specify <code>SyncToDestination</code>, you must provide a value for <code>S3Destination</code>. Specify <code>SyncFromSource</code> to synchronize data from a single account and multiple Regions, or multiple Amazon Web Services accounts and Amazon Web Services Regions, as listed in Organizations for Explorer. If you specify <code>SyncFromSource</code>, you must provide a value for <code>SyncSource</code>. The default value is <code>SyncToDestination</code>.</p>
        sync_source: <p>Specify information about the data sources to synchronize. This parameter is required if the <code>SyncType</code> value is SyncFromSource.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.resource_data_sync_already_exists_exception.ResourceDataSyncAlreadyExistsException: <p>A sync configuration with the same name already exists.</p>
        capo_ssm.errors.resource_data_sync_count_exceeded_exception.ResourceDataSyncCountExceededException: <p>You have exceeded the allowed maximum sync configurations.</p>
        capo_ssm.errors.resource_data_sync_invalid_configuration_exception.ResourceDataSyncInvalidConfigurationException: <p>The specified sync configuration is invalid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.create_resource_data_sync_request.CreateResourceDataSyncRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.create_resource_data_sync_result.CreateResourceDataSyncResult"
    ]:
        import capo_ssm._operations.amazon_ssm.create_resource_data_sync

        output, http_response = (
            capo_ssm._operations.amazon_ssm.create_resource_data_sync.create_resource_data_sync(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateResourceDataSync")
    )
    input_: capo_ssm.types.create_resource_data_sync_request.CreateResourceDataSyncRequest = {
        "sync_name": sync_name
    }
    if s3_destination is not None:
        input_["s3_destination"] = s3_destination
    if sync_type is not None:
        input_["sync_type"] = sync_type
    if sync_source is not None:
        input_["sync_source"] = sync_source

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output