EnvironmentAccountConnection
The EnvironmentAccountConnection resource lets you manage AWS Proton EnvironmentAccountConnections that facilitate the connection between a management account and an environment account.
Minimal Example
Section titled “Minimal Example”Create a basic EnvironmentAccountConnection with required properties and some common optional settings.
import AWS from "alchemy/aws/control";
const basicConnection = await AWS.Proton.EnvironmentAccountConnection("basicConnection", { EnvironmentName: "ProductionEnvironment", ComponentRoleArn: "arn:aws:iam::123456789012:role/ProtonComponentRole", ManagementAccountId: "123456789012", CodebuildRoleArn: "arn:aws:iam::123456789012:role/ProtonCodeBuildRole", EnvironmentAccountId: "098765432109"});
Advanced Configuration
Section titled “Advanced Configuration”Configure an EnvironmentAccountConnection with additional tags for better management and identification.
const advancedConnection = await AWS.Proton.EnvironmentAccountConnection("advancedConnection", { EnvironmentName: "StagingEnvironment", ComponentRoleArn: "arn:aws:iam::123456789012:role/ProtonComponentRole", ManagementAccountId: "123456789012", CodebuildRoleArn: "arn:aws:iam::123456789012:role/ProtonCodeBuildRole", EnvironmentAccountId: "098765432109", RoleArn: "arn:aws:iam::123456789012:role/ProtonRole", Tags: [ { Key: "Environment", Value: "Staging" }, { Key: "Project", Value: "WebApp" } ]});
Adoption of Existing Resources
Section titled “Adoption of Existing Resources”Adopt an existing EnvironmentAccountConnection instead of failing if it already exists.
const adoptConnection = await AWS.Proton.EnvironmentAccountConnection("adoptConnection", { EnvironmentName: "ExistingEnvironment", ComponentRoleArn: "arn:aws:iam::123456789012:role/ProtonComponentRole", ManagementAccountId: "123456789012", CodebuildRoleArn: "arn:aws:iam::123456789012:role/ProtonCodeBuildRole", EnvironmentAccountId: "098765432109", adopt: true});