Connection
The Connection resource allows you to manage AWS CodeConnections Connections that facilitate integrations between AWS services and external tools.
Minimal Example
Section titled “Minimal Example”Create a basic connection with the required properties and an optional host ARN.
import AWS from "alchemy/aws/control";
const basicConnection = await AWS.CodeConnections.Connection("myBasicConnection", { ConnectionName: "MyBasicConnection", HostArn: "arn:aws:codeconnections:us-east-1:123456789012:host/my-host"});
Advanced Configuration
Section titled “Advanced Configuration”Configure a connection with additional properties like provider type and tags.
const advancedConnection = await AWS.CodeConnections.Connection("myAdvancedConnection", { ConnectionName: "MyAdvancedConnection", HostArn: "arn:aws:codeconnections:us-east-1:123456789012:host/my-host", ProviderType: "GitHub", Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Team", Value: "DevOps" } ]});
Adoption of Existing Resources
Section titled “Adoption of Existing Resources”Create a connection that adopts an existing resource if it already exists.
const adoptConnection = await AWS.CodeConnections.Connection("myAdoptedConnection", { ConnectionName: "MyAdoptedConnection", HostArn: "arn:aws:codeconnections:us-east-1:123456789012:host/my-host", ProviderType: "GitLab", adopt: true});
Updating a Connection
Section titled “Updating a Connection”Update an existing connection by specifying its name and new properties.
const updatedConnection = await AWS.CodeConnections.Connection("myUpdatedConnection", { ConnectionName: "MyUpdatedConnection", HostArn: "arn:aws:codeconnections:us-east-1:123456789012:host/my-updated-host", ProviderType: "Bitbucket", Tags: [ { Key: "Environment", Value: "Staging" } ]});