1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateDBInstance;
6impl CreateDBInstance {
7 pub fn new() -> Self {
9 Self
10 }
11 pub(crate) async fn orchestrate(
12 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13 input: crate::operation::create_db_instance::CreateDbInstanceInput,
14 ) -> ::std::result::Result<
15 crate::operation::create_db_instance::CreateDbInstanceOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::create_db_instance::CreateDBInstanceError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22 ::aws_smithy_runtime_api::client::interceptors::context::Error,
23 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24 >| {
25 err.map_service_error(|err| {
26 err.downcast::<crate::operation::create_db_instance::CreateDBInstanceError>()
27 .expect("correct error type")
28 })
29 };
30 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31 .await
32 .map_err(map_err)?;
33 let output = context.finalize().map_err(map_err)?;
34 ::std::result::Result::Ok(
35 output
36 .downcast::<crate::operation::create_db_instance::CreateDbInstanceOutput>()
37 .expect("correct output type"),
38 )
39 }
40
41 pub(crate) async fn orchestrate_with_stop_point(
42 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43 input: crate::operation::create_db_instance::CreateDbInstanceInput,
44 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45 ) -> ::std::result::Result<
46 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47 ::aws_smithy_runtime_api::client::result::SdkError<
48 ::aws_smithy_runtime_api::client::interceptors::context::Error,
49 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50 >,
51 > {
52 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53 use ::tracing::Instrument;
54 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("RDS", "CreateDBInstance", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "RDS.CreateDBInstance",
59 "rpc.service" = "RDS",
60 "rpc.method" = "CreateDBInstance",
61 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62 "rpc.system" = "aws-api",
63 ))
64 .await
65 }
66
67 pub(crate) fn operation_runtime_plugins(
68 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69 client_config: &crate::config::Config,
70 config_override: ::std::option::Option<crate::config::Builder>,
71 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74 if let ::std::option::Option::Some(config_override) = config_override {
75 for plugin in config_override.runtime_plugins.iter().cloned() {
76 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77 }
78 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79 config_override,
80 client_config.config.clone(),
81 &client_config.runtime_components,
82 ));
83 }
84 runtime_plugins
85 }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateDBInstance {
88 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateDBInstance");
90
91 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92 CreateDBInstanceRequestSerializer,
93 ));
94 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95 CreateDBInstanceResponseDeserializer,
96 ));
97
98 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99 crate::config::auth::Params::builder()
100 .operation_name("CreateDBInstance")
101 .build()
102 .expect("required fields set"),
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
106 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("CreateDBInstance", "RDS"));
107 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
108 signing_options.double_uri_encode = true;
109 signing_options.content_sha256_header = false;
110 signing_options.normalize_uri_path = true;
111 signing_options.payload_override = None;
112
113 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
114 signing_options,
115 ..::std::default::Default::default()
116 });
117
118 ::std::option::Option::Some(cfg.freeze())
119 }
120
121 fn runtime_components(
122 &self,
123 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
124 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
125 #[allow(unused_mut)]
126 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateDBInstance")
127 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
128 CreateDBInstanceTelemetryInputCaptureInterceptor,
129 ))
130 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
131 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
132 ))
133 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
134 CreateDBInstanceEndpointParamsInterceptor,
135 ))
136 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
137 crate::operation::create_db_instance::CreateDBInstanceError,
138 >::new())
139 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
140 crate::operation::create_db_instance::CreateDBInstanceError,
141 >::new())
142 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
143 crate::operation::create_db_instance::CreateDBInstanceError,
144 >::new());
145
146 ::std::borrow::Cow::Owned(rcb)
147 }
148}
149
150#[derive(Debug)]
151struct CreateDBInstanceTelemetryInputCaptureInterceptor;
152
153#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
154impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDBInstanceTelemetryInputCaptureInterceptor {
155 fn name(&self) -> &'static str {
156 "CreateDBInstanceTelemetryInputCaptureInterceptor"
157 }
158
159 fn read_before_execution(
160 &self,
161 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
162 '_,
163 ::aws_smithy_runtime_api::client::interceptors::context::Input,
164 ::aws_smithy_runtime_api::client::interceptors::context::Output,
165 ::aws_smithy_runtime_api::client::interceptors::context::Error,
166 >,
167 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
168 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
169 let ::std::option::Option::Some(requested) = cfg
171 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
172 .filter(|r| !r.is_empty())
173 else {
174 return ::std::result::Result::Ok(());
175 };
176
177 let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateDbInstanceInput>() else {
178 return ::std::result::Result::Ok(());
180 };
181
182 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
183 if requested.should_capture("DBName") {
184 if let ::std::option::Option::Some(value) = input.db_name.as_deref() {
185 captured.insert("DBName", value);
186 }
187 }
188 if requested.should_capture("DBInstanceIdentifier") {
189 if let ::std::option::Option::Some(value) = input.db_instance_identifier.as_deref() {
190 captured.insert("DBInstanceIdentifier", value);
191 }
192 }
193 if requested.should_capture("DBInstanceClass") {
194 if let ::std::option::Option::Some(value) = input.db_instance_class.as_deref() {
195 captured.insert("DBInstanceClass", value);
196 }
197 }
198 if requested.should_capture("Engine") {
199 if let ::std::option::Option::Some(value) = input.engine.as_deref() {
200 captured.insert("Engine", value);
201 }
202 }
203 if requested.should_capture("MasterUsername") {
204 if let ::std::option::Option::Some(value) = input.master_username.as_deref() {
205 captured.insert("MasterUsername", value);
206 }
207 }
208 if requested.should_capture("AvailabilityZone") {
209 if let ::std::option::Option::Some(value) = input.availability_zone.as_deref() {
210 captured.insert("AvailabilityZone", value);
211 }
212 }
213 if requested.should_capture("DBSubnetGroupName") {
214 if let ::std::option::Option::Some(value) = input.db_subnet_group_name.as_deref() {
215 captured.insert("DBSubnetGroupName", value);
216 }
217 }
218 if requested.should_capture("PreferredMaintenanceWindow") {
219 if let ::std::option::Option::Some(value) = input.preferred_maintenance_window.as_deref() {
220 captured.insert("PreferredMaintenanceWindow", value);
221 }
222 }
223 if requested.should_capture("DBParameterGroupName") {
224 if let ::std::option::Option::Some(value) = input.db_parameter_group_name.as_deref() {
225 captured.insert("DBParameterGroupName", value);
226 }
227 }
228 if requested.should_capture("PreferredBackupWindow") {
229 if let ::std::option::Option::Some(value) = input.preferred_backup_window.as_deref() {
230 captured.insert("PreferredBackupWindow", value);
231 }
232 }
233 if requested.should_capture("EngineVersion") {
234 if let ::std::option::Option::Some(value) = input.engine_version.as_deref() {
235 captured.insert("EngineVersion", value);
236 }
237 }
238 if requested.should_capture("LicenseModel") {
239 if let ::std::option::Option::Some(value) = input.license_model.as_deref() {
240 captured.insert("LicenseModel", value);
241 }
242 }
243 if requested.should_capture("OptionGroupName") {
244 if let ::std::option::Option::Some(value) = input.option_group_name.as_deref() {
245 captured.insert("OptionGroupName", value);
246 }
247 }
248 if requested.should_capture("CharacterSetName") {
249 if let ::std::option::Option::Some(value) = input.character_set_name.as_deref() {
250 captured.insert("CharacterSetName", value);
251 }
252 }
253 if requested.should_capture("NcharCharacterSetName") {
254 if let ::std::option::Option::Some(value) = input.nchar_character_set_name.as_deref() {
255 captured.insert("NcharCharacterSetName", value);
256 }
257 }
258 if requested.should_capture("DBClusterIdentifier") {
259 if let ::std::option::Option::Some(value) = input.db_cluster_identifier.as_deref() {
260 captured.insert("DBClusterIdentifier", value);
261 }
262 }
263 if requested.should_capture("StorageType") {
264 if let ::std::option::Option::Some(value) = input.storage_type.as_deref() {
265 captured.insert("StorageType", value);
266 }
267 }
268 if requested.should_capture("TdeCredentialArn") {
269 if let ::std::option::Option::Some(value) = input.tde_credential_arn.as_deref() {
270 captured.insert("TdeCredentialArn", value);
271 }
272 }
273 if requested.should_capture("KmsKeyId") {
274 if let ::std::option::Option::Some(value) = input.kms_key_id.as_deref() {
275 captured.insert("KmsKeyId", value);
276 }
277 }
278 if requested.should_capture("Domain") {
279 if let ::std::option::Option::Some(value) = input.domain.as_deref() {
280 captured.insert("Domain", value);
281 }
282 }
283 if requested.should_capture("DomainFqdn") {
284 if let ::std::option::Option::Some(value) = input.domain_fqdn.as_deref() {
285 captured.insert("DomainFqdn", value);
286 }
287 }
288 if requested.should_capture("DomainOu") {
289 if let ::std::option::Option::Some(value) = input.domain_ou.as_deref() {
290 captured.insert("DomainOu", value);
291 }
292 }
293 if requested.should_capture("DomainAuthSecretArn") {
294 if let ::std::option::Option::Some(value) = input.domain_auth_secret_arn.as_deref() {
295 captured.insert("DomainAuthSecretArn", value);
296 }
297 }
298 if requested.should_capture("MonitoringRoleArn") {
299 if let ::std::option::Option::Some(value) = input.monitoring_role_arn.as_deref() {
300 captured.insert("MonitoringRoleArn", value);
301 }
302 }
303 if requested.should_capture("DomainIAMRoleName") {
304 if let ::std::option::Option::Some(value) = input.domain_iam_role_name.as_deref() {
305 captured.insert("DomainIAMRoleName", value);
306 }
307 }
308 if requested.should_capture("Timezone") {
309 if let ::std::option::Option::Some(value) = input.timezone.as_deref() {
310 captured.insert("Timezone", value);
311 }
312 }
313 if requested.should_capture("PerformanceInsightsKMSKeyId") {
314 if let ::std::option::Option::Some(value) = input.performance_insights_kms_key_id.as_deref() {
315 captured.insert("PerformanceInsightsKMSKeyId", value);
316 }
317 }
318 if requested.should_capture("NetworkType") {
319 if let ::std::option::Option::Some(value) = input.network_type.as_deref() {
320 captured.insert("NetworkType", value);
321 }
322 }
323 if requested.should_capture("BackupTarget") {
324 if let ::std::option::Option::Some(value) = input.backup_target.as_deref() {
325 captured.insert("BackupTarget", value);
326 }
327 }
328 if requested.should_capture("CustomIamInstanceProfile") {
329 if let ::std::option::Option::Some(value) = input.custom_iam_instance_profile.as_deref() {
330 captured.insert("CustomIamInstanceProfile", value);
331 }
332 }
333 if requested.should_capture("DBSystemId") {
334 if let ::std::option::Option::Some(value) = input.db_system_id.as_deref() {
335 captured.insert("DBSystemId", value);
336 }
337 }
338 if requested.should_capture("CACertificateIdentifier") {
339 if let ::std::option::Option::Some(value) = input.ca_certificate_identifier.as_deref() {
340 captured.insert("CACertificateIdentifier", value);
341 }
342 }
343 if requested.should_capture("MasterUserSecretKmsKeyId") {
344 if let ::std::option::Option::Some(value) = input.master_user_secret_kms_key_id.as_deref() {
345 captured.insert("MasterUserSecretKmsKeyId", value);
346 }
347 }
348 if requested.should_capture("EngineLifecycleSupport") {
349 if let ::std::option::Option::Some(value) = input.engine_lifecycle_support.as_deref() {
350 captured.insert("EngineLifecycleSupport", value);
351 }
352 }
353
354 cfg.interceptor_state().store_put(captured);
355 ::std::result::Result::Ok(())
356 }
357}
358#[derive(Debug)]
359struct CreateDBInstanceResponseDeserializer;
360impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateDBInstanceResponseDeserializer {
361 fn deserialize_nonstreaming_with_config(
362 &self,
363 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
364 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
365 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
366 let (success, status) = (response.status().is_success(), response.status().as_u16());
367 let headers = response.headers();
368 let body = response.body().bytes().expect("body loaded");
369 #[allow(unused_mut)]
370 let mut force_error = false;
371 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
372 let parse_result = if !success && status != 200 || force_error {
373 crate::protocol_serde::shape_create_db_instance::de_create_db_instance_http_error(status, headers, body)
374 } else {
375 crate::protocol_serde::shape_create_db_instance::de_create_db_instance_http_response(status, headers, body)
376 };
377 crate::protocol_serde::type_erase_result(parse_result)
378 }
379}
380#[derive(Debug)]
381struct CreateDBInstanceRequestSerializer;
382impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateDBInstanceRequestSerializer {
383 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
384 fn serialize_input(
385 &self,
386 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
387 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
388 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
389 let input = input
390 .downcast::<crate::operation::create_db_instance::CreateDbInstanceInput>()
391 .expect("correct type");
392 let _header_serialization_settings = _cfg
393 .load::<crate::serialization_settings::HeaderSerializationSettings>()
394 .cloned()
395 .unwrap_or_default();
396 let mut request_builder = {
397 #[allow(clippy::uninlined_format_args)]
398 fn uri_base(
399 _input: &crate::operation::create_db_instance::CreateDbInstanceInput,
400 output: &mut ::std::string::String,
401 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
402 use ::std::fmt::Write as _;
403 ::std::write!(output, "/").expect("formatting should succeed");
404 ::std::result::Result::Ok(())
405 }
406 #[allow(clippy::unnecessary_wraps)]
407 fn update_http_builder(
408 input: &crate::operation::create_db_instance::CreateDbInstanceInput,
409 builder: ::http_1x::request::Builder,
410 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
411 let mut uri = ::std::string::String::new();
412 uri_base(input, &mut uri)?;
413 ::std::result::Result::Ok(builder.method("POST").uri(uri))
414 }
415 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
416 builder =
417 _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
418 builder
419 };
420 let body = ::aws_smithy_types::body::SdkBody::from(
421 crate::protocol_serde::shape_create_db_instance_input::ser_create_db_instance_input_input_input(&input)?,
422 );
423 if let Some(content_length) = body.content_length() {
424 let content_length = content_length.to_string();
425 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
426 }
427 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
428 }
429}
430#[derive(Debug)]
431struct CreateDBInstanceEndpointParamsInterceptor;
432
433#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
434impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDBInstanceEndpointParamsInterceptor {
435 fn name(&self) -> &'static str {
436 "CreateDBInstanceEndpointParamsInterceptor"
437 }
438
439 fn read_before_execution(
440 &self,
441 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
442 '_,
443 ::aws_smithy_runtime_api::client::interceptors::context::Input,
444 ::aws_smithy_runtime_api::client::interceptors::context::Output,
445 ::aws_smithy_runtime_api::client::interceptors::context::Error,
446 >,
447 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
448 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
449 let _input = context
450 .input()
451 .downcast_ref::<CreateDbInstanceInput>()
452 .ok_or("failed to downcast to CreateDbInstanceInput")?;
453
454 let params = crate::config::endpoint::Params::builder()
455 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
456 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
457 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
458 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
459 .build()
460 .map_err(|err| {
461 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
462 })?;
463 cfg.interceptor_state()
464 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
465 ::std::result::Result::Ok(())
466 }
467}
468
469#[non_exhaustive]
474#[derive(::std::fmt::Debug)]
475pub enum CreateDBInstanceError {
476 AuthorizationNotFoundFault(crate::types::error::AuthorizationNotFoundFault),
479 #[deprecated(note = "Please avoid using this fault")]
481 BackupPolicyNotFoundFault(crate::types::error::BackupPolicyNotFoundFault),
482 CertificateNotFoundFault(crate::types::error::CertificateNotFoundFault),
484 DbClusterNotFoundFault(crate::types::error::DbClusterNotFoundFault),
486 DbInstanceAlreadyExistsFault(crate::types::error::DbInstanceAlreadyExistsFault),
488 DbParameterGroupNotFoundFault(crate::types::error::DbParameterGroupNotFoundFault),
490 DbSecurityGroupNotFoundFault(crate::types::error::DbSecurityGroupNotFoundFault),
492 DbSubnetGroupDoesNotCoverEnoughAZs(crate::types::error::DbSubnetGroupDoesNotCoverEnoughAZs),
494 DbSubnetGroupNotFoundFault(crate::types::error::DbSubnetGroupNotFoundFault),
496 DomainNotFoundFault(crate::types::error::DomainNotFoundFault),
498 InstanceQuotaExceededFault(crate::types::error::InstanceQuotaExceededFault),
500 InsufficientDbInstanceCapacityFault(crate::types::error::InsufficientDbInstanceCapacityFault),
502 InvalidDbClusterStateFault(crate::types::error::InvalidDbClusterStateFault),
504 InvalidSubnet(crate::types::error::InvalidSubnet),
506 InvalidVpcNetworkStateFault(crate::types::error::InvalidVpcNetworkStateFault),
508 KmsKeyNotAccessibleFault(crate::types::error::KmsKeyNotAccessibleFault),
510 NetworkTypeNotSupported(crate::types::error::NetworkTypeNotSupported),
512 OptionGroupNotFoundFault(crate::types::error::OptionGroupNotFoundFault),
514 ProvisionedIopsNotAvailableInAzFault(crate::types::error::ProvisionedIopsNotAvailableInAzFault),
516 StorageQuotaExceededFault(crate::types::error::StorageQuotaExceededFault),
518 StorageTypeNotSupportedFault(crate::types::error::StorageTypeNotSupportedFault),
520 TenantDatabaseQuotaExceededFault(crate::types::error::TenantDatabaseQuotaExceededFault),
522 VpcEncryptionControlViolationException(crate::types::error::VpcEncryptionControlViolationException),
524 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
526 variable wildcard pattern and check `.code()`:
527 \
528 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
529 \
530 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateDBInstanceError) for what information is available for the error.")]
531 Unhandled(crate::error::sealed_unhandled::Unhandled),
532}
533impl CreateDBInstanceError {
534 pub fn unhandled(
536 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
537 ) -> Self {
538 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
539 source: err.into(),
540 meta: ::std::default::Default::default(),
541 })
542 }
543
544 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
546 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
547 source: err.clone().into(),
548 meta: err,
549 })
550 }
551 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
556 match self {
557 Self::AuthorizationNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
558 Self::BackupPolicyNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
559 Self::CertificateNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
560 Self::DbClusterNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
561 Self::DbInstanceAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
562 Self::DbParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
563 Self::DbSecurityGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
564 Self::DbSubnetGroupDoesNotCoverEnoughAZs(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
565 Self::DbSubnetGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
566 Self::DomainNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
567 Self::InstanceQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
568 Self::InsufficientDbInstanceCapacityFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
569 Self::InvalidDbClusterStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
570 Self::InvalidSubnet(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
571 Self::InvalidVpcNetworkStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
572 Self::KmsKeyNotAccessibleFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
573 Self::NetworkTypeNotSupported(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
574 Self::OptionGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
575 Self::ProvisionedIopsNotAvailableInAzFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
576 Self::StorageQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
577 Self::StorageTypeNotSupportedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
578 Self::TenantDatabaseQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
579 Self::VpcEncryptionControlViolationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
580 Self::Unhandled(e) => &e.meta,
581 }
582 }
583 pub fn is_authorization_not_found_fault(&self) -> bool {
585 matches!(self, Self::AuthorizationNotFoundFault(_))
586 }
587 pub fn is_backup_policy_not_found_fault(&self) -> bool {
589 matches!(self, Self::BackupPolicyNotFoundFault(_))
590 }
591 pub fn is_certificate_not_found_fault(&self) -> bool {
593 matches!(self, Self::CertificateNotFoundFault(_))
594 }
595 pub fn is_db_cluster_not_found_fault(&self) -> bool {
597 matches!(self, Self::DbClusterNotFoundFault(_))
598 }
599 pub fn is_db_instance_already_exists_fault(&self) -> bool {
601 matches!(self, Self::DbInstanceAlreadyExistsFault(_))
602 }
603 pub fn is_db_parameter_group_not_found_fault(&self) -> bool {
605 matches!(self, Self::DbParameterGroupNotFoundFault(_))
606 }
607 pub fn is_db_security_group_not_found_fault(&self) -> bool {
609 matches!(self, Self::DbSecurityGroupNotFoundFault(_))
610 }
611 pub fn is_db_subnet_group_does_not_cover_enough_azs(&self) -> bool {
613 matches!(self, Self::DbSubnetGroupDoesNotCoverEnoughAZs(_))
614 }
615 pub fn is_db_subnet_group_not_found_fault(&self) -> bool {
617 matches!(self, Self::DbSubnetGroupNotFoundFault(_))
618 }
619 pub fn is_domain_not_found_fault(&self) -> bool {
621 matches!(self, Self::DomainNotFoundFault(_))
622 }
623 pub fn is_instance_quota_exceeded_fault(&self) -> bool {
625 matches!(self, Self::InstanceQuotaExceededFault(_))
626 }
627 pub fn is_insufficient_db_instance_capacity_fault(&self) -> bool {
629 matches!(self, Self::InsufficientDbInstanceCapacityFault(_))
630 }
631 pub fn is_invalid_db_cluster_state_fault(&self) -> bool {
633 matches!(self, Self::InvalidDbClusterStateFault(_))
634 }
635 pub fn is_invalid_subnet(&self) -> bool {
637 matches!(self, Self::InvalidSubnet(_))
638 }
639 pub fn is_invalid_vpc_network_state_fault(&self) -> bool {
641 matches!(self, Self::InvalidVpcNetworkStateFault(_))
642 }
643 pub fn is_kms_key_not_accessible_fault(&self) -> bool {
645 matches!(self, Self::KmsKeyNotAccessibleFault(_))
646 }
647 pub fn is_network_type_not_supported(&self) -> bool {
649 matches!(self, Self::NetworkTypeNotSupported(_))
650 }
651 pub fn is_option_group_not_found_fault(&self) -> bool {
653 matches!(self, Self::OptionGroupNotFoundFault(_))
654 }
655 pub fn is_provisioned_iops_not_available_in_az_fault(&self) -> bool {
657 matches!(self, Self::ProvisionedIopsNotAvailableInAzFault(_))
658 }
659 pub fn is_storage_quota_exceeded_fault(&self) -> bool {
661 matches!(self, Self::StorageQuotaExceededFault(_))
662 }
663 pub fn is_storage_type_not_supported_fault(&self) -> bool {
665 matches!(self, Self::StorageTypeNotSupportedFault(_))
666 }
667 pub fn is_tenant_database_quota_exceeded_fault(&self) -> bool {
669 matches!(self, Self::TenantDatabaseQuotaExceededFault(_))
670 }
671 pub fn is_vpc_encryption_control_violation_exception(&self) -> bool {
673 matches!(self, Self::VpcEncryptionControlViolationException(_))
674 }
675}
676impl ::std::error::Error for CreateDBInstanceError {
677 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
678 match self {
679 Self::AuthorizationNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
680 Self::BackupPolicyNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
681 Self::CertificateNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
682 Self::DbClusterNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
683 Self::DbInstanceAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
684 Self::DbParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
685 Self::DbSecurityGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
686 Self::DbSubnetGroupDoesNotCoverEnoughAZs(_inner) => ::std::option::Option::Some(_inner),
687 Self::DbSubnetGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
688 Self::DomainNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
689 Self::InstanceQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
690 Self::InsufficientDbInstanceCapacityFault(_inner) => ::std::option::Option::Some(_inner),
691 Self::InvalidDbClusterStateFault(_inner) => ::std::option::Option::Some(_inner),
692 Self::InvalidSubnet(_inner) => ::std::option::Option::Some(_inner),
693 Self::InvalidVpcNetworkStateFault(_inner) => ::std::option::Option::Some(_inner),
694 Self::KmsKeyNotAccessibleFault(_inner) => ::std::option::Option::Some(_inner),
695 Self::NetworkTypeNotSupported(_inner) => ::std::option::Option::Some(_inner),
696 Self::OptionGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
697 Self::ProvisionedIopsNotAvailableInAzFault(_inner) => ::std::option::Option::Some(_inner),
698 Self::StorageQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
699 Self::StorageTypeNotSupportedFault(_inner) => ::std::option::Option::Some(_inner),
700 Self::TenantDatabaseQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
701 Self::VpcEncryptionControlViolationException(_inner) => ::std::option::Option::Some(_inner),
702 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
703 }
704 }
705}
706impl ::std::fmt::Display for CreateDBInstanceError {
707 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
708 match self {
709 Self::AuthorizationNotFoundFault(_inner) => _inner.fmt(f),
710 Self::BackupPolicyNotFoundFault(_inner) => _inner.fmt(f),
711 Self::CertificateNotFoundFault(_inner) => _inner.fmt(f),
712 Self::DbClusterNotFoundFault(_inner) => _inner.fmt(f),
713 Self::DbInstanceAlreadyExistsFault(_inner) => _inner.fmt(f),
714 Self::DbParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
715 Self::DbSecurityGroupNotFoundFault(_inner) => _inner.fmt(f),
716 Self::DbSubnetGroupDoesNotCoverEnoughAZs(_inner) => _inner.fmt(f),
717 Self::DbSubnetGroupNotFoundFault(_inner) => _inner.fmt(f),
718 Self::DomainNotFoundFault(_inner) => _inner.fmt(f),
719 Self::InstanceQuotaExceededFault(_inner) => _inner.fmt(f),
720 Self::InsufficientDbInstanceCapacityFault(_inner) => _inner.fmt(f),
721 Self::InvalidDbClusterStateFault(_inner) => _inner.fmt(f),
722 Self::InvalidSubnet(_inner) => _inner.fmt(f),
723 Self::InvalidVpcNetworkStateFault(_inner) => _inner.fmt(f),
724 Self::KmsKeyNotAccessibleFault(_inner) => _inner.fmt(f),
725 Self::NetworkTypeNotSupported(_inner) => _inner.fmt(f),
726 Self::OptionGroupNotFoundFault(_inner) => _inner.fmt(f),
727 Self::ProvisionedIopsNotAvailableInAzFault(_inner) => _inner.fmt(f),
728 Self::StorageQuotaExceededFault(_inner) => _inner.fmt(f),
729 Self::StorageTypeNotSupportedFault(_inner) => _inner.fmt(f),
730 Self::TenantDatabaseQuotaExceededFault(_inner) => _inner.fmt(f),
731 Self::VpcEncryptionControlViolationException(_inner) => _inner.fmt(f),
732 Self::Unhandled(_inner) => {
733 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
734 write!(f, "unhandled error ({code})")
735 } else {
736 f.write_str("unhandled error")
737 }
738 }
739 }
740 }
741}
742impl ::aws_smithy_types::retry::ProvideErrorKind for CreateDBInstanceError {
743 fn code(&self) -> ::std::option::Option<&str> {
744 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
745 }
746 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
747 ::std::option::Option::None
748 }
749}
750impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateDBInstanceError {
751 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
752 match self {
753 Self::AuthorizationNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
754 Self::BackupPolicyNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
755 Self::CertificateNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
756 Self::DbClusterNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
757 Self::DbInstanceAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
758 Self::DbParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
759 Self::DbSecurityGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
760 Self::DbSubnetGroupDoesNotCoverEnoughAZs(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
761 Self::DbSubnetGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
762 Self::DomainNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
763 Self::InstanceQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
764 Self::InsufficientDbInstanceCapacityFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
765 Self::InvalidDbClusterStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
766 Self::InvalidSubnet(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
767 Self::InvalidVpcNetworkStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
768 Self::KmsKeyNotAccessibleFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
769 Self::NetworkTypeNotSupported(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
770 Self::OptionGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
771 Self::ProvisionedIopsNotAvailableInAzFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
772 Self::StorageQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
773 Self::StorageTypeNotSupportedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
774 Self::TenantDatabaseQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
775 Self::VpcEncryptionControlViolationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
776 Self::Unhandled(_inner) => &_inner.meta,
777 }
778 }
779}
780impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateDBInstanceError {
781 fn create_unhandled_error(
782 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
783 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
784 ) -> Self {
785 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
786 source,
787 meta: meta.unwrap_or_default(),
788 })
789 }
790}
791impl ::aws_types::request_id::RequestId for crate::operation::create_db_instance::CreateDBInstanceError {
792 fn request_id(&self) -> Option<&str> {
793 self.meta().request_id()
794 }
795}
796
797pub use crate::operation::create_db_instance::_create_db_instance_input::CreateDbInstanceInput;
798
799pub use crate::operation::create_db_instance::_create_db_instance_output::CreateDbInstanceOutput;
800
801mod _create_db_instance_input;
802
803mod _create_db_instance_output;
804
805pub mod builders;