Skip to content
GitHubXDiscordRSS

RepositoryLink

Learn how to create, update, and manage AWS CodeStarConnections RepositoryLinks using Alchemy Cloud Control.

The RepositoryLink resource allows you to manage AWS CodeStarConnections RepositoryLinks for linking your source code repositories to your AWS CodeStar projects.

Create a basic RepositoryLink with the required properties.

import AWS from "alchemy/aws/control";
const basicRepositoryLink = await AWS.CodeStarConnections.RepositoryLink("BasicRepoLink", {
OwnerId: "123456789012",
ConnectionArn: "arn:aws:codestar-connections:us-east-1:123456789012:connection/abcd1234-56ef-78gh-90ij-klmnopqrst",
RepositoryName: "MyAwesomeRepo",
Tags: [
{ Key: "Environment", Value: "Development" },
{ Key: "Project", Value: "CodeStarDemo" }
]
});

Add an encryption key ARN for enhanced security when creating a RepositoryLink.

const secureRepositoryLink = await AWS.CodeStarConnections.RepositoryLink("SecureRepoLink", {
OwnerId: "123456789012",
ConnectionArn: "arn:aws:codestar-connections:us-east-1:123456789012:connection/abcd1234-56ef-78gh-90ij-klmnopqrst",
RepositoryName: "MySecureRepo",
EncryptionKeyArn: "arn:aws:kms:us-east-1:123456789012:key/abcd1234-56ef-78gh-90ij-klmnopqrst",
Tags: [
{ Key: "Environment", Value: "Production" }
]
});

Create a RepositoryLink that adopts an existing resource instead of failing if it already exists.

const adoptedRepositoryLink = await AWS.CodeStarConnections.RepositoryLink("AdoptedRepoLink", {
OwnerId: "123456789012",
ConnectionArn: "arn:aws:codestar-connections:us-east-1:123456789012:connection/abcd1234-56ef-78gh-90ij-klmnopqrst",
RepositoryName: "MyAdoptedRepo",
adopt: true
});