Skip to content

create_sync_configuration async

create_sync_configuration(
    branch: BranchName,
    config_file: DeploymentFilePath,
    repository_link_id: RepositoryLinkId,
    resource_name: ResourceName,
    role_arn: IamRoleArn,
    sync_type: SyncConfigurationType,
    *,
    config_overrides: Optional[AsyncCodeStarconnectionsClientConfig] = None,
    publish_deployment_status: Optional[PublishDeploymentStatus] = None,
    trigger_resource_update_on: Optional[TriggerResourceUpdateOn] = None,
) -> CreateSyncConfigurationOutput

Creates a sync configuration which allows Amazon Web Services to sync content from a Git repository to update a specified Amazon Web Services resource. Parameters for the sync configuration are determined by the sync type.

Parameters:

  • branch (BranchName) –

    The branch in the repository from which changes will be synced.

  • config_file (DeploymentFilePath) –

    The file name of the configuration file that manages syncing between the connection and the repository. This configuration file is stored in the repository.

  • repository_link_id (RepositoryLinkId) –

    The ID of the repository link created for the connection. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.

  • resource_name (ResourceName) –

    The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of CFN_STACK_SYNC) that will be synchronized from the linked repository.

  • role_arn (IamRoleArn) –

    The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a given Amazon Web Services resource on your behalf.

  • sync_type (SyncConfigurationType) –

    The type of sync configuration.

  • publish_deployment_status (Optional[PublishDeploymentStatus], default: None ) –

    Whether to enable or disable publishing of deployment status to source providers.

  • trigger_resource_update_on (Optional[TriggerResourceUpdateOn], default: None ) –

    When to trigger Git sync to begin the stack update.

Raises:

Source code in docs_src/capo_codestar_connections/_services/async_code_starconnections.py
async def create_sync_configuration(
    self,
    branch: "capo_codestar_connections.types.branch_name.BranchName",
    config_file: "capo_codestar_connections.types.deployment_file_path.DeploymentFilePath",
    repository_link_id: "capo_codestar_connections.types.repository_link_id.RepositoryLinkId",
    resource_name: "capo_codestar_connections.types.resource_name.ResourceName",
    role_arn: "capo_codestar_connections.types.iam_role_arn.IamRoleArn",
    sync_type: "capo_codestar_connections.types.sync_configuration_type.SyncConfigurationType",
    *,
    config_overrides: Optional[AsyncCodeStarconnectionsClientConfig] = None,
    publish_deployment_status: Optional[
        "capo_codestar_connections.types.publish_deployment_status.PublishDeploymentStatus"
    ] = None,
    trigger_resource_update_on: Optional[
        "capo_codestar_connections.types.trigger_resource_update_on.TriggerResourceUpdateOn"
    ] = None,
) -> "capo_codestar_connections.types.create_sync_configuration_output.CreateSyncConfigurationOutput":
    """<p>Creates a sync configuration which allows Amazon Web Services to sync content from a Git repository to update a specified Amazon Web Services resource. Parameters for the sync configuration are determined by the sync type.</p>

    Args:
        branch: <p>The branch in the repository from which changes will be synced.</p>
        config_file: <p>The file name of the configuration file that manages syncing between the connection and the repository. This configuration file is stored in the repository.</p>
        repository_link_id: <p>The ID of the repository link created for the connection. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.</p>
        resource_name: <p>The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of CFN_STACK_SYNC) that will be synchronized from the linked repository.</p>
        role_arn: <p>The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a given Amazon Web Services resource on your behalf.</p>
        sync_type: <p>The type of sync configuration.</p>
        publish_deployment_status: <p>Whether to enable or disable publishing of deployment status to source providers.</p>
        trigger_resource_update_on: <p>When to trigger Git sync to begin the stack update.</p>

    Raises:
        capo_codestar_connections.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_codestar_connections.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modification to an application. For example, two individuals attempting to edit the same application at the same time. </p>
        capo_codestar_connections.errors.internal_server_exception.InternalServerException: <p>Received an internal server exception. Try again later.</p>
        capo_codestar_connections.errors.invalid_input_exception.InvalidInputException: <p>The input is not valid. Verify that the action is typed correctly.</p>
        capo_codestar_connections.errors.limit_exceeded_exception.LimitExceededException: <p>Exceeded the maximum limit for connections.</p>
        capo_codestar_connections.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>Unable to create resource. Resource already exists.</p>
        capo_codestar_connections.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codestar_connections.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codestar_connections.types.create_sync_configuration_input.CreateSyncConfigurationInput]",
    ) -> AsyncOperationResponse[
        "capo_codestar_connections.types.create_sync_configuration_output.CreateSyncConfigurationOutput"
    ]:
        import capo_codestar_connections._operations.code_star_connections_20191201.create_sync_configuration

        (
            output,
            http_response,
        ) = await capo_codestar_connections._operations.code_star_connections_20191201.create_sync_configuration.async_create_sync_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSyncConfiguration")
    )
    input_: capo_codestar_connections.types.create_sync_configuration_input.CreateSyncConfigurationInput = {
        "branch": branch,
        "config_file": config_file,
        "repository_link_id": repository_link_id,
        "resource_name": resource_name,
        "role_arn": role_arn,
        "sync_type": sync_type,
    }
    if publish_deployment_status is not None:
        input_["publish_deployment_status"] = publish_deployment_status
    if trigger_resource_update_on is not None:
        input_["trigger_resource_update_on"] = trigger_resource_update_on

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output