updateEnvironmentAccountConnection method

Future<UpdateEnvironmentAccountConnectionOutput> updateEnvironmentAccountConnection({
  1. required String id,
  2. String? codebuildRoleArn,
  3. String? componentRoleArn,
  4. String? roleArn,
})

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.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter id : The ID of the environment account connection to update.

Parameter codebuildRoleArn : The 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.

Parameter componentRoleArn : The 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.

Parameter roleArn : The Amazon Resource Name (ARN) of the IAM service role that's associated with the environment account connection to update.

Implementation

Future<UpdateEnvironmentAccountConnectionOutput>
    updateEnvironmentAccountConnection({
  required String id,
  String? codebuildRoleArn,
  String? componentRoleArn,
  String? roleArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AwsProton20200720.UpdateEnvironmentAccountConnection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      if (codebuildRoleArn != null) 'codebuildRoleArn': codebuildRoleArn,
      if (componentRoleArn != null) 'componentRoleArn': componentRoleArn,
      if (roleArn != null) 'roleArn': roleArn,
    },
  );

  return UpdateEnvironmentAccountConnectionOutput.fromJson(jsonResponse.body);
}