update_connection
async
¶
update_connection(
connection_id: ConnectionIdentifier,
ingestion_config: IngestionConfig,
*,
config_overrides: Optional[AsyncContextClientConfig] = None,
name: Optional[ResourceName] = None,
scope: Optional[DataSourceScope] = None,
access_config: Optional[AccessConfig] = None,
sync_schedule: Optional[SyncSchedule] = None,
glue_connection_mappings: Optional[GlueConnectionMappingList] = None,
publish: Optional[bool] = None,
) -> UpdateConnectionResponse
Updates a connection's configuration.
Parameters:
-
connection_id(ConnectionIdentifier) –The connection to update, by its ID (which starts with
conn-) or its ARN. -
name(Optional[ResourceName], default:None) –The new name. If you omit it, the name is unchanged.
-
scope(Optional[DataSourceScope], default:None) –The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of
CreateConnectionRequest.scopeapply, with the following additions:-
A
DATABRICKSorSNOWFLAKEscope names at most onedatabricksCatalogorsnowflakeDatabase, unless the existing scope already names each one. -
If the stored scope has a selector with a
glueServicesegment, the new scope can't be empty. Every selector that it adds must also have aglueServicesegment. Otherwise, the request fails withValidationException. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.
-
-
access_config(Optional[AccessConfig], default:None) –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
DATABRICKSandSNOWFLAKE, a configuration with no variant clears a storediamRole, and the connection is then returned with noaccessConfig.For
GLUE_DATA_CATALOGandBEDROCK_KNOWLEDGE_BASE, you cannot add or remove theiamRole. An update that adds aniamRoleto a connection stored without one fails withValidationException. So does an update that provides a configuration withoutiamRolefor 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. -
sync_schedule(Optional[SyncSchedule], default:None) –The new sync schedule for a
DATABRICKSorSNOWFLAKEsource. If you omit it, the existing schedule is unchanged. Not accepted forGLUE_DATA_CATALOGandBEDROCK_KNOWLEDGE_BASEconnections. -
ingestion_config(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:PassRolepermission to pass this role to the data producer, and the role must be in your account. You can't clear the role. -
glue_connection_mappings(Optional[GlueConnectionMappingList], default:None) –The AWS Glue connection for each
redshiftNamespace, and for eachrdsInstanceandrdsDatabasepair, inscope. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changesscope, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those ofCreateConnectionRequest.glueConnectionMappings. You can't change the list of aSNOWFLAKEconnection, which is keyed bysnowflakeDatabase: omit it or send it unchanged. -
publish(Optional[bool], default:None) –Specifies whether to publish a third-party connection created with
publish: false. Iftrue, 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.falseis not accepted, because a connection can't be unpublished. Delete the connection instead.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.
-
InternalServerException–The request failed because of an internal error. Retry the request.
-
ThrottlingException–The request was denied because it exceeded a request rate quota. Wait, then retry the request.
-
ValidationException–The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.
-
ConflictException–The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.
-
ResourceNotFoundException–The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.
-
ServiceQuotaExceededException–The request would exceed a service quota. Check the quota that
quotaCodenames, reduce your usage, and then retry the request. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Update the scope of a connection The following example adds the marketing_db database to the scope of the connection conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b and keeps its ingestion role, which every update must specify.
>>> await client.update_connection(connection_id='conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b', scope={'selectors': [{'path': [{'level': 'glueCatalog', 'id': 'arn:aws:glue:us-east-1:111122223333:catalog'}, {'level': 'glueDatabase', 'id': 'sales_db'}]}, {'path': [{'level': 'glueCatalog', 'id': 'arn:aws:glue:us-east-1:111122223333:catalog'}, {'level': 'glueDatabase', 'id': 'marketing_db'}]}]}, ingestion_config={'roleArn': 'arn:aws:iam::111122223333:role/ContextIngestionRole'})
Source code in docs_src/capo_context/_services/async_context.py
4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 | |