Skip to content

SyncConfiguration

Source: src/AWS/CodeConnections/SyncConfiguration.ts

An AWS CodeConnections sync configuration — connects a repository link’s branch + deployment file to an Amazon Web Services resource so Git sync keeps the resource updated from the repository (CloudFormation stack sync).

Stack Sync from a Repository Link

const sync = yield* CodeConnections.SyncConfiguration("StackSync", {
branch: "main",
configFile: "deployments/stack-deployment.yaml",
repositoryLinkId: link.repositoryLinkId,
resourceName: "my-stack",
roleArn: gitSyncRole.roleArn,
});

Sync Only on Deployment-File Changes

const sync = yield* CodeConnections.SyncConfiguration("StackSync", {
branch: "main",
configFile: "deployments/stack-deployment.yaml",
repositoryLinkId: link.repositoryLinkId,
resourceName: "my-stack",
roleArn: gitSyncRole.roleArn,
triggerResourceUpdateOn: "FILE_CHANGE",
pullRequestComment: "DISABLED",
});