Skip to main content

environment_account_connections

Creates, updates, deletes, gets or lists an environment_account_connections resource.

Overview

Nameenvironment_account_connections
TypeResource
Idaws.proton.environment_account_connections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the environment account connection. (pattern: <code>^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
arnstringThe Amazon Resource Name (ARN) of the environment account connection.
codebuild_role_arnstringThe Amazon Resource Name (ARN) of an IAM service role in the environment account. Proton uses this role to provision infrastructure resources using CodeBuild-based provisioning in the associated environment account. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov):iam::\d{12}:role/([\w+=,.@-]{1,512}[/:])*([\w+=,.@-]{1,64})$</code>)
component_role_arnstringThe Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in the associated environment account. It determines the scope of infrastructure that a component can provision in the account. The environment account connection must have a componentRoleArn to allow directly defined components to be associated with any environments running in the account. For more information about components, see Proton components in the Proton User Guide. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov):iam::\d{12}:role/([\w+=,.@-]{1,512}[/:])*([\w+=,.@-]{1,64})$</code>)
environment_account_idstringThe environment account that's connected to the environment account connection. (pattern: <code>^\d{12}$</code>)
environment_namestringThe name of the environment that's associated with the environment account connection. (pattern: <code>^[0-9A-Za-z]+[0-9A-Za-z_-]*$</code>)
last_modified_atstring (date-time)The time when the environment account connection was last modified.
management_account_idstringThe ID of the management account that's connected to the environment account connection. (pattern: <code>^\d{12}$</code>)
requested_atstring (date-time)The time when the environment account connection request was made.
role_arnstringThe IAM service role that's associated with the environment account connection. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov):[a-zA-Z0-9-]+:[a-zA-Z0-9-]:\d{12}:([\w+=,.@-]+[/:])[\w+=,.@-]+$</code>)
statusstringThe status of the environment account connection. (PENDING, CONNECTED, REJECTED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_environment_account_connectionselectregionIn an environment account, get the detailed data for an environment account connection. For more information, see Environment account connections in the Proton User guide.
list_environment_account_connectionsselectregionView a list of environment account connections. For more information, see Environment account connections in the Proton User guide.
create_environment_account_connectioninsertregion, environmentName, managementAccountIdCreate an environment account connection in an environment account so that environment infrastructure resources can be provisioned in the environment account from a management account. An environment account connection is a secure bi-directional connection between a management account and an environment account that maintains authorization and permissions. For more information, see Environment account connections in the Proton User guide.
update_environment_account_connectionupdateregion, idIn an environment account, update an environment account connection to use a new IAM role. For more information, see Environment account connections in the Proton User guide.
delete_environment_account_connectiondeleteregionIn an environment account, delete an environment account connection. After you delete an environment account connection that’s in use by an Proton environment, Proton can’t manage the environment infrastructure resources until a new environment account connection is accepted for the environment account and associated environment. You're responsible for cleaning up provisioned resources that remain without an environment connection. For more information, see Environment account connections in the Proton User guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

In an environment account, get the detailed data for an environment account connection. For more information, see Environment account connections in the Proton User guide.

SELECT
id,
arn,
codebuild_role_arn,
component_role_arn,
environment_account_id,
environment_name,
last_modified_at,
management_account_id,
requested_at,
role_arn,
status
FROM aws.proton.environment_account_connections
WHERE region = '{{ region }}' -- required
;

INSERT examples

Create an environment account connection in an environment account so that environment infrastructure resources can be provisioned in the environment account from a management account. An environment account connection is a secure bi-directional connection between a management account and an environment account that maintains authorization and permissions. For more information, see Environment account connections in the Proton User guide.

INSERT INTO aws.proton.environment_account_connections (
clientToken,
codebuildRoleArn,
componentRoleArn,
environmentName,
managementAccountId,
roleArn,
tags,
region
)
SELECT
'{{ clientToken }}',
'{{ codebuildRoleArn }}',
'{{ componentRoleArn }}',
'{{ environmentName }}' /* required */,
'{{ managementAccountId }}' /* required */,
'{{ roleArn }}',
'{{ tags }}',
'{{ region }}'
RETURNING
environment_account_connection
;

UPDATE examples

In an environment account, update an environment account connection to use a new IAM role. For more information, see Environment account connections in the Proton User guide.

UPDATE aws.proton.environment_account_connections
SET
codebuildRoleArn = '{{ codebuildRoleArn }}',
componentRoleArn = '{{ componentRoleArn }}',
id = '{{ id }}',
roleArn = '{{ roleArn }}'
WHERE
region = '{{ region }}' --required
AND id = '{{ id }}' --required
RETURNING
environment_account_connection;

DELETE examples

In an environment account, delete an environment account connection. After you delete an environment account connection that’s in use by an Proton environment, Proton can’t manage the environment infrastructure resources until a new environment account connection is accepted for the environment account and associated environment. You're responsible for cleaning up provisioned resources that remain without an environment connection. For more information, see Environment account connections in the Proton User guide.

DELETE FROM aws.proton.environment_account_connections
WHERE region = '{{ region }}' --required
;