aws_sdk_context/client/create_connection.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`CreateConnection`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`client_token(impl Into<String>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_client_token):<br>required: **false**<br><p>A client idempotency token. It is optional, so the AWS SDKs can generate it automatically and reuse it on retries. A retry with an identical request returns the original connection. A different request returns <code>ValidationException</code>. <code>acknowledgements</code>, <code>tags</code> and, once the connection is <code>ACTIVE</code>, <code>publish</code> are not compared with the original request. A create refused for a missing acknowledgement records no token.</p><br>
7 /// - [`name(impl Into<String>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_name):<br>required: **true**<br><p>The name of the connection. Required. You can change it later with UpdateConnection. Starts with a letter and contains 3–63 ASCII letters, digits, and hyphens.</p><br>
8 /// - [`data_source(DataSourceReference)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::data_source) / [`set_data_source(Option<DataSourceReference>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_data_source):<br>required: **true**<br><p>The external data source that this connection binds to: its <code>type</code> and <code>location.arn</code>. The ARN must be in your account, except for <code>GLUE_DATA_CATALOG</code>, where it can name a catalog or an AWS Glue connection in another account.</p> <ul> <li> <p><code>GLUE_DATA_CATALOG</code> - An AWS Glue Data Catalog ARN (<code>:catalog</code> or <code>:catalog/<path></code>), or the ARN of an existing AWS Glue connection (<code>:connection/<name></code>) for a federated AWS data source such as Amazon Redshift or Amazon RDS. The AWS Glue connection must be a unified connection (ConnectionSchemaVersion 2) in your partition and Region that you can read. You can't specify <code>scope</code> with an AWS Glue connection ARN. While AWS Glue is still validating the connection, the request fails with <code>ConflictException</code>. If its validation failed, the request fails with <code>AccessDeniedException</code>.</p></li> <li> <p><code>DATABRICKS</code> or <code>SNOWFLAKE</code> - The ARN of an existing AWS Glue connection whose AWS Glue ConnectionType matches <code>type</code>. AWS Context validates its Credential Broker settings, if present, and doesn't store them.</p></li> </ul><br>
9 /// - [`scope(DataSourceScope)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::scope) / [`set_scope(Option<DataSourceScope>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_scope):<br>required: **false**<br><p>Optional hierarchical subset of the data source to ingest. Absent means the whole source. A DATABRICKS scope names at most one <code>databricksCatalog</code>, and a SNOWFLAKE scope one <code>snowflakeDatabase</code>. A GLUE_DATA_CATALOG scope can select by service with a <code>glueService</code> segment (see <code>DataSourceScope</code>). An unknown service name, a repeated or misplaced <code>glueService</code> segment, a later level of another service, or <code>glueService</code> on another connection type returns ValidationException.</p><br>
10 /// - [`access_config(AccessConfig)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::access_config) / [`set_access_config(Option<AccessConfig>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_access_config):<br>required: **false**<br><p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p> <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, <code>iamRole</code> is the IAM role that AWS Context assumes to read the source and the AWS Glue connections in <code>glueConnectionMappings</code>. If you omit <code>accessConfig</code> or set no variant, AWS Context reads them with your own credentials. This applies whether the source is in your account or another account. For a source in another account, AWS Context checks when it creates the connection that <code>iamRole</code> can read the source, and the request fails if it can't. A source in another account with no <code>iamRole</code> isn't checked when the connection is created. An <code>accessConfig</code> with no variant is stored as absent and is not returned on the connection.</p> <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, AWS Glue reads the source with the <code>ROLE_ARN</code> of the AWS Glue connection in <code>dataSource</code>, not with <code>accessConfig</code>. For these types, <code>accessConfig</code> is reserved for other roles.</p><br>
11 /// - [`sync_schedule(SyncSchedule)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::sync_schedule) / [`set_sync_schedule(Option<SyncSchedule>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_sync_schedule):<br>required: **false**<br><p>How often AWS Context re-syncs a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the default is <code>DAILY</code>. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections. You can change it with UpdateConnection.</p><br>
12 /// - [`ingestion_config(IngestionConfig)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::ingestion_config) / [`set_ingestion_config(Option<IngestionConfig>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_ingestion_config):<br>required: **true**<br><p>The ingestion configuration: the IAM role that a data producer (AWS Glue Data Catalog or Amazon Bedrock knowledge base) assumes to push data into this connection's agent contexts. It is separate from <code>accessConfig</code>, which names the role that AWS Context assumes to read the source. Required, because a connection can't ingest data without a role that its data producer can assume. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account.</p><br>
13 /// - [`glue_connection_mappings(GlueConnectionMapping)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::glue_connection_mappings) / [`set_glue_connection_mappings(Option<Vec::<GlueConnectionMapping>>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_glue_connection_mappings):<br>required: **false**<br><p>The AWS Glue connection to use for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>, keyed by <code>path</code>. Optional. You can specify 0–20 entries. The following rules apply:</p> <ul> <li> <p>Once an entry names a level, every resource of that level in <code>scope</code> needs an entry. While an entry names <code>rdsInstance</code>, every selector that names an <code>rdsInstance</code> must also name its <code>rdsDatabase</code>.</p></li> <li> <p><code>redshiftNamespace</code> and <code>rdsInstance</code> entries require <code>dataSource</code> to be an AWS Glue Data Catalog ARN. <code>accessConfig.iamRole</code> is optional.</p></li> <li> <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li> <li> <p>While any entry is present, <code>scope</code> cannot contain a selector that names only a catalog or a <code>glueService</code>, because such a selector covers every resource of the catalog or service. Otherwise, a selector with a <code>glueService</code> segment follows these rules as it would without that segment. An entry's <code>path</code> never names <code>glueService</code>.</p></li> <li> <p>A selector that names only <code>glueService</code> <code>REDSHIFT</code> or <code>RDS</code>, with no namespace or instance, cannot be combined with any entry. Such a connection reads only the service's metadata, and you cannot query its data.</p></li> </ul><br>
14 /// - [`publish(bool)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::publish) / [`set_publish(Option<bool>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_publish):<br>required: **false**<br><p>Specifies whether to configure catalog synchronization and wait for it to be provisioned during this call. If you omit it, the default is <code>true</code>. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>false</code> validates only the AWS Glue connection. The connection is returned as <code>CREATING</code> with <code>subStatus</code> <code>GLUE_CONNECTION_VALIDATED</code>, and you publish it later by calling UpdateConnection with <code>publish</code> set to <code>true</code>. Ignored for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which have no sync job.</p><br>
15 /// - [`acknowledgements(impl Into<String>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::acknowledgements) / [`set_acknowledgements(Option<Vec::<String>>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_acknowledgements):<br>required: **false**<br><p>The conditions that you acknowledge AWS Context can't honor. Specify <code>CUSTOMER_MANAGED_KEY</code> when the knowledge base is encrypted with an AWS KMS customer managed key and you accept that AWS Context stores the ingested data under AWS owned keys. If you omit it, creating a connection to such a knowledge base fails with <code>ValidationException</code>. An unknown or repeated value also fails with <code>ValidationException</code>.</p><br>
16 /// - [`tags(impl Into<String>, impl Into<String>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::tags) / [`set_tags(Option<HashMap::<String, String>>)`](crate::operation::create_connection::builders::CreateConnectionFluentBuilder::set_tags):<br>required: **false**<br><p>Tags to add to the connection when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new connection. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p><br>
17 /// - On success, responds with [`CreateConnectionOutput`](crate::operation::create_connection::CreateConnectionOutput) with field(s):
18 /// - [`id(String)`](crate::operation::create_connection::CreateConnectionOutput::id): <p>The ID of the connection.</p>
19 /// - [`arn(String)`](crate::operation::create_connection::CreateConnectionOutput::arn): <p>The ARN of the connection.</p>
20 /// - [`name(String)`](crate::operation::create_connection::CreateConnectionOutput::name): <p>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.</p>
21 /// - [`data_source(Option<DataSourceReference>)`](crate::operation::create_connection::CreateConnectionOutput::data_source): <p>The typed reference to the external data source that this connection binds to. Its <code>type</code>, the authoritative kind of data source, is in <code>dataSource.type</code>.</p>
22 /// - [`scope(Option<DataSourceScope>)`](crate::operation::create_connection::CreateConnectionOutput::scope): <p>The hierarchical subset of the data source this connection ingests.</p>
23 /// - [`access_config(Option<AccessConfig>)`](crate::operation::create_connection::CreateConnectionOutput::access_config): <p>Per-connection access configuration: the IAM role used for data access.</p>
24 /// - [`sync_schedule(Option<SyncSchedule>)`](crate::operation::create_connection::CreateConnectionOutput::sync_schedule): <p>The effective sync schedule. Present for <code>DATABRICKS</code> and <code>SNOWFLAKE</code> connections (<code>DAILY</code> if you didn't specify one). Absent for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which are event-driven.</p>
25 /// - [`ingestion_config(Option<IngestionConfig>)`](crate::operation::create_connection::CreateConnectionOutput::ingestion_config): <p>The connection's ingestion configuration (the IAM role a data producer assumes to push into this connection). Absent when no ingestion role is configured.</p>
26 /// - [`glue_connection_mappings(Option<Vec::<GlueConnectionMapping>>)`](crate::operation::create_connection::CreateConnectionOutput::glue_connection_mappings): <p>The AWS Glue connection for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>. Absent when none is configured.</p>
27 /// - [`status(ConnectionStatus)`](crate::operation::create_connection::CreateConnectionOutput::status): <p>The connection's status. Valid values:</p> <ul> <li> <p><code>CREATING</code> - Validation or provisioning is still in progress.</p></li> <li> <p><code>ACTIVE</code> - The data source is reachable and, for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, AWS Glue has provisioned catalog synchronization and returned its crawler ARN. This doesn't mean that a crawl has started or completed.</p></li> <li> <p><code>UPDATING</code> - The connection is being updated.</p></li> <li> <p><code>DELETING</code> - The connection is being deleted.</p></li> <li> <p><code>FAILED</code> - Validation or provisioning failed, and the connection can't recover.</p></li> </ul>
28 /// - [`failure(Option<ConnectionFailure>)`](crate::operation::create_connection::CreateConnectionOutput::failure): <p>The reason the connection is FAILED. Absent in every other status.</p>
29 /// - [`sub_status(Option<ResourceSubStatus>)`](crate::operation::create_connection::CreateConnectionOutput::sub_status): <p>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 <code>publish: false</code> means it is waiting for UpdateConnection <code>publish: true</code>.</p>
30 /// - [`created_at(DateTime)`](crate::operation::create_connection::CreateConnectionOutput::created_at): <p>The date and time when the connection was created.</p>
31 /// - [`updated_at(DateTime)`](crate::operation::create_connection::CreateConnectionOutput::updated_at): <p>When the resource last changed. Equal to <code>createdAt</code> until the first update.</p>
32 /// - On failure, responds with [`SdkError<CreateConnectionError>`](crate::operation::create_connection::CreateConnectionError)
33 pub fn create_connection(&self) -> crate::operation::create_connection::builders::CreateConnectionFluentBuilder {
34 crate::operation::create_connection::builders::CreateConnectionFluentBuilder::new(self.handle.clone())
35 }
36}