Skip to main content

source_repositories

Creates, updates, deletes, gets or lists a source_repositories resource.

Overview

Namesource_repositories
TypeResource
Idaws.codecatalyst.source_repositories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the source repository. (pattern: <code>(?!.[.]git$)[\w-.]</code>)
created_timestring (date-time)The time the source repository was created, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.
descriptionstringThe description of the source repository.
last_updated_timestring (date-time)The time the source repository was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.
project_namestringThe name of the project in the space. (pattern: <code>[a-zA-Z0-9]+(?:[-_.][a-zA-Z0-9]+)*</code>)
space_namestringThe name of the space. (pattern: <code>[a-zA-Z0-9]+(?:[-_.][a-zA-Z0-9]+)*</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_source_repositoryselectspace_name, project_name, name, regionReturns information about a source repository.
list_source_repositoriesselectspace_name, project_name, regionRetrieves a list of source repositories in a project.
create_source_repositoryinsertspace_name, project_name, name, regionCreates an empty Git-based source repository in a specified project. The repository is created with an initial empty commit with a default branch named main.
delete_source_repositorydeletespace_name, project_name, name, regionDeletes a source repository in Amazon CodeCatalyst. You cannot use this API to delete a linked repository. It can only be used to delete a Amazon CodeCatalyst source repository.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of the source repository.
project_namestringThe name of the project in the space.
regionstringAWS region (default: us-east-1)
space_namestringThe name of the space.

SELECT examples

Returns information about a source repository.

SELECT
name,
created_time,
description,
last_updated_time,
project_name,
space_name
FROM aws.codecatalyst.source_repositories
WHERE space_name = '{{ space_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an empty Git-based source repository in a specified project. The repository is created with an initial empty commit with a default branch named main.

INSERT INTO aws.codecatalyst.source_repositories (
description,
space_name,
project_name,
name,
region
)
SELECT
'{{ description }}',
'{{ space_name }}',
'{{ project_name }}',
'{{ name }}',
'{{ region }}'
RETURNING
name,
description,
project_name,
space_name
;

DELETE examples

Deletes a source repository in Amazon CodeCatalyst. You cannot use this API to delete a linked repository. It can only be used to delete a Amazon CodeCatalyst source repository.

DELETE FROM aws.codecatalyst.source_repositories
WHERE space_name = '{{ space_name }}' --required
AND project_name = '{{ project_name }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
;