

# UpdateConnection

Updates a connection's configuration.

## Request Parameters
<a name="API_UpdateConnection_RequestParameters"></a>

 ** accessConfig **   
The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.  
For `DATABRICKS` and `SNOWFLAKE`, a configuration with no variant clears a stored `iamRole`, and the connection is then returned with no `accessConfig`.  
For `GLUE_DATA_CATALOG` and `BEDROCK_KNOWLEDGE_BASE`, you cannot add or remove the `iamRole`. An update that adds an `iamRole` to a connection stored without one fails with `ValidationException`. So does an update that provides a configuration without `iamRole` for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.  
Type: [AccessConfig](API_AccessConfig.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: No

 ** connectionId **   
The connection to update, by its ID (which starts with `conn-`) or its ARN.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 180.  
Pattern: `(arn:(aws|aws-cn|aws-us-gov):context:[a-z0-9\-]{1,32}:\d{12}:connection/)?[a-z0-9]+(-[a-z0-9]+)*`   
Required: Yes

 ** glueConnectionMappings **   
The AWS Glue connection for each `redshiftNamespace`, and for each `rdsInstance` and `rdsDatabase` pair, in `scope`. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes `scope`, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of `CreateConnectionRequest.glueConnectionMappings`. You can't change the list of a `SNOWFLAKE` connection, which is keyed by `snowflakeDatabase`: omit it or send it unchanged.  
Type: Array of [GlueConnectionMapping](API_GlueConnectionMapping.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 20 items.  
Required: No

 ** ingestionConfig **   
The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have `iam:PassRole` permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.  
Type: [IngestionConfig](API_IngestionConfig.md) object  
Required: Yes

 ** name **   
The new name. If you omit it, the name is unchanged.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 63.  
Pattern: `[a-zA-Z][a-zA-Z0-9-]*`   
Required: No

 ** publish **   
Specifies whether to publish a third-party connection created with `publish: false`. If `true`, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. `false` is not accepted, because a connection can't be unpublished. Delete the connection instead.  
Type: Boolean  
Required: No

 ** scope **   
The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of `CreateConnectionRequest.scope` apply, with the following additions:  
+ A `DATABRICKS` or `SNOWFLAKE` scope names at most one `databricksCatalog` or `snowflakeDatabase`, unless the existing scope already names each one.
+ If the stored scope has a selector with a `glueService` segment, the new scope can't be empty. Every selector that it adds must also have a `glueService` segment. Otherwise, the request fails with `ValidationException`. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.
Type: [DataSourceScope](API_DataSourceScope.md) object  
Required: No

 ** syncSchedule **   
The new sync schedule for a `DATABRICKS` or `SNOWFLAKE` source. If you omit it, the existing schedule is unchanged. Not accepted for `GLUE_DATA_CATALOG` and `BEDROCK_KNOWLEDGE_BASE` connections.  
Type: [SyncSchedule](API_SyncSchedule.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: No

## Response Elements
<a name="API_UpdateConnection_ResponseElements"></a>

The following elements are returned by the service.

 ** accessConfig **   
Per-connection access configuration: the IAM role used for data access.  
Type: [AccessConfig](API_AccessConfig.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.

 ** arn **   
The ARN of the connection.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 180.  
Pattern: `arn:(aws|aws-cn|aws-us-gov):context:[a-z0-9\-]{1,32}:\d{12}:connection/[a-z0-9]+(-[a-z0-9]+)*` 

 ** createdAt **   
The date and time when the connection was created.  
Type: Timestamp

 ** dataSource **   
The typed reference to the external data source that this connection binds to. Its `type`, the authoritative kind of data source, is in `dataSource.type`.  
Type: [DataSourceReference](API_DataSourceReference.md) object

 ** failure **   
The reason the connection is FAILED. Absent in every other status.  
Type: [ConnectionFailure](API_ConnectionFailure.md) object

 ** glueConnectionMappings **   
The AWS Glue connection for each `redshiftNamespace`, each `rdsInstance` and `rdsDatabase` pair, or each `snowflakeDatabase` in `scope`. Absent when none is configured.  
Type: Array of [GlueConnectionMapping](API_GlueConnectionMapping.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 20 items.

 ** id **   
The ID of the connection.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-z0-9]+(-[a-z0-9]+)*` 

 ** ingestionConfig **   
The connection's ingestion configuration (the IAM role a data producer assumes to push into this connection). Absent when no ingestion role is configured.  
Type: [IngestionConfig](API_IngestionConfig.md) object

 ** name **   
The name of the connection. You set it when you create the connection and can change it with UpdateConnection. Uses the same constraints as an agent context name. Always present.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 63.  
Pattern: `[a-zA-Z][a-zA-Z0-9-]*` 

 ** scope **   
The hierarchical subset of the data source this connection ingests.  
Type: [DataSourceScope](API_DataSourceScope.md) object

 ** status **   
The connection's status. Valid values:  
+  `CREATING` - Validation or provisioning is still in progress.
+  `ACTIVE` - The data source is reachable and, for a `DATABRICKS` or `SNOWFLAKE` connection, AWS Glue has provisioned catalog synchronization and returned its crawler ARN. This doesn't mean that a crawl has started or completed.
+  `UPDATING` - The connection is being updated.
+  `DELETING` - The connection is being deleted.
+  `FAILED` - Validation or provisioning failed, and the connection can't recover.
Type: String  
Valid Values: `CREATING | ACTIVE | UPDATING | DELETING | FAILED` 

 ** subStatus **   
The last milestone a third-party connection's lifecycle reached. Present in two statuses: CREATING, where it shows the resources provisioned so far, and DELETING, where it shows the resources removed so far. Absent in every other status and while nothing has been done yet in the current direction. CREATING at GLUE\_CONNECTION\_VALIDATED on a connection created with `publish: false` means it is waiting for UpdateConnection `publish: true`.  
Type: String  
Valid Values: `GLUE_CONNECTION_CREATED | GLUE_CONNECTION_VALIDATED | SYNC_JOB_CREATED` 

 ** syncSchedule **   
The effective sync schedule. Present for `DATABRICKS` and `SNOWFLAKE` connections (`DAILY` if you didn't specify one). Absent for `GLUE_DATA_CATALOG` and `BEDROCK_KNOWLEDGE_BASE` connections, which are event-driven.  
Type: [SyncSchedule](API_SyncSchedule.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.

 ** updatedAt **   
When the resource last changed. Equal to `createdAt` until the first update.  
Type: Timestamp

## Errors
<a name="API_UpdateConnection_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.    
 ** message **   
A message that describes the error.
HTTP Status Code: 403

 ** ConflictException **   
The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.    
 ** message **   
A message that describes the error.  
 ** resourceId **   
The ID of the resource that caused the conflict. When several resources caused it, a comma-separated list of their IDs.  
 ** resourceType **   
The type of the resource that caused the conflict.  
Valid values:  
+  `agent-context` - An agent context.
+  `connection` - A connection.
+  `curation-policy` - A curation policy.
+  `evaluation` - Reserved for future use.
+  `ontology` - An ontology.
+  `ontology-induction` - An ontology induction.
+  `resource-policy` - A resource-based policy.
HTTP Status Code: 409

 ** InternalServerException **   
The request failed because of an internal error. Retry the request.    
 ** message **   
A message that describes the error.
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.    
 ** message **   
A message that describes the error.  
 ** resourceId **   
The ID of the resource that was not found.  
 ** resourceType **   
The type of the resource that wasn't found.  
Valid values:  
+  `agent-context` - An agent context.
+  `connection` - A connection.
+  `curation-policy` - A curation policy.
+  `evaluation` - Reserved for future use.
+  `ontology` - An ontology.
+  `ontology-induction` - An ontology induction.
+  `resource-policy` - A resource-based policy.
HTTP Status Code: 404

 ** ServiceQuotaExceededException **   
The request would exceed a service quota. Check the quota that `quotaCode` names, reduce your usage, and then retry the request.    
 ** message **   
A message that describes the error.  
 ** quotaCode **   
The code of the quota that the request would exceed.  
 ** resourceId **   
The ID of the resource that the quota applies to.  
 ** resourceType **   
The type of the resource that the quota applies to.  
Valid values:  
+  `agent-context` - An agent context.
+  `connection` - A connection.
+  `curation-policy` - A curation policy.
+  `evaluation` - Reserved for future use.
+  `ontology` - An ontology.
+  `ontology-induction` - An ontology induction.
+  `resource-policy` - A resource-based policy.  
 ** serviceCode **   
The code of the service that owns the quota.
HTTP Status Code: 402

 ** ThrottlingException **   
The request was denied because it exceeded a request rate quota. Wait, then retry the request.    
 ** message **   
A message that describes the error.  
 ** quotaCode **   
The code of the quota that throttled the request.  
 ** retryAfterSeconds **   
The number of seconds to wait before you retry the request, if AWS Context provides one.  
 ** serviceCode **   
The code of the service whose quota throttled the request.
HTTP Status Code: 429

 ** ValidationException **   
The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.    
 ** fieldList **   
The fields that failed validation, each with a message that describes why.  
 ** message **   
A message that describes the error.  
 ** reason **   
The reason that the input failed validation. Valid values:  
+  `unknownOperation` - The operation isn't recognized.
+  `cannotParse` - The request couldn't be parsed.
+  `fieldValidationFailed` - One or more fields failed validation. `fieldList` describes them.
+  `other` - Another reason. `message` describes it.
HTTP Status Code: 400

## See Also
<a name="API_UpdateConnection_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/context-2022-07-26/UpdateConnection) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/context-2022-07-26/UpdateConnection) 