Skip to content

create_repository

create_repository(
    provider: RepositoryProvider,
    name: RepositoryName,
    connection_arn: Arn,
    *,
    config_overrides: Optional[ProtonClientConfig] = None,
    encryption_key: Optional[Arn] = None,
    tags: Optional[TagList] = None,
) -> CreateRepositoryOutput

Create and register a link to a repository. Proton uses the link to repeatedly access the repository, to either push to it (self-managed provisioning) or pull from it (template sync). You can share a linked repository across multiple resources (like environments using self-managed provisioning, or synced templates). When you create a repository link, Proton creates a service-linked role for you.

For more information, see Self-managed provisioning, Template bundles, and Template sync configurations in the Proton User Guide.

Parameters:

  • provider (RepositoryProvider) –

    The repository provider.

  • name (RepositoryName) –

    The repository name (for example, myrepos/myrepo).

  • connection_arn (Arn) –

    The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see Setting up for Proton in the Proton User Guide.

  • encryption_key (Optional[Arn], default: None ) –

    The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.

  • tags (Optional[TagList], default: None ) –

    An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.

    For more information, see Proton resources and tagging in the Proton User Guide.

Raises:

Source code in docs_src/capo_proton/_services/proton.py
def create_repository(
    self,
    provider: "capo_proton.types.repository_provider.RepositoryProvider",
    name: "capo_proton.types.repository_name.RepositoryName",
    connection_arn: "capo_proton.types.arn.Arn",
    *,
    config_overrides: Optional[ProtonClientConfig] = None,
    encryption_key: Optional["capo_proton.types.arn.Arn"] = None,
    tags: Optional["capo_proton.types.tag_list.TagList"] = None,
) -> "capo_proton.types.create_repository_output.CreateRepositoryOutput":
    """<p>Create and register a link to a repository. Proton uses the link to repeatedly access the repository, to either push to it (self-managed provisioning) or pull from it (template sync). You can share a linked repository across multiple resources (like environments using self-managed provisioning, or synced templates). When you create a repository link, Proton creates a <a href="https://docs.aws.amazon.com/proton/latest/userguide/using-service-linked-roles.html">service-linked role</a> for you.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-works-prov-methods.html#ag-works-prov-methods-self">Self-managed provisioning</a>, <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-template-authoring.html#ag-template-bundles">Template bundles</a>, and <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-template-sync-configs.html">Template sync configurations</a> in the <i>Proton User Guide</i>.</p>

    Args:
        provider: <p>The repository provider.</p>
        name: <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
        connection_arn: <p>The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html">Setting up for Proton</a> in the <i>Proton User Guide</i>.</p>
        encryption_key: <p>The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.</p>
        tags: <p>An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>

    Raises:
        capo_proton.errors.access_denied_exception.AccessDeniedException: <p>There <i>isn't</i> sufficient access for performing this action.</p>
        capo_proton.errors.conflict_exception.ConflictException: <p>The request <i>couldn't</i> be made due to a conflicting operation or resource.</p>
        capo_proton.errors.internal_server_exception.InternalServerException: <p>The request failed to register with the service.</p>
        capo_proton.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A quota was exceeded. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-limits.html">Proton Quotas</a> in the <i>Proton User Guide</i>.</p>
        capo_proton.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_proton.errors.validation_exception.ValidationException: <p>The input is invalid or an out-of-range value was supplied for the input parameter.</p>
        capo_proton.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_proton.types.create_repository_input.CreateRepositoryInput]",
    ) -> OperationResponse[
        "capo_proton.types.create_repository_output.CreateRepositoryOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.create_repository

        output, http_response = (
            capo_proton._operations.aws_proton20200720.create_repository.create_repository(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRepository")
    )
    input_: capo_proton.types.create_repository_input.CreateRepositoryInput = {
        "provider": provider,
        "name": name,
        "connection_arn": connection_arn,
    }
    if encryption_key is not None:
        input_["encryption_key"] = encryption_key
    if tags is not None:
        input_["tags"] = tags

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