sync_configurations
Creates, updates, deletes or gets a sync_configuration resource or lists sync_configurations in a region
Overview
| Name | sync_configurations |
| Type | Resource |
| Description | Schema for AWS::CodeStarConnections::SyncConfiguration resource which is used to enables an AWS resource to be synchronized from a source-provider. |
| Id | awscc.codestarconnections.sync_configurations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
owner_id | string | the ID of the entity that owns the repository. |
resource_name | string | The name of the resource that is being synchronized to the repository. |
repository_name | string | The name of the repository that is being synced to. |
provider_type | string | The name of the external provider where your third-party code repository is configured. |
branch | string | The name of the branch of the repository from which resources are to be synchronized, |
config_file | string | The source provider repository path of the sync configuration file of the respective SyncType. |
sync_type | string | The type of resource synchronization service that is to be configured, for example, CFN_STACK_SYNC. |
role_arn | string | The IAM Role that allows AWS to update CloudFormation stacks based on content in the specified repository. |
publish_deployment_status | string | Whether to enable or disable publishing of deployment status to source providers. |
trigger_resource_update_on | string | When to trigger Git sync to begin the stack update. |
repository_link_id | string | A UUID that uniquely identifies the RepositoryLink that the SyncConfig is associated with. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
resource_name | string | The name of the resource that is being synchronized to the repository. |
sync_type | string | The type of resource synchronization service that is to be configured, for example, CFN_STACK_SYNC. |
region | string | AWS region. |
For more information, see AWS::CodeStarConnections::SyncConfiguration.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | sync_configurations | INSERT | Branch, ConfigFile, RepositoryLinkId, ResourceName, SyncType, RoleArn, region |
delete_resource | sync_configurations | DELETE | Identifier, region |
update_resource | sync_configurations | UPDATE | Identifier, PatchDocument, region |
list_resources | sync_configurations_list_only | SELECT | region |
get_resource | sync_configurations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual sync_configuration.
SELECT
region,
owner_id,
resource_name,
repository_name,
provider_type,
branch,
config_file,
sync_type,
role_arn,
publish_deployment_status,
trigger_resource_update_on,
repository_link_id
FROM awscc.codestarconnections.sync_configurations
WHERE
region = '{{ region }}' AND
Identifier = '{{ resource_name }}|{{ sync_type }}';
Lists all sync_configurations in a region.
SELECT
region,
resource_name,
sync_type
FROM awscc.codestarconnections.sync_configurations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new sync_configuration resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codestarconnections.sync_configurations (
ResourceName,
Branch,
ConfigFile,
SyncType,
RoleArn,
RepositoryLinkId,
region
)
SELECT
'{{ resource_name }}',
'{{ branch }}',
'{{ config_file }}',
'{{ sync_type }}',
'{{ role_arn }}',
'{{ repository_link_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.codestarconnections.sync_configurations (
ResourceName,
Branch,
ConfigFile,
SyncType,
RoleArn,
PublishDeploymentStatus,
TriggerResourceUpdateOn,
RepositoryLinkId,
region
)
SELECT
'{{ resource_name }}',
'{{ branch }}',
'{{ config_file }}',
'{{ sync_type }}',
'{{ role_arn }}',
'{{ publish_deployment_status }}',
'{{ trigger_resource_update_on }}',
'{{ repository_link_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: sync_configuration
props:
- name: resource_name
value: '{{ resource_name }}'
- name: branch
value: '{{ branch }}'
- name: config_file
value: '{{ config_file }}'
- name: sync_type
value: '{{ sync_type }}'
- name: role_arn
value: '{{ role_arn }}'
- name: publish_deployment_status
value: '{{ publish_deployment_status }}'
- name: trigger_resource_update_on
value: '{{ trigger_resource_update_on }}'
- name: repository_link_id
value: '{{ repository_link_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a sync_configuration resource, using stack-deploy.
/*+ update */
UPDATE awscc.codestarconnections.sync_configurations
SET PatchDocument = string('{{ {
"Branch": branch,
"ConfigFile": config_file,
"RoleArn": role_arn,
"PublishDeploymentStatus": publish_deployment_status,
"TriggerResourceUpdateOn": trigger_resource_update_on,
"RepositoryLinkId": repository_link_id
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ resource_name }}|{{ sync_type }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.codestarconnections.sync_configurations
WHERE
Identifier = '{{ resource_name }}|{{ sync_type }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the sync_configurations resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
codestar-connections:CreateSyncConfiguration,
codestar-connections:PassRepository,
iam:PassRole
codestar-connections:GetSyncConfiguration
codestar-connections:UpdateSyncConfiguration,
codestar-connections:PassRepository,
iam:PassRole
codestar-connections:DeleteSyncConfiguration,
codestar-connections:GetSyncConfiguration
codestar-connections:ListSyncConfigurations,
codestar-connections:ListRepositoryLinks