From 9c170505adbb138b530d0219bf0f40fd7b481152 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 10 Aug 2023 14:29:37 -0500 Subject: [PATCH 01/36] add support for nullable struct members when generating AWS SDKs --- aws/rust-runtime/aws-config/src/sts/util.rs | 17 ++++------------- aws/sdk-adhoc-test/build.gradle.kts | 7 +++++-- .../customize/timestream/TimestreamDecorator.kt | 4 ++-- aws/sdk/build.gradle.kts | 3 ++- .../integration-tests/dynamodb/tests/movies.rs | 12 ++++++++---- .../client/smithy/ClientCodegenVisitor.kt | 6 +++++- .../codegen/client/smithy/ClientRustSettings.kt | 3 +++ .../codegen/core/smithy/CoreRustSettings.kt | 8 ++++++-- .../protocols/parse/JsonParserGenerator.kt | 10 +++++----- .../serialize/QuerySerializerGenerator.kt | 14 ++++++++++---- rust-runtime/aws-smithy-http/Cargo.toml | 1 + .../aws-smithy-http/src/operation/error.rs | 7 +++++++ 12 files changed, 58 insertions(+), 34 deletions(-) diff --git a/aws/rust-runtime/aws-config/src/sts/util.rs b/aws/rust-runtime/aws-config/src/sts/util.rs index bc6151985d..e215204f84 100644 --- a/aws/rust-runtime/aws-config/src/sts/util.rs +++ b/aws/rust-runtime/aws-config/src/sts/util.rs @@ -17,24 +17,15 @@ pub(crate) fn into_credentials( ) -> provider::Result { let sts_credentials = sts_credentials .ok_or_else(|| CredentialsError::unhandled("STS credentials must be defined"))?; - let expiration = SystemTime::try_from( - sts_credentials - .expiration - .ok_or_else(|| CredentialsError::unhandled("missing expiration"))?, - ) - .map_err(|_| { + let expiration = SystemTime::try_from(sts_credentials.expiration).map_err(|_| { CredentialsError::unhandled( "credential expiration time cannot be represented by a SystemTime", ) })?; Ok(AwsCredentials::new( - sts_credentials - .access_key_id - .ok_or_else(|| CredentialsError::unhandled("access key id missing from result"))?, - sts_credentials - .secret_access_key - .ok_or_else(|| CredentialsError::unhandled("secret access token missing"))?, - sts_credentials.session_token, + sts_credentials.access_key_id, + sts_credentials.secret_access_key, + Some(sts_credentials.session_token), Some(expiration), provider_name, )) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 2e09902e5d..87dc86f8e8 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -38,6 +38,7 @@ dependencies { } fun getSmithyRuntimeMode(): String = properties.get("smithy.runtime.mode") ?: "orchestrator" +fun getGenerateOptionsForRequiredShapes(): String = properties.get("smithy.generate.options.for.required.shapes") ?: "true" val allCodegenTests = listOf( CodegenTest( @@ -48,7 +49,8 @@ val allCodegenTests = listOf( , "codegen": { "includeFluentClient": false, - "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}" + "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", + "generateOptionsForRequiredShapes": "${getGenerateOptionsForRequiredShapes()}" }, "customizationConfig": { "awsSdk": { @@ -65,7 +67,8 @@ val allCodegenTests = listOf( , "codegen": { "includeFluentClient": false, - "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}" + "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", + "generateOptionsForRequiredShapes": "${getGenerateOptionsForRequiredShapes()}" }, "customizationConfig": { "awsSdk": { diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/timestream/TimestreamDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/timestream/TimestreamDecorator.kt index 57c033421c..3e81426581 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/timestream/TimestreamDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/timestream/TimestreamDecorator.kt @@ -71,12 +71,12 @@ class TimestreamDecorator : ClientCodegenDecorator { client.describe_endpoints().send().await.map_err(|e| { #{ResolveEndpointError}::from_source("failed to call describe_endpoints", e) })?; - let endpoint = describe_endpoints.endpoints().unwrap().get(0).unwrap(); + let endpoint = describe_endpoints.endpoints().get(0).unwrap(); let expiry = client.conf().time_source().expect("checked when ep discovery was enabled").now() + #{Duration}::from_secs(endpoint.cache_period_in_minutes() as u64 * 60); Ok(( #{Endpoint}::builder() - .url(format!("https://{}", endpoint.address().unwrap())) + .url(format!("https://{}", endpoint.address())) .build(), expiry, )) diff --git a/aws/sdk/build.gradle.kts b/aws/sdk/build.gradle.kts index ebf1b3a705..6bd940f9bd 100644 --- a/aws/sdk/build.gradle.kts +++ b/aws/sdk/build.gradle.kts @@ -106,7 +106,8 @@ fun generateSmithyBuild(services: AwsServices): String { "debugMode": $debugMode, "eventStreamAllowList": [$eventStreamAllowListMembers], "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", - "enableUserConfigurableRuntimePlugins": false + "enableUserConfigurableRuntimePlugins": false, + "generateOptionsForRequiredShapes": false }, "service": "${service.service}", "module": "$moduleName", diff --git a/aws/sdk/integration-tests/dynamodb/tests/movies.rs b/aws/sdk/integration-tests/dynamodb/tests/movies.rs index a3eaa244ad..f9a0e01409 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/movies.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/movies.rs @@ -28,25 +28,29 @@ async fn create_table(client: &Client, table_name: &str) { KeySchemaElement::builder() .attribute_name("year") .key_type(KeyType::Hash) - .build(), + .build() + .unwrap(), ) .key_schema( KeySchemaElement::builder() .attribute_name("title") .key_type(KeyType::Range) - .build(), + .build() + .unwrap(), ) .attribute_definitions( AttributeDefinition::builder() .attribute_name("year") .attribute_type(ScalarAttributeType::N) - .build(), + .build() + .unwrap(), ) .attribute_definitions( AttributeDefinition::builder() .attribute_name("title") .attribute_type(ScalarAttributeType::S) - .build(), + .build() + .unwrap(), ) .provisioned_throughput( ProvisionedThroughput::builder() diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt index b8cf2605de..5204d706bc 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt @@ -78,7 +78,11 @@ class ClientCodegenVisitor( val rustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = settings.runtimeConfig, renameExceptions = settings.codegenConfig.renameExceptions, - nullabilityCheckMode = NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1, + nullabilityCheckMode = if (settings.codegenConfig.generateOptionsForRequiredShapes) { + NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1 + } else { + NullableIndex.CheckMode.CLIENT_CAREFUL + }, moduleProvider = ClientModuleProvider, nameBuilderFor = { symbol -> "${symbol.name}Builder" }, ) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt index c7268a67a3..b48b2de5e3 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt @@ -98,6 +98,7 @@ enum class SmithyRuntimeMode { data class ClientCodegenConfig( override val formatTimeoutSeconds: Int = defaultFormatTimeoutSeconds, override val debugMode: Boolean = defaultDebugMode, + override val generateOptionsForRequiredShapes: Boolean = defaultGenerateOptionsForRequiredShapes, val renameExceptions: Boolean = defaultRenameExceptions, val includeFluentClient: Boolean = defaultIncludeFluentClient, val addMessageToErrors: Boolean = defaultAddMessageToErrors, @@ -136,11 +137,13 @@ data class ClientCodegenConfig( enableNewSmithyRuntime = SmithyRuntimeMode.fromString(node.get().getStringMemberOrDefault("enableNewSmithyRuntime", "middleware")), includeEndpointUrlConfig = node.get().getBooleanMemberOrDefault("includeEndpointUrlConfig", defaultIncludeEndpointUrlConfig), enableUserConfigurableRuntimePlugins = node.get().getBooleanMemberOrDefault("enableUserConfigurableRuntimePlugins", defaultEnableUserConfigurableRuntimePlugins), + generateOptionsForRequiredShapes = node.get().getBooleanMemberOrDefault("generateOptionsForRequiredShapes", defaultGenerateOptionsForRequiredShapes), ) } else { ClientCodegenConfig( formatTimeoutSeconds = coreCodegenConfig.formatTimeoutSeconds, debugMode = coreCodegenConfig.debugMode, + generateOptionsForRequiredShapes = node.get().getBooleanMemberOrDefault("generateOptionsForRequiredShapes", defaultGenerateOptionsForRequiredShapes), ) } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt index 72db4046d7..e84bbb2d04 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt @@ -41,21 +41,25 @@ const val CODEGEN_SETTINGS = "codegen" open class CoreCodegenConfig( open val formatTimeoutSeconds: Int = defaultFormatTimeoutSeconds, open val debugMode: Boolean = defaultDebugMode, + open val generateOptionsForRequiredShapes: Boolean = defaultGenerateOptionsForRequiredShapes, ) { companion object { const val defaultFormatTimeoutSeconds = 20 const val defaultDebugMode = false + const val defaultGenerateOptionsForRequiredShapes = true fun fromNode(node: Optional): CoreCodegenConfig = if (node.isPresent) { CoreCodegenConfig( - node.get().getNumberMemberOrDefault("formatTimeoutSeconds", defaultFormatTimeoutSeconds).toInt(), - node.get().getBooleanMemberOrDefault("debugMode", defaultDebugMode), + formatTimeoutSeconds = node.get().getNumberMemberOrDefault("formatTimeoutSeconds", defaultFormatTimeoutSeconds).toInt(), + debugMode = node.get().getBooleanMemberOrDefault("debugMode", defaultDebugMode), + generateOptionsForRequiredShapes = node.get().getBooleanMemberOrDefault("generateOptionsForRequiredShapes", defaultGenerateOptionsForRequiredShapes), ) } else { CoreCodegenConfig( formatTimeoutSeconds = defaultFormatTimeoutSeconds, debugMode = defaultDebugMode, + generateOptionsForRequiredShapes = defaultGenerateOptionsForRequiredShapes, ) } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt index 01c2b64e6a..dbdc6d0f77 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt @@ -39,6 +39,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.canUseDefault import software.amazon.smithy.rust.codegen.core.smithy.customize.NamedCustomization import software.amazon.smithy.rust.codegen.core.smithy.customize.Section +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator.Companion.hasFallibleBuilder import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.renderUnknownVariant import software.amazon.smithy.rust.codegen.core.smithy.generators.setterName @@ -282,7 +283,7 @@ class JsonParserGenerator( is BooleanShape -> rustTemplate("#{expect_bool_or_null}(tokens.next())?", *codegenScope) is NumberShape -> deserializeNumber(target) is BlobShape -> deserializeBlob(memberShape) - is TimestampShape -> deserializeTimestamp(target, memberShape) + is TimestampShape -> deserializeTimestamp(memberShape) is CollectionShape -> deserializeCollection(target) is MapShape -> deserializeMap(target) is StructureShape -> deserializeStruct(target) @@ -356,7 +357,7 @@ class JsonParserGenerator( } } - private fun RustWriter.deserializeTimestamp(shape: TimestampShape, member: MemberShape) { + private fun RustWriter.deserializeTimestamp(member: MemberShape) { val timestampFormat = httpBindingResolver.timestampFormat( member, HttpLocation.DOCUMENT, @@ -508,9 +509,8 @@ class JsonParserGenerator( "Builder" to symbolProvider.symbolForBuilder(shape), ) deserializeStructInner(shape.members()) - // Only call `build()` if the builder is not fallible. Otherwise, return the builder. - if (returnSymbolToParse.isUnconstrained) { - rust("Ok(Some(builder))") + if (hasFallibleBuilder(shape, symbolProvider)) { + rust("Ok(Some(builder.build()?))") } else { rust("Ok(Some(builder.build()))") } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt index 974e112cde..6003193290 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt @@ -5,6 +5,7 @@ package software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize +import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.BlobShape import software.amazon.smithy.model.shapes.BooleanShape import software.amazon.smithy.model.shapes.CollectionShape @@ -44,7 +45,7 @@ import software.amazon.smithy.rust.codegen.core.util.inputShape import software.amazon.smithy.rust.codegen.core.util.isTargetUnit import software.amazon.smithy.rust.codegen.core.util.orNull -abstract class QuerySerializerGenerator(codegenContext: CodegenContext) : StructuredDataSerializerGenerator { +abstract class QuerySerializerGenerator(private val codegenContext: CodegenContext) : StructuredDataSerializerGenerator { protected data class Context( /** Expression that yields a QueryValueWriter */ val writerExpression: String, @@ -212,9 +213,14 @@ abstract class QuerySerializerGenerator(codegenContext: CodegenContext) : Struct val writer = context.writerExpression val value = context.valueExpression when (target) { - is StringShape -> when (target.hasTrait()) { - true -> rust("$writer.string(${value.name}.as_str());") - false -> rust("$writer.string(${value.name});") + is StringShape -> { + when ( + target.hasTrait() || + symbolProvider.config.nullabilityCheckMode == NullableIndex.CheckMode.CLIENT_CAREFUL + ) { + true -> rust("$writer.string(${value.name}.as_str());") + false -> rust("$writer.string(${value.name});") + } } is BooleanShape -> rust("$writer.boolean(${value.asValue()});") is NumberShape -> { diff --git a/rust-runtime/aws-smithy-http/Cargo.toml b/rust-runtime/aws-smithy-http/Cargo.toml index 0238f5dfc6..784222bd30 100644 --- a/rust-runtime/aws-smithy-http/Cargo.toml +++ b/rust-runtime/aws-smithy-http/Cargo.toml @@ -17,6 +17,7 @@ event-stream = ["aws-smithy-eventstream"] [dependencies] aws-smithy-eventstream = { path = "../aws-smithy-eventstream", optional = true } aws-smithy-types = { path = "../aws-smithy-types" } +aws-smithy-json = { path = "../aws-smithy-json" } bytes = "1" bytes-utils = "0.1" http = "0.2.3" diff --git a/rust-runtime/aws-smithy-http/src/operation/error.rs b/rust-runtime/aws-smithy-http/src/operation/error.rs index 5b2024396f..6c7cf67cd5 100644 --- a/rust-runtime/aws-smithy-http/src/operation/error.rs +++ b/rust-runtime/aws-smithy-http/src/operation/error.rs @@ -5,6 +5,7 @@ //! Errors for operations +use aws_smithy_json::deserialize::error::DeserializeError; use aws_smithy_types::date_time::DateTimeFormatError; use http::uri::InvalidUri; use std::borrow::Cow; @@ -185,3 +186,9 @@ impl Error for BuildError { } } } + +impl From for DeserializeError { + fn from(build_error: BuildError) -> Self { + DeserializeError::custom_source("deserialization failed due to a build error", build_error) + } +} From b1c7ec5ee424365e3cc20d2f06cd610394cb3884 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 10 Aug 2023 14:46:59 -0500 Subject: [PATCH 02/36] add CHANGELOG.next.toml entries --- CHANGELOG.next.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index fac4ec6ebd..5a596743f4 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -22,3 +22,15 @@ message = "`RuntimeComponents` and `RuntimeComponentsBuilder` are now re-exporte references = ["smithy-rs#2904"] meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client"} author = "jdisanti" + +[[aws-sdk-rust]] +message = "Struct members modeled as required are no longer wrapped in `Option`s." +references = ["smithy-rs#2916", "aws-sdk-rust#536"] +meta = { "breaking" = true, "tada" = true, "bug" = false } +author = "Velfi" + +[[smithy-rs]] +message = "Support for Smithy IDLv2 nullability can now be enabled by setting `generateOptionsForRequiredShapes = false` in your codegen config. This will render `@required` struct members without an `Option`." +references = ["smithy-rs#2916", "smithy-rs#1767"] +meta = { "breaking" = false, "tada" = true, "bug" = false, "target" = "client"} +author = "Velfi" From 0f27839dda3b934530004e55039b361320805c93 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 10 Aug 2023 14:54:30 -0500 Subject: [PATCH 03/36] fix SDK adhoc tests config generation --- aws/sdk-adhoc-test/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 87dc86f8e8..1edad01980 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -38,7 +38,7 @@ dependencies { } fun getSmithyRuntimeMode(): String = properties.get("smithy.runtime.mode") ?: "orchestrator" -fun getGenerateOptionsForRequiredShapes(): String = properties.get("smithy.generate.options.for.required.shapes") ?: "true" +fun getGenerateOptionsForRequiredShapes(): Boolean = properties.get("smithy.generate.options.for.required.shapes").toBoolean() val allCodegenTests = listOf( CodegenTest( @@ -50,7 +50,7 @@ val allCodegenTests = listOf( "codegen": { "includeFluentClient": false, "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", - "generateOptionsForRequiredShapes": "${getGenerateOptionsForRequiredShapes()}" + "generateOptionsForRequiredShapes": ${getGenerateOptionsForRequiredShapes()} }, "customizationConfig": { "awsSdk": { @@ -68,7 +68,7 @@ val allCodegenTests = listOf( "codegen": { "includeFluentClient": false, "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", - "generateOptionsForRequiredShapes": "${getGenerateOptionsForRequiredShapes()}" + "generateOptionsForRequiredShapes": ${getGenerateOptionsForRequiredShapes()} }, "customizationConfig": { "awsSdk": { From 81f428bddbda7b1f01a7bf2ddb2f47c5847c980b Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 10 Aug 2023 15:08:18 -0500 Subject: [PATCH 04/36] fix XML parseStructure --- .../parse/XmlBindingTraitParserGenerator.kt | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt index d083d0e901..839542e5e1 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt @@ -474,16 +474,17 @@ class XmlBindingTraitParserGenerator( } else { rust("let _ = decoder;") } - withBlock("Ok(builder.build()", ")") { - if (BuilderGenerator.hasFallibleBuilder(shape, symbolProvider)) { - // NOTE:(rcoh) This branch is unreachable given the current nullability rules. - // Only synthetic inputs can have fallible builders, but synthetic inputs can never be parsed - // (because they're inputs, only outputs will be parsed!) - - // I'm leaving this branch here so that the binding trait parser generator would work for a server - // side implementation in the future. - rustTemplate(""".map_err(|_|#{XmlDecodeError}::custom("missing field"))?""", *codegenScope) - } + + if (BuilderGenerator.hasFallibleBuilder(shape, symbolProvider)) { + // NOTE:(rcoh) This branch is unreachable given the current nullability rules. + // Only synthetic inputs can have fallible builders, but synthetic inputs can never be parsed + // (because they're inputs, only outputs will be parsed!) + + // I'm leaving this branch here so that the binding trait parser generator would work for a server + // side implementation in the future. + rustTemplate("""builder.build().map_err(|_|#{XmlDecodeError}::custom("missing field"))""", *codegenScope) + } else { + rust("Ok(builder.build())") } } } From 266f54fa0e4b394cb4703ca17f04738376fabe9c Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 12:45:08 -0500 Subject: [PATCH 05/36] fix server codegen issue --- .../client/smithy/ClientRustSettings.kt | 2 +- .../protocol/ProtocolParserGenerator.kt | 24 +++++++++++-------- .../protocols/parse/JsonParserGenerator.kt | 16 ++++++++++--- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt index b48b2de5e3..c8823455e4 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt @@ -143,7 +143,7 @@ data class ClientCodegenConfig( ClientCodegenConfig( formatTimeoutSeconds = coreCodegenConfig.formatTimeoutSeconds, debugMode = coreCodegenConfig.debugMode, - generateOptionsForRequiredShapes = node.get().getBooleanMemberOrDefault("generateOptionsForRequiredShapes", defaultGenerateOptionsForRequiredShapes), + generateOptionsForRequiredShapes = coreCodegenConfig.generateOptionsForRequiredShapes, ) } } diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt index 61b0c42047..15e47d8ddd 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt @@ -137,7 +137,7 @@ class ProtocolParserGenerator( withBlock("Err(match error_code {", "})") { val errors = operationShape.operationErrors(model) errors.forEach { error -> - val errorShape = model.expectShape(error.id, software.amazon.smithy.model.shapes.StructureShape::class.java) + val errorShape = model.expectShape(error.id, StructureShape::class.java) val variantName = symbolProvider.toSymbol(model.expectShape(error.id)).name val errorCode = httpBindingResolver.errorCode(errorShape).dq() withBlock( @@ -145,7 +145,7 @@ class ProtocolParserGenerator( "}),", errorSymbol, ) { - software.amazon.smithy.rust.codegen.core.rustlang.Attribute.AllowUnusedMut.render(this) + Attribute.AllowUnusedMut.render(this) assignment("mut tmp") { rustBlock("") { renderShapeParser( @@ -166,14 +166,18 @@ class ProtocolParserGenerator( ) } } - if (errorShape.errorMessageMember() != null) { - rust( - """ - if tmp.message.is_none() { - tmp.message = _error_message; - } - """, - ) + val errorMessageMember = errorShape.errorMessageMember() + // If the message member is optional and wasn't set, we set a generic error message. + if (errorMessageMember != null) { + if (errorMessageMember.isOptional) { + rust( + """ + if tmp.message.is_none() { + tmp.message = _error_message; + } + """, + ) + } } rust("tmp") } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt index dbdc6d0f77..8b527647c0 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt @@ -509,10 +509,20 @@ class JsonParserGenerator( "Builder" to symbolProvider.symbolForBuilder(shape), ) deserializeStructInner(shape.members()) - if (hasFallibleBuilder(shape, symbolProvider)) { - rust("Ok(Some(builder.build()?))") + + // TODO the need for this check should be eliminated or the server code should be updated. + if (codegenContext.target == CodegenTarget.SERVER) { + if (returnSymbolToParse.isUnconstrained) { + rust("Ok(Some(builder))") + } else { + rust("Ok(Some(builder.build()))") + } } else { - rust("Ok(Some(builder.build()))") + if (hasFallibleBuilder(shape, symbolProvider)) { + rust("Ok(Some(builder.build()?))") + } else { + rust("Ok(Some(builder.build()))") + } } } } From 86dc32235e0f2f80b9d772a28018e5b7661e7bac Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 12:52:51 -0500 Subject: [PATCH 06/36] remove TODO --- .../codegen/core/smithy/protocols/parse/JsonParserGenerator.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt index 8b527647c0..9905d7ddce 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt @@ -510,7 +510,6 @@ class JsonParserGenerator( ) deserializeStructInner(shape.members()) - // TODO the need for this check should be eliminated or the server code should be updated. if (codegenContext.target == CodegenTarget.SERVER) { if (returnSymbolToParse.isUnconstrained) { rust("Ok(Some(builder))") From a5565a345fa228114aa288a90a20eb5cec5f7297 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 13:58:01 -0500 Subject: [PATCH 07/36] update route53 resource ID trimmer --- .../src/route53_resource_id_preprocessor.rs | 26 ++++++++----------- .../customize/route53/Route53Decorator.kt | 3 ++- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs index 32fad6b160..e9a8cfe7f4 100644 --- a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs +++ b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs @@ -16,7 +16,7 @@ use std::marker::PhantomData; // This function is only used to strip prefixes from resource IDs at the time they're passed as // input to a request. Resource IDs returned in responses may or may not include a prefix. /// Strip the resource type prefix from resource ID return -fn trim_resource_id(resource_id: &mut Option) { +fn trim_resource_id(resource_id: Option<&mut String>) { const PREFIXES: &[&str] = &[ "/hostedzone/", "hostedzone/", @@ -26,13 +26,9 @@ fn trim_resource_id(resource_id: &mut Option) { "delegationset/", ]; - for prefix in PREFIXES { - if let Some(id) = resource_id - .as_deref() - .unwrap_or_default() - .strip_prefix(prefix) - { - *resource_id = Some(id.to_string()); + if let Some(resource_id) = resource_id { + if let Some(trimmed_id) = resource_id.strip_prefix("/hostedzone/") { + *resource_id = trimmed_id.to_string(); return; } } @@ -40,7 +36,7 @@ fn trim_resource_id(resource_id: &mut Option) { pub(crate) struct Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> &'a mut Option, + G: for<'a> Fn(&'a mut T) -> Option<&'a mut String>, { get_mut_resource_id: G, _phantom: PhantomData, @@ -48,7 +44,7 @@ where impl fmt::Debug for Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> &'a mut Option, + G: for<'a> Fn(&'a mut T) -> Option<&'a mut String>, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Route53ResourceIdInterceptor").finish() @@ -57,7 +53,7 @@ where impl Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> &'a mut Option, + G: for<'a> Fn(&'a mut T) -> Option<&'a mut String>, { pub(crate) fn new(get_mut_resource_id: G) -> Self { Self { @@ -69,7 +65,7 @@ where impl Interceptor for Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> &'a mut Option + Send + Sync, + G: for<'a> Fn(&'a mut T) -> Option<&'a mut String> + Send + Sync, T: fmt::Debug + Send + Sync + 'static, { fn name(&self) -> &'static str { @@ -102,7 +98,7 @@ mod test { let mut operation = OperationInput { resource: Some("Z0441723226OZ66S5ZCNZ".to_string()), }; - trim_resource_id(&mut operation.resource); + trim_resource_id(operation.resource.as_mut()); assert_eq!( &operation.resource.unwrap_or_default(), "Z0441723226OZ66S5ZCNZ" @@ -118,7 +114,7 @@ mod test { let mut operation = OperationInput { change_id: Some("/change/Z0441723226OZ66S5ZCNZ".to_string()), }; - trim_resource_id(&mut operation.change_id); + trim_resource_id(operation.change_id.as_mut()); assert_eq!( &operation.change_id.unwrap_or_default(), "Z0441723226OZ66S5ZCNZ" @@ -134,7 +130,7 @@ mod test { let mut operation = OperationInput { hosted_zone: Some("hostedzone/Z0441723226OZ66S5ZCNZ".to_string()), }; - trim_resource_id(&mut operation.hosted_zone); + trim_resource_id(operation.hosted_zone.as_mut()); assert_eq!( &operation.hosted_zone.unwrap_or_default(), "Z0441723226OZ66S5ZCNZ" diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt index 9e0888fa39..a236ccaab8 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt @@ -96,10 +96,11 @@ class TrimResourceIdCustomization( RuntimeType.forInlineDependency( InlineAwsDependency.forRustFile("route53_resource_id_preprocessor"), ).resolve("Route53ResourceIdInterceptor") + rustTemplate( """ #{Route53ResourceIdInterceptor}::new(|input: &mut #{Input}| { - &mut input.$fieldName + Some(&mut input.$fieldName) }) """, "Input" to codegenContext.symbolProvider.toSymbol(inputShape), From 2d20462329aaaf483cd74bc995badf0634b9249e Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 14:14:27 -0500 Subject: [PATCH 08/36] add back the prefix loop that I accidentally removed --- .../src/route53_resource_id_preprocessor.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs index e9a8cfe7f4..f04d71a0da 100644 --- a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs +++ b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs @@ -26,10 +26,12 @@ fn trim_resource_id(resource_id: Option<&mut String>) { "delegationset/", ]; - if let Some(resource_id) = resource_id { - if let Some(trimmed_id) = resource_id.strip_prefix("/hostedzone/") { - *resource_id = trimmed_id.to_string(); - return; + for prefix in PREFIXES { + if let Some(resource_id) = resource_id { + if let Some(trimmed_id) = resource_id.strip_prefix(prefix) { + *resource_id = trimmed_id.to_string(); + return; + } } } } From acff7bd46ce48d396d831b9def0def0af78a5789 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 14:38:59 -0500 Subject: [PATCH 09/36] more fixing for route53 --- .../src/route53_resource_id_preprocessor.rs | 48 ++++++++----------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs index f04d71a0da..590cb39081 100644 --- a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs +++ b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs @@ -16,7 +16,7 @@ use std::marker::PhantomData; // This function is only used to strip prefixes from resource IDs at the time they're passed as // input to a request. Resource IDs returned in responses may or may not include a prefix. /// Strip the resource type prefix from resource ID return -fn trim_resource_id(resource_id: Option<&mut String>) { +fn trim_resource_id(resource_id: &mut String) { const PREFIXES: &[&str] = &[ "/hostedzone/", "hostedzone/", @@ -27,11 +27,9 @@ fn trim_resource_id(resource_id: Option<&mut String>) { ]; for prefix in PREFIXES { - if let Some(resource_id) = resource_id { - if let Some(trimmed_id) = resource_id.strip_prefix(prefix) { - *resource_id = trimmed_id.to_string(); - return; - } + if let Some(trimmed_id) = resource_id.strip_prefix(prefix) { + *resource_id = trimmed_id.to_string(); + return; } } } @@ -81,8 +79,9 @@ where _cfg: &mut ConfigBag, ) -> Result<(), BoxError> { let input: &mut T = context.input_mut().downcast_mut().expect("correct type"); - let field = (self.get_mut_resource_id)(input); - trim_resource_id(field); + if let Some(field) = (self.get_mut_resource_id)(input) { + trim_resource_id(field) + } Ok(()) } } @@ -94,48 +93,39 @@ mod test { #[test] fn does_not_change_regular_zones() { struct OperationInput { - resource: Option, + resource: String, } let mut operation = OperationInput { - resource: Some("Z0441723226OZ66S5ZCNZ".to_string()), + resource: "Z0441723226OZ66S5ZCNZ".to_string(), }; - trim_resource_id(operation.resource.as_mut()); - assert_eq!( - &operation.resource.unwrap_or_default(), - "Z0441723226OZ66S5ZCNZ" - ); + trim_resource_id(&mut operation.resource); + assert_eq!(&operation.resource, "Z0441723226OZ66S5ZCNZ"); } #[test] fn sanitizes_prefixed_zone() { struct OperationInput { - change_id: Option, + change_id: String, } let mut operation = OperationInput { - change_id: Some("/change/Z0441723226OZ66S5ZCNZ".to_string()), + change_id: "/change/Z0441723226OZ66S5ZCNZ".to_string(), }; - trim_resource_id(operation.change_id.as_mut()); - assert_eq!( - &operation.change_id.unwrap_or_default(), - "Z0441723226OZ66S5ZCNZ" - ); + trim_resource_id(&mut operation.change_id); + assert_eq!(&operation.change_id, "Z0441723226OZ66S5ZCNZ"); } #[test] fn allow_no_leading_slash() { struct OperationInput { - hosted_zone: Option, + hosted_zone: String, } let mut operation = OperationInput { - hosted_zone: Some("hostedzone/Z0441723226OZ66S5ZCNZ".to_string()), + hosted_zone: "hostedzone/Z0441723226OZ66S5ZCNZ".to_string(), }; - trim_resource_id(operation.hosted_zone.as_mut()); - assert_eq!( - &operation.hosted_zone.unwrap_or_default(), - "Z0441723226OZ66S5ZCNZ" - ); + trim_resource_id(&mut operation.hosted_zone); + assert_eq!(&operation.hosted_zone, "Z0441723226OZ66S5ZCNZ"); } } From 976f3a25b28095440a20cade84a1048574fde199 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 14:59:49 -0500 Subject: [PATCH 10/36] fix query serializer generator ref --- .../core/smithy/protocols/serialize/QuerySerializerGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt index 6003193290..5af795e94a 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt @@ -242,7 +242,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte is TimestampShape -> { val timestampFormat = determineTimestampFormat(context.shape) val timestampFormatType = RuntimeType.serializeTimestampFormat(runtimeConfig, timestampFormat) - rust("$writer.date_time(${value.name}, #T)?;", timestampFormatType) + rust("$writer.date_time(&${value.name}, #T)?;", timestampFormatType) } is CollectionShape -> serializeCollection(context, Context(writer, context.valueExpression, target)) is MapShape -> serializeMap(context, Context(writer, context.valueExpression, target)) From 397c4abd31bc99dd73444aa16a8d1e2941ae4841 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 14 Aug 2023 16:17:30 -0500 Subject: [PATCH 11/36] fix the QuerySerializerGenerator correctly --- .../core/smithy/protocols/serialize/QuerySerializerGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt index 5af795e94a..d2125e2acd 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt @@ -242,7 +242,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte is TimestampShape -> { val timestampFormat = determineTimestampFormat(context.shape) val timestampFormatType = RuntimeType.serializeTimestampFormat(runtimeConfig, timestampFormat) - rust("$writer.date_time(&${value.name}, #T)?;", timestampFormatType) + rust("$writer.date_time(${value.asRef()}, #T)?;", timestampFormatType) } is CollectionShape -> serializeCollection(context, Context(writer, context.valueExpression, target)) is MapShape -> serializeMap(context, Context(writer, context.valueExpression, target)) From 80bb7680a254213ed8be72ba533feeb50b9ee783 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Tue, 15 Aug 2023 10:52:45 -0500 Subject: [PATCH 12/36] fix idempotency token generation --- .../smithy/customizations/IdempotencyTokenGenerator.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt index 3ee06bcea5..098f91c11f 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt @@ -40,12 +40,15 @@ class IdempotencyTokenGenerator( return when (section) { is OperationSection.AdditionalRuntimePlugins -> writable { section.addOperationRuntimePlugin(this) { + // An idempotency token is required, but it'll be set to an empty string if + // the user didn't specify one. If that's the case, then we'll generate one + // and set it. rustTemplate( """ #{IdempotencyTokenRuntimePlugin}::new(|token_provider, input| { let input: &mut #{Input} = input.downcast_mut().expect("correct type"); - if input.$memberName.is_none() { - input.$memberName = #{Some}(token_provider.make_idempotency_token()); + if input.$memberName.is_empty() { + input.$memberName = token_provider.make_idempotency_token(); } }) """, From a44ae9973432faaaf10a4ed1611acef354e59a29 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Tue, 15 Aug 2023 11:29:03 -0500 Subject: [PATCH 13/36] no really, fix idempotency token generation update code in response to PR comments --- .../IdempotencyTokenGenerator.kt | 65 ++++++++++++------- .../protocol/ProtocolTestGenerator.kt | 2 +- .../parse/XmlBindingTraitParserGenerator.kt | 6 -- .../aws-smithy-http/src/operation/error.rs | 5 +- 4 files changed, 48 insertions(+), 30 deletions(-) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt index 098f91c11f..502aababcb 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/IdempotencyTokenGenerator.kt @@ -19,6 +19,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.toType import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType.Companion.preludeScope +import software.amazon.smithy.rust.codegen.core.smithy.isOptional import software.amazon.smithy.rust.codegen.core.util.findMemberWithTrait import software.amazon.smithy.rust.codegen.core.util.inputShape @@ -37,31 +38,51 @@ class IdempotencyTokenGenerator( return emptySection } val memberName = symbolProvider.toMemberName(idempotencyTokenMember) + val codegenScope = arrayOf( + *preludeScope, + "Input" to symbolProvider.toSymbol(inputShape), + "IdempotencyTokenRuntimePlugin" to + InlineDependency.forRustFile( + RustModule.pubCrate("client_idempotency_token", parent = ClientRustModule.root), + "/inlineable/src/client_idempotency_token.rs", + CargoDependency.smithyRuntimeApi(runtimeConfig), + CargoDependency.smithyTypes(runtimeConfig), + ).toType().resolve("IdempotencyTokenRuntimePlugin"), + ) + return when (section) { is OperationSection.AdditionalRuntimePlugins -> writable { section.addOperationRuntimePlugin(this) { - // An idempotency token is required, but it'll be set to an empty string if - // the user didn't specify one. If that's the case, then we'll generate one - // and set it. - rustTemplate( - """ - #{IdempotencyTokenRuntimePlugin}::new(|token_provider, input| { - let input: &mut #{Input} = input.downcast_mut().expect("correct type"); - if input.$memberName.is_empty() { - input.$memberName = token_provider.make_idempotency_token(); - } - }) - """, - *preludeScope, - "Input" to symbolProvider.toSymbol(inputShape), - "IdempotencyTokenRuntimePlugin" to - InlineDependency.forRustFile( - RustModule.pubCrate("client_idempotency_token", parent = ClientRustModule.root), - "/inlineable/src/client_idempotency_token.rs", - CargoDependency.smithyRuntimeApi(runtimeConfig), - CargoDependency.smithyTypes(runtimeConfig), - ).toType().resolve("IdempotencyTokenRuntimePlugin"), - ) + if (symbolProvider.toSymbol(idempotencyTokenMember).isOptional()) { + // An idempotency token is optional. If the user didn't specify a token + // then we'll generate one and set it. + rustTemplate( + """ + #{IdempotencyTokenRuntimePlugin}::new(|token_provider, input| { + let input: &mut #{Input} = input.downcast_mut().expect("correct type"); + if input.$memberName.is_none() { + input.$memberName = #{Some}(token_provider.make_idempotency_token()); + } + }) + """, + *codegenScope, + ) + } else { + // An idempotency token is required, but it'll be set to an empty string if + // the user didn't specify one. If that's the case, then we'll generate one + // and set it. + rustTemplate( + """ + #{IdempotencyTokenRuntimePlugin}::new(|token_provider, input| { + let input: &mut #{Input} = input.downcast_mut().expect("correct type"); + if input.$memberName.is_empty() { + input.$memberName = token_provider.make_idempotency_token(); + } + }) + """, + *codegenScope, + ) + } } } is OperationSection.MutateInput -> writable { diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolTestGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolTestGenerator.kt index 2f994788fe..ba91a9f29b 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolTestGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolTestGenerator.kt @@ -471,7 +471,7 @@ class DefaultProtocolTestGenerator( // When we generate a body instead of a stub, drop the trailing `;` and enable the assertion assertOk(rustWriter) { rustWriter.write( - "#T(&body, ${ + "#T(body, ${ rustWriter.escape(body).dq() }, #T::from(${(mediaType ?: "unknown").dq()}))", RT.protocolTest(rc, "validate_body"), diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt index 839542e5e1..6538dab7a9 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt @@ -476,12 +476,6 @@ class XmlBindingTraitParserGenerator( } if (BuilderGenerator.hasFallibleBuilder(shape, symbolProvider)) { - // NOTE:(rcoh) This branch is unreachable given the current nullability rules. - // Only synthetic inputs can have fallible builders, but synthetic inputs can never be parsed - // (because they're inputs, only outputs will be parsed!) - - // I'm leaving this branch here so that the binding trait parser generator would work for a server - // side implementation in the future. rustTemplate("""builder.build().map_err(|_|#{XmlDecodeError}::custom("missing field"))""", *codegenScope) } else { rust("Ok(builder.build())") diff --git a/rust-runtime/aws-smithy-http/src/operation/error.rs b/rust-runtime/aws-smithy-http/src/operation/error.rs index 6c7cf67cd5..2079b9b212 100644 --- a/rust-runtime/aws-smithy-http/src/operation/error.rs +++ b/rust-runtime/aws-smithy-http/src/operation/error.rs @@ -189,6 +189,9 @@ impl Error for BuildError { impl From for DeserializeError { fn from(build_error: BuildError) -> Self { - DeserializeError::custom_source("deserialization failed due to a build error", build_error) + DeserializeError::custom_source( + "deserialization failed because a required field was missing", + build_error, + ) } } From 916265adc1fd49cfdbba9203f2c7ce51bcab772b Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Wed, 16 Aug 2023 14:00:33 -0500 Subject: [PATCH 14/36] fix serde bugs update serde tests to cover more cases --- aws/sdk-adhoc-test/build.gradle.kts | 6 +- .../ec2/EC2MakePrimitivesOptionalTest.kt | 15 +- aws/sdk/build.gradle.kts | 2 +- .../client/smithy/ClientCodegenVisitor.kt | 7 +- .../client/smithy/ClientRustSettings.kt | 8 +- .../codegen/core/smithy/CoreRustSettings.kt | 4 - .../rust/codegen/core/smithy/SymbolVisitor.kt | 2 +- .../serialize/QuerySerializerGenerator.kt | 32 ++- .../rust/codegen/core/testutil/TestHelpers.kt | 10 +- .../core/rustlang/RustReservedWordsTest.kt | 4 +- .../generators/StructureGeneratorTest.kt | 1 - .../AwsQuerySerializerGeneratorTest.kt | 160 ++++++++++++++- .../Ec2QuerySerializerGeneratorTest.kt | 165 +++++++++++++++- .../serialize/JsonSerializerGeneratorTest.kt | 186 +++++++++++++++++- .../XmlBindingTraitSerializerGeneratorTest.kt | 180 ++++++++++++++++- 15 files changed, 728 insertions(+), 54 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 1edad01980..a9a8eb82c5 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -38,7 +38,7 @@ dependencies { } fun getSmithyRuntimeMode(): String = properties.get("smithy.runtime.mode") ?: "orchestrator" -fun getGenerateOptionsForRequiredShapes(): Boolean = properties.get("smithy.generate.options.for.required.shapes").toBoolean() +fun getNullabilityCheckMode(): String = properties.get("smithy.nullability.check.mode") ?: "CLIENT" val allCodegenTests = listOf( CodegenTest( @@ -50,7 +50,7 @@ val allCodegenTests = listOf( "codegen": { "includeFluentClient": false, "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", - "generateOptionsForRequiredShapes": ${getGenerateOptionsForRequiredShapes()} + "nullabilityCheckMode": ${getNullabilityCheckMode()} }, "customizationConfig": { "awsSdk": { @@ -68,7 +68,7 @@ val allCodegenTests = listOf( "codegen": { "includeFluentClient": false, "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", - "generateOptionsForRequiredShapes": ${getGenerateOptionsForRequiredShapes()} + "nullabilityCheckMode": ${getNullabilityCheckMode()} }, "customizationConfig": { "awsSdk": { diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/customize/ec2/EC2MakePrimitivesOptionalTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/customize/ec2/EC2MakePrimitivesOptionalTest.kt index 51eba7fa86..ae919497f0 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/customize/ec2/EC2MakePrimitivesOptionalTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/customize/ec2/EC2MakePrimitivesOptionalTest.kt @@ -6,15 +6,22 @@ package software.amazon.smithy.rustsdk.customize.ec2 import io.kotest.matchers.shouldBe -import org.junit.jupiter.api.Test +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.CsvSource import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel import software.amazon.smithy.rust.codegen.core.util.lookup internal class EC2MakePrimitivesOptionalTest { - @Test - fun `primitive shapes are boxed`() { + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + ) + fun `primitive shapes are boxed`(nullabilityCheckMode: NullableIndex.CheckMode) { val baseModel = """ namespace test structure Primitives { @@ -36,7 +43,7 @@ internal class EC2MakePrimitivesOptionalTest { val nullableIndex = NullableIndex(model) val struct = model.lookup("test#Primitives") struct.members().forEach { - nullableIndex.isMemberNullable(it, NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1) shouldBe true + nullableIndex.isMemberNullable(it, nullabilityCheckMode) shouldBe true } } } diff --git a/aws/sdk/build.gradle.kts b/aws/sdk/build.gradle.kts index 3b3d3472f8..96f26534a6 100644 --- a/aws/sdk/build.gradle.kts +++ b/aws/sdk/build.gradle.kts @@ -107,7 +107,7 @@ fun generateSmithyBuild(services: AwsServices): String { "eventStreamAllowList": [$eventStreamAllowListMembers], "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", "enableUserConfigurableRuntimePlugins": false, - "generateOptionsForRequiredShapes": false + "nullabilityCheckMode": "CLIENT_CAREFUL" }, "service": "${service.service}", "module": "$moduleName", diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt index 5204d706bc..59a4840704 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt @@ -7,7 +7,6 @@ package software.amazon.smithy.rust.codegen.client.smithy import software.amazon.smithy.build.PluginContext import software.amazon.smithy.model.Model -import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.model.shapes.Shape @@ -78,11 +77,7 @@ class ClientCodegenVisitor( val rustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = settings.runtimeConfig, renameExceptions = settings.codegenConfig.renameExceptions, - nullabilityCheckMode = if (settings.codegenConfig.generateOptionsForRequiredShapes) { - NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1 - } else { - NullableIndex.CheckMode.CLIENT_CAREFUL - }, + nullabilityCheckMode = settings.codegenConfig.nullabilityCheckMode, moduleProvider = ClientModuleProvider, nameBuilderFor = { symbol -> "${symbol.name}Builder" }, ) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt index c8823455e4..a077ea3642 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt @@ -6,6 +6,7 @@ package software.amazon.smithy.rust.codegen.client.smithy import software.amazon.smithy.model.Model +import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.node.ObjectNode import software.amazon.smithy.model.shapes.ShapeId import software.amazon.smithy.rust.codegen.core.smithy.CODEGEN_SETTINGS @@ -98,7 +99,7 @@ enum class SmithyRuntimeMode { data class ClientCodegenConfig( override val formatTimeoutSeconds: Int = defaultFormatTimeoutSeconds, override val debugMode: Boolean = defaultDebugMode, - override val generateOptionsForRequiredShapes: Boolean = defaultGenerateOptionsForRequiredShapes, + val nullabilityCheckMode: NullableIndex.CheckMode = NullableIndex.CheckMode.CLIENT, val renameExceptions: Boolean = defaultRenameExceptions, val includeFluentClient: Boolean = defaultIncludeFluentClient, val addMessageToErrors: Boolean = defaultAddMessageToErrors, @@ -120,6 +121,7 @@ data class ClientCodegenConfig( private val defaultEnableNewSmithyRuntime = SmithyRuntimeMode.Orchestrator private const val defaultIncludeEndpointUrlConfig = true private const val defaultEnableUserConfigurableRuntimePlugins = true + private val defaultNullabilityCheckMode = "CLIENT" fun fromCodegenConfigAndNode(coreCodegenConfig: CoreCodegenConfig, node: Optional) = if (node.isPresent) { @@ -137,13 +139,13 @@ data class ClientCodegenConfig( enableNewSmithyRuntime = SmithyRuntimeMode.fromString(node.get().getStringMemberOrDefault("enableNewSmithyRuntime", "middleware")), includeEndpointUrlConfig = node.get().getBooleanMemberOrDefault("includeEndpointUrlConfig", defaultIncludeEndpointUrlConfig), enableUserConfigurableRuntimePlugins = node.get().getBooleanMemberOrDefault("enableUserConfigurableRuntimePlugins", defaultEnableUserConfigurableRuntimePlugins), - generateOptionsForRequiredShapes = node.get().getBooleanMemberOrDefault("generateOptionsForRequiredShapes", defaultGenerateOptionsForRequiredShapes), + nullabilityCheckMode = NullableIndex.CheckMode.valueOf(node.get().getStringMemberOrDefault("nullabilityCheckMode", defaultNullabilityCheckMode)), ) } else { ClientCodegenConfig( formatTimeoutSeconds = coreCodegenConfig.formatTimeoutSeconds, debugMode = coreCodegenConfig.debugMode, - generateOptionsForRequiredShapes = coreCodegenConfig.generateOptionsForRequiredShapes, + nullabilityCheckMode = NullableIndex.CheckMode.valueOf(defaultNullabilityCheckMode), ) } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt index e84bbb2d04..b477ab5607 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/CoreRustSettings.kt @@ -41,25 +41,21 @@ const val CODEGEN_SETTINGS = "codegen" open class CoreCodegenConfig( open val formatTimeoutSeconds: Int = defaultFormatTimeoutSeconds, open val debugMode: Boolean = defaultDebugMode, - open val generateOptionsForRequiredShapes: Boolean = defaultGenerateOptionsForRequiredShapes, ) { companion object { const val defaultFormatTimeoutSeconds = 20 const val defaultDebugMode = false - const val defaultGenerateOptionsForRequiredShapes = true fun fromNode(node: Optional): CoreCodegenConfig = if (node.isPresent) { CoreCodegenConfig( formatTimeoutSeconds = node.get().getNumberMemberOrDefault("formatTimeoutSeconds", defaultFormatTimeoutSeconds).toInt(), debugMode = node.get().getBooleanMemberOrDefault("debugMode", defaultDebugMode), - generateOptionsForRequiredShapes = node.get().getBooleanMemberOrDefault("generateOptionsForRequiredShapes", defaultGenerateOptionsForRequiredShapes), ) } else { CoreCodegenConfig( formatTimeoutSeconds = defaultFormatTimeoutSeconds, debugMode = defaultDebugMode, - generateOptionsForRequiredShapes = defaultGenerateOptionsForRequiredShapes, ) } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt index b2426c602c..2413d64a81 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt @@ -187,7 +187,7 @@ open class SymbolVisitor( val rustType = RustType.Opaque(shape.contextName(serviceShape).toPascalCase()) symbolBuilder(shape, rustType).locatedIn(moduleForShape(shape)).build() } else { - simpleShape(shape) + symbolBuilder(shape, RustType.String).build() } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt index d2125e2acd..1c25b22317 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt @@ -52,6 +52,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte /** Expression representing the value to write to the QueryValueWriter */ val valueExpression: ValueExpression, val shape: T, + val isOptional: Boolean = false, ) protected data class MemberContext( @@ -89,6 +90,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte protected val model = codegenContext.model protected val symbolProvider = codegenContext.symbolProvider protected val runtimeConfig = codegenContext.runtimeConfig + private val nullableIndex = NullableIndex(model) private val target = codegenContext.target private val serviceShape = codegenContext.serviceShape private val serializerError = runtimeConfig.serializationError() @@ -119,7 +121,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte } override fun unsetStructure(structure: StructureShape): RuntimeType { - TODO("AwsQuery doesn't support payload serialization") + TODO("$protocolName doesn't support payload serialization") } override fun operationInputSerializer(operationShape: OperationShape): RuntimeType? { @@ -172,11 +174,26 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte "Input" to structureSymbol, *codegenScope, ) { - serializeStructureInner(context) + context.copy(writerExpression = "writer", valueExpression = ValueExpression.Reference("input")) + .also { inner -> + for (member in inner.shape.members()) { + val memberContext = MemberContext.structMember(inner, member, symbolProvider) + structWriter(memberContext) { writerExpression -> + serializeMember(memberContext.copy(writerExpression = writerExpression)) + } + } + } rust("Ok(())") } } - rust("#T(${context.writerExpression}, ${context.valueExpression.name})?;", structureSerializer) + +// if (structureSymbol.isOptional()) { +// rustBlock("if let Some(${safeName()}) = ${context.valueExpression.asRef()}") { +// rust("#T(${context.writerExpression}, ${safeName()})?;", structureSerializer) +// } +// } else { + rust("#T(${context.writerExpression}, ${context.valueExpression.asRef()})?;", structureSerializer) +// } } private fun RustWriter.serializeStructureInner(context: Context) { @@ -214,12 +231,9 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte val value = context.valueExpression when (target) { is StringShape -> { - when ( - target.hasTrait() || - symbolProvider.config.nullabilityCheckMode == NullableIndex.CheckMode.CLIENT_CAREFUL - ) { + when (target.hasTrait()) { true -> rust("$writer.string(${value.name}.as_str());") - false -> rust("$writer.string(${value.name});") + false -> rust("$writer.string(${value.asRef()});") } } is BooleanShape -> rust("$writer.boolean(${value.asValue()});") @@ -236,7 +250,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte ) } is BlobShape -> rust( - "$writer.string(&#T(${value.name}));", + "$writer.string(&#T(&${value.name}));", RuntimeType.base64Encode(runtimeConfig), ) is TimestampShape -> { diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt index b80f211c76..e52ba106bb 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt @@ -100,10 +100,10 @@ private object CodegenCoreTestModules { } } -val TestRustSymbolProviderConfig = RustSymbolProviderConfig( +fun testRustSymbolProviderConfig(nullabilityCheckMode: NullableIndex.CheckMode = NullableIndex.CheckMode.CLIENT) = RustSymbolProviderConfig( runtimeConfig = TestRuntimeConfig, renameExceptions = true, - nullabilityCheckMode = NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1, + nullabilityCheckMode = nullabilityCheckMode, moduleProvider = CodegenCoreTestModules.TestModuleProvider, ) @@ -142,11 +142,12 @@ fun String.asSmithyModel(sourceLocation: String? = null, smithyVersion: String = internal fun testSymbolProvider( model: Model, rustReservedWordConfig: RustReservedWordConfig? = null, + nullabilityCheckMode: NullableIndex.CheckMode = NullableIndex.CheckMode.CLIENT, ): RustSymbolProvider = SymbolVisitor( testRustSettings(), model, ServiceShape.builder().version("test").id("test#Service").build(), - TestRustSymbolProviderConfig, + testRustSymbolProviderConfig(nullabilityCheckMode), ).let { BaseSymbolMetadataProvider(it, additionalAttributes = listOf(Attribute.NonExhaustive)) } .let { RustReservedWordSymbolProvider( @@ -161,9 +162,10 @@ internal fun testCodegenContext( serviceShape: ServiceShape? = null, settings: CoreRustSettings = testRustSettings(), codegenTarget: CodegenTarget = CodegenTarget.CLIENT, + nullabilityCheckMode: NullableIndex.CheckMode = NullableIndex.CheckMode.CLIENT, ): CodegenContext = CodegenContext( model, - testSymbolProvider(model), + testSymbolProvider(model, nullabilityCheckMode = nullabilityCheckMode), TestModuleDocProvider, serviceShape ?: model.serviceShapes.firstOrNull() diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt index 25e47e0963..a1d9062827 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt @@ -14,14 +14,14 @@ import software.amazon.smithy.rust.codegen.core.smithy.MaybeRenamed import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitor import software.amazon.smithy.rust.codegen.core.smithy.WrappingSymbolProvider import software.amazon.smithy.rust.codegen.core.smithy.renamedFrom -import software.amazon.smithy.rust.codegen.core.testutil.TestRustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel import software.amazon.smithy.rust.codegen.core.testutil.testRustSettings +import software.amazon.smithy.rust.codegen.core.testutil.testRustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.util.lookup internal class RustReservedWordSymbolProviderTest { private class TestSymbolProvider(model: Model) : - WrappingSymbolProvider(SymbolVisitor(testRustSettings(), model, null, TestRustSymbolProviderConfig)) + WrappingSymbolProvider(SymbolVisitor(testRustSettings(), model, null, testRustSymbolProviderConfig())) private val emptyConfig = RustReservedWordConfig(emptyMap(), emptyMap(), emptyMap()) @Test diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/StructureGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/StructureGeneratorTest.kt index 77932ddfac..af7ff639b5 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/StructureGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/StructureGeneratorTest.kt @@ -84,7 +84,6 @@ class StructureGeneratorTest { val credentials = model.lookup("com.test#Credentials") val secretStructure = model.lookup("com.test#SecretStructure") val structWithInnerSecretStructure = model.lookup("com.test#StructWithInnerSecretStructure") - val error = model.lookup("com.test#MyError") val rustReservedWordConfig: RustReservedWordConfig = RustReservedWordConfig( structureMemberMap = StructureGenerator.structureMemberNameMap, diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt index ad44554e36..bdd1420210 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt @@ -7,10 +7,12 @@ package software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.CsvSource +import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator.Companion.hasFallibleBuilder import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.TestEnumType import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator @@ -95,7 +97,7 @@ class AwsQuerySerializerGeneratorTest { val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModel)) val codegenContext = testCodegenContext(model, codegenTarget = codegenTarget) val symbolProvider = codegenContext.symbolProvider - val parserGenerator = AwsQuerySerializerGenerator(testCodegenContext(model, codegenTarget = codegenTarget)) + val parserGenerator = AwsQuerySerializerGenerator(codegenContext) val operationGenerator = parserGenerator.operationInputSerializer(model.lookup("test#Op")) val project = TestWorkspace.testProject(symbolProvider) @@ -152,4 +154,160 @@ class AwsQuerySerializerGeneratorTest { } project.compileAndTest() } + + private val baseModelWithRequiredTypes = """ + namespace test + use aws.protocols#restJson1 + + union Choice { + blob: Blob, + boolean: Boolean, + date: Timestamp, + enum: FooEnum, + int: Integer, + @xmlFlattened + list: SomeList, + long: Long, + map: MyMap, + number: Double, + s: String, + top: Top, + unit: Unit, + } + + @enum([{name: "FOO", value: "FOO"}]) + string FooEnum + + map MyMap { + key: String, + value: Choice, + } + + list SomeList { + member: Choice + } + + structure Top { + @required + choice: Choice, + @required + field: String, + @required + extra: Long, + @xmlName("rec") + recursive: TopList + } + + list TopList { + @xmlName("item") + member: Top + } + + structure OpInput { + @required + @xmlName("some_bool") + boolean: Boolean, + list: SomeList, + map: MyMap, + @required + top: Top, + @required + blob: Blob + } + + @http(uri: "/top", method: "POST") + operation Op { + input: OpInput, + } + """.asSmithyModel() + + @ParameterizedTest + @CsvSource( + "true, CLIENT", + "true, CLIENT_CAREFUL", + "true, CLIENT_ZERO_VALUE_V1", + "true, CLIENT_ZERO_VALUE_V1_NO_INPUT", + "false, SERVER", + ) + fun `generates valid serializers for required types`(generateUnknownVariant: Boolean, nullabilityCheckMode: NullableIndex.CheckMode) { + val codegenTarget = when (generateUnknownVariant) { + true -> CodegenTarget.CLIENT + false -> CodegenTarget.SERVER + } + val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModelWithRequiredTypes)) + val codegenContext = testCodegenContext(model, codegenTarget = codegenTarget, nullabilityCheckMode = nullabilityCheckMode) + val symbolProvider = codegenContext.symbolProvider + val parserGenerator = AwsQuerySerializerGenerator(codegenContext) + val operationGenerator = parserGenerator.operationInputSerializer(model.lookup("test#Op")) + + val project = TestWorkspace.testProject(symbolProvider) + + // Depending on the nullability check mode, the builder can be fallible or not. When it's fallible, we need to + // add unwrap calls. + val builderIsFallible = hasFallibleBuilder(model.lookup("test#Top"), symbolProvider) + val maybeUnwrap = if (builderIsFallible) { ".unwrap()" } else { "" } + project.lib { + unitTest( + "query_serializer", + """ + use test_model::{Choice, Top}; + + let input = crate::test_input::OpInput::builder() + .top( + Top::builder() + .field("Hello") + .choice(Choice::Boolean(true)) + .extra(45) + .recursive( + Top::builder() + .field("World!") + .choice(Choice::Boolean(true)) + .extra(55) + .build() + $maybeUnwrap + ) + .build() + $maybeUnwrap + ) + .boolean(true) + .build() + .unwrap(); + let serialized = ${format(operationGenerator!!)}(&input).unwrap(); + let output = std::str::from_utf8(serialized.bytes().unwrap()).unwrap(); + assert_eq!( + output, + "\ + Action=Op\ + &Version=test\ + &some_bool=true\ + &top.choice.choice=true\ + &top.field=Hello\ + &top.extra=45\ + &top.rec.item.1.choice.choice=true\ + &top.rec.item.1.field=World%21\ + &top.rec.item.1.extra=55" + ); + """, + ) + } + model.lookup("test#Top").also { top -> + top.renderWithModelBuilder(model, symbolProvider, project) + project.moduleFor(top) { + UnionGenerator( + model, + symbolProvider, + this, + model.lookup("test#Choice"), + renderUnknownVariant = generateUnknownVariant, + ).render() + val enum = model.lookup("test#FooEnum") + EnumGenerator(model, symbolProvider, enum, TestEnumType).render(this) + } + } + + model.lookup("test#Op").inputShape(model).also { input -> + input.renderWithModelBuilder(model, symbolProvider, project) + } + project.compileAndTest() + } } diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt index 2436aff706..6ed9f79edc 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt @@ -5,10 +5,13 @@ package software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize -import org.junit.jupiter.api.Test +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.CsvSource +import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.TestEnumType import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator @@ -19,6 +22,7 @@ import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel import software.amazon.smithy.rust.codegen.core.testutil.compileAndTest import software.amazon.smithy.rust.codegen.core.testutil.renderWithModelBuilder import software.amazon.smithy.rust.codegen.core.testutil.testCodegenContext +import software.amazon.smithy.rust.codegen.core.testutil.testRustSettings import software.amazon.smithy.rust.codegen.core.testutil.testSymbolProvider import software.amazon.smithy.rust.codegen.core.testutil.unitTest import software.amazon.smithy.rust.codegen.core.util.inputShape @@ -83,10 +87,18 @@ class Ec2QuerySerializerGeneratorTest { } """.asSmithyModel() - @Test - fun `generates valid serializers`() { + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + "SERVER", + ) + fun `generates valid serializers`(nullabilityCheckMode: NullableIndex.CheckMode) { val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModel)) - val codegenContext = testCodegenContext(model) + val settings = testRustSettings() + val codegenContext = testCodegenContext(model, settings = settings, nullabilityCheckMode = nullabilityCheckMode) val symbolProvider = codegenContext.symbolProvider val parserGenerator = Ec2QuerySerializerGenerator(codegenContext) val operationGenerator = parserGenerator.operationInputSerializer(model.lookup("test#Op")) @@ -139,4 +151,149 @@ class Ec2QuerySerializerGeneratorTest { } project.compileAndTest() } + + private val baseModelWithRequiredTypes = """ + namespace test + + union Choice { + blob: Blob, + boolean: Boolean, + date: Timestamp, + enum: FooEnum, + int: Integer, + @xmlFlattened + list: SomeList, + long: Long, + map: MyMap, + number: Double, + s: String, + top: Top, + unit: Unit, + } + + @enum([{name: "FOO", value: "FOO"}]) + string FooEnum + + map MyMap { + key: String, + value: Choice, + } + + list SomeList { + member: Choice + } + + structure Top { + @required + choice: Choice, + @required + field: String, + @required + extra: Long, + @xmlName("rec") + recursive: TopList + } + + list TopList { + @xmlName("item") + member: Top + } + + structure OpInput { + @required + @xmlName("some_bool") + boolean: Boolean, + list: SomeList, + map: MyMap, + @required + top: Top, + } + + @http(uri: "/top", method: "POST") + operation Op { + input: OpInput, + } + """.asSmithyModel() + + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + "SERVER", + ) + fun `generates valid serializers for required types`(nullabilityCheckMode: NullableIndex.CheckMode) { + val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModelWithRequiredTypes)) + val settings = testRustSettings() + val codegenContext = testCodegenContext(model, settings = settings, nullabilityCheckMode = nullabilityCheckMode) + val symbolProvider = codegenContext.symbolProvider + val parserGenerator = Ec2QuerySerializerGenerator(codegenContext) + val operationGenerator = parserGenerator.operationInputSerializer(model.lookup("test#Op")) + + val project = TestWorkspace.testProject(testSymbolProvider(model)) + + // Depending on the nullability check mode, the builder can be fallible or not. When it's fallible, we need to + // add unwrap calls. + val builderIsFallible = + BuilderGenerator.hasFallibleBuilder(model.lookup("test#Top"), symbolProvider) + val maybeUnwrap = if (builderIsFallible) { ".unwrap()" } else { "" } + project.lib { + unitTest( + "ec2query_serializer", + """ + use test_model::{Choice, Top}; + + let input = crate::test_input::OpInput::builder() + .top( + Top::builder() + .field("Hello") + .choice(Choice::Boolean(true)) + .extra(45) + .recursive( + Top::builder() + .field("World!") + .choice(Choice::Boolean(true)) + .extra(55) + .build() + $maybeUnwrap + ) + .build() + $maybeUnwrap + ) + .boolean(true) + .build() + .unwrap(); + let serialized = ${format(operationGenerator!!)}(&input).unwrap(); + let output = std::str::from_utf8(serialized.bytes().unwrap()).unwrap(); + assert_eq!( + output, + "\ + Action=Op\ + &Version=test\ + &Some_bool=true\ + &Top.Choice.Choice=true\ + &Top.Field=Hello\ + &Top.Extra=45\ + &Top.Rec.1.Choice.Choice=true\ + &Top.Rec.1.Field=World%21\ + &Top.Rec.1.Extra=55" + ); + """, + ) + } + model.lookup("test#Top").also { top -> + top.renderWithModelBuilder(model, symbolProvider, project) + project.moduleFor(top) { + UnionGenerator(model, symbolProvider, this, model.lookup("test#Choice")).render() + val enum = model.lookup("test#FooEnum") + EnumGenerator(model, symbolProvider, enum, TestEnumType).render(this) + } + } + + model.lookup("test#Op").inputShape(model).also { input -> + input.renderWithModelBuilder(model, symbolProvider, project) + } + project.compileAndTest() + } } diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt index 23c27f331b..8612e0721c 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt @@ -5,10 +5,13 @@ package software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize -import org.junit.jupiter.api.Test +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.CsvSource +import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.TestEnumType import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator @@ -98,10 +101,17 @@ class JsonSerializerGeneratorTest { } """.asSmithyModel() - @Test - fun `generates valid serializers`() { + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + "SERVER", + ) + fun `generates valid serializers`(nullabilityCheckMode: NullableIndex.CheckMode) { val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModel)) - val codegenContext = testCodegenContext(model) + val codegenContext = testCodegenContext(model, nullabilityCheckMode = nullabilityCheckMode) val symbolProvider = codegenContext.symbolProvider val parserSerializer = JsonSerializerGenerator( codegenContext, @@ -137,7 +147,173 @@ class JsonSerializerGeneratorTest { .choice(Choice::Unknown) .build() ).build().unwrap(); - let serialized = ${format(operationGenerator)}(&input).expect_err("cannot serialize unknown variant"); + ${format(operationGenerator)}(&input).expect_err("cannot serialize unknown variant"); + """, + ) + } + model.lookup("test#Top").also { top -> + top.renderWithModelBuilder(model, symbolProvider, project) + project.moduleFor(top) { + UnionGenerator(model, symbolProvider, this, model.lookup("test#Choice")).render() + val enum = model.lookup("test#FooEnum") + EnumGenerator(model, symbolProvider, enum, TestEnumType).render(this) + } + } + + model.lookup("test#Op").inputShape(model).also { input -> + input.renderWithModelBuilder(model, symbolProvider, project) + } + project.compileAndTest() + } + + private val baseModelWithRequiredTypes = """ + namespace test + use aws.protocols#restJson1 + + union Choice { + blob: Blob, + boolean: Boolean, + date: Timestamp, + document: Document, + enum: FooEnum, + int: Integer, + list: SomeList, + listSparse: SomeSparseList, + long: Long, + map: MyMap, + mapSparse: MySparseMap, + number: Double, + s: String, + top: Top, + unit: Unit, + } + + @enum([{name: "FOO", value: "FOO"}]) + string FooEnum + + map MyMap { + key: String, + value: Choice, + } + + @sparse + map MySparseMap { + key: String, + value: Choice, + } + + list SomeList { + member: Choice + } + + @sparse + list SomeSparseList { + member: Choice + } + + structure Top { + @required + choice: Choice, + @required + field: String, + @required + extra: Long, + @jsonName("rec") + recursive: TopList + } + + list TopList { + member: Top + } + + structure OpInput { + @httpHeader("x-test") + someHeader: String, + + @required + boolean: Boolean, + list: SomeList, + map: MyMap, + + @required + top: Top + } + + @http(uri: "/top", method: "POST") + operation Op { + input: OpInput, + } + """.asSmithyModel() + + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + "SERVER", + ) + fun `generates valid serializers for required types`(nullabilityCheckMode: NullableIndex.CheckMode) { + val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModelWithRequiredTypes)) + val codegenContext = testCodegenContext(model, nullabilityCheckMode = nullabilityCheckMode) + val symbolProvider = codegenContext.symbolProvider + val parserSerializer = JsonSerializerGenerator( + codegenContext, + HttpTraitHttpBindingResolver(model, ProtocolContentTypes.consistent("application/json")), + ::restJsonFieldName, + ) + val operationGenerator = parserSerializer.operationInputSerializer(model.lookup("test#Op")) + val documentGenerator = parserSerializer.documentSerializer() + + val project = TestWorkspace.testProject(testSymbolProvider(model)) + + // Depending on the nullability check mode, the builder can be fallible or not. When it's fallible, we need to + // add unwrap calls. + val builderIsFallible = + BuilderGenerator.hasFallibleBuilder(model.lookup("test#Top"), symbolProvider) + val maybeUnwrap = if (builderIsFallible) { ".unwrap()" } else { "" } + project.lib { + unitTest( + "json_serializers", + """ + use test_model::{Choice, Top}; + + // Generate the document serializer even though it's not tested directly + // ${format(documentGenerator)} + + let input = crate::test_input::OpInput::builder() + .top( + Top::builder() + .field("Hello") + .choice(Choice::Boolean(true)) + .extra(45) + .recursive( + Top::builder() + .field("World!") + .choice(Choice::Boolean(true)) + .extra(55) + .build() + $maybeUnwrap + ) + .build() + $maybeUnwrap + ) + .boolean(true) + .build() + .unwrap(); + let serialized = ${format(operationGenerator!!)}(&input).unwrap(); + let output = std::str::from_utf8(serialized.bytes().unwrap()).unwrap(); + assert_eq!(output, r#"{"boolean":true,"top":{"choice":{"boolean":true},"field":"Hello","extra":45,"rec":[{"choice":{"boolean":true},"field":"World!","extra":55}]}}"#); + + let input = crate::test_input::OpInput::builder().top( + Top::builder() + .field("Hello") + .choice(Choice::Unknown) + .extra(45) + .build() + $maybeUnwrap + ).build().unwrap(); + ${format(operationGenerator)}(&input).expect_err("cannot serialize unknown variant"); """, ) } diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/XmlBindingTraitSerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/XmlBindingTraitSerializerGeneratorTest.kt index a695d2a401..4410c33910 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/XmlBindingTraitSerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/XmlBindingTraitSerializerGeneratorTest.kt @@ -5,13 +5,18 @@ package software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize -import org.junit.jupiter.api.Test +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.CsvSource +import software.amazon.smithy.model.knowledge.NullableIndex +import software.amazon.smithy.model.shapes.MemberShape import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.TestEnumType import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator +import software.amazon.smithy.rust.codegen.core.smithy.isOptional import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpTraitHttpBindingResolver import software.amazon.smithy.rust.codegen.core.smithy.protocols.ProtocolContentTypes import software.amazon.smithy.rust.codegen.core.smithy.transformers.OperationNormalizer @@ -103,10 +108,17 @@ internal class XmlBindingTraitSerializerGeneratorTest { } """.asSmithyModel() - @Test - fun `generates valid serializers`() { + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + "SERVER", + ) + fun `generates valid serializers`(nullabilityCheckMode: NullableIndex.CheckMode) { val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModel)) - val codegenContext = testCodegenContext(model) + val codegenContext = testCodegenContext(model, nullabilityCheckMode = nullabilityCheckMode) val symbolProvider = codegenContext.symbolProvider val parserGenerator = XmlBindingTraitSerializerGenerator( codegenContext, @@ -120,14 +132,14 @@ internal class XmlBindingTraitSerializerGeneratorTest { "serialize_xml", """ use test_model::Top; - let inp = crate::test_input::OpInput::builder().payload( + let input = crate::test_input::OpInput::builder().payload( Top::builder() .field("hello!") .extra(45) .recursive(Top::builder().extra(55).build()) .build() ).build().unwrap(); - let serialized = ${format(operationSerializer)}(&inp.payload.unwrap()).unwrap(); + let serialized = ${format(operationSerializer)}(&input.payload.unwrap()).unwrap(); let output = std::str::from_utf8(&serialized).unwrap(); assert_eq!(output, "hello!"); """, @@ -158,4 +170,160 @@ internal class XmlBindingTraitSerializerGeneratorTest { } project.compileAndTest() } + + private val baseModelWithRequiredTypes = """ + namespace test + use aws.protocols#restXml + union Choice { + boolean: Boolean, + @xmlFlattened + @xmlName("Hi") + flatMap: MyMap, + deepMap: MyMap, + @xmlFlattened + flatList: SomeList, + deepList: SomeList, + s: String, + enum: FooEnum, + date: Timestamp, + number: Double, + top: Top, + blob: Blob, + unit: Unit, + } + + @enum([{name: "FOO", value: "FOO"}]) + string FooEnum + + map MyMap { + @xmlName("Name") + key: String, + @xmlName("Setting") + value: Choice, + } + + list SomeList { + member: Choice + } + + + structure Top { + @required + choice: Choice, + @required + field: String, + @required + @xmlAttribute + extra: Long, + @xmlName("prefix:local") + renamedWithPrefix: String, + @xmlName("rec") + @xmlFlattened + recursive: TopList + } + + list TopList { + member: Top + } + + structure OpInput { + @required + @httpPayload + payload: Top + } + + @http(uri: "/top", method: "POST") + operation Op { + input: OpInput, + } + """.asSmithyModel() + + @ParameterizedTest + @CsvSource( + "CLIENT", + "CLIENT_CAREFUL", + "CLIENT_ZERO_VALUE_V1", + "CLIENT_ZERO_VALUE_V1_NO_INPUT", + "SERVER", + ) + fun `generates valid serializers for required types`(nullabilityCheckMode: NullableIndex.CheckMode) { + val model = RecursiveShapeBoxer().transform(OperationNormalizer.transform(baseModelWithRequiredTypes)) + val codegenContext = testCodegenContext(model, nullabilityCheckMode = nullabilityCheckMode) + val symbolProvider = codegenContext.symbolProvider + val parserGenerator = XmlBindingTraitSerializerGenerator( + codegenContext, + HttpTraitHttpBindingResolver(model, ProtocolContentTypes.consistent("application/xml")), + ) + val operationSerializer = parserGenerator.payloadSerializer(model.lookup("test#OpInput\$payload")) + + val project = TestWorkspace.testProject(symbolProvider) + + // Depending on the nullability check mode, the builder can be fallible or not. When it's fallible, we need to + // add unwrap calls. + val builderIsFallible = + BuilderGenerator.hasFallibleBuilder(model.lookup("test#Top"), symbolProvider) + val maybeUnwrap = if (builderIsFallible) { ".unwrap()" } else { "" } + val payloadIsOptional = model.lookup("test#OpInput\$payload").let { + symbolProvider.toSymbol(it).isOptional() + } + val maybeUnwrapPayload = if (payloadIsOptional) { ".unwrap()" } else { "" } + project.lib { + unitTest( + "serialize_xml", + """ + use test_model::{Choice, Top}; + + let input = crate::test_input::OpInput::builder() + .payload( + Top::builder() + .field("Hello") + .choice(Choice::Boolean(true)) + .extra(45) + .recursive( + Top::builder() + .field("World!") + .choice(Choice::Boolean(true)) + .extra(55) + .build() + $maybeUnwrap + ) + .build() + $maybeUnwrap + ) + .build() + .unwrap(); + let serialized = ${format(operationSerializer)}(&input.payload$maybeUnwrapPayload).unwrap(); + let output = std::str::from_utf8(&serialized).unwrap(); + assert_eq!(output, "trueHellotrueWorld!"); + """, + ) + unitTest( + "unknown_variants", + """ + use test_model::{Choice, Top}; + let input = crate::test_input::OpInput::builder().payload( + Top::builder() + .field("Hello") + .choice(Choice::Unknown) + .extra(45) + .build() + $maybeUnwrap + ).build().unwrap(); + ${format(operationSerializer)}(&input.payload$maybeUnwrapPayload).expect_err("cannot serialize unknown variant"); + """, + ) + } + model.lookup("test#Top").also { top -> + top.renderWithModelBuilder(model, symbolProvider, project) + project.moduleFor(top) { + UnionGenerator(model, symbolProvider, this, model.lookup("test#Choice")).render() + val enum = model.lookup("test#FooEnum") + EnumGenerator(model, symbolProvider, enum, TestEnumType).render(this) + } + } + model.lookup("test#Op").inputShape(model).also { input -> + input.renderWithModelBuilder(model, symbolProvider, project) + } + project.compileAndTest() + } } From 761c1e4ded2dde28c79ca9302010c3830098ec20 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Wed, 16 Aug 2023 14:17:03 -0500 Subject: [PATCH 15/36] fix more tests --- .../qldbsession/tests/integration.rs | 14 +++++--------- .../serialize/AwsQuerySerializerGeneratorTest.kt | 4 +++- rust-runtime/aws-smithy-types/src/blob.rs | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/aws/sdk/integration-tests/qldbsession/tests/integration.rs b/aws/sdk/integration-tests/qldbsession/tests/integration.rs index cd1f77cd86..4fe5eee1a9 100644 --- a/aws/sdk/integration-tests/qldbsession/tests/integration.rs +++ b/aws/sdk/integration-tests/qldbsession/tests/integration.rs @@ -3,19 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -use aws_sdk_qldbsession as qldbsession; +use aws_sdk_qldbsession::config::{Config, Credentials, Region}; +use aws_sdk_qldbsession::types::StartSessionRequest; +use aws_sdk_qldbsession::Client; use aws_smithy_client::test_connection::TestConnection; use aws_smithy_http::body::SdkBody; use http::Uri; -use qldbsession::config::{Config, Credentials, Region}; -use qldbsession::types::StartSessionRequest; -use qldbsession::Client; use std::time::{Duration, UNIX_EPOCH}; -// TODO(DVR): having the full HTTP requests right in the code is a bit gross, consider something -// like https://github.com/davidbarsky/sigv4/blob/master/aws-sigv4/src/lib.rs#L283-L315 to store -// the requests/responses externally - #[tokio::test] async fn signv4_use_correct_service_name() { let conn = TestConnection::new(vec![( @@ -46,7 +41,8 @@ async fn signv4_use_correct_service_name() { .start_session( StartSessionRequest::builder() .ledger_name("not-real-ledger") - .build(), + .build() + .unwrap(), ) .customize() .await diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt index bdd1420210..2203b05dc1 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/AwsQuerySerializerGeneratorTest.kt @@ -270,6 +270,7 @@ class AwsQuerySerializerGeneratorTest { $maybeUnwrap ) .boolean(true) + .blob(aws_smithy_types::Blob::new(&b"test"[..])) .build() .unwrap(); let serialized = ${format(operationGenerator!!)}(&input).unwrap(); @@ -285,7 +286,8 @@ class AwsQuerySerializerGeneratorTest { &top.extra=45\ &top.rec.item.1.choice.choice=true\ &top.rec.item.1.field=World%21\ - &top.rec.item.1.extra=55" + &top.rec.item.1.extra=55\ + &blob=dGVzdA%3D%3D" ); """, ) diff --git a/rust-runtime/aws-smithy-types/src/blob.rs b/rust-runtime/aws-smithy-types/src/blob.rs index 5365b91249..ab7ae30d3c 100644 --- a/rust-runtime/aws-smithy-types/src/blob.rs +++ b/rust-runtime/aws-smithy-types/src/blob.rs @@ -43,7 +43,7 @@ mod serde_serialize { S: serde::Serializer, { if serializer.is_human_readable() { - serializer.serialize_str(&crate::base64::encode(&self.inner)) + serializer.serialize_str(&base64::encode(&self.inner)) } else { serializer.serialize_bytes(&self.inner) } From 36b71272b9d7592bf00eed5c752b98f17d2495e0 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Wed, 16 Aug 2023 14:46:20 -0500 Subject: [PATCH 16/36] fix server client and eventstream stuff --- aws/sdk-adhoc-test/build.gradle.kts | 2 +- aws/sdk/build.gradle.kts | 3 ++- .../parse/EventStreamUnmarshallerGenerator.kt | 23 ++++++++++++------- examples/pokemon-service/tests/simple.rs | 12 +++++----- .../aws-smithy-http/src/operation/error.rs | 9 ++++++++ 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index a9a8eb82c5..73f49c328b 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -38,7 +38,7 @@ dependencies { } fun getSmithyRuntimeMode(): String = properties.get("smithy.runtime.mode") ?: "orchestrator" -fun getNullabilityCheckMode(): String = properties.get("smithy.nullability.check.mode") ?: "CLIENT" +fun getNullabilityCheckMode(): String = properties.get("smithy.nullability.check.mode") ?: "CLIENT_CAREFUL" val allCodegenTests = listOf( CodegenTest( diff --git a/aws/sdk/build.gradle.kts b/aws/sdk/build.gradle.kts index 96f26534a6..c056616d7e 100644 --- a/aws/sdk/build.gradle.kts +++ b/aws/sdk/build.gradle.kts @@ -62,6 +62,7 @@ val crateVersioner by lazy { aws.sdk.CrateVersioner.defaultFor(rootProject, prop fun getRustMSRV(): String = properties.get("rust.msrv") ?: throw Exception("Rust MSRV missing") fun getPreviousReleaseVersionManifestPath(): String? = properties.get("aws.sdk.previous.release.versions.manifest") fun getSmithyRuntimeMode(): String = properties.get("smithy.runtime.mode") ?: "orchestrator" +fun getNullabilityCheckMode(): String = properties.get("nullability.check.mode") ?: "CLIENT_CAREFUL" fun loadServiceMembership(): Membership { val membershipOverride = properties.get("aws.services")?.let { parseMembership(it) } @@ -107,7 +108,7 @@ fun generateSmithyBuild(services: AwsServices): String { "eventStreamAllowList": [$eventStreamAllowListMembers], "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", "enableUserConfigurableRuntimePlugins": false, - "nullabilityCheckMode": "CLIENT_CAREFUL" + "nullabilityCheckMode": "${getNullabilityCheckMode()}", }, "service": "${service.service}", "module": "$moduleName", diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt index 6b706a1e09..415586b40f 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt @@ -32,6 +32,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.withBlock import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.renderUnknownVariant import software.amazon.smithy.rust.codegen.core.smithy.generators.setterName @@ -336,12 +337,14 @@ class EventStreamUnmarshallerGenerator( rust(header) for (member in syntheticUnion.errorMembers) { rustBlock("${member.memberName.dq()} $matchOperator ") { + val target = model.expectShape(member.target, StructureShape::class.java) + val builder = symbolProvider.symbolForBuilder(target) + val builderIsFallible = BuilderGenerator.hasFallibleBuilder(target, symbolProvider) + val parser = protocol.structuredDataParser().errorParser(target) // TODO(EventStream): Errors on the operation can be disjoint with errors in the union, // so we need to generate a new top-level Error type for each event stream union. when (codegenTarget) { CodegenTarget.CLIENT -> { - val target = model.expectShape(member.target, StructureShape::class.java) - val parser = protocol.structuredDataParser().errorParser(target) if (parser != null) { rust("let mut builder = #T::default();", symbolProvider.symbolForBuilder(target)) rustTemplate( @@ -352,7 +355,9 @@ class EventStreamUnmarshallerGenerator( })?; builder.set_meta(Some(generic)); return Ok(#{UnmarshalledMessage}::Error( - #{OpError}::${member.target.name}(builder.build()) + #{OpError}::${member.target.name}( + builder.build()${if (builderIsFallible) { "?" } else { "" }} + ) )) """, "parser" to parser, @@ -362,10 +367,12 @@ class EventStreamUnmarshallerGenerator( } CodegenTarget.SERVER -> { - val target = model.expectShape(member.target, StructureShape::class.java) - val parser = protocol.structuredDataParser().errorParser(target) - val mut = if (parser != null) { " mut" } else { "" } - rust("let$mut builder = #T::default();", symbolProvider.symbolForBuilder(target)) + val mut = if (parser != null) { + " mut" + } else { + "" + } + rust("let$mut builder = #T::default();", builder) if (parser != null) { rustTemplate( """ @@ -382,7 +389,7 @@ class EventStreamUnmarshallerGenerator( """ return Ok(#{UnmarshalledMessage}::Error( #{OpError}::${member.target.name}( - builder.build() + builder.build()${if (builderIsFallible) { "?" } else { "" }} ) )) """, diff --git a/examples/pokemon-service/tests/simple.rs b/examples/pokemon-service/tests/simple.rs index 3a055da587..dc9f88d0b5 100644 --- a/examples/pokemon-service/tests/simple.rs +++ b/examples/pokemon-service/tests/simple.rs @@ -19,7 +19,7 @@ async fn simple_integration_test() { let client = common::client(); let service_statistics_out = client.get_server_statistics().send().await.unwrap(); - assert_eq!(0, service_statistics_out.calls_count.unwrap()); + assert_eq!(0, service_statistics_out.calls_count); let pokemon_species_output = client .get_pokemon_species() @@ -27,10 +27,10 @@ async fn simple_integration_test() { .send() .await .unwrap(); - assert_eq!("pikachu", pokemon_species_output.name().unwrap()); + assert_eq!("pikachu", pokemon_species_output.name()); let service_statistics_out = client.get_server_statistics().send().await.unwrap(); - assert_eq!(1, service_statistics_out.calls_count.unwrap()); + assert_eq!(1, service_statistics_out.calls_count); let storage_err = client .get_storage() @@ -56,12 +56,12 @@ async fn simple_integration_test() { .await .unwrap(); assert_eq!( - Some(vec![ + vec![ "bulbasaur".to_string(), "charmander".to_string(), "squirtle".to_string(), "pikachu".to_string() - ]), + ], storage_out.collection ); @@ -80,7 +80,7 @@ async fn simple_integration_test() { ); let service_statistics_out = client.get_server_statistics().send().await.unwrap(); - assert_eq!(2, service_statistics_out.calls_count.unwrap()); + assert_eq!(2, service_statistics_out.calls_count); let hyper_client = hyper::Client::new(); let health_check_url = format!("{}/ping", common::base_url()); diff --git a/rust-runtime/aws-smithy-http/src/operation/error.rs b/rust-runtime/aws-smithy-http/src/operation/error.rs index 2079b9b212..10d5942edb 100644 --- a/rust-runtime/aws-smithy-http/src/operation/error.rs +++ b/rust-runtime/aws-smithy-http/src/operation/error.rs @@ -195,3 +195,12 @@ impl From for DeserializeError { ) } } + +#[cfg(feature = "event-stream")] +impl From for aws_smithy_eventstream::error::Error { + fn from(build_error: BuildError) -> Self { + aws_smithy_eventstream::error::Error::unmarshalling(format!( + "error unmarshalling failed because a required field was missing: {build_error}" + )) + } +} From 7e464ccf4c6db3604bff2227c0b8621271599c8f Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Wed, 16 Aug 2023 15:00:26 -0500 Subject: [PATCH 17/36] remove insurmountable comma fix JSON parse test unwrap --- aws/sdk/build.gradle.kts | 2 +- .../core/smithy/protocols/parse/JsonParserGeneratorTest.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aws/sdk/build.gradle.kts b/aws/sdk/build.gradle.kts index c056616d7e..e1351b8bae 100644 --- a/aws/sdk/build.gradle.kts +++ b/aws/sdk/build.gradle.kts @@ -108,7 +108,7 @@ fun generateSmithyBuild(services: AwsServices): String { "eventStreamAllowList": [$eventStreamAllowListMembers], "enableNewSmithyRuntime": "${getSmithyRuntimeMode()}", "enableUserConfigurableRuntimePlugins": false, - "nullabilityCheckMode": "${getNullabilityCheckMode()}", + "nullabilityCheckMode": "${getNullabilityCheckMode()}" }, "service": "${service.service}", "module": "$moduleName", diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt index 79435b5e9b..108207473f 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt @@ -149,7 +149,7 @@ class JsonParserGeneratorTest { let top = output.top.expect("top"); assert_eq!(Some(45), top.extra); assert_eq!(Some("something".to_string()), top.field); - assert_eq!(Some(Choice::Int(5)), top.choice); + assert_eq!(Choice::Int(5), top.choice); """, ) unitTest( @@ -166,7 +166,7 @@ class JsonParserGeneratorTest { // unknown variant let input = br#"{ "top": { "choice": { "somenewvariant": "data" } } }"#; let output = ${format(operationGenerator)}(input, test_output::OpOutput::builder()).unwrap().build(); - assert!(output.top.unwrap().choice.unwrap().is_unknown()); + assert!(output.top.unwrap().choice.is_unknown()); """, ) From d2b2c556c0e8db54133afc758427fd55574d892d Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Wed, 16 Aug 2023 15:57:56 -0500 Subject: [PATCH 18/36] fix another server example update codegen to log the rustSymbolProviderConfig during init --- aws/sdk/integration-tests/Cargo.toml | 3 ++- .../rust/codegen/client/smithy/ClientCodegenVisitor.kt | 2 ++ examples/Cargo.toml | 3 ++- .../pokemon-service-test/tests/simple_integration_test.rs | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/sdk/integration-tests/Cargo.toml b/aws/sdk/integration-tests/Cargo.toml index 284bc1bcb1..42a1385840 100644 --- a/aws/sdk/integration-tests/Cargo.toml +++ b/aws/sdk/integration-tests/Cargo.toml @@ -11,10 +11,11 @@ members = [ "no-default-features", "polly", "qldbsession", + "route53", "s3", "s3control", "sts", - "transcribestreaming", "timestreamquery", + "transcribestreaming", "webassembly", ] diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt index 59a4840704..eb8daccdef 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt @@ -81,6 +81,8 @@ class ClientCodegenVisitor( moduleProvider = ClientModuleProvider, nameBuilderFor = { symbol -> "${symbol.name}Builder" }, ) + + println("rustSymbolProviderConfig:\n$rustSymbolProviderConfig") val baseModel = baselineTransform(context.model) val untransformedService = settings.getService(baseModel) val (protocol, generator) = ClientProtocolLoader( diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 33c374bbcb..453eee98e4 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -6,7 +6,8 @@ members = [ "pokemon-service-tls", "pokemon-service-lambda", "pokemon-service-server-sdk", - "pokemon-service-client" + "pokemon-service-client", + ] [profile.release] diff --git a/examples/python/pokemon-service-test/tests/simple_integration_test.rs b/examples/python/pokemon-service-test/tests/simple_integration_test.rs index 39f979e9a3..0c928fa0d7 100644 --- a/examples/python/pokemon-service-test/tests/simple_integration_test.rs +++ b/examples/python/pokemon-service-test/tests/simple_integration_test.rs @@ -36,7 +36,7 @@ async fn simple_integration_test_http2() { async fn simple_integration_test_with_client(client: PokemonClient) { let service_statistics_out = client.get_server_statistics().send().await.unwrap(); - assert_eq!(0, service_statistics_out.calls_count.unwrap()); + assert_eq!(0, service_statistics_out.calls_count); let pokemon_species_output = client .get_pokemon_species() @@ -44,10 +44,10 @@ async fn simple_integration_test_with_client(client: PokemonClient) { .send() .await .unwrap(); - assert_eq!("pikachu", pokemon_species_output.name().unwrap()); + assert_eq!("pikachu", pokemon_species_output.name()); let service_statistics_out = client.get_server_statistics().send().await.unwrap(); - assert_eq!(1, service_statistics_out.calls_count.unwrap()); + assert_eq!(1, service_statistics_out.calls_count); let pokemon_species_error = client .get_pokemon_species() @@ -64,7 +64,7 @@ async fn simple_integration_test_with_client(client: PokemonClient) { ); let service_statistics_out = client.get_server_statistics().send().await.unwrap(); - assert_eq!(2, service_statistics_out.calls_count.unwrap()); + assert_eq!(2, service_statistics_out.calls_count); let _health_check = client.check_health().send().await.unwrap(); } From f0e4a1f0da3efe80629c2032fe580457a712c507 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Aug 2023 11:28:11 -0500 Subject: [PATCH 19/36] fix gradle build config typo update integration test Cargo.toml fix Ec2 query serializer fix Route53 id trimming decorator update the Route53 and EC2 models --- aws/sdk-adhoc-test/build.gradle.kts | 2 +- .../customize/route53/Route53Decorator.kt | 2 +- aws/sdk/aws-models/ec2.json | 3517 ++++++++++++++--- aws/sdk/aws-models/route53.json | 450 ++- aws/sdk/integration-tests/Cargo.toml | 1 - .../serialize/QuerySerializerGenerator.kt | 8 +- .../smithy/rust/codegen/core/testutil/Rust.kt | 2 +- .../Ec2QuerySerializerGeneratorTest.kt | 6 +- 8 files changed, 3411 insertions(+), 577 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 0ab437d949..83a2592414 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -37,7 +37,7 @@ dependencies { implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion") } -fun getNullabilityCheckMode(): String = properties.get("smithy.nullability.check.mode") ?: "CLIENT_CAREFUL" +fun getNullabilityCheckMode(): String = properties.get("nullability.check.mode") ?: "CLIENT_CAREFUL" val allCodegenTests = listOf( CodegenTest( diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt index a236ccaab8..0e7ba294c8 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt @@ -100,7 +100,7 @@ class TrimResourceIdCustomization( rustTemplate( """ #{Route53ResourceIdInterceptor}::new(|input: &mut #{Input}| { - Some(&mut input.$fieldName) + input.$fieldName.as_mut() }) """, "Input" to codegenContext.symbolProvider.toSymbol(inputShape), diff --git a/aws/sdk/aws-models/ec2.json b/aws/sdk/aws-models/ec2.json index 4d35d56d54..43911fdd00 100644 --- a/aws/sdk/aws-models/ec2.json +++ b/aws/sdk/aws-models/ec2.json @@ -1535,7 +1535,20 @@ "target": "com.amazonaws.ec2#AllocateAddressResult" }, "traits": { - "smithy.api#documentation": "

Allocates an Elastic IP address to your Amazon Web Services account. After you allocate the Elastic IP address you can associate \n it with an instance or network interface. After you release an Elastic IP address, it is released to the IP address \n pool and can be allocated to a different Amazon Web Services account.

\n

You can allocate an Elastic IP address from an address pool owned by Amazon Web Services or from an address pool created \n from a public IPv4 address range that you have brought to Amazon Web Services for use with your Amazon Web Services resources using bring your own \n IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon Elastic Compute Cloud User Guide.

\n

If you release an Elastic IP address, you might be able to recover it. You cannot recover\n an Elastic IP address that you released after it is allocated to another Amazon Web Services account. To attempt to recover an Elastic IP address that you released, specify\n it in this operation.

\n

For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

\n

You can allocate a carrier IP address which is a public IP address from a telecommunication carrier, \n to a network interface which resides in a subnet in a Wavelength Zone (for example an EC2 instance).

" + "smithy.api#documentation": "

Allocates an Elastic IP address to your Amazon Web Services account. After you allocate the Elastic IP address you can associate \n it with an instance or network interface. After you release an Elastic IP address, it is released to the IP address \n pool and can be allocated to a different Amazon Web Services account.

\n

You can allocate an Elastic IP address from an address pool owned by Amazon Web Services or from an address pool created \n from a public IPv4 address range that you have brought to Amazon Web Services for use with your Amazon Web Services resources using bring your own \n IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon Elastic Compute Cloud User Guide.

\n

If you release an Elastic IP address, you might be able to recover it. You cannot recover\n an Elastic IP address that you released after it is allocated to another Amazon Web Services account. To attempt to recover an Elastic IP address that you released, specify\n it in this operation.

\n

For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

\n

You can allocate a carrier IP address which is a public IP address from a telecommunication carrier, \n to a network interface which resides in a subnet in a Wavelength Zone (for example an EC2 instance).

", + "smithy.api#examples": [ + { + "title": "To allocate an Elastic IP address", + "documentation": "This example allocates an Elastic IP address.", + "output": { + "PublicIp": "203.0.113.0", + "AllocationId": "eipalloc-64d5890a", + "PublicIpv4Pool": "amazon", + "NetworkBorderGroup": "us-east-1", + "Domain": "vpc" + } + } + ] } }, "com.amazonaws.ec2#AllocateAddressRequest": { @@ -1726,8 +1739,7 @@ "aws.protocols#ec2QueryName": "Quantity", "smithy.api#clientOptional": {}, "smithy.api#default": 0, - "smithy.api#documentation": "

The number of Dedicated Hosts to allocate to your account with these\n parameters.

", - "smithy.api#required": {}, + "smithy.api#documentation": "

The number of Dedicated Hosts to allocate to your account with these parameters. If you are \n allocating the Dedicated Hosts on an Outpost, and you specify AssetIds, \n you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each \n specified hardware asset. If you specify both AssetIds and \n Quantity, then the value that you specify for \n Quantity must be equal to the number of asset IDs specified.

", "smithy.api#xmlName": "quantity" } }, @@ -1747,7 +1759,7 @@ "OutpostArn": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate\n the Dedicated Host.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate\n the Dedicated Host. If you specify OutpostArn, you can \n optionally specify AssetIds.

\n

If you are allocating the Dedicated Host in a Region, omit this parameter.

" } }, "HostMaintenance": { @@ -1755,6 +1767,13 @@ "traits": { "smithy.api#documentation": "

Indicates whether to enable or disable host maintenance for the Dedicated Host. For\n more information, see Host\n maintenance in the Amazon EC2 User Guide.

" } + }, + "AssetIds": { + "target": "com.amazonaws.ec2#AssetIdList", + "traits": { + "smithy.api#documentation": "

The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting \n specific hardware assets on an Outpost can help to minimize latency between your workloads. \n This parameter is supported only if you specify OutpostArn. \n If you are allocating the Dedicated Hosts in a Region, omit this parameter.

\n
    \n
  • \n

    If you specify this parameter, you can omit Quantity. \n In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware \n asset.

    \n
  • \n
  • \n

    If you specify both AssetIds and \n Quantity, then the value for \n Quantity must be equal to the number of asset IDs \n specified.

    \n
  • \n
", + "smithy.api#xmlName": "AssetId" + } } }, "traits": { @@ -1987,7 +2006,7 @@ "min": 1, "max": 30 }, - "smithy.api#pattern": "^[a-zA-Z0-9\\.\\*]+$" + "smithy.api#pattern": "^[a-zA-Z0-9\\.\\*\\-]+$" } }, "com.amazonaws.ec2#AllowedInstanceTypeSet": { @@ -3976,52 +3995,56 @@ "type": "error" }, { - "conditions": [], - "type": "tree", - "rules": [ + "conditions": [ { - "conditions": [ + "fn": "booleanEquals", + "argv": [ { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" + "ref": "UseDualStack" }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" + true + ] } - ] + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] }, { - "conditions": [], + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], "type": "tree", "rules": [ { "conditions": [ { - "fn": "isSet", + "fn": "aws.partition", "argv": [ { "ref": "Region" } - ] + ], + "assign": "PartitionResult" } ], "type": "tree", @@ -4029,13 +4052,22 @@ { "conditions": [ { - "fn": "aws.partition", + "fn": "booleanEquals", "argv": [ { - "ref": "Region" - } - ], - "assign": "PartitionResult" + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] } ], "type": "tree", @@ -4045,92 +4077,83 @@ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseFIPS" - }, - true + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } ] }, { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - }, - { - "fn": "booleanEquals", + "fn": "getAttr", "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", - "rules": [ { - "conditions": [], - "endpoint": { - "url": "https://ec2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } + "ref": "PartitionResult" + }, + "supportsDualStack" ] } ] - }, + } + ], + "type": "tree", + "rules": [ { "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" + "endpoint": { + "url": "https://ec2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ] + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "type": "tree", + "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseFIPS" - }, - true + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } ] } ], @@ -4139,155 +4162,115 @@ { "conditions": [ { - "fn": "booleanEquals", + "fn": "stringEquals", "argv": [ - true, + "aws-us-gov", { "fn": "getAttr", "argv": [ { "ref": "PartitionResult" }, - "supportsFIPS" + "name" ] } ] } ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "stringEquals", - "argv": [ - "aws-us-gov", - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "name" - ] - } - ] - } - ], - "endpoint": { - "url": "https://ec2.{Region}.amazonaws.com", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - }, - { - "conditions": [], - "endpoint": { - "url": "https://ec2-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - } - ] + "endpoint": { + "url": "https://ec2.{Region}.amazonaws.com", + "properties": {}, + "headers": {} + }, + "type": "endpoint" }, { "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" + "endpoint": { + "url": "https://ec2-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ] + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "type": "tree", + "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", + "fn": "getAttr", "argv": [ - true, { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://ec2.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } + "ref": "PartitionResult" + }, + "supportsDualStack" ] } ] - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" } - ] - }, - { - "conditions": [], + ], "type": "tree", "rules": [ { "conditions": [], "endpoint": { - "url": "https://ec2.{Region}.{PartitionResult#dnsSuffix}", + "url": "https://ec2.{Region}.{PartitionResult#dualStackDnsSuffix}", "properties": {}, "headers": {} }, "type": "endpoint" } ] + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" } ] + }, + { + "conditions": [], + "endpoint": { + "url": "https://ec2.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] - }, - { - "conditions": [], - "error": "Invalid Configuration: Missing Region", - "type": "error" } ] + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" } ] }, @@ -5660,6 +5643,15 @@ } } }, + "com.amazonaws.ec2#AssetId": { + "type": "string" + }, + "com.amazonaws.ec2#AssetIdList": { + "type": "list", + "member": { + "target": "com.amazonaws.ec2#AssetId" + } + }, "com.amazonaws.ec2#AssignIpv6Addresses": { "type": "operation", "input": { @@ -5870,7 +5862,7 @@ "target": "com.amazonaws.ec2#AssignPrivateNatGatewayAddressResult" }, "traits": { - "smithy.api#documentation": "

Assigns one or more private IPv4 addresses to a private NAT gateway. For more information, see Work with NAT gateways in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Assigns one or more private IPv4 addresses to a private NAT gateway. For more information, see \n Work with NAT gateways in the Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#AssignPrivateNatGatewayAddressRequest": { @@ -5880,7 +5872,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#required": {} } }, @@ -5919,7 +5911,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "aws.protocols#ec2QueryName": "NatGatewayId", - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#xmlName": "natGatewayId" } }, @@ -5970,7 +5962,20 @@ "target": "com.amazonaws.ec2#AssociateAddressResult" }, "traits": { - "smithy.api#documentation": "

Associates an Elastic IP address, or carrier IP address (for instances that are in\n subnets in Wavelength Zones) with an instance or a network interface. Before you can use an\n Elastic IP address, you must allocate it to your account.

\n

If the Elastic IP address is already\n associated with a different instance, it is disassociated from that instance and associated\n with the specified instance. If you associate an Elastic IP address with an instance that has\n an existing Elastic IP address, the existing address is disassociated from the instance, but\n remains allocated to your account.

\n

[Subnets in Wavelength Zones] You can associate an IP address from the telecommunication\n carrier to the instance or network interface.

\n

You cannot associate an Elastic IP address with an interface in a different network border group.

\n \n

This is an idempotent operation. If you perform the operation more than once, Amazon EC2\n doesn't return an error, and you may be charged for each time the Elastic IP address is\n remapped to the same instance. For more information, see the Elastic IP\n Addresses section of Amazon EC2\n Pricing.

\n
" + "smithy.api#documentation": "

Associates an Elastic IP address, or carrier IP address (for instances that are in\n subnets in Wavelength Zones) with an instance or a network interface. Before you can use an\n Elastic IP address, you must allocate it to your account.

\n

If the Elastic IP address is already\n associated with a different instance, it is disassociated from that instance and associated\n with the specified instance. If you associate an Elastic IP address with an instance that has\n an existing Elastic IP address, the existing address is disassociated from the instance, but\n remains allocated to your account.

\n

[Subnets in Wavelength Zones] You can associate an IP address from the telecommunication\n carrier to the instance or network interface.

\n

You cannot associate an Elastic IP address with an interface in a different network border group.

\n \n

This is an idempotent operation. If you perform the operation more than once, Amazon EC2\n doesn't return an error, and you may be charged for each time the Elastic IP address is\n remapped to the same instance. For more information, see the Elastic IP\n Addresses section of Amazon EC2\n Pricing.

\n
", + "smithy.api#examples": [ + { + "title": "To associate an Elastic IP address", + "documentation": "This example associates the specified Elastic IP address with the specified instance.", + "input": { + "AllocationId": "eipalloc-64d5890a", + "InstanceId": "i-0b263919b6498b123" + }, + "output": { + "AssociationId": "eipassoc-2bebb745" + } + } + ] } }, "com.amazonaws.ec2#AssociateAddressRequest": { @@ -6135,7 +6140,17 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

\n

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

\n

For more information, see DHCP options sets\n in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

\n

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

\n

For more information, see DHCP options sets\n in the Amazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To associate a DHCP options set with a VPC", + "documentation": "This example associates the specified DHCP options set with the specified VPC.", + "input": { + "DhcpOptionsId": "dopt-d9070ebb", + "VpcId": "vpc-a01106c2" + } + } + ] } }, "com.amazonaws.ec2#AssociateDhcpOptionsRequest": { @@ -6257,7 +6272,30 @@ "target": "com.amazonaws.ec2#AssociateIamInstanceProfileResult" }, "traits": { - "smithy.api#documentation": "

Associates an IAM instance profile with a running or stopped instance. You cannot\n associate more than one IAM instance profile with an instance.

" + "smithy.api#documentation": "

Associates an IAM instance profile with a running or stopped instance. You cannot\n associate more than one IAM instance profile with an instance.

", + "smithy.api#examples": [ + { + "title": "To associate an IAM instance profile with an instance", + "documentation": "This example associates an IAM instance profile named admin-role with the specified instance.", + "input": { + "IamInstanceProfile": { + "Name": "admin-role" + }, + "InstanceId": "i-123456789abcde123" + }, + "output": { + "IamInstanceProfileAssociation": { + "InstanceId": "i-123456789abcde123", + "State": "associating", + "AssociationId": "iip-assoc-0e7736511a163c209", + "IamInstanceProfile": { + "Id": "AIPAJBLK7RKJKWDXVHIEC", + "Arn": "arn:aws:iam::123456789012:instance-profile/admin-role" + } + } + } + } + ] } }, "com.amazonaws.ec2#AssociateIamInstanceProfileRequest": { @@ -6443,7 +6481,7 @@ "target": "com.amazonaws.ec2#AssociateNatGatewayAddressResult" }, "traits": { - "smithy.api#documentation": "

Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more information, see Work with NAT gateways in the Amazon Virtual Private Cloud User Guide.

\n

By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by requesting a quota adjustment. For more information, see Elastic IP address quotas in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more information, \n see Work with NAT gateways in the Amazon VPC User Guide.

\n

By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by requesting a quota adjustment. For more information, see Elastic IP address quotas in the Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#AssociateNatGatewayAddressRequest": { @@ -6453,7 +6491,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#required": {} } }, @@ -6493,7 +6531,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "aws.protocols#ec2QueryName": "NatGatewayId", - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#xmlName": "natGatewayId" } }, @@ -6519,7 +6557,7 @@ "target": "com.amazonaws.ec2#AssociateRouteTableResult" }, "traits": { - "smithy.api#documentation": "

Associates a subnet in your VPC or an internet gateway or virtual private gateway\n attached to your VPC with a route table in your VPC. This association causes traffic\n from the subnet or gateway to be routed according to the routes in the route table. The\n action returns an association ID, which you need in order to disassociate the route\n table later. A route table can be associated with multiple subnets.

\n

For more information, see Route tables in the\n Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Associates a subnet in your VPC or an internet gateway or virtual private gateway\n attached to your VPC with a route table in your VPC. This association causes traffic\n from the subnet or gateway to be routed according to the routes in the route table. The\n action returns an association ID, which you need in order to disassociate the route\n table later. A route table can be associated with multiple subnets.

\n

For more information, see Route tables in the\n Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#AssociateRouteTableRequest": { @@ -6940,7 +6978,7 @@ "target": "com.amazonaws.ec2#AssociateVpcCidrBlockResult" }, "traits": { - "smithy.api#documentation": "

Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block,\n an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 address pool that\n you provisioned through bring your own IP addresses (BYOIP). The IPv6 CIDR block size is fixed\n at /56.

\n

You must specify one of the following in the request: an IPv4 CIDR block, an IPv6\n pool, or an Amazon-provided IPv6 CIDR block.

\n

For more information about associating CIDR blocks with your VPC and applicable\n restrictions, see VPC and subnet sizing in the\n Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block,\n an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 address pool that\n you provisioned through bring your own IP addresses (BYOIP). The IPv6 CIDR block size is fixed\n at /56.

\n

You must specify one of the following in the request: an IPv4 CIDR block, an IPv6\n pool, or an Amazon-provided IPv6 CIDR block.

\n

For more information about associating CIDR blocks with your VPC and applicable\n restrictions, see IP addressing for your VPCs and subnets \n in the Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#AssociateVpcCidrBlockRequest": { @@ -7272,7 +7310,7 @@ "target": "com.amazonaws.ec2#AttachClassicLinkVpcResult" }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's\n\t\t\tsecurity groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You\n\t\t\tcan only link an instance that's in the running state. An instance is\n\t\t\tautomatically unlinked from a VPC when it's stopped - you can link it to the VPC again when\n\t\t\tyou restart it.

\n

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.

\n

Linking your instance to a VPC is sometimes referred to as attaching your instance.

" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC\n\t\t\tsecurity groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You\n\t\t\tcan only link an instance that's in the running state. An instance is\n\t\t\tautomatically unlinked from a VPC when it's stopped - you can link it to the VPC again when\n\t\t\tyou restart it.

\n

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.

\n

Linking your instance to a VPC is sometimes referred to as attaching your instance.

" } }, "com.amazonaws.ec2#AttachClassicLinkVpcRequest": { @@ -7292,7 +7330,7 @@ "target": "com.amazonaws.ec2#GroupIdStringList", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.

", + "smithy.api#documentation": "

The IDs of the security groups. You cannot specify security groups from a different VPC.

", "smithy.api#required": {}, "smithy.api#xmlName": "SecurityGroupId" } @@ -7302,7 +7340,7 @@ "traits": { "aws.protocols#ec2QueryName": "InstanceId", "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.

", + "smithy.api#documentation": "

The ID of the EC2-Classic instance.

", "smithy.api#required": {}, "smithy.api#xmlName": "instanceId" } @@ -7312,7 +7350,7 @@ "traits": { "aws.protocols#ec2QueryName": "VpcId", "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of a ClassicLink-enabled VPC.

", + "smithy.api#documentation": "

The ID of the ClassicLink-enabled VPC.

", "smithy.api#required": {}, "smithy.api#xmlName": "vpcId" } @@ -7349,7 +7387,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and\n\t\t\tthe VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity \n\t\t between the internet and the VPC. For more information, see Internet gateways in the \n\t\t Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#AttachInternetGatewayRequest": { @@ -7577,7 +7615,25 @@ "target": "com.amazonaws.ec2#VolumeAttachment" }, "traits": { - "smithy.api#documentation": "

Attaches an EBS volume to a running or stopped instance and exposes it to the instance\n with the specified device name.

\n

Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For\n more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

\n

After you attach an EBS volume, you must make it available. For more information, see \n Make an EBS volume available for use.

\n

If a volume has an Amazon Web Services Marketplace product code:

\n
    \n
  • \n

    The volume can be attached only to a stopped instance.

    \n
  • \n
  • \n

    Amazon Web Services Marketplace product codes are copied from the volume to the instance.

    \n
  • \n
  • \n

    You must be subscribed to the product.

    \n
  • \n
  • \n

    The instance type and operating system of the instance must support the product. For\n example, you can't detach a volume from a Windows instance and attach it to a Linux\n instance.

    \n
  • \n
\n

For more information, see Attach an Amazon EBS volume to an instance in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Attaches an EBS volume to a running or stopped instance and exposes it to the instance\n with the specified device name.

\n

Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For\n more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

\n

After you attach an EBS volume, you must make it available. For more information, see \n Make an EBS volume available for use.

\n

If a volume has an Amazon Web Services Marketplace product code:

\n
    \n
  • \n

    The volume can be attached only to a stopped instance.

    \n
  • \n
  • \n

    Amazon Web Services Marketplace product codes are copied from the volume to the instance.

    \n
  • \n
  • \n

    You must be subscribed to the product.

    \n
  • \n
  • \n

    The instance type and operating system of the instance must support the product. For\n example, you can't detach a volume from a Windows instance and attach it to a Linux\n instance.

    \n
  • \n
\n

For more information, see Attach an Amazon EBS volume to an instance in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To attach a volume to an instance", + "documentation": "This example attaches a volume (``vol-1234567890abcdef0``) to an instance (``i-01474ef662b89480``) as ``/dev/sdf``.", + "input": { + "VolumeId": "vol-1234567890abcdef0", + "InstanceId": "i-01474ef662b89480", + "Device": "/dev/sdf" + }, + "output": { + "AttachTime": "2016-08-29T18:52:32.724Z", + "InstanceId": "i-01474ef662b89480", + "VolumeId": "vol-1234567890abcdef0", + "State": "attaching", + "Device": "/dev/sdf" + } + } + ] } }, "com.amazonaws.ec2#AttachVolumeRequest": { @@ -7956,7 +8012,7 @@ "target": "com.amazonaws.ec2#AuthorizeSecurityGroupEgressResult" }, "traits": { - "smithy.api#documentation": "

[VPC only] Adds the specified outbound (egress) rules to a security group for use with a VPC.

\n

An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 CIDR\n address ranges, or to the instances that are associated with the specified source\n security groups. When specifying an outbound rule for your security group in a VPC, the\n IpPermissions must include a destination for the traffic.

\n

You specify a protocol for each rule (for example, TCP). \n For the TCP and UDP protocols, you must also specify the destination port or port range. \n For the ICMP protocol, you must also specify the ICMP type and code. \n You can use -1 for the type or code to mean all types or all codes.

\n

Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.

\n

For information about VPC security group quotas, see Amazon VPC quotas.

" + "smithy.api#documentation": "

Adds the specified outbound (egress) rules to a security group for use with a VPC.

\n

An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 CIDR\n address ranges, or to the instances that are associated with the specified source\n security groups. When specifying an outbound rule for your security group in a VPC, the\n IpPermissions must include a destination for the traffic.

\n

You specify a protocol for each rule (for example, TCP). \n For the TCP and UDP protocols, you must also specify the destination port or port range. \n For the ICMP protocol, you must also specify the ICMP type and code. \n You can use -1 for the type or code to mean all types or all codes.

\n

Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.

\n

For information about VPC security group quotas, see Amazon VPC quotas.

" } }, "com.amazonaws.ec2#AuthorizeSecurityGroupEgressRequest": { @@ -8089,7 +8145,30 @@ "target": "com.amazonaws.ec2#AuthorizeSecurityGroupIngressResult" }, "traits": { - "smithy.api#documentation": "

Adds the specified inbound (ingress) rules to a security group.

\n

An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR\n address range, or from the instances that are associated with the specified destination security \n groups. When specifying an inbound rule for your security group in a VPC, the\n IpPermissions must include a source for the traffic.

\n

You specify a protocol for each rule (for example, TCP). \n For TCP and UDP, you must also specify the destination port or port range. \n For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. \n You can use -1 to mean all types or all codes.

\n

Rule changes are propagated to instances within the security group as quickly as possible. \n However, a small delay might occur.

\n

For more information about VPC security group quotas, see Amazon VPC quotas.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "

Adds the specified inbound (ingress) rules to a security group.

\n

An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR\n address range, or from the instances that are associated with the specified destination security \n groups. When specifying an inbound rule for your security group in a VPC, the\n IpPermissions must include a source for the traffic.

\n

You specify a protocol for each rule (for example, TCP). \n For TCP and UDP, you must also specify the destination port or port range. \n For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. \n You can use -1 to mean all types or all codes.

\n

Rule changes are propagated to instances within the security group as quickly as possible. \n However, a small delay might occur.

\n

For more information about VPC security group quotas, see Amazon VPC quotas.

", + "smithy.api#examples": [ + { + "title": "To add a rule that allows inbound SSH traffic from an IPv4 address range", + "documentation": "This example enables inbound traffic on TCP port 22 (SSH). The rule includes a description to help you identify it later.", + "input": { + "GroupId": "sg-903004f8", + "IpPermissions": [ + { + "IpProtocol": "tcp", + "FromPort": 22, + "ToPort": 22, + "IpRanges": [ + { + "CidrIp": "203.0.113.0/24", + "Description": "SSH access from the LA office" + } + ] + } + ] + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#AuthorizeSecurityGroupIngressRequest": { @@ -8118,7 +8197,7 @@ "GroupName": { "target": "com.amazonaws.ec2#SecurityGroupName", "traits": { - "smithy.api#documentation": "

[EC2-Classic, default VPC] The name of the security group. You must specify either the\n security group ID or the security group name in the request. For security groups in a\n nondefault VPC, you must specify the security group ID.

" + "smithy.api#documentation": "

[Default VPC] The name of the security group. You must specify either the\n security group ID or the security group name in the request. For security groups in a\n nondefault VPC, you must specify the security group ID.

" } }, "IpPermissions": { @@ -8130,19 +8209,19 @@ "IpProtocol": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The IP protocol name (tcp, udp, icmp) or number\n (see Protocol Numbers). To specify icmpv6, use a set of IP permissions.

\n

[VPC only] Use -1 to specify all protocols. If you specify -1 or a \n protocol other than tcp, udp, or icmp, traffic on all ports \n is allowed, regardless of any ports you specify.

\n

Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.

" + "smithy.api#documentation": "

The IP protocol name (tcp, udp, icmp) or number\n (see Protocol Numbers). To specify icmpv6, use a set of IP permissions.

\n

Use -1 to specify all protocols. If you specify -1 or a \n protocol other than tcp, udp, or icmp, traffic on all ports \n is allowed, regardless of any ports you specify.

\n

Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.

" } }, "SourceSecurityGroupName": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter \n in combination with the following parameters: the CIDR IP address range, the start of the port range, \n the IP protocol, and the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. \n To create a rule with a specific IP protocol and port range, use a set of IP permissions instead. For \n EC2-VPC, the source security group must be in the same VPC.

" + "smithy.api#documentation": "

[Default VPC] The name of the source security group. You can't specify this parameter \n in combination with the following parameters: the CIDR IP address range, the start of the port range, \n the IP protocol, and the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. \n To create a rule with a specific IP protocol and port range, use a set of IP permissions instead. \n The source security group must be in the same VPC.

" } }, "SourceSecurityGroupOwnerId": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

[nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security group is \n in a different account. You can't specify this parameter in combination with the following parameters: \n the CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. \n Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol \n and port range, use a set of IP permissions instead.

" + "smithy.api#documentation": "

[Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security group is \n in a different account. You can't specify this parameter in combination with the following parameters: \n the CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. \n Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol \n and port range, use a set of IP permissions instead.

" } }, "ToPort": { @@ -8351,6 +8430,9 @@ "smithy.api#documentation": "

Describes Availability Zones, Local Zones, and Wavelength Zones.

" } }, + "com.amazonaws.ec2#AvailabilityZoneId": { + "type": "string" + }, "com.amazonaws.ec2#AvailabilityZoneList": { "type": "list", "member": { @@ -8510,6 +8592,9 @@ "com.amazonaws.ec2#BareMetalFlag": { "type": "boolean" }, + "com.amazonaws.ec2#BaselineBandwidthInGbps": { + "type": "double" + }, "com.amazonaws.ec2#BaselineBandwidthInMbps": { "type": "integer" }, @@ -10938,7 +11023,7 @@ } }, "traits": { - "smithy.api#documentation": "

Describes the ClassicLink DNS support status of a VPC.

" + "smithy.api#documentation": "\n

Deprecated.

\n
\n

Describes the ClassicLink DNS support status of a VPC.

" } }, "com.amazonaws.ec2#ClassicLinkDnsSupportList": { @@ -10957,7 +11042,7 @@ "target": "com.amazonaws.ec2#GroupIdentifierList", "traits": { "aws.protocols#ec2QueryName": "GroupSet", - "smithy.api#documentation": "

A list of security groups.

", + "smithy.api#documentation": "

The security groups.

", "smithy.api#xmlName": "groupSet" } }, @@ -10987,7 +11072,7 @@ } }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Describes a linked EC2-Classic instance.

" + "smithy.api#documentation": "\n

Deprecated.

\n
\n

Describes a linked EC2-Classic instance.

" } }, "com.amazonaws.ec2#ClassicLinkInstanceList": { @@ -12267,7 +12352,20 @@ "target": "com.amazonaws.ec2#ConfirmProductInstanceResult" }, "traits": { - "smithy.api#documentation": "

Determines whether a product code is associated with an instance. This action can only\n be used by the owner of the product code. It is useful when a product code owner must\n verify whether another user's instance is eligible for support.

" + "smithy.api#documentation": "

Determines whether a product code is associated with an instance. This action can only\n be used by the owner of the product code. It is useful when a product code owner must\n verify whether another user's instance is eligible for support.

", + "smithy.api#examples": [ + { + "title": "To confirm the product instance", + "documentation": "This example determines whether the specified product code is associated with the specified instance.", + "input": { + "ProductCode": "774F4FF8", + "InstanceId": "i-1234567890abcdef0" + }, + "output": { + "OwnerId": "123456789012" + } + } + ] } }, "com.amazonaws.ec2#ConfirmProductInstanceRequest": { @@ -12719,7 +12817,22 @@ "target": "com.amazonaws.ec2#CopyImageResult" }, "traits": { - "smithy.api#documentation": "

Initiates the copy of an AMI. You can copy an AMI from one Region to another, or from a\n Region to an Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost\n to another, or within the same Outpost. To copy an AMI to another partition, see CreateStoreImageTask.

\n

To copy an AMI from one Region to another, specify the source Region using the \n \t\tSourceRegion parameter, and specify the \n \t\tdestination Region using its endpoint. Copies of encrypted backing snapshots for\n \t\tthe AMI are encrypted. Copies of unencrypted backing snapshots remain unencrypted, \n \t\tunless you set Encrypted during the copy operation. You cannot \n \t\tcreate an unencrypted copy of an encrypted backing snapshot.

\n

To copy an AMI from a Region to an Outpost, specify the source Region using the \n \t\tSourceRegion parameter, and specify the \n \t\tARN of the destination Outpost using DestinationOutpostArn. \n \t\tBacking snapshots copied to an Outpost are encrypted by default using the default\n \t\tencryption key for the Region, or a different key that you specify in the request using \n \t\tKmsKeyId. Outposts do not support unencrypted \n \t\tsnapshots. For more information, \n \t\t\tAmazon EBS local snapshots on Outposts in the Amazon EC2 User Guide.

\n

For more information about the prerequisites and limits when copying an AMI, see Copy an AMI in the\n Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Initiates the copy of an AMI. You can copy an AMI from one Region to another, or from a\n Region to an Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost\n to another, or within the same Outpost. To copy an AMI to another partition, see CreateStoreImageTask.

\n

To copy an AMI from one Region to another, specify the source Region using the \n \t\tSourceRegion parameter, and specify the \n \t\tdestination Region using its endpoint. Copies of encrypted backing snapshots for\n \t\tthe AMI are encrypted. Copies of unencrypted backing snapshots remain unencrypted, \n \t\tunless you set Encrypted during the copy operation. You cannot \n \t\tcreate an unencrypted copy of an encrypted backing snapshot.

\n

To copy an AMI from a Region to an Outpost, specify the source Region using the \n \t\tSourceRegion parameter, and specify the \n \t\tARN of the destination Outpost using DestinationOutpostArn. \n \t\tBacking snapshots copied to an Outpost are encrypted by default using the default\n \t\tencryption key for the Region, or a different key that you specify in the request using \n \t\tKmsKeyId. Outposts do not support unencrypted \n \t\tsnapshots. For more information, \n \t\t\tAmazon EBS local snapshots on Outposts in the Amazon EC2 User Guide.

\n

For more information about the prerequisites and limits when copying an AMI, see Copy an AMI in the\n Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To copy an AMI to another region", + "documentation": "This example copies the specified AMI from the us-east-1 region to the current region.", + "input": { + "Description": "", + "Name": "My server", + "SourceImageId": "ami-5731123e", + "SourceRegion": "us-east-1" + }, + "output": { + "ImageId": "ami-438bea42" + } + } + ] } }, "com.amazonaws.ec2#CopyImageRequest": { @@ -12835,7 +12948,22 @@ "target": "com.amazonaws.ec2#CopySnapshotResult" }, "traits": { - "smithy.api#documentation": "

Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy a\n snapshot within the same Region, from one Region to another, or from a Region to an Outpost. \n You can't copy a snapshot from an Outpost to a Region, from one Outpost to another, or within \n the same Outpost.

\n

You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).

\n

When copying snapshots to a Region, copies of encrypted EBS snapshots remain encrypted. \n \tCopies of unencrypted snapshots remain unencrypted, unless you enable encryption for the \n \tsnapshot copy operation. By default, encrypted snapshot copies use the default Key Management Service (KMS) \n \tKMS key; however, you can specify a different KMS key. To copy an encrypted \n \tsnapshot that has been shared from another account, you must have permissions for the KMS key \n \tused to encrypt the snapshot.

\n

Snapshots copied to an Outpost are encrypted by default using the default\n \t\tencryption key for the Region, or a different key that you specify in the request using \n \t\tKmsKeyId. Outposts do not support unencrypted \n \t\tsnapshots. For more information, \n \t\t\tAmazon EBS local snapshots on Outposts in the Amazon Elastic Compute Cloud User Guide.

\n

Snapshots created by copying another snapshot have an arbitrary volume ID that should not\n be used for any purpose.

\n

For more information, see Copy an Amazon EBS snapshot in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy a\n snapshot within the same Region, from one Region to another, or from a Region to an Outpost. \n You can't copy a snapshot from an Outpost to a Region, from one Outpost to another, or within \n the same Outpost.

\n

You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).

\n

When copying snapshots to a Region, copies of encrypted EBS snapshots remain encrypted. \n \tCopies of unencrypted snapshots remain unencrypted, unless you enable encryption for the \n \tsnapshot copy operation. By default, encrypted snapshot copies use the default Key Management Service (KMS) \n \tKMS key; however, you can specify a different KMS key. To copy an encrypted \n \tsnapshot that has been shared from another account, you must have permissions for the KMS key \n \tused to encrypt the snapshot.

\n

Snapshots copied to an Outpost are encrypted by default using the default\n \t\tencryption key for the Region, or a different key that you specify in the request using \n \t\tKmsKeyId. Outposts do not support unencrypted \n \t\tsnapshots. For more information, \n \t\t\tAmazon EBS local snapshots on Outposts in the Amazon Elastic Compute Cloud User Guide.

\n

Snapshots created by copying another snapshot have an arbitrary volume ID that should not\n be used for any purpose.

\n

For more information, see Copy an Amazon EBS snapshot in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To copy a snapshot", + "documentation": "This example copies a snapshot with the snapshot ID of ``snap-066877671789bd71b`` from the ``us-west-2`` region to the ``us-east-1`` region and adds a short description to identify the snapshot.", + "input": { + "SourceRegion": "us-west-2", + "SourceSnapshotId": "snap-066877671789bd71b", + "Description": "This is my copied snapshot.", + "DestinationRegion": "us-east-1" + }, + "output": { + "SnapshotId": "snap-066877671789bd71b" + } + } + ] } }, "com.amazonaws.ec2#CopySnapshotRequest": { @@ -13040,7 +13168,7 @@ "target": "com.amazonaws.ec2#AmdSevSnpSpecification", "traits": { "aws.protocols#ec2QueryName": "AmdSevSnp", - "smithy.api#documentation": "

Indicates whether the instance is enabled for AMD SEV-SNP.

", + "smithy.api#documentation": "

Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see \n AMD SEV-SNP.

", "smithy.api#xmlName": "amdSevSnp" } } @@ -13071,7 +13199,7 @@ "AmdSevSnp": { "target": "com.amazonaws.ec2#AmdSevSnpSpecification", "traits": { - "smithy.api#documentation": "

Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported \n with M6a, R6a, and C6a instance types only.

" + "smithy.api#documentation": "

Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported \n with M6a, R6a, and C6a instance types only. For more information, see \n AMD SEV-SNP.

" } } }, @@ -13301,13 +13429,13 @@ } }, "AvailabilityZone": { - "target": "com.amazonaws.ec2#String", + "target": "com.amazonaws.ec2#AvailabilityZoneName", "traits": { "smithy.api#documentation": "

The Availability Zone in which to create the Capacity Reservation.

" } }, "AvailabilityZoneId": { - "target": "com.amazonaws.ec2#String", + "target": "com.amazonaws.ec2#AvailabilityZoneId", "traits": { "smithy.api#documentation": "

The ID of the Availability Zone in which to create the Capacity Reservation.

" } @@ -13863,7 +13991,27 @@ "target": "com.amazonaws.ec2#CreateCustomerGatewayResult" }, "traits": { - "smithy.api#documentation": "

Provides information to Amazon Web Services about your customer gateway device. The\n customer gateway device is the appliance at your end of the VPN connection. You\n must provide the IP address of the customer gateway device’s external\n interface. The IP address must be static and can be behind a device performing network\n address translation (NAT).

\n

For devices that use Border Gateway Protocol (BGP), you can also provide the device's\n BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network.\n If you don't have an ASN already, you can use a private ASN. For more information, see \n Customer gateway \n options for your Site-to-Site VPN connection in the Amazon Web Services Site-to-Site VPN User Guide.

\n

To create more than one customer gateway with the same VPN type, IP address, and\n BGP ASN, specify a unique device name for each customer gateway. An identical request\n returns information about the existing customer gateway; it doesn't create a new customer\n gateway.

" + "smithy.api#documentation": "

Provides information to Amazon Web Services about your customer gateway device. The\n customer gateway device is the appliance at your end of the VPN connection. You\n must provide the IP address of the customer gateway device’s external\n interface. The IP address must be static and can be behind a device performing network\n address translation (NAT).

\n

For devices that use Border Gateway Protocol (BGP), you can also provide the device's\n BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network.\n If you don't have an ASN already, you can use a private ASN. For more information, see \n Customer gateway \n options for your Site-to-Site VPN connection in the Amazon Web Services Site-to-Site VPN User Guide.

\n

To create more than one customer gateway with the same VPN type, IP address, and\n BGP ASN, specify a unique device name for each customer gateway. An identical request\n returns information about the existing customer gateway; it doesn't create a new customer\n gateway.

", + "smithy.api#examples": [ + { + "title": "To create a customer gateway", + "documentation": "This example creates a customer gateway with the specified IP address for its outside interface.", + "input": { + "Type": "ipsec.1", + "PublicIp": "12.1.2.3", + "BgpAsn": 65534 + }, + "output": { + "CustomerGateway": { + "CustomerGatewayId": "cgw-0e11f167", + "IpAddress": "12.1.2.3", + "State": "available", + "Type": "ipsec.1", + "BgpAsn": "65534" + } + } + } + ] } }, "com.amazonaws.ec2#CreateCustomerGatewayRequest": { @@ -13958,7 +14106,7 @@ "target": "com.amazonaws.ec2#CreateDefaultSubnetResult" }, "traits": { - "smithy.api#documentation": "

Creates a default subnet with a size /20 IPv4 CIDR block in the\n specified Availability Zone in your default VPC. You can have only one default subnet\n per Availability Zone. For more information, see Creating a default\n subnet in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a default subnet with a size /20 IPv4 CIDR block in the\n specified Availability Zone in your default VPC. You can have only one default subnet\n per Availability Zone. For more information, see Create a default\n subnet in the Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#CreateDefaultSubnetRequest": { @@ -14018,7 +14166,7 @@ "target": "com.amazonaws.ec2#CreateDefaultVpcResult" }, "traits": { - "smithy.api#documentation": "

Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet\n\t\t\tin each Availability Zone. For more information about the components of a default VPC,\n\t\t\tsee Default VPC and\n\t\t\tdefault subnets in the Amazon Virtual Private Cloud User Guide. You cannot\n\t\t\tspecify the components of the default VPC yourself.

\n

If you deleted your previous default VPC, you can create a default VPC. You cannot have\n\t\t\tmore than one default VPC per Region.

\n

If your account supports EC2-Classic, you cannot use this action to create a default VPC\n\t\t\tin a Region that supports EC2-Classic. If you want a default VPC in a Region that\n\t\t\tsupports EC2-Classic, see \"I really want a default VPC for my existing EC2 account. Is\n\t\t\tthat possible?\" in the Default VPCs\n\t\t\tFAQ.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "

Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet\n\t\t\tin each Availability Zone. For more information about the components of a default VPC,\n\t\t\tsee Default VPCs \n\t\t in the Amazon VPC User Guide. You cannot specify the components of the \n\t\t default VPC yourself.

\n

If you deleted your previous default VPC, you can create a default VPC. You cannot have\n\t\t\tmore than one default VPC per Region.

" } }, "com.amazonaws.ec2#CreateDefaultVpcRequest": { @@ -14062,7 +14210,42 @@ "target": "com.amazonaws.ec2#CreateDhcpOptionsResult" }, "traits": { - "smithy.api#documentation": "

Creates a set of DHCP options for your VPC. After creating the set, you must\n\t\t\t\tassociate it with the VPC, causing all existing and new instances that you launch in\n\t\t\t\tthe VPC to use this set of DHCP options. The following are the individual DHCP\n\t\t\t\toptions you can specify. For more information about the options, see RFC 2132.

\n
    \n
  • \n

    \n domain-name-servers - The IP addresses of up to four domain name\n servers, or AmazonProvidedDNS. The default DHCP option set specifies\n AmazonProvidedDNS. If specifying more than one domain name server, specify the\n IP addresses in a single parameter, separated by commas. To have your instance\n receive a custom DNS hostname as specified in domain-name, you must\n set domain-name-servers to a custom DNS server.

    \n
  • \n
  • \n

    \n domain-name - If you're using AmazonProvidedDNS in\n us-east-1, specify ec2.internal. If you're using\n AmazonProvidedDNS in another Region, specify\n region.compute.internal (for example,\n ap-northeast-1.compute.internal). Otherwise, specify a domain\n name (for example, ExampleCompany.com). This value is used to complete\n unqualified DNS hostnames. Important: Some\n Linux operating systems accept multiple domain names separated by spaces.\n However, Windows and other Linux operating systems treat the value as a single\n domain, which results in unexpected behavior. If your DHCP options set is\n associated with a VPC that has instances with multiple operating systems,\n specify only one domain name.

    \n
  • \n
  • \n

    \n ntp-servers - The IP addresses of up to four Network Time Protocol (NTP)\n servers.

    \n
  • \n
  • \n

    \n netbios-name-servers - The IP addresses of up to four NetBIOS name\n servers.

    \n
  • \n
  • \n

    \n netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that\n you specify 2 (broadcast and multicast are not currently supported). For more information\n about these node types, see RFC 2132.

    \n
  • \n
\n

Your VPC automatically starts out with a set of DHCP options that includes only a DNS\n\t\t\tserver that we provide (AmazonProvidedDNS). If you create a set of options, and if your\n\t\t\tVPC has an internet gateway, make sure to set the domain-name-servers\n\t\t\toption either to AmazonProvidedDNS or to a domain name server of your\n\t\t\tchoice. For more information, see DHCP options sets in the\n\t\t\tAmazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a set of DHCP options for your VPC. After creating the set, you must\n\t\t\t\tassociate it with the VPC, causing all existing and new instances that you launch in\n\t\t\t\tthe VPC to use this set of DHCP options. The following are the individual DHCP\n\t\t\t\toptions you can specify. For more information about the options, see RFC 2132.

\n
    \n
  • \n

    \n domain-name-servers - The IP addresses of up to four domain name\n servers, or AmazonProvidedDNS. The default DHCP option set specifies\n AmazonProvidedDNS. If specifying more than one domain name server, specify the\n IP addresses in a single parameter, separated by commas. To have your instance\n receive a custom DNS hostname as specified in domain-name, you must\n set domain-name-servers to a custom DNS server.

    \n
  • \n
  • \n

    \n domain-name - If you're using AmazonProvidedDNS in\n us-east-1, specify ec2.internal. If you're using\n AmazonProvidedDNS in another Region, specify\n region.compute.internal (for example,\n ap-northeast-1.compute.internal). Otherwise, specify a domain\n name (for example, ExampleCompany.com). This value is used to complete\n unqualified DNS hostnames. Important: Some\n Linux operating systems accept multiple domain names separated by spaces.\n However, Windows and other Linux operating systems treat the value as a single\n domain, which results in unexpected behavior. If your DHCP options set is\n associated with a VPC that has instances with multiple operating systems,\n specify only one domain name.

    \n
  • \n
  • \n

    \n ntp-servers - The IP addresses of up to four Network Time Protocol (NTP)\n servers.

    \n
  • \n
  • \n

    \n netbios-name-servers - The IP addresses of up to four NetBIOS name\n servers.

    \n
  • \n
  • \n

    \n netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that\n you specify 2 (broadcast and multicast are not currently supported). For more information\n about these node types, see RFC 2132.

    \n
  • \n
\n

Your VPC automatically starts out with a set of DHCP options that includes only a DNS\n\t\t\tserver that we provide (AmazonProvidedDNS). If you create a set of options, and if your\n\t\t\tVPC has an internet gateway, make sure to set the domain-name-servers\n\t\t\toption either to AmazonProvidedDNS or to a domain name server of your\n\t\t\tchoice. For more information, see DHCP options sets in the\n\t\t\tAmazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a DHCP options set", + "documentation": "This example creates a DHCP options set.", + "input": { + "DhcpConfigurations": [ + { + "Key": "domain-name-servers", + "Values": [ + "10.2.5.1", + "10.2.5.2" + ] + } + ] + }, + "output": { + "DhcpOptions": { + "DhcpConfigurations": [ + { + "Values": [ + { + "Value": "10.2.5.2" + }, + { + "Value": "10.2.5.1" + } + ], + "Key": "domain-name-servers" + } + ], + "DhcpOptionsId": "dopt-d9070ebb" + } + } + } + ] } }, "com.amazonaws.ec2#CreateDhcpOptionsRequest": { @@ -14198,7 +14381,7 @@ "target": "com.amazonaws.ec2#CreateFleetResult" }, "traits": { - "smithy.api#documentation": "

Launches an EC2 Fleet.

\n

You can create a single EC2 Fleet that includes multiple launch specifications that vary by\n instance type, AMI, Availability Zone, or subnet.

\n

For more information, see EC2 Fleet in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Creates an EC2 Fleet that contains the configuration information for On-Demand Instances and Spot Instances.\n Instances are launched immediately if there is available capacity.

\n

A single EC2 Fleet can include multiple launch specifications that vary by instance type,\n AMI, Availability Zone, or subnet.

\n

For more information, see EC2 Fleet in the Amazon EC2 User Guide.

" } }, "com.amazonaws.ec2#CreateFleetError": { @@ -14527,7 +14710,7 @@ "LogFormat": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The fields to include in the flow log record. List the fields in the order in which\n they should appear. If you omit this parameter, the flow log is created using the\n default format. If you specify this parameter, you must include at least one\n field. For more information about the available fields, see Flow log\n records in the Amazon VPC User Guide or Transit Gateway Flow Log\n records in the Amazon Web Services Transit Gateway Guide.

\n

Specify the fields using the ${field-id} format, separated by spaces. For\n the CLI, surround this parameter value with single quotes on Linux or\n double quotes on Windows.

" + "smithy.api#documentation": "

The fields to include in the flow log record. List the fields in the order in which\n they should appear. If you omit this parameter, the flow log is created using the\n default format. If you specify this parameter, you must include at least one\n field. For more information about the available fields, see Flow log\n records in the Amazon VPC User Guide or Transit Gateway Flow Log\n records in the Amazon Web Services Transit Gateway Guide.

\n

Specify the fields using the ${field-id} format, separated by spaces.

" } }, "TagSpecifications": { @@ -14688,7 +14871,7 @@ "target": "com.amazonaws.ec2#CreateImageResult" }, "traits": { - "smithy.api#documentation": "

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance \n \tthat is either running or stopped.

\n

By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can \n\t\t\t\t\ttake snapshots of the attached volumes while data is at rest, in order to ensure a consistent \n\t\t\t\t\tstate. You can set the NoReboot parameter to true in the API request, \n\t\t\t\t\tor use the --no-reboot option in the CLI to prevent Amazon EC2 from shutting down and \n\t\t\t\t\trebooting the instance.

\n \n

If you choose to bypass the shutdown and reboot process by setting the NoReboot \n\t\t\t\t\tparameter to true in the API request, or by using the --no-reboot option \n\t\t\t\t\tin the CLI, we can't guarantee the file system integrity of the created image.

\n
\n

If you customized your instance with instance store volumes or Amazon EBS volumes in addition to the root device volume, the \n \tnew AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, \n \tthe instance automatically launches with those additional volumes.

\n

For more information, see Create an Amazon EBS-backed Linux\n AMI in the Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance \n \tthat is either running or stopped.

\n

If you customized your instance with instance store volumes or Amazon EBS volumes in addition to the root device volume, the \n \tnew AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, \n \tthe instance automatically launches with those additional volumes.

\n

For more information, see Create an Amazon EBS-backed Linux\n AMI in the Amazon Elastic Compute Cloud User Guide.

" } }, "com.amazonaws.ec2#CreateImageRequest": { @@ -14746,7 +14929,7 @@ "aws.protocols#ec2QueryName": "NoReboot", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

By default, when Amazon EC2 creates the new AMI, it reboots the instance so that it can \n\t\t\t\t\ttake snapshots of the attached volumes while data is at rest, in order to ensure a consistent \n\t\t\t\t\tstate. You can set the NoReboot parameter to true in the API request, \n\t\t\t\t\tor use the --no-reboot option in the CLI to prevent Amazon EC2 from shutting down and \n\t\t\t\t\trebooting the instance.

\n \n

If you choose to bypass the shutdown and reboot process by setting the NoReboot \n\t\t\t\t\tparameter to true in the API request, or by using the --no-reboot option \n\t\t\t\t\tin the CLI, we can't guarantee the file system integrity of the created image.

\n
\n

Default: false (follow standard reboot process)

", + "smithy.api#documentation": "

Indicates whether or not the instance should be automatically rebooted before creating \n the image. Specify one of the following values:

\n
    \n
  • \n

    \n true - The instance is not rebooted before creating the image. This \n creates crash-consistent snapshots that include only the data that has been written \n to the volumes at the time the snapshots are created. Buffered data and data in \n memory that has not yet been written to the volumes is not included in the snapshots.

    \n
  • \n
  • \n

    \n false - The instance is rebooted before creating the image. This \n ensures that all buffered data and data in memory is written to the volumes before the \n snapshots are created.

    \n
  • \n
\n

Default: false\n

", "smithy.api#xmlName": "noReboot" } }, @@ -14787,7 +14970,7 @@ "target": "com.amazonaws.ec2#CreateInstanceConnectEndpointResult" }, "traits": { - "smithy.api#documentation": "

Creates an EC2 Instance Connect Endpoint.

\n

An EC2 Instance Connect Endpoint allows you to connect to a resource, without\n requiring the resource to have a public IPv4 address. For more information, see Connect to your resources without requiring a public IPv4 address using EC2\n Instance Connect Endpoint in the Amazon EC2 User\n Guide.

" + "smithy.api#documentation": "

Creates an EC2 Instance Connect Endpoint.

\n

An EC2 Instance Connect Endpoint allows you to connect to an instance, without\n requiring the instance to have a public IPv4 address. For more information, see Connect to your instances without requiring a public IPv4 address using EC2\n Instance Connect Endpoint in the Amazon EC2 User\n Guide.

" } }, "com.amazonaws.ec2#CreateInstanceConnectEndpointRequest": { @@ -14946,7 +15129,7 @@ "target": "com.amazonaws.ec2#CreateInstanceExportTaskResult" }, "traits": { - "smithy.api#documentation": "

Exports a running or stopped instance to an Amazon S3 bucket.

\n

For information about the supported operating systems, image formats, and known limitations\n for the types of instances you can export, see Exporting an instance as a VM Using VM Import/Export\n in the VM Import/Export User Guide.

" + "smithy.api#documentation": "

Exports a running or stopped instance to an Amazon S3 bucket.

\n

For information about the prerequisites for your Amazon S3 bucket, supported operating systems,\n image formats, and known limitations for the types of instances you can export, see Exporting an instance as a VM Using VM\n Import/Export in the VM Import/Export User Guide.

" } }, "com.amazonaws.ec2#CreateInstanceExportTaskRequest": { @@ -15027,7 +15210,20 @@ "target": "com.amazonaws.ec2#CreateInternetGatewayResult" }, "traits": { - "smithy.api#documentation": "

Creates an internet gateway for use with a VPC. After creating the internet gateway,\n\t\t\tyou attach it to a VPC using AttachInternetGateway.

\n

For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates an internet gateway for use with a VPC. After creating the internet gateway,\n\t\t\tyou attach it to a VPC using AttachInternetGateway.

\n

For more information, see Internet gateways in the \n Amazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To create an Internet gateway", + "documentation": "This example creates an Internet gateway.", + "output": { + "InternetGateway": { + "Tags": [], + "InternetGatewayId": "igw-c0a643a9", + "Attachments": [] + } + } + } + ] } }, "com.amazonaws.ec2#CreateInternetGatewayRequest": { @@ -15445,7 +15641,16 @@ "target": "com.amazonaws.ec2#KeyPair" }, "traits": { - "smithy.api#documentation": "

Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the\n specified PEM or PPK format. Amazon EC2 stores the public key and displays the private\n key for you to save to a file. The private key is returned as an unencrypted PEM encoded\n PKCS#1 private key or an unencrypted PPK formatted private key for use with PuTTY. If a\n key with the specified name already exists, Amazon EC2 returns an error.

\n

The key pair returned to you is available only in the Amazon Web Services Region in which you create it.\n If you prefer, you can create your own key pair using a third-party tool and upload it\n to any Region using ImportKeyPair.

\n

You can have up to 5,000 key pairs per Amazon Web Services Region.

\n

For more information, see Amazon EC2 key pairs in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the\n specified PEM or PPK format. Amazon EC2 stores the public key and displays the private\n key for you to save to a file. The private key is returned as an unencrypted PEM encoded\n PKCS#1 private key or an unencrypted PPK formatted private key for use with PuTTY. If a\n key with the specified name already exists, Amazon EC2 returns an error.

\n

The key pair returned to you is available only in the Amazon Web Services Region in which you create it.\n If you prefer, you can create your own key pair using a third-party tool and upload it\n to any Region using ImportKeyPair.

\n

You can have up to 5,000 key pairs per Amazon Web Services Region.

\n

For more information, see Amazon EC2 key pairs in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a key pair", + "documentation": "This example creates a key pair named my-key-pair.", + "input": { + "KeyName": "my-key-pair" + } + } + ] } }, "com.amazonaws.ec2#CreateKeyPairRequest": { @@ -15502,7 +15707,50 @@ "target": "com.amazonaws.ec2#CreateLaunchTemplateResult" }, "traits": { - "smithy.api#documentation": "

Creates a launch template.

\n

A launch template contains the parameters to launch an instance. When you launch an\n instance using RunInstances, you can specify a launch template instead\n of providing the launch parameters in the request. For more information, see Launch\n an instance from a launch template in the\n Amazon Elastic Compute Cloud User Guide.

\n

If you want to clone an existing launch template as the basis for creating a new\n launch template, you can use the Amazon EC2 console. The API, SDKs, and CLI do not support\n cloning a template. For more information, see Create a launch template from an existing launch template in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates a launch template.

\n

A launch template contains the parameters to launch an instance. When you launch an\n instance using RunInstances, you can specify a launch template instead\n of providing the launch parameters in the request. For more information, see Launch\n an instance from a launch template in the\n Amazon Elastic Compute Cloud User Guide.

\n

If you want to clone an existing launch template as the basis for creating a new\n launch template, you can use the Amazon EC2 console. The API, SDKs, and CLI do not support\n cloning a template. For more information, see Create a launch template from an existing launch template in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a launch template", + "documentation": "This example creates a launch template that specifies the subnet in which to launch the instance, assigns a public IP address and an IPv6 address to the instance, and creates a tag for the instance.", + "input": { + "LaunchTemplateName": "my-template", + "VersionDescription": "WebVersion1", + "LaunchTemplateData": { + "NetworkInterfaces": [ + { + "AssociatePublicIpAddress": true, + "DeviceIndex": 0, + "Ipv6AddressCount": 1, + "SubnetId": "subnet-7b16de0c" + } + ], + "ImageId": "ami-8c1be5f6", + "InstanceType": "t2.small", + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "webserver" + } + ] + } + ] + } + }, + "output": { + "LaunchTemplate": { + "LatestVersionNumber": 1, + "LaunchTemplateId": "lt-01238c059e3466abc", + "LaunchTemplateName": "my-template", + "DefaultVersionNumber": 1, + "CreatedBy": "arn:aws:iam::123456789012:root", + "CreateTime": "2017-11-27T09:13:24.000Z" + } + } + } + ] } }, "com.amazonaws.ec2#CreateLaunchTemplateRequest": { @@ -15589,7 +15837,48 @@ "target": "com.amazonaws.ec2#CreateLaunchTemplateVersionResult" }, "traits": { - "smithy.api#documentation": "

Creates a new version of a launch template. You can specify an existing version of\n launch template from which to base the new version.

\n

Launch template versions are numbered in the order in which they are created. You\n cannot specify, change, or replace the numbering of launch template versions.

\n

Launch templates are immutable; after you create a launch template, you can't modify\n it. Instead, you can create a new version of the launch template that includes any\n changes you require.

\n

For more information, see Modify a launch template (manage launch template versions) in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates a new version of a launch template. You can specify an existing version of\n launch template from which to base the new version.

\n

Launch template versions are numbered in the order in which they are created. You\n cannot specify, change, or replace the numbering of launch template versions.

\n

Launch templates are immutable; after you create a launch template, you can't modify\n it. Instead, you can create a new version of the launch template that includes any\n changes you require.

\n

For more information, see Modify a launch template (manage launch template versions) in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a launch template version", + "documentation": "This example creates a new launch template version based on version 1 of the specified launch template and specifies a different AMI ID.", + "input": { + "LaunchTemplateId": "lt-0abcd290751193123", + "SourceVersion": "1", + "VersionDescription": "WebVersion2", + "LaunchTemplateData": { + "ImageId": "ami-c998b6b2" + } + }, + "output": { + "LaunchTemplateVersion": { + "VersionDescription": "WebVersion2", + "LaunchTemplateId": "lt-0abcd290751193123", + "LaunchTemplateName": "my-template", + "VersionNumber": 2, + "CreatedBy": "arn:aws:iam::123456789012:root", + "LaunchTemplateData": { + "ImageId": "ami-c998b6b2", + "InstanceType": "t2.micro", + "NetworkInterfaces": [ + { + "Ipv6Addresses": [ + { + "Ipv6Address": "2001:db8:1234:1a00::123" + } + ], + "DeviceIndex": 0, + "SubnetId": "subnet-7b16de0c", + "AssociatePublicIpAddress": true + } + ] + }, + "DefaultVersion": false, + "CreateTime": "2017-12-01T13:35:46.000Z" + } + } + } + ] } }, "com.amazonaws.ec2#CreateLaunchTemplateVersionRequest": { @@ -16052,7 +16341,31 @@ "target": "com.amazonaws.ec2#CreateNatGatewayResult" }, "traits": { - "smithy.api#documentation": "

Creates a NAT gateway in the specified subnet. This action creates a network interface\n in the specified subnet with a private IP address from the IP address range of the\n subnet. You can create either a public NAT gateway or a private NAT gateway.

\n

With a public NAT gateway, internet-bound traffic from a private subnet can be routed\n to the NAT gateway, so that instances in a private subnet can connect to the internet.

\n

With a private NAT gateway, private communication is routed across VPCs and on-premises\n networks through a transit gateway or virtual private gateway. Common use cases include\n running large workloads behind a small pool of allowlisted IPv4 addresses, preserving\n private IPv4 addresses, and communicating between overlapping networks.

\n

For more information, see NAT gateways in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a NAT gateway in the specified subnet. This action creates a network interface\n in the specified subnet with a private IP address from the IP address range of the\n subnet. You can create either a public NAT gateway or a private NAT gateway.

\n

With a public NAT gateway, internet-bound traffic from a private subnet can be routed\n to the NAT gateway, so that instances in a private subnet can connect to the internet.

\n

With a private NAT gateway, private communication is routed across VPCs and on-premises\n networks through a transit gateway or virtual private gateway. Common use cases include\n running large workloads behind a small pool of allowlisted IPv4 addresses, preserving\n private IPv4 addresses, and communicating between overlapping networks.

\n

For more information, see NAT gateways in the Amazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a NAT gateway", + "documentation": "This example creates a NAT gateway in subnet subnet-1a2b3c4d and associates an Elastic IP address with the allocation ID eipalloc-37fc1a52 with the NAT gateway.", + "input": { + "SubnetId": "subnet-1a2b3c4d", + "AllocationId": "eipalloc-37fc1a52" + }, + "output": { + "NatGateway": { + "NatGatewayAddresses": [ + { + "AllocationId": "eipalloc-37fc1a52" + } + ], + "VpcId": "vpc-1122aabb", + "State": "pending", + "NatGatewayId": "nat-08d48af2a8e83edfd", + "SubnetId": "subnet-1a2b3c4d", + "CreateTime": "2015-12-17T12:45:26.732Z" + } + } + } + ] } }, "com.amazonaws.ec2#CreateNatGatewayRequest": { @@ -16109,14 +16422,14 @@ "SecondaryAllocationIds": { "target": "com.amazonaws.ec2#AllocationIdList", "traits": { - "smithy.api#documentation": "

Secondary EIP allocation IDs. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.

", + "smithy.api#documentation": "

Secondary EIP allocation IDs. For more information, see Create a NAT gateway \n in the Amazon VPC User Guide.

", "smithy.api#xmlName": "SecondaryAllocationId" } }, "SecondaryPrivateIpAddresses": { "target": "com.amazonaws.ec2#IpList", "traits": { - "smithy.api#documentation": "

Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.

", + "smithy.api#documentation": "

Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon VPC User Guide.

", "smithy.api#xmlName": "SecondaryPrivateIpAddress" } }, @@ -16125,7 +16438,7 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": 0, - "smithy.api#documentation": "

[Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

[Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. \n For more information about secondary addresses, see Create a NAT gateway \n in the Amazon VPC User Guide.

" } } }, @@ -16166,7 +16479,7 @@ "target": "com.amazonaws.ec2#CreateNetworkAclResult" }, "traits": { - "smithy.api#documentation": "

Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.

\n

For more information, see Network ACLs in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.

\n

For more information, see Network ACLs in the\n\t\t\t\tAmazon VPC User Guide.

" } }, "com.amazonaws.ec2#CreateNetworkAclEntry": { @@ -16178,7 +16491,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules \n\t\t and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated \n\t\t with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of \n\t\t ingress rules and a separate set of egress rules.

\n

We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the \n\t\t other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.

\n

After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.

\n

For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules \n\t\t and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated \n\t\t with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of \n\t\t ingress rules and a separate set of egress rules.

\n

We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the \n\t\t other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.

\n

After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.

\n

For more information about network ACLs, see Network ACLs \n in the Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#CreateNetworkAclEntryRequest": { @@ -16746,6 +17059,14 @@ "smithy.api#documentation": "

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

", "smithy.api#idempotencyToken": {} } + }, + "EnablePrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

If you’re creating a network interface in a dual-stack or IPv6-only subnet, you have\n the option to assign a primary IPv6 IP address. A primary IPv6 address is an IPv6 GUA\n address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if the instance that\n this ENI will be attached to relies on its IPv6 address not changing. Amazon Web Services\n will automatically assign an IPv6 address associated with the ENI attached to your\n instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a\n primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary\n IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is\n terminated or the network interface is detached. If you have multiple IPv6 addresses\n associated with an ENI attached to your instance and you enable a primary IPv6 address,\n the first IPv6 GUA address associated with the ENI becomes the primary IPv6\n address.

" + } } }, "traits": { @@ -16785,7 +17106,18 @@ "target": "com.amazonaws.ec2#CreatePlacementGroupResult" }, "traits": { - "smithy.api#documentation": "

Creates a placement group in which to launch instances. The strategy of the placement\n group determines how the instances are organized within the group.

\n

A cluster placement group is a logical grouping of instances within a\n single Availability Zone that benefit from low network latency, high network throughput.\n A spread placement group places instances on distinct hardware. A\n partition placement group places groups of instances in different\n partitions, where instances in one partition do not share the same hardware with\n instances in another partition.

\n

For more information, see Placement groups in the\n Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Creates a placement group in which to launch instances. The strategy of the placement\n group determines how the instances are organized within the group.

\n

A cluster placement group is a logical grouping of instances within a\n single Availability Zone that benefit from low network latency, high network throughput.\n A spread placement group places instances on distinct hardware. A\n partition placement group places groups of instances in different\n partitions, where instances in one partition do not share the same hardware with\n instances in another partition.

\n

For more information, see Placement groups in the\n Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a placement group", + "documentation": "This example creates a placement group with the specified name.", + "input": { + "GroupName": "my-cluster", + "Strategy": "cluster" + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#CreatePlacementGroupRequest": { @@ -17157,7 +17489,7 @@ "target": "com.amazonaws.ec2#CreateRouteResult" }, "traits": { - "smithy.api#documentation": "

Creates a route in a route table within a VPC.

\n

You must specify either a destination CIDR block or a prefix list ID. You must also specify \n exactly one of the resources from the parameter list.

\n

When determining how to route traffic, we use the route with the most specific match.\n For example, traffic is destined for the IPv4 address 192.0.2.3, and the\n route table includes the following two IPv4 routes:

\n
    \n
  • \n

    \n 192.0.2.0/24 (goes to some target A)

    \n
  • \n
  • \n

    \n 192.0.2.0/28 (goes to some target B)

    \n
  • \n
\n

Both routes apply to the traffic destined for 192.0.2.3. However, the second route\n\t\t\t\tin the list covers a smaller number of IP addresses and is therefore more specific,\n\t\t\t\tso we use that route to determine where to target the traffic.

\n

For more information about route tables, see Route tables in the\n Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a route in a route table within a VPC.

\n

You must specify either a destination CIDR block or a prefix list ID. You must also specify \n exactly one of the resources from the parameter list.

\n

When determining how to route traffic, we use the route with the most specific match.\n For example, traffic is destined for the IPv4 address 192.0.2.3, and the\n route table includes the following two IPv4 routes:

\n
    \n
  • \n

    \n 192.0.2.0/24 (goes to some target A)

    \n
  • \n
  • \n

    \n 192.0.2.0/28 (goes to some target B)

    \n
  • \n
\n

Both routes apply to the traffic destined for 192.0.2.3. However, the second route\n\t\t\t\tin the list covers a smaller number of IP addresses and is therefore more specific,\n\t\t\t\tso we use that route to determine where to target the traffic.

\n

For more information about route tables, see Route tables in the\n Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#CreateRouteRequest": { @@ -17315,7 +17647,7 @@ "target": "com.amazonaws.ec2#CreateRouteTableResult" }, "traits": { - "smithy.api#documentation": "

Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.

\n

For more information, see Route tables in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.

\n

For more information, see Route tables in the\n\t\t\t\tAmazon VPC User Guide.

" } }, "com.amazonaws.ec2#CreateRouteTableRequest": { @@ -17378,7 +17710,21 @@ "target": "com.amazonaws.ec2#CreateSecurityGroupResult" }, "traits": { - "smithy.api#documentation": "

Creates a security group.

\n

A security group acts as a virtual firewall for your instance to control inbound and outbound traffic.\n For more information, see\n\t\t\t\tAmazon EC2 security groups in \n\t\t\t\tthe Amazon Elastic Compute Cloud User Guide and \n\t\t\t\tSecurity groups for your VPC in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

\n

When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.

\n

You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.

\n

You can add or remove rules from your security groups using \n\t\t\t\t\tAuthorizeSecurityGroupIngress,\n\t\t\t\t\tAuthorizeSecurityGroupEgress,\n\t\t\t\t\tRevokeSecurityGroupIngress, and\n\t\t\t\t\tRevokeSecurityGroupEgress.

\n

For more information about VPC security group limits, see Amazon VPC Limits.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "

Creates a security group.

\n

A security group acts as a virtual firewall for your instance to control inbound and outbound traffic.\n For more information, see\n\t\t\t\tAmazon EC2 security groups in \n\t\t\t\tthe Amazon Elastic Compute Cloud User Guide and \n\t\t\t\tSecurity groups for your VPC in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

\n

When you create a security group, you specify a friendly name of your choice. \n You can't have two security groups for the same VPC with the same name.

\n

You have a default security group for use in your VPC. If you don't specify a security group \n when you launch an instance, the instance is launched into the appropriate default security group. \n A default security group includes a default rule that grants instances unrestricted network access \n to each other.

\n

You can add or remove rules from your security groups using \n\t\t\t\t\tAuthorizeSecurityGroupIngress,\n\t\t\t\t\tAuthorizeSecurityGroupEgress,\n\t\t\t\t\tRevokeSecurityGroupIngress, and\n\t\t\t\t\tRevokeSecurityGroupEgress.

\n

For more information about VPC security group limits, see Amazon VPC Limits.

", + "smithy.api#examples": [ + { + "title": "To create a security group for a VPC", + "documentation": "This example creates a security group for the specified VPC.", + "input": { + "Description": "My security group", + "GroupName": "my-security-group", + "VpcId": "vpc-1a2b3c4d" + }, + "output": { + "GroupId": "sg-903004f8" + } + } + ] } }, "com.amazonaws.ec2#CreateSecurityGroupRequest": { @@ -17388,7 +17734,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

A description for the security group.

\n

Constraints: Up to 255 characters in length

\n

Constraints for EC2-Classic: ASCII characters

\n

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

", + "smithy.api#documentation": "

A description for the security group.

\n

Constraints: Up to 255 characters in length

\n

Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

", "smithy.api#required": {}, "smithy.api#xmlName": "GroupDescription" } @@ -17397,14 +17743,14 @@ "target": "com.amazonaws.ec2#String", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The name of the security group.

\n

Constraints: Up to 255 characters in length. Cannot start with\n sg-.

\n

Constraints for EC2-Classic: ASCII characters

\n

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

", + "smithy.api#documentation": "

The name of the security group.

\n

Constraints: Up to 255 characters in length. Cannot start with sg-.

\n

Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

", "smithy.api#required": {} } }, "VpcId": { "target": "com.amazonaws.ec2#VpcId", "traits": { - "smithy.api#documentation": "

[EC2-VPC] The ID of the VPC. Required for EC2-VPC.

" + "smithy.api#documentation": "

The ID of the VPC. Required for a nondefault VPC.

" } }, "TagSpecifications": { @@ -17462,7 +17808,27 @@ "target": "com.amazonaws.ec2#Snapshot" }, "traits": { - "smithy.api#documentation": "

Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for\n \tbackups, to make copies of EBS volumes, and to save data before shutting down an\n \tinstance.

\n

You can create snapshots of volumes in a Region and volumes on an Outpost. If you \n \tcreate a snapshot of a volume in a Region, the snapshot must be stored in the same \n \tRegion as the volume. If you create a snapshot of a volume on an Outpost, the snapshot \n \tcan be stored on the same Outpost as the volume, or in the Region for that Outpost.

\n

When a snapshot is created, any Amazon Web Services Marketplace product codes that are associated with the\n source volume are propagated to the snapshot.

\n

You can take a snapshot of an attached volume that is in use. However, snapshots only\n capture data that has been written to your Amazon EBS volume at the time the snapshot command is\n issued; this might exclude any data that has been cached by any applications or the operating\n system. If you can pause any file systems on the volume long enough to take a snapshot, your\n snapshot should be complete. However, if you cannot pause all file writes to the volume, you\n should unmount the volume from within the instance, issue the snapshot command, and then\n remount the volume to ensure a consistent and complete snapshot. You may remount and use your\n volume while the snapshot status is pending.

\n

When you create a snapshot for an EBS volume that serves as a root device, we recommend \n that you stop the instance before taking the snapshot.

\n

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that\n are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes\n and any associated snapshots always remain protected.

\n

You can tag your snapshots during creation. For more information, see Tag your Amazon EC2\n resources in the Amazon Elastic Compute Cloud User Guide.

\n

For more information, see Amazon Elastic Block Store and Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for\n \tbackups, to make copies of EBS volumes, and to save data before shutting down an\n \tinstance.

\n

You can create snapshots of volumes in a Region and volumes on an Outpost. If you \n \tcreate a snapshot of a volume in a Region, the snapshot must be stored in the same \n \tRegion as the volume. If you create a snapshot of a volume on an Outpost, the snapshot \n \tcan be stored on the same Outpost as the volume, or in the Region for that Outpost.

\n

When a snapshot is created, any Amazon Web Services Marketplace product codes that are associated with the\n source volume are propagated to the snapshot.

\n

You can take a snapshot of an attached volume that is in use. However, snapshots only\n capture data that has been written to your Amazon EBS volume at the time the snapshot command is\n issued; this might exclude any data that has been cached by any applications or the operating\n system. If you can pause any file systems on the volume long enough to take a snapshot, your\n snapshot should be complete. However, if you cannot pause all file writes to the volume, you\n should unmount the volume from within the instance, issue the snapshot command, and then\n remount the volume to ensure a consistent and complete snapshot. You may remount and use your\n volume while the snapshot status is pending.

\n

When you create a snapshot for an EBS volume that serves as a root device, we recommend \n that you stop the instance before taking the snapshot.

\n

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that\n are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes\n and any associated snapshots always remain protected.

\n

You can tag your snapshots during creation. For more information, see Tag your Amazon EC2\n resources in the Amazon Elastic Compute Cloud User Guide.

\n

For more information, see Amazon Elastic Block Store and Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a snapshot", + "documentation": "This example creates a snapshot of the volume with a volume ID of ``vol-1234567890abcdef0`` and a short description to identify the snapshot.", + "input": { + "VolumeId": "vol-1234567890abcdef0", + "Description": "This is my root volume snapshot." + }, + "output": { + "Description": "This is my root volume snapshot.", + "Tags": [], + "VolumeId": "vol-1234567890abcdef0", + "State": "pending", + "VolumeSize": 8, + "StartTime": "2014-02-28T21:06:01.000Z", + "OwnerId": "012345678910", + "SnapshotId": "snap-066877671789bd71b" + } + } + ] } }, "com.amazonaws.ec2#CreateSnapshotRequest": { @@ -17729,7 +18095,27 @@ "target": "com.amazonaws.ec2#CreateSubnetResult" }, "traits": { - "smithy.api#documentation": "

Creates a subnet in the specified VPC. For an IPv4 only subnet, specify an IPv4 CIDR block.\n If the VPC has an IPv6 CIDR block, you can create an IPv6 only subnet or a dual stack subnet instead.\n For an IPv6 only subnet, specify an IPv6 CIDR block. For a dual stack subnet, specify both\n an IPv4 CIDR block and an IPv6 CIDR block.

\n

A subnet CIDR block must not overlap the CIDR block of an existing subnet in the VPC.\n After you create a subnet, you can't change its CIDR block.

\n

The allowed size for an IPv4 subnet is between a /28 netmask (16 IP addresses) and \n a /16 netmask (65,536 IP addresses). Amazon Web Services reserves both the first four and \n the last IPv4 address in each subnet's CIDR block. They're not available for your use.

\n

If you've associated an IPv6 CIDR block with your VPC, you can associate an IPv6 CIDR block \n with a subnet when you create it. The allowed block size for an IPv6 subnet is a /64 netmask.

\n

If you add more than one subnet to a VPC, they're set up in a star topology with a\n logical router in the middle.

\n

When you stop an instance in a subnet, it retains its private IPv4 address. It's\n therefore possible to have a subnet with no running instances (they're all stopped), but\n no remaining IP addresses available.

\n

For more information, see Subnets in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a subnet in the specified VPC. For an IPv4 only subnet, specify an IPv4 CIDR block.\n If the VPC has an IPv6 CIDR block, you can create an IPv6 only subnet or a dual stack subnet instead.\n For an IPv6 only subnet, specify an IPv6 CIDR block. For a dual stack subnet, specify both\n an IPv4 CIDR block and an IPv6 CIDR block.

\n

A subnet CIDR block must not overlap the CIDR block of an existing subnet in the VPC.\n After you create a subnet, you can't change its CIDR block.

\n

The allowed size for an IPv4 subnet is between a /28 netmask (16 IP addresses) and \n a /16 netmask (65,536 IP addresses). Amazon Web Services reserves both the first four and \n the last IPv4 address in each subnet's CIDR block. They're not available for your use.

\n

If you've associated an IPv6 CIDR block with your VPC, you can associate an IPv6 CIDR block \n with a subnet when you create it. The allowed block size for an IPv6 subnet is a /64 netmask.

\n

If you add more than one subnet to a VPC, they're set up in a star topology with a\n logical router in the middle.

\n

When you stop an instance in a subnet, it retains its private IPv4 address. It's\n therefore possible to have a subnet with no running instances (they're all stopped), but\n no remaining IP addresses available.

\n

For more information, see Subnets in the Amazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a subnet", + "documentation": "This example creates a subnet in the specified VPC with the specified CIDR block. We recommend that you let us select an Availability Zone for you.", + "input": { + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.1.0/24" + }, + "output": { + "Subnet": { + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.1.0/24", + "State": "pending", + "AvailabilityZone": "us-west-2c", + "SubnetId": "subnet-9d4a7b6c", + "AvailableIpAddressCount": 251 + } + } + } + ] } }, "com.amazonaws.ec2#CreateSubnetCidrReservation": { @@ -17741,7 +18127,7 @@ "target": "com.amazonaws.ec2#CreateSubnetCidrReservationResult" }, "traits": { - "smithy.api#documentation": "

Creates a subnet CIDR reservation. For information about subnet CIDR reservations, see Subnet CIDR reservations in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Creates a subnet CIDR reservation. For more information, see Subnet CIDR reservations \n in the Amazon Virtual Private Cloud User Guide and Assign prefixes \n to network interfaces in the Amazon Elastic Compute Cloud User Guide.

" } }, "com.amazonaws.ec2#CreateSubnetCidrReservationRequest": { @@ -17767,14 +18153,14 @@ "target": "com.amazonaws.ec2#SubnetCidrReservationType", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The type of reservation.

\n

The following are valid values:

\n
    \n
  • \n

    \n prefix: The Amazon EC2\n Prefix\n Delegation feature assigns the IP addresses to network interfaces that are\n associated with an instance. For information about Prefix\n Delegation,\n see Prefix Delegation\n for Amazon EC2 network interfaces in the\n Amazon Elastic Compute Cloud User Guide.

    \n
  • \n
  • \n

    \n explicit: You manually assign the IP addresses to resources that\n reside in your subnet.

    \n
  • \n
", + "smithy.api#documentation": "

The type of reservation. The reservation type determines how the reserved IP addresses are \n assigned to resources.

\n
    \n
  • \n

    \n prefix - Amazon Web Services assigns the reserved IP addresses to \n network interfaces.

    \n
  • \n
  • \n

    \n explicit - You assign the reserved IP addresses to network interfaces.

    \n
  • \n
", "smithy.api#required": {} } }, "Description": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The\n description\n to assign to the subnet CIDR reservation.

" + "smithy.api#documentation": "

The description to assign to the subnet CIDR reservation.

" } }, "DryRun": { @@ -17826,7 +18212,7 @@ "AvailabilityZone": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The Availability Zone or Local Zone for the subnet.

\n

Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we \n do not necessarily select a different zone for each subnet.

\n

To create a subnet in a Local Zone, set this value to the Local Zone ID, for example\n us-west-2-lax-1a. For information about the Regions that support Local Zones, \n see Available Regions in the Amazon Elastic Compute Cloud User Guide.

\n

To create a subnet in an Outpost, set this value to the Availability Zone for the\n Outpost and specify the Outpost ARN.

" + "smithy.api#documentation": "

The Availability Zone or Local Zone for the subnet.

\n

Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we \n do not necessarily select a different zone for each subnet.

\n

To create a subnet in a Local Zone, set this value to the Local Zone ID, for example\n us-west-2-lax-1a. For information about the Regions that support Local Zones, \n see Local Zones locations.

\n

To create a subnet in an Outpost, set this value to the Availability Zone for the\n Outpost and specify the Outpost ARN.

" } }, "AvailabilityZoneId": { @@ -18198,7 +18584,7 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": 0, - "smithy.api#documentation": "

The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do\n not specify this parameter when you want to mirror the entire packet. To mirror a subset of\n the packet, set this to the length (in bytes) that you want to mirror. For example, if you\n set this value to 100, then the first 100 bytes that meet the filter criteria are copied to\n the target.

\n

If you do not want to mirror the entire packet, use the PacketLength parameter to specify the number of bytes in each packet to mirror.

" + "smithy.api#documentation": "

The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do\n not specify this parameter when you want to mirror the entire packet. To mirror a subset of\n the packet, set this to the length (in bytes) that you want to mirror. For example, if you\n set this value to 100, then the first 100 bytes that meet the filter criteria are copied to\n the target.

\n

If you do not want to mirror the entire packet, use the PacketLength parameter to specify the number of bytes in each packet to mirror.

\n

For sessions with Network Load Balancer (NLB) Traffic Mirror targets the default PacketLength will be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an error response.

" } }, "SessionNumber": { @@ -19757,7 +20143,29 @@ "target": "com.amazonaws.ec2#Volume" }, "traits": { - "smithy.api#documentation": "

Creates an EBS volume that can be attached to an instance in the same Availability Zone.

\n

You can create a new empty volume or restore a volume from an EBS snapshot.\n Any Amazon Web Services Marketplace product codes from the snapshot are propagated to the volume.

\n

You can create encrypted volumes. Encrypted volumes must be attached to instances that \n support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically \n encrypted. For more information, see Amazon EBS encryption\n in the Amazon Elastic Compute Cloud User Guide.

\n

You can tag your volumes during creation. For more information, see Tag your Amazon EC2\n resources in the Amazon Elastic Compute Cloud User Guide.

\n

For more information, see Create an Amazon EBS volume in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates an EBS volume that can be attached to an instance in the same Availability Zone.

\n

You can create a new empty volume or restore a volume from an EBS snapshot.\n Any Amazon Web Services Marketplace product codes from the snapshot are propagated to the volume.

\n

You can create encrypted volumes. Encrypted volumes must be attached to instances that \n support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically \n encrypted. For more information, see Amazon EBS encryption\n in the Amazon Elastic Compute Cloud User Guide.

\n

You can tag your volumes during creation. For more information, see Tag your Amazon EC2\n resources in the Amazon Elastic Compute Cloud User Guide.

\n

For more information, see Create an Amazon EBS volume in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a new volume", + "documentation": "This example creates an 80 GiB General Purpose (SSD) volume in the Availability Zone ``us-east-1a``.", + "input": { + "AvailabilityZone": "us-east-1a", + "Size": 80, + "VolumeType": "gp2" + }, + "output": { + "AvailabilityZone": "us-east-1a", + "Encrypted": false, + "VolumeType": "gp2", + "VolumeId": "vol-6b60b7c7", + "State": "creating", + "Iops": 240, + "SnapshotId": "", + "CreateTime": "2016-08-29T18:52:32.724Z", + "Size": 80 + } + } + ] } }, "com.amazonaws.ec2#CreateVolumePermission": { @@ -19820,7 +20228,7 @@ "target": "com.amazonaws.ec2#AvailabilityZoneName", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The Availability Zone in which to create the volume.

", + "smithy.api#documentation": "

The ID of the Availability Zone in which to create the volume. For example, us-east-1a.

", "smithy.api#required": {} } }, @@ -19928,7 +20336,25 @@ "target": "com.amazonaws.ec2#CreateVpcResult" }, "traits": { - "smithy.api#documentation": "

Creates a VPC with the specified CIDR blocks. For more information, see\n\t VPC CIDR blocks in the Amazon Virtual Private Cloud User Guide.

\n

You can optionally request an IPv6 CIDR block for the VPC. You can request an Amazon-provided \n IPv6 CIDR block from Amazon's pool of IPv6 addresses, or an IPv6 CIDR block from an IPv6 address \n pool that you provisioned through bring your own IP addresses (BYOIP).

\n

By default, each instance that you launch in the VPC has the default DHCP options, which\n\t\t\tinclude only a default DNS server that we provide (AmazonProvidedDNS). For more\n\t\t\tinformation, see DHCP option sets in the Amazon Virtual Private Cloud User Guide.

\n

You can specify the instance tenancy value for the VPC when you create it. You can't change\n this value for the VPC after you create it. For more information, see Dedicated Instances in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Creates a VPC with the specified CIDR blocks. For more information, see IP addressing for your VPCs and subnets in the \n Amazon VPC User Guide.

\n

You can optionally request an IPv6 CIDR block for the VPC. You can request an Amazon-provided \n IPv6 CIDR block from Amazon's pool of IPv6 addresses, or an IPv6 CIDR block from an IPv6 address \n pool that you provisioned through bring your own IP addresses (BYOIP).

\n

By default, each instance that you launch in the VPC has the default DHCP options, which\n\t\t\tinclude only a default DNS server that we provide (AmazonProvidedDNS). For more\n\t\t\tinformation, see DHCP option sets in the Amazon VPC User Guide.

\n

You can specify the instance tenancy value for the VPC when you create it. You can't change\n this value for the VPC after you create it. For more information, see Dedicated Instances in the\n Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To create a VPC", + "documentation": "This example creates a VPC with the specified CIDR block.", + "input": { + "CidrBlock": "10.0.0.0/16" + }, + "output": { + "Vpc": { + "InstanceTenancy": "default", + "State": "pending", + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.0.0/16", + "DhcpOptionsId": "dopt-7a8b9c2d" + } + } + } + ] } }, "com.amazonaws.ec2#CreateVpcEndpoint": { @@ -19940,7 +20366,7 @@ "target": "com.amazonaws.ec2#CreateVpcEndpointResult" }, "traits": { - "smithy.api#documentation": "

Creates a VPC endpoint for a specified service. An endpoint enables you to create a\n private connection between your VPC and the service. The service may be provided by Amazon Web Services,\n an Amazon Web Services Marketplace Partner, or another Amazon Web Services account. For more information, \n see the Amazon Web Services PrivateLink Guide.

" + "smithy.api#documentation": "

Creates a VPC endpoint. A VPC endpoint provides a private connection between the\n specified VPC and the specified endpoint service. You can use an endpoint service\n provided by Amazon Web Services, an Amazon Web Services Marketplace Partner, or another\n Amazon Web Services account. For more information, see the Amazon Web Services PrivateLink User Guide.

" } }, "com.amazonaws.ec2#CreateVpcEndpointConnectionNotification": { @@ -20050,7 +20476,7 @@ "target": "com.amazonaws.ec2#VpcId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of the VPC for the endpoint.

", + "smithy.api#documentation": "

The ID of the VPC.

", "smithy.api#required": {} } }, @@ -20058,7 +20484,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The service name.

", + "smithy.api#documentation": "

The name of the endpoint service.

", "smithy.api#required": {} } }, @@ -21311,7 +21737,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified customer gateway. You must delete the VPN connection before you\n can delete the customer gateway.

" + "smithy.api#documentation": "

Deletes the specified customer gateway. You must delete the VPN connection before you\n can delete the customer gateway.

", + "smithy.api#examples": [ + { + "title": "To delete a customer gateway", + "documentation": "This example deletes the specified customer gateway.", + "input": { + "CustomerGatewayId": "cgw-0e11f167" + } + } + ] } }, "com.amazonaws.ec2#DeleteCustomerGatewayRequest": { @@ -21350,7 +21785,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.

" + "smithy.api#documentation": "

Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.

", + "smithy.api#examples": [ + { + "title": "To delete a DHCP options set", + "documentation": "This example deletes the specified DHCP options set.", + "input": { + "DhcpOptionsId": "dopt-d9070ebb" + } + } + ] } }, "com.amazonaws.ec2#DeleteDhcpOptionsRequest": { @@ -22115,7 +22559,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified key pair, by removing the public key from Amazon EC2.

" + "smithy.api#documentation": "

Deletes the specified key pair, by removing the public key from Amazon EC2.

", + "smithy.api#examples": [ + { + "title": "To delete a key pair", + "documentation": "This example deletes the specified key pair.", + "input": { + "KeyName": "my-key-pair" + } + } + ] } }, "com.amazonaws.ec2#DeleteKeyPairRequest": { @@ -22157,7 +22610,26 @@ "target": "com.amazonaws.ec2#DeleteLaunchTemplateResult" }, "traits": { - "smithy.api#documentation": "

Deletes a launch template. Deleting a launch template deletes all of its\n versions.

" + "smithy.api#documentation": "

Deletes a launch template. Deleting a launch template deletes all of its\n versions.

", + "smithy.api#examples": [ + { + "title": "To delete a launch template", + "documentation": "This example deletes the specified launch template.", + "input": { + "LaunchTemplateId": "lt-0abcd290751193123" + }, + "output": { + "LaunchTemplate": { + "LatestVersionNumber": 2, + "LaunchTemplateId": "lt-0abcd290751193123", + "LaunchTemplateName": "my-template", + "DefaultVersionNumber": 2, + "CreatedBy": "arn:aws:iam::123456789012:root", + "CreateTime": "2017-11-23T16:46:25.000Z" + } + } + } + ] } }, "com.amazonaws.ec2#DeleteLaunchTemplateRequest": { @@ -22213,7 +22685,29 @@ "target": "com.amazonaws.ec2#DeleteLaunchTemplateVersionsResult" }, "traits": { - "smithy.api#documentation": "

Deletes one or more versions of a launch template. You cannot delete the default\n version of a launch template; you must first assign a different version as the default.\n If the default version is the only version for the launch template, you must delete the\n entire launch template using DeleteLaunchTemplate.

" + "smithy.api#documentation": "

Deletes one or more versions of a launch template.

\n

You can't delete the default version of a launch template; you must first assign a\n different version as the default. If the default version is the only version for the\n launch template, you must delete the entire launch template using DeleteLaunchTemplate.

\n

You can delete up to 200 launch template versions in a single request. To delete more\n than 200 versions in a single request, use DeleteLaunchTemplate, which\n deletes the launch template and all of its versions.

\n

For more information, see Delete a launch template version in the EC2 User\n Guide.

", + "smithy.api#examples": [ + { + "title": "To delete a launch template version", + "documentation": "This example deletes the specified launch template version.", + "input": { + "LaunchTemplateId": "lt-0abcd290751193123", + "Versions": [ + "1" + ] + }, + "output": { + "SuccessfullyDeletedLaunchTemplateVersions": [ + { + "LaunchTemplateName": "my-template", + "VersionNumber": 1, + "LaunchTemplateId": "lt-0abcd290751193123" + } + ], + "UnsuccessfullyDeletedLaunchTemplateVersions": [] + } + } + ] } }, "com.amazonaws.ec2#DeleteLaunchTemplateVersionsRequest": { @@ -22243,7 +22737,7 @@ "target": "com.amazonaws.ec2#VersionStringList", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The version numbers of one or more launch template versions to delete.

", + "smithy.api#documentation": "

The version numbers of one or more launch template versions to delete. You can specify\n up to 200 launch template version numbers.

", "smithy.api#required": {}, "smithy.api#xmlName": "LaunchTemplateVersion" } @@ -22652,7 +23146,19 @@ "target": "com.amazonaws.ec2#DeleteNatGatewayResult" }, "traits": { - "smithy.api#documentation": "

Deletes the specified NAT gateway. Deleting a public NAT gateway disassociates its Elastic IP address, \n but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway \n routes in your route tables.

" + "smithy.api#documentation": "

Deletes the specified NAT gateway. Deleting a public NAT gateway disassociates its Elastic IP address, \n but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway \n routes in your route tables.

", + "smithy.api#examples": [ + { + "title": "To delete a NAT gateway", + "documentation": "This example deletes the specified NAT gateway.", + "input": { + "NatGatewayId": "nat-04ae55e711cec5680" + }, + "output": { + "NatGatewayId": "nat-04ae55e711cec5680" + } + } + ] } }, "com.amazonaws.ec2#DeleteNatGatewayRequest": { @@ -23439,7 +23945,17 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes a security group.

\n

If you attempt to delete a security group that is associated with an instance, or is\n\t\t\t referenced by another security group, the operation fails with\n\t\t\t\tInvalidGroup.InUse in EC2-Classic or\n\t\t\t\tDependencyViolation in EC2-VPC.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "

Deletes a security group.

\n

If you attempt to delete a security group that is associated with an instance or network interface or is\n\t\t\t referenced by another security group, the operation fails with\n\t\t\t\tDependencyViolation.

", + "smithy.api#examples": [ + { + "title": "To delete a security group", + "documentation": "This example deletes the specified security group.", + "input": { + "GroupId": "sg-903004f8" + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#DeleteSecurityGroupRequest": { @@ -23448,13 +23964,13 @@ "GroupId": { "target": "com.amazonaws.ec2#SecurityGroupId", "traits": { - "smithy.api#documentation": "

The ID of the security group. Required for a nondefault VPC.

" + "smithy.api#documentation": "

The ID of the security group.

" } }, "GroupName": { "target": "com.amazonaws.ec2#SecurityGroupName", "traits": { - "smithy.api#documentation": "

[EC2-Classic, default VPC] The name of the security group. You can specify either the\n security group name or the security group ID. For security groups in a nondefault VPC,\n you must specify the security group ID.

" + "smithy.api#documentation": "

[Default VPC] The name of the security group. You can specify either the\n security group name or the security group ID. For security groups in a nondefault VPC,\n you must specify the security group ID.

" } }, "DryRun": { @@ -23481,7 +23997,17 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified snapshot.

\n

When you make periodic snapshots of a volume, the snapshots are incremental, and only the\n blocks on the device that have changed since your last snapshot are saved in the new snapshot.\n When you delete a snapshot, only the data not needed for any other snapshot is removed. So\n regardless of which prior snapshots have been deleted, all active snapshots will have access\n to all the information needed to restore the volume.

\n

You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI.\n You must first de-register the AMI before you can delete the snapshot.

\n

For more information, see Delete an Amazon EBS snapshot in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Deletes the specified snapshot.

\n

When you make periodic snapshots of a volume, the snapshots are incremental, and only the\n blocks on the device that have changed since your last snapshot are saved in the new snapshot.\n When you delete a snapshot, only the data not needed for any other snapshot is removed. So\n regardless of which prior snapshots have been deleted, all active snapshots will have access\n to all the information needed to restore the volume.

\n

You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI.\n You must first de-register the AMI before you can delete the snapshot.

\n

For more information, see Delete an Amazon EBS snapshot in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To delete a snapshot", + "documentation": "This example deletes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``. If the command succeeds, no output is returned.", + "input": { + "SnapshotId": "snap-1234567890abcdef0" + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#DeleteSnapshotRequest": { @@ -23519,7 +24045,13 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the data feed for Spot Instances.

" + "smithy.api#documentation": "

Deletes the data feed for Spot Instances.

", + "smithy.api#examples": [ + { + "title": "To cancel a Spot Instance data feed subscription", + "documentation": "This example deletes a Spot data feed subscription for the account." + } + ] } }, "com.amazonaws.ec2#DeleteSpotDatafeedSubscriptionRequest": { @@ -23550,7 +24082,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

" + "smithy.api#documentation": "

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

", + "smithy.api#examples": [ + { + "title": "To delete a subnet", + "documentation": "This example deletes the specified subnet.", + "input": { + "SubnetId": "subnet-9d4a7b6c" + } + } + ] } }, "com.amazonaws.ec2#DeleteSubnetCidrReservation": { @@ -24720,7 +25261,17 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified EBS volume. The volume must be in the available state\n (not attached to an instance).

\n

The volume can remain in the deleting state for several minutes.

\n

For more information, see Delete an Amazon EBS volume in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Deletes the specified EBS volume. The volume must be in the available state\n (not attached to an instance).

\n

The volume can remain in the deleting state for several minutes.

\n

For more information, see Delete an Amazon EBS volume in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To delete a volume", + "documentation": "This example deletes an available volume with the volume ID of ``vol-049df61146c4d7901``. If the command succeeds, no output is returned.", + "input": { + "VolumeId": "vol-049df61146c4d7901" + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#DeleteVolumeRequest": { @@ -24758,7 +25309,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

" + "smithy.api#documentation": "

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

", + "smithy.api#examples": [ + { + "title": "To delete a VPC", + "documentation": "This example deletes the specified VPC.", + "input": { + "VpcId": "vpc-a01106c2" + } + } + ] } }, "com.amazonaws.ec2#DeleteVpcEndpointConnectionNotifications": { @@ -25553,7 +26113,33 @@ "target": "com.amazonaws.ec2#DescribeAccountAttributesResult" }, "traits": { - "smithy.api#documentation": "

Describes attributes of your Amazon Web Services account. The following are the supported account attributes:

\n
    \n
  • \n

    \n supported-platforms: Indicates whether your account can launch instances\n into EC2-Classic and EC2-VPC, or only into EC2-VPC.

    \n
  • \n
  • \n

    \n default-vpc: The ID of the default VPC for your account, or\n none.

    \n
  • \n
  • \n

    \n max-instances: This attribute is no longer supported. The returned\n value does not reflect your actual vCPU limit for running On-Demand Instances.\n For more information, see On-Demand Instance Limits in the\n Amazon Elastic Compute Cloud User Guide.

    \n
  • \n
  • \n

    \n vpc-max-security-groups-per-interface: The maximum number of security groups\n that you can assign to a network interface.

    \n
  • \n
  • \n

    \n max-elastic-ips: The maximum number of Elastic IP addresses that you can\n allocate for use with EC2-Classic.

    \n
  • \n
  • \n

    \n vpc-max-elastic-ips: The maximum number of Elastic IP addresses that you can\n allocate for use with EC2-VPC.

    \n
  • \n
\n \n

We are retiring EC2-Classic on August 15, 2022. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon EC2 User Guide.

\n
" + "smithy.api#documentation": "

Describes attributes of your Amazon Web Services account. The following are the supported account attributes:

\n
    \n
  • \n

    \n default-vpc: The ID of the default VPC for your account, or none.

    \n
  • \n
  • \n

    \n max-instances: This attribute is no longer supported. The returned\n value does not reflect your actual vCPU limit for running On-Demand Instances.\n For more information, see On-Demand Instance Limits in the\n Amazon Elastic Compute Cloud User Guide.

    \n
  • \n
  • \n

    \n max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate.

    \n
  • \n
  • \n

    \n supported-platforms: This attribute is deprecated.

    \n
  • \n
  • \n

    \n vpc-max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate.

    \n
  • \n
  • \n

    \n vpc-max-security-groups-per-interface: The maximum number of security groups\n that you can assign to a network interface.

    \n
  • \n
", + "smithy.api#examples": [ + { + "title": "To describe a single attribute for your AWS account", + "documentation": "This example describes the supported-platforms attribute for your AWS account.", + "input": { + "AttributeNames": [ + "supported-platforms" + ] + }, + "output": { + "AccountAttributes": [ + { + "AttributeName": "supported-platforms", + "AttributeValues": [ + { + "AttributeValue": "EC2" + }, + { + "AttributeValue": "VPC" + } + ] + } + ] + } + } + ] } }, "com.amazonaws.ec2#DescribeAccountAttributesRequest": { @@ -25696,7 +26282,32 @@ "target": "com.amazonaws.ec2#DescribeAddressesResult" }, "traits": { - "smithy.api#documentation": "

Describes the specified Elastic IP addresses or all of your Elastic IP addresses.

" + "smithy.api#documentation": "

Describes the specified Elastic IP addresses or all of your Elastic IP addresses.

", + "smithy.api#examples": [ + { + "title": "To describe your Elastic IP addresses", + "documentation": "This example describes your Elastic IP addresses.", + "output": { + "Addresses": [ + { + "InstanceId": "i-1234567890abcdef0", + "PublicIp": "198.51.100.0", + "Domain": "standard" + }, + { + "Domain": "vpc", + "InstanceId": "i-1234567890abcdef0", + "NetworkInterfaceId": "eni-12345678", + "AssociationId": "eipassoc-12345678", + "NetworkInterfaceOwnerId": "123456789012", + "PublicIp": "203.0.113.0", + "AllocationId": "eipalloc-12345678", + "PrivateIpAddress": "10.0.1.241" + } + ] + } + } + ] } }, "com.amazonaws.ec2#DescribeAddressesAttribute": { @@ -25902,7 +26513,41 @@ "target": "com.amazonaws.ec2#DescribeAvailabilityZonesResult" }, "traits": { - "smithy.api#documentation": "

Describes the Availability Zones, Local Zones, and Wavelength Zones that are available to\n you. If there is an event impacting a zone, you can use this request to view the state and any\n provided messages for that zone.

\n

For more information about Availability Zones, Local Zones, and Wavelength Zones, see\n Regions and zones \n in the Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Describes the Availability Zones, Local Zones, and Wavelength Zones that are available to\n you. If there is an event impacting a zone, you can use this request to view the state and any\n provided messages for that zone.

\n

For more information about Availability Zones, Local Zones, and Wavelength Zones, see\n Regions and zones \n in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe your Availability Zones", + "documentation": "This example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current region.", + "output": { + "AvailabilityZones": [ + { + "State": "available", + "RegionName": "us-east-1", + "Messages": [], + "ZoneName": "us-east-1b" + }, + { + "State": "available", + "RegionName": "us-east-1", + "Messages": [], + "ZoneName": "us-east-1c" + }, + { + "State": "available", + "RegionName": "us-east-1", + "Messages": [], + "ZoneName": "us-east-1d" + }, + { + "State": "available", + "RegionName": "us-east-1", + "Messages": [], + "ZoneName": "us-east-1e" + } + ] + } + } + ] } }, "com.amazonaws.ec2#DescribeAvailabilityZonesRequest": { @@ -26504,7 +27149,7 @@ "target": "com.amazonaws.ec2#DescribeClassicLinkInstancesResult" }, "traits": { - "smithy.api#documentation": "

Describes one or more of your linked EC2-Classic instances. This request only returns\n\t\t\tinformation about EC2-Classic instances linked to a VPC through ClassicLink. You cannot\n\t\t\tuse this request to return information about other instances.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
", + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Describes one or more of your linked EC2-Classic instances. This request only returns\n\t\t\tinformation about EC2-Classic instances linked to a VPC through ClassicLink. You cannot\n\t\t\tuse this request to return information about other instances.

", "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -26529,7 +27174,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n group-id - The ID of a VPC security group that's associated with the instance.

    \n
  • \n
  • \n

    \n instance-id - The ID of the instance.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC to which the instance is\n\t\t\t\t\tlinked.

    \n

    \n vpc-id - The ID of the VPC that the instance is linked to.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n group-id - The ID of a VPC security group that's associated with the instance.

    \n
  • \n
  • \n

    \n instance-id - The ID of the instance.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC to which the instance is linked.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -26546,7 +27191,7 @@ "InstanceIds": { "target": "com.amazonaws.ec2#InstanceIdStringList", "traits": { - "smithy.api#documentation": "

One or more instance IDs. Must be instances linked to a VPC through ClassicLink.

", + "smithy.api#documentation": "

The instance IDs. Must be instances linked to a VPC through ClassicLink.

", "smithy.api#xmlName": "InstanceId" } }, @@ -27313,6 +27958,28 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more of your VPN customer gateways.

\n

For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN\n User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe a customer gateway", + "documentation": "This example describes the specified customer gateway.", + "input": { + "CustomerGatewayIds": [ + "cgw-0e11f167" + ] + }, + "output": { + "CustomerGateways": [ + { + "CustomerGatewayId": "cgw-0e11f167", + "IpAddress": "12.1.2.3", + "State": "available", + "Type": "ipsec.1", + "BgpAsn": "65534" + } + ] + } + } + ], "smithy.waiters#waitable": { "CustomerGatewayAvailable": { "acceptors": [ @@ -27411,7 +28078,38 @@ "target": "com.amazonaws.ec2#DescribeDhcpOptionsResult" }, "traits": { - "smithy.api#documentation": "

Describes one or more of your DHCP options sets.

\n

For more information, see DHCP options sets in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

", + "smithy.api#documentation": "

Describes one or more of your DHCP options sets.

\n

For more information, see DHCP options sets in the\n\t\t\t\tAmazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe a DHCP options set", + "documentation": "This example describes the specified DHCP options set.", + "input": { + "DhcpOptionsIds": [ + "dopt-d9070ebb" + ] + }, + "output": { + "DhcpOptions": [ + { + "DhcpConfigurations": [ + { + "Values": [ + { + "Value": "10.2.5.2" + }, + { + "Value": "10.2.5.1" + } + ], + "Key": "domain-name-servers" + } + ], + "DhcpOptionsId": "dopt-d9070ebb" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -27443,7 +28141,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n dhcp-options-id - The ID of a DHCP options set.

    \n
  • \n
  • \n

    \n key - The key for one of the options (for example, domain-name).

    \n
  • \n
  • \n

    \n value - The value for one of the options.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the DHCP options set.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n dhcp-options-id - The ID of a DHCP options set.

    \n
  • \n
  • \n

    \n key - The key for one of the options (for example, domain-name).

    \n
  • \n
  • \n

    \n value - The value for one of the options.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the DHCP options set.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -27542,7 +28240,7 @@ "EgressOnlyInternetGatewayIds": { "target": "com.amazonaws.ec2#EgressOnlyInternetGatewayIdList", "traits": { - "smithy.api#documentation": "

One or more egress-only internet gateway IDs.

", + "smithy.api#documentation": "

The IDs of the egress-only internet gateways.

", "smithy.api#xmlName": "EgressOnlyInternetGatewayId" } }, @@ -27563,7 +28261,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } } @@ -29163,6 +29861,30 @@ }, "traits": { "smithy.api#documentation": "

Describes your IAM instance profile associations.

", + "smithy.api#examples": [ + { + "title": "To describe an IAM instance profile association", + "documentation": "This example describes the specified IAM instance profile association.", + "input": { + "AssociationIds": [ + "iip-assoc-0db249b1f25fa24b8" + ] + }, + "output": { + "IamInstanceProfileAssociations": [ + { + "InstanceId": "i-09eb09efa73ec1dee", + "State": "associated", + "AssociationId": "iip-assoc-0db249b1f25fa24b8", + "IamInstanceProfile": { + "Id": "AIPAJVQN4F5WVLGCJDRGM", + "Arn": "arn:aws:iam::123456789012:instance-profile/admin-role" + } + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -29346,7 +30068,25 @@ "target": "com.amazonaws.ec2#ImageAttribute" }, "traits": { - "smithy.api#documentation": "

Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.

" + "smithy.api#documentation": "

Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.

", + "smithy.api#examples": [ + { + "title": "To describe the launch permissions for an AMI", + "documentation": "This example describes the launch permissions for the specified AMI.", + "input": { + "Attribute": "launchPermission", + "ImageId": "ami-5731123e" + }, + "output": { + "ImageId": "ami-5731123e", + "LaunchPermissions": [ + { + "UserId": "123456789012" + } + ] + } + } + ] } }, "com.amazonaws.ec2#DescribeImageAttributeRequest": { @@ -29394,6 +30134,48 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you.

\n

The images available to you include public images, private images that you own, and private images owned by other \n Amazon Web Services accounts for which you have explicit launch permissions.

\n

Recently deregistered images appear in the returned results for a short interval and then\n return empty results. After all instances that reference a deregistered AMI are terminated,\n specifying the ID of the image will eventually return an error indicating that the AMI ID\n cannot be found.

", + "smithy.api#examples": [ + { + "title": "To describe an AMI", + "documentation": "This example describes the specified AMI.", + "input": { + "ImageIds": [ + "ami-5731123e" + ] + }, + "output": { + "Images": [ + { + "VirtualizationType": "paravirtual", + "Name": "My server", + "Hypervisor": "xen", + "ImageId": "ami-5731123e", + "RootDeviceType": "ebs", + "State": "available", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/sda1", + "Ebs": { + "DeleteOnTermination": true, + "SnapshotId": "snap-1234567890abcdef0", + "VolumeSize": 8, + "VolumeType": "standard" + } + } + ], + "Architecture": "x86_64", + "ImageLocation": "123456789012/My server", + "KernelId": "aki-88aa75e1", + "OwnerId": "123456789012", + "RootDeviceName": "/dev/sda1", + "Public": false, + "ImageType": "machine", + "Description": "An AMI for my server" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -29466,7 +30248,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n architecture - The image architecture (i386 |\n x86_64 | arm64).

    \n
  • \n
  • \n

    \n block-device-mapping.delete-on-termination - A Boolean value that indicates\n \twhether the Amazon EBS volume is deleted on instance termination.

    \n
  • \n
  • \n

    \n block-device-mapping.device-name - The device name specified in the block device mapping (for\n example, /dev/sdh or xvdh).

    \n
  • \n
  • \n

    \n block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS\n volume.

    \n
  • \n
  • \n

    \n block-device-mapping.volume-size - The volume size of the Amazon EBS volume, in GiB.

    \n
  • \n
  • \n

    \n block-device-mapping.volume-type - The volume type of the Amazon EBS volume\n (io1 | io2 | gp2 | gp3 | sc1\n | st1 | standard).

    \n
  • \n
  • \n

    \n block-device-mapping.encrypted - A Boolean that indicates whether the Amazon EBS volume is encrypted.

    \n
  • \n
  • \n

    \n creation-date - The time when the image was created, in the ISO 8601\n format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example,\n 2021-09-29T11:04:43.305Z. You can use a wildcard (*), for\n example, 2021-09-29T*, which matches an entire day.

    \n
  • \n
  • \n

    \n description - The description of the image (provided during image\n creation).

    \n
  • \n
  • \n

    \n ena-support - A Boolean that indicates whether enhanced networking\n with ENA is enabled.

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor type (ovm |\n xen).

    \n
  • \n
  • \n

    \n image-id - The ID of the image.

    \n
  • \n
  • \n

    \n image-type - The image type (machine | kernel |\n ramdisk).

    \n
  • \n
  • \n

    \n is-public - A Boolean that indicates whether the image is public.

    \n
  • \n
  • \n

    \n kernel-id - The kernel ID.

    \n
  • \n
  • \n

    \n manifest-location - The location of the image manifest.

    \n
  • \n
  • \n

    \n name - The name of the AMI (provided during image creation).

    \n
  • \n
  • \n

    \n owner-alias - The owner alias (amazon | aws-marketplace). \n The valid aliases are defined in an Amazon-maintained list. This is not the Amazon Web Services account alias that can be \n \tset using the IAM console. We recommend that you use the Owner \n \trequest parameter instead of this filter.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the owner. We recommend that you use the \n \t\tOwner request parameter instead of this filter.

    \n
  • \n
  • \n

    \n platform - The platform. The only supported value is windows.

    \n
  • \n
  • \n

    \n product-code - The product code.

    \n
  • \n
  • \n

    \n product-code.type - The type of the product code (marketplace).

    \n
  • \n
  • \n

    \n ramdisk-id - The RAM disk ID.

    \n
  • \n
  • \n

    \n root-device-name - The device name of the root device volume (for example, /dev/sda1).

    \n
  • \n
  • \n

    \n root-device-type - The type of the root device volume (ebs |\n instance-store).

    \n
  • \n
  • \n

    \n state - The state of the image (available | pending\n | failed).

    \n
  • \n
  • \n

    \n state-reason-code - The reason code for the state change.

    \n
  • \n
  • \n

    \n state-reason-message - The message for the state change.

    \n
  • \n
  • \n

    \n sriov-net-support - A value of simple indicates\n that enhanced networking with the Intel 82599 VF interface is enabled.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n virtualization-type - The virtualization type (paravirtual |\n hvm).

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n architecture - The image architecture (i386 | x86_64 | \n arm64 | x86_64_mac | arm64_mac).

    \n
  • \n
  • \n

    \n block-device-mapping.delete-on-termination - A Boolean value that indicates\n \twhether the Amazon EBS volume is deleted on instance termination.

    \n
  • \n
  • \n

    \n block-device-mapping.device-name - The device name specified in the block device mapping (for\n example, /dev/sdh or xvdh).

    \n
  • \n
  • \n

    \n block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS\n volume.

    \n
  • \n
  • \n

    \n block-device-mapping.volume-size - The volume size of the Amazon EBS volume, in GiB.

    \n
  • \n
  • \n

    \n block-device-mapping.volume-type - The volume type of the Amazon EBS volume\n (io1 | io2 | gp2 | gp3 | sc1\n | st1 | standard).

    \n
  • \n
  • \n

    \n block-device-mapping.encrypted - A Boolean that indicates whether the Amazon EBS volume is encrypted.

    \n
  • \n
  • \n

    \n creation-date - The time when the image was created, in the ISO 8601\n format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example,\n 2021-09-29T11:04:43.305Z. You can use a wildcard (*), for\n example, 2021-09-29T*, which matches an entire day.

    \n
  • \n
  • \n

    \n description - The description of the image (provided during image\n creation).

    \n
  • \n
  • \n

    \n ena-support - A Boolean that indicates whether enhanced networking\n with ENA is enabled.

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor type (ovm |\n xen).

    \n
  • \n
  • \n

    \n image-id - The ID of the image.

    \n
  • \n
  • \n

    \n image-type - The image type (machine | kernel |\n ramdisk).

    \n
  • \n
  • \n

    \n is-public - A Boolean that indicates whether the image is public.

    \n
  • \n
  • \n

    \n kernel-id - The kernel ID.

    \n
  • \n
  • \n

    \n manifest-location - The location of the image manifest.

    \n
  • \n
  • \n

    \n name - The name of the AMI (provided during image creation).

    \n
  • \n
  • \n

    \n owner-alias - The owner alias (amazon | aws-marketplace). \n The valid aliases are defined in an Amazon-maintained list. This is not the Amazon Web Services account alias that can be \n \tset using the IAM console. We recommend that you use the Owner \n \trequest parameter instead of this filter.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the owner. We recommend that you use the \n \t\tOwner request parameter instead of this filter.

    \n
  • \n
  • \n

    \n platform - The platform. The only supported value is windows.

    \n
  • \n
  • \n

    \n product-code - The product code.

    \n
  • \n
  • \n

    \n product-code.type - The type of the product code (marketplace).

    \n
  • \n
  • \n

    \n ramdisk-id - The RAM disk ID.

    \n
  • \n
  • \n

    \n root-device-name - The device name of the root device volume (for example, /dev/sda1).

    \n
  • \n
  • \n

    \n root-device-type - The type of the root device volume (ebs |\n instance-store).

    \n
  • \n
  • \n

    \n state - The state of the image (available | pending\n | failed).

    \n
  • \n
  • \n

    \n state-reason-code - The reason code for the state change.

    \n
  • \n
  • \n

    \n state-reason-message - The message for the state change.

    \n
  • \n
  • \n

    \n sriov-net-support - A value of simple indicates\n that enhanced networking with the Intel 82599 VF interface is enabled.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n virtualization-type - The virtualization type (paravirtual |\n hvm).

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -30117,6 +30899,47 @@ }, "traits": { "smithy.api#documentation": "

Describes the status of the specified instances or all of your instances. By default,\n only running instances are described, unless you specifically indicate to return the\n status of all instances.

\n

Instance status includes the following components:

\n
    \n
  • \n

    \n Status checks - Amazon EC2 performs status\n checks on running EC2 instances to identify hardware and software issues. For\n more information, see Status checks for your instances and Troubleshoot\n instances with failed status checks in the Amazon EC2 User\n Guide.

    \n
  • \n
  • \n

    \n Scheduled events - Amazon EC2 can schedule\n events (such as reboot, stop, or terminate) for your instances related to\n hardware issues, software updates, or system maintenance. For more information,\n see Scheduled events for your instances in the Amazon EC2 User\n Guide.

    \n
  • \n
  • \n

    \n Instance state - You can manage your instances\n from the moment you launch them through their termination. For more information,\n see Instance\n lifecycle in the Amazon EC2 User Guide.

    \n
  • \n
", + "smithy.api#examples": [ + { + "title": "To describe the status of an instance", + "documentation": "This example describes the current status of the specified instance.", + "input": { + "InstanceIds": [ + "i-1234567890abcdef0" + ] + }, + "output": { + "InstanceStatuses": [ + { + "InstanceId": "i-1234567890abcdef0", + "InstanceState": { + "Code": 16, + "Name": "running" + }, + "AvailabilityZone": "us-east-1d", + "SystemStatus": { + "Status": "ok", + "Details": [ + { + "Status": "passed", + "Name": "reachability" + } + ] + }, + "InstanceStatus": { + "Status": "ok", + "Details": [ + { + "Status": "passed", + "Name": "reachability" + } + ] + } + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -30368,7 +31191,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters. Filter names and values are case-sensitive.

\n
    \n
  • \n

    \n auto-recovery-supported - Indicates whether Amazon CloudWatch action based recovery is supported (true | false).

    \n
  • \n
  • \n

    \n bare-metal - Indicates whether it is a bare metal instance type (true | false).

    \n
  • \n
  • \n

    \n burstable-performance-supported - Indicates whether it is a burstable\n performance instance type (true | false).

    \n
  • \n
  • \n

    \n current-generation - Indicates whether this instance type is the latest\n generation instance type of an instance family (true | false).

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.baseline-bandwidth-in-mbps - The baseline\n bandwidth performance for an EBS-optimized instance type, in Mbps.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.baseline-iops - The baseline input/output storage\n operations per second for an EBS-optimized instance type.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.baseline-throughput-in-mbps - The baseline\n throughput performance for an EBS-optimized instance type, in MB/s.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.maximum-bandwidth-in-mbps - The maximum bandwidth\n performance for an EBS-optimized instance type, in Mbps.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.maximum-iops - The maximum input/output storage\n operations per second for an EBS-optimized instance type.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.maximum-throughput-in-mbps - The maximum\n throughput performance for an EBS-optimized instance type, in MB/s.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-support - Indicates whether the instance type is\n EBS-optimized (supported | unsupported |\n default).

    \n
  • \n
  • \n

    \n ebs-info.encryption-support - Indicates whether EBS encryption is supported\n (supported | unsupported).

    \n
  • \n
  • \n

    \n ebs-info.nvme-support - Indicates whether non-volatile memory express (NVMe)\n is supported for EBS volumes (required | supported | unsupported).

    \n
  • \n
  • \n

    \n free-tier-eligible - Indicates whether the instance type is eligible to use\n in the free tier (true | false).

    \n
  • \n
  • \n

    \n hibernation-supported - Indicates whether On-Demand hibernation is supported (true | false).

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor (nitro | xen).

    \n
  • \n
  • \n

    \n instance-storage-info.disk.count - The number of local disks.

    \n
  • \n
  • \n

    \n instance-storage-info.disk.size-in-gb - The storage size of each instance storage disk, in\n GB.

    \n
  • \n
  • \n

    \n instance-storage-info.disk.type - The storage technology for the local\n instance storage disks (hdd | ssd).

    \n
  • \n
  • \n

    \n instance-storage-info.encryption-support - Indicates whether data is encrypted at rest \n (required | supported | unsupported).

    \n
  • \n
  • \n

    \n instance-storage-info.nvme-support - Indicates whether non-volatile memory\n express (NVMe) is supported for instance store (required | supported |\n unsupported).

    \n
  • \n
  • \n

    \n instance-storage-info.total-size-in-gb - The total amount of storage available from all local\n instance storage, in GB.

    \n
  • \n
  • \n

    \n instance-storage-supported - Indicates whether the instance type has local\n instance storage (true | false).

    \n
  • \n
  • \n

    \n instance-type - The instance type (for example c5.2xlarge or\n c5*).

    \n
  • \n
  • \n

    \n memory-info.size-in-mib - The memory size.

    \n
  • \n
  • \n

    \n network-info.efa-info.maximum-efa-interfaces - The maximum number of Elastic \n Fabric Adapters (EFAs) per instance.

    \n
  • \n
  • \n

    \n network-info.efa-supported - Indicates whether the instance type supports\n Elastic Fabric Adapter (EFA) (true | false).

    \n
  • \n
  • \n

    \n network-info.ena-support - Indicates whether Elastic Network Adapter (ENA) is\n supported or required (required | supported |\n unsupported).

    \n
  • \n
  • \n

    \n network-info.encryption-in-transit-supported - Indicates whether the instance type \n automatically encrypts in-transit traffic between instances (true | false).

    \n
  • \n
  • \n

    \n network-info.ipv4-addresses-per-interface - The maximum number of private IPv4 addresses per\n network interface.

    \n
  • \n
  • \n

    \n network-info.ipv6-addresses-per-interface - The maximum number of private IPv6 addresses per\n network interface.

    \n
  • \n
  • \n

    \n network-info.ipv6-supported - Indicates whether the instance type supports IPv6 (true | false).

    \n
  • \n
  • \n

    \n network-info.maximum-network-cards - The maximum number of network cards per\n instance.

    \n
  • \n
  • \n

    \n network-info.maximum-network-interfaces - The maximum number of network interfaces per instance.

    \n
  • \n
  • \n

    \n network-info.network-performance - The network performance (for example, \"25\n Gigabit\").

    \n
  • \n
  • \n

    \n processor-info.supported-architecture - The CPU architecture\n (arm64 | i386 | x86_64).

    \n
  • \n
  • \n

    \n processor-info.sustained-clock-speed-in-ghz - The CPU clock speed, in GHz.

    \n
  • \n
  • \n

    \n supported-boot-mode - The boot mode (legacy-bios |\n uefi).

    \n
  • \n
  • \n

    \n supported-root-device-type - The root device type (ebs |\n instance-store).

    \n
  • \n
  • \n

    \n supported-usage-class - The usage class (on-demand |\n spot).

    \n
  • \n
  • \n

    \n supported-virtualization-type - The virtualization type (hvm |\n paravirtual).

    \n
  • \n
  • \n

    \n vcpu-info.default-cores - The default number of cores for the instance type.

    \n
  • \n
  • \n

    \n vcpu-info.default-threads-per-core - The default number of threads per core for the instance\n type.

    \n
  • \n
  • \n

    \n vcpu-info.default-vcpus - The default number of vCPUs for the instance type.

    \n
  • \n
  • \n

    \n vcpu-info.valid-cores - The number of cores that can be configured for the instance type.

    \n
  • \n
  • \n

    \n vcpu-info.valid-threads-per-core - The number of threads per core that can be configured for the instance type.\n For example, \"1\" or \"1,2\".

    \n
  • \n
", + "smithy.api#documentation": "

One or more filters. Filter names and values are case-sensitive.

\n
    \n
  • \n

    \n auto-recovery-supported - Indicates whether Amazon CloudWatch action based recovery is supported (true | false).

    \n
  • \n
  • \n

    \n bare-metal - Indicates whether it is a bare metal instance type (true | false).

    \n
  • \n
  • \n

    \n burstable-performance-supported - Indicates whether the instance type is a \n burstable performance T instance type (true | false).

    \n
  • \n
  • \n

    \n current-generation - Indicates whether this instance type is the latest\n generation instance type of an instance family (true | false).

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.baseline-bandwidth-in-mbps - The baseline\n bandwidth performance for an EBS-optimized instance type, in Mbps.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.baseline-iops - The baseline input/output storage\n operations per second for an EBS-optimized instance type.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.baseline-throughput-in-mbps - The baseline\n throughput performance for an EBS-optimized instance type, in MB/s.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.maximum-bandwidth-in-mbps - The maximum bandwidth\n performance for an EBS-optimized instance type, in Mbps.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.maximum-iops - The maximum input/output storage\n operations per second for an EBS-optimized instance type.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-info.maximum-throughput-in-mbps - The maximum\n throughput performance for an EBS-optimized instance type, in MB/s.

    \n
  • \n
  • \n

    \n ebs-info.ebs-optimized-support - Indicates whether the instance type is\n EBS-optimized (supported | unsupported |\n default).

    \n
  • \n
  • \n

    \n ebs-info.encryption-support - Indicates whether EBS encryption is supported\n (supported | unsupported).

    \n
  • \n
  • \n

    \n ebs-info.nvme-support - Indicates whether non-volatile memory express (NVMe)\n is supported for EBS volumes (required | supported | unsupported).

    \n
  • \n
  • \n

    \n free-tier-eligible - Indicates whether the instance type is eligible to use\n in the free tier (true | false).

    \n
  • \n
  • \n

    \n hibernation-supported - Indicates whether On-Demand hibernation is supported (true | false).

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor (nitro | xen).

    \n
  • \n
  • \n

    \n instance-storage-info.disk.count - The number of local disks.

    \n
  • \n
  • \n

    \n instance-storage-info.disk.size-in-gb - The storage size of each instance storage disk, in\n GB.

    \n
  • \n
  • \n

    \n instance-storage-info.disk.type - The storage technology for the local\n instance storage disks (hdd | ssd).

    \n
  • \n
  • \n

    \n instance-storage-info.encryption-support - Indicates whether data is encrypted at rest \n (required | supported | unsupported).

    \n
  • \n
  • \n

    \n instance-storage-info.nvme-support - Indicates whether non-volatile memory\n express (NVMe) is supported for instance store (required | supported |\n unsupported).

    \n
  • \n
  • \n

    \n instance-storage-info.total-size-in-gb - The total amount of storage available from all local\n instance storage, in GB.

    \n
  • \n
  • \n

    \n instance-storage-supported - Indicates whether the instance type has local\n instance storage (true | false).

    \n
  • \n
  • \n

    \n instance-type - The instance type (for example c5.2xlarge or\n c5*).

    \n
  • \n
  • \n

    \n memory-info.size-in-mib - The memory size.

    \n
  • \n
  • \n

    \n network-info.efa-info.maximum-efa-interfaces - The maximum number of Elastic \n Fabric Adapters (EFAs) per instance.

    \n
  • \n
  • \n

    \n network-info.efa-supported - Indicates whether the instance type supports\n Elastic Fabric Adapter (EFA) (true | false).

    \n
  • \n
  • \n

    \n network-info.ena-support - Indicates whether Elastic Network Adapter (ENA) is\n supported or required (required | supported |\n unsupported).

    \n
  • \n
  • \n

    \n network-info.encryption-in-transit-supported - Indicates whether the instance type \n automatically encrypts in-transit traffic between instances (true | false).

    \n
  • \n
  • \n

    \n network-info.ipv4-addresses-per-interface - The maximum number of private IPv4 addresses per\n network interface.

    \n
  • \n
  • \n

    \n network-info.ipv6-addresses-per-interface - The maximum number of private IPv6 addresses per\n network interface.

    \n
  • \n
  • \n

    \n network-info.ipv6-supported - Indicates whether the instance type supports IPv6 (true | false).

    \n
  • \n
  • \n

    \n network-info.maximum-network-cards - The maximum number of network cards per\n instance.

    \n
  • \n
  • \n

    \n network-info.maximum-network-interfaces - The maximum number of network interfaces per instance.

    \n
  • \n
  • \n

    \n network-info.network-performance - The network performance (for example, \"25\n Gigabit\").

    \n
  • \n
  • \n

    \n nitro-enclaves-support - Indicates whether Nitro Enclaves is supported (supported |\n unsupported).

    \n
  • \n
  • \n

    \n nitro-tpm-support - Indicates whether NitroTPM is supported (supported |\n unsupported).

    \n
  • \n
  • \n

    \n nitro-tpm-info.supported-versions - The supported NitroTPM version (2.0).

    \n
  • \n
  • \n

    \n processor-info.supported-architecture - The CPU architecture\n (arm64 | i386 | x86_64).

    \n
  • \n
  • \n

    \n processor-info.sustained-clock-speed-in-ghz - The CPU clock speed, in GHz.

    \n
  • \n
  • \n

    \n processor-info.supported-features - The supported CPU features (amd-sev-snp).

    \n
  • \n
  • \n

    \n supported-boot-mode - The boot mode (legacy-bios |\n uefi).

    \n
  • \n
  • \n

    \n supported-root-device-type - The root device type (ebs |\n instance-store).

    \n
  • \n
  • \n

    \n supported-usage-class - The usage class (on-demand |\n spot).

    \n
  • \n
  • \n

    \n supported-virtualization-type - The virtualization type (hvm |\n paravirtual).

    \n
  • \n
  • \n

    \n vcpu-info.default-cores - The default number of cores for the instance type.

    \n
  • \n
  • \n

    \n vcpu-info.default-threads-per-core - The default number of threads per core for the instance\n type.

    \n
  • \n
  • \n

    \n vcpu-info.default-vcpus - The default number of vCPUs for the instance type.

    \n
  • \n
  • \n

    \n vcpu-info.valid-cores - The number of cores that can be configured for the instance type.

    \n
  • \n
  • \n

    \n vcpu-info.valid-threads-per-core - The number of threads per core that can be configured for the instance type.\n For example, \"1\" or \"1,2\".

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -30423,6 +31246,18 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified instances or all instances.

\n

If you specify instance IDs, the output includes information for only the specified\n instances. If you specify filters, the output includes information for only those\n instances that meet the filter criteria. If you do not specify instance IDs or filters,\n the output includes information for all instances, which can affect performance. We\n recommend that you use pagination to ensure that the operation returns quickly and\n successfully.

\n

If you specify an instance ID that is not valid, an error is returned. If you specify\n an instance that you do not own, it is not included in the output.

\n

Recently terminated instances might appear in the returned results. This interval is\n usually less than one hour.

\n

If you describe instances in the rare case where an Availability Zone is experiencing\n a service disruption and you specify instance IDs that are in the affected zone, or do\n not specify any instance IDs at all, the call fails. If you describe instances and\n specify only instance IDs that are in an unaffected zone, the call works\n normally.

", + "smithy.api#examples": [ + { + "title": "To describe an Amazon EC2 instance", + "documentation": "This example describes the specified instance.", + "input": { + "InstanceIds": [ + "i-1234567890abcdef0" + ] + }, + "output": {} + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -30584,7 +31419,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n affinity - The affinity setting for an instance running on a\n Dedicated Host (default | host).

    \n
  • \n
  • \n

    \n architecture - The instance architecture (i386 |\n x86_64 | arm64).

    \n
  • \n
  • \n

    \n availability-zone - The Availability Zone of the instance.

    \n
  • \n
  • \n

    \n block-device-mapping.attach-time - The attach time for an EBS\n volume mapped to the instance, for example,\n 2010-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n block-device-mapping.delete-on-termination - A Boolean that\n indicates whether the EBS volume is deleted on instance termination.

    \n
  • \n
  • \n

    \n block-device-mapping.device-name - The device name specified in the\n block device mapping (for example, /dev/sdh or\n xvdh).

    \n
  • \n
  • \n

    \n block-device-mapping.status - The status for the EBS volume\n (attaching | attached | detaching |\n detached).

    \n
  • \n
  • \n

    \n block-device-mapping.volume-id - The volume ID of the EBS\n volume.

    \n
  • \n
  • \n

    \n capacity-reservation-id - The ID of the Capacity Reservation into which the\n instance was launched.

    \n
  • \n
  • \n

    \n client-token - The idempotency token you provided when you launched\n the instance.

    \n
  • \n
  • \n

    \n dns-name - The public DNS name of the instance.

    \n
  • \n
  • \n

    \n hibernation-options.configured - A Boolean that indicates whether\n the instance is enabled for hibernation. A value of true means that\n the instance is enabled for hibernation.

    \n
  • \n
  • \n

    \n host-id - The ID of the Dedicated Host on which the instance is\n running, if applicable.

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor type of the instance\n (ovm | xen). The value xen is used\n for both Xen and Nitro hypervisors.

    \n
  • \n
  • \n

    \n iam-instance-profile.arn - The instance profile associated with\n the instance. Specified as an ARN.

    \n
  • \n
  • \n

    \n image-id - The ID of the image used to launch the\n instance.

    \n
  • \n
  • \n

    \n instance-id - The ID of the instance.

    \n
  • \n
  • \n

    \n instance-lifecycle - Indicates whether this is a Spot Instance or\n a Scheduled Instance (spot | scheduled).

    \n
  • \n
  • \n

    \n instance-state-code - The state of the instance, as a 16-bit\n unsigned integer. The high byte is used for internal purposes and should be\n ignored. The low byte is set based on the state represented. The valid values\n are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64\n (stopping), and 80 (stopped).

    \n
  • \n
  • \n

    \n instance-state-name - The state of the instance\n (pending | running | shutting-down |\n terminated | stopping |\n stopped).

    \n
  • \n
  • \n

    \n instance-type - The type of instance (for example,\n t2.micro).

    \n
  • \n
  • \n

    \n instance.group-id - The ID of the security group for the\n instance.

    \n
  • \n
  • \n

    \n instance.group-name - The name of the security group for the\n instance.

    \n
  • \n
  • \n

    \n ip-address - The public IPv4 address of the instance.

    \n
  • \n
  • \n

    \n kernel-id - The kernel ID.

    \n
  • \n
  • \n

    \n key-name - The name of the key pair used when the instance was\n launched.

    \n
  • \n
  • \n

    \n launch-index - When launching multiple instances, this is the\n index for the instance in the launch group (for example, 0, 1, 2, and so on).\n

    \n
  • \n
  • \n

    \n launch-time - The time when the instance was launched, in the ISO\n 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example,\n 2021-09-29T11:04:43.305Z. You can use a wildcard\n (*), for example, 2021-09-29T*, which matches an\n entire day.

    \n
  • \n
  • \n

    \n metadata-options.http-tokens - The metadata request authorization\n state (optional | required)

    \n
  • \n
  • \n

    \n metadata-options.http-put-response-hop-limit - The HTTP metadata\n request put response hop limit (integer, possible values 1 to\n 64)

    \n
  • \n
  • \n

    \n metadata-options.http-endpoint - The status of access to the HTTP\n metadata endpoint on your instance (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.instance-metadata-tags - The status of access to\n instance tags from the instance metadata (enabled |\n disabled)

    \n
  • \n
  • \n

    \n monitoring-state - Indicates whether detailed monitoring is\n enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n network-interface.addresses.private-ip-address - The private IPv4\n address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.primary - Specifies whether the IPv4\n address of the network interface is the primary private IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.public-ip - The ID of the\n association of an Elastic IP address (IPv4) with a network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.ip-owner-id - The owner\n ID of the private IPv4 address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.public-ip - The address of the\n Elastic IP address (IPv4) bound to the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.ip-owner-id - The owner of the\n Elastic IP address (IPv4) associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.allocation-id - The allocation ID\n returned when you allocated the Elastic IP address (IPv4) for your network\n interface.

    \n
  • \n
  • \n

    \n network-interface.association.association-id - The association ID\n returned when the network interface was associated with an IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.attachment.attachment-id - The ID of the\n interface attachment.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-id - The ID of the instance\n to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-owner-id - The owner ID of\n the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.device-index - The device index to\n which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.status - The status of the\n attachment (attaching | attached |\n detaching | detached).

    \n
  • \n
  • \n

    \n network-interface.attachment.attach-time - The time that the\n network interface was attached to an instance.

    \n
  • \n
  • \n

    \n network-interface.attachment.delete-on-termination - Specifies\n whether the attachment is deleted when an instance is terminated.

    \n
  • \n
  • \n

    \n network-interface.availability-zone - The Availability Zone for\n the network interface.

    \n
  • \n
  • \n

    \n network-interface.description - The description of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.group-id - The ID of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.group-name - The name of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-addresses.ipv6-address - The IPv6 address\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.mac-address - The MAC address of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.network-interface-id - The ID of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.owner-id - The ID of the owner of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.private-dns-name - The private DNS name of the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.requester-id - The requester ID for the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.requester-managed - Indicates whether the\n network interface is being managed by Amazon Web Services.

    \n
  • \n
  • \n

    \n network-interface.status - The status of the network interface\n (available) | in-use).

    \n
  • \n
  • \n

    \n network-interface.source-dest-check - Whether the network\n interface performs source/destination checking. A value of true\n means that checking is enabled, and false means that checking is\n disabled. The value must be false for the network interface to\n perform network address translation (NAT) in your VPC.

    \n
  • \n
  • \n

    \n network-interface.subnet-id - The ID of the subnet for the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.vpc-id - The ID of the VPC for the network\n interface.

    \n
  • \n
  • \n

    \n outpost-arn - The Amazon Resource Name (ARN) of the\n Outpost.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the instance\n owner.

    \n
  • \n
  • \n

    \n placement-group-name - The name of the placement group for the\n instance.

    \n
  • \n
  • \n

    \n placement-partition-number - The partition in which the instance is\n located.

    \n
  • \n
  • \n

    \n platform - The platform. To list only Windows instances, use\n windows.

    \n
  • \n
  • \n

    \n private-dns-name - The private IPv4 DNS name of the\n instance.

    \n
  • \n
  • \n

    \n private-ip-address - The private IPv4 address of the\n instance.

    \n
  • \n
  • \n

    \n product-code - The product code associated with the AMI used to\n launch the instance.

    \n
  • \n
  • \n

    \n product-code.type - The type of product code (devpay |\n marketplace).

    \n
  • \n
  • \n

    \n ramdisk-id - The RAM disk ID.

    \n
  • \n
  • \n

    \n reason - The reason for the current state of the instance (for\n example, shows \"User Initiated [date]\" when you stop or terminate the instance).\n Similar to the state-reason-code filter.

    \n
  • \n
  • \n

    \n requester-id - The ID of the entity that launched the instance on\n your behalf (for example, Amazon Web Services Management Console, Auto Scaling, and so\n on).

    \n
  • \n
  • \n

    \n reservation-id - The ID of the instance's reservation. A\n reservation ID is created any time you launch an instance. A reservation ID has\n a one-to-one relationship with an instance launch request, but can be associated\n with more than one instance if you launch multiple instances using the same\n launch request. For example, if you launch one instance, you get one reservation\n ID. If you launch ten instances using the same launch request, you also get one\n reservation ID.

    \n
  • \n
  • \n

    \n root-device-name - The device name of the root device volume (for\n example, /dev/sda1).

    \n
  • \n
  • \n

    \n root-device-type - The type of the root device volume\n (ebs | instance-store).

    \n
  • \n
  • \n

    \n source-dest-check - Indicates whether the instance performs\n source/destination checking. A value of true means that checking is\n enabled, and false means that checking is disabled. The value must\n be false for the instance to perform network address translation\n (NAT) in your VPC.

    \n
  • \n
  • \n

    \n spot-instance-request-id - The ID of the Spot Instance\n request.

    \n
  • \n
  • \n

    \n state-reason-code - The reason code for the state change.

    \n
  • \n
  • \n

    \n state-reason-message - A message that describes the state\n change.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet for the instance.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n tenancy - The tenancy of an instance (dedicated |\n default | host).

    \n
  • \n
  • \n

    \n virtualization-type - The virtualization type of the instance\n (paravirtual | hvm).

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC that the instance is running in.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n affinity - The affinity setting for an instance running on a\n Dedicated Host (default | host).

    \n
  • \n
  • \n

    \n architecture - The instance architecture (i386 |\n x86_64 | arm64).

    \n
  • \n
  • \n

    \n availability-zone - The Availability Zone of the instance.

    \n
  • \n
  • \n

    \n block-device-mapping.attach-time - The attach time for an EBS\n volume mapped to the instance, for example,\n 2022-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n block-device-mapping.delete-on-termination - A Boolean that\n indicates whether the EBS volume is deleted on instance termination.

    \n
  • \n
  • \n

    \n block-device-mapping.device-name - The device name specified in\n the block device mapping (for example, /dev/sdh or\n xvdh).

    \n
  • \n
  • \n

    \n block-device-mapping.status - The status for the EBS volume\n (attaching | attached | detaching |\n detached).

    \n
  • \n
  • \n

    \n block-device-mapping.volume-id - The volume ID of the EBS\n volume.

    \n
  • \n
  • \n

    \n boot-mode - The boot mode that was specified by the AMI\n (legacy-bios | uefi |\n uefi-preferred).

    \n
  • \n
  • \n

    \n capacity-reservation-id - The ID of the Capacity Reservation into which the\n instance was launched.

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-preference\n - The instance's Capacity Reservation preference (open | none).

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-target.capacity-reservation-id\n - The ID of the targeted Capacity Reservation.

    \n
  • \n
  • \n

    \n capacity-reservation-specification.capacity-reservation-target.capacity-reservation-resource-group-arn\n - The ARN of the targeted Capacity Reservation group.

    \n
  • \n
  • \n

    \n client-token - The idempotency token you provided when you\n launched the instance.

    \n
  • \n
  • \n

    \n current-instance-boot-mode - The boot mode that is used to launch\n the instance at launch or start (legacy-bios |\n uefi).

    \n
  • \n
  • \n

    \n dns-name - The public DNS name of the instance.

    \n
  • \n
  • \n

    \n ebs-optimized - A Boolean that indicates whether the instance is\n optimized for Amazon EBS I/O.

    \n
  • \n
  • \n

    \n ena-support - A Boolean that indicates whether the instance is\n enabled for enhanced networking with ENA.

    \n
  • \n
  • \n

    \n enclave-options.enabled - A Boolean that indicates whether the\n instance is enabled for Amazon Web Services Nitro Enclaves.

    \n
  • \n
  • \n

    \n hibernation-options.configured - A Boolean that indicates whether\n the instance is enabled for hibernation. A value of true means that\n the instance is enabled for hibernation.

    \n
  • \n
  • \n

    \n host-id - The ID of the Dedicated Host on which the instance is\n running, if applicable.

    \n
  • \n
  • \n

    \n hypervisor - The hypervisor type of the instance\n (ovm | xen). The value xen is used\n for both Xen and Nitro hypervisors.

    \n
  • \n
  • \n

    \n iam-instance-profile.arn - The instance profile associated with\n the instance. Specified as an ARN.

    \n
  • \n
  • \n

    \n iam-instance-profile.id - The instance profile associated with\n the instance. Specified as an ID.

    \n
  • \n
  • \n

    \n iam-instance-profile.name - The instance profile associated with\n the instance. Specified as an name.

    \n
  • \n
  • \n

    \n image-id - The ID of the image used to launch the\n instance.

    \n
  • \n
  • \n

    \n instance-id - The ID of the instance.

    \n
  • \n
  • \n

    \n instance-lifecycle - Indicates whether this is a Spot Instance or\n a Scheduled Instance (spot | scheduled).

    \n
  • \n
  • \n

    \n instance-state-code - The state of the instance, as a 16-bit\n unsigned integer. The high byte is used for internal purposes and should be\n ignored. The low byte is set based on the state represented. The valid values\n are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64\n (stopping), and 80 (stopped).

    \n
  • \n
  • \n

    \n instance-state-name - The state of the instance\n (pending | running | shutting-down |\n terminated | stopping |\n stopped).

    \n
  • \n
  • \n

    \n instance-type - The type of instance (for example,\n t2.micro).

    \n
  • \n
  • \n

    \n instance.group-id - The ID of the security group for the\n instance.

    \n
  • \n
  • \n

    \n instance.group-name - The name of the security group for the\n instance.

    \n
  • \n
  • \n

    \n ip-address - The public IPv4 address of the instance.

    \n
  • \n
  • \n

    \n ipv6-address - The IPv6 address of the instance.

    \n
  • \n
  • \n

    \n kernel-id - The kernel ID.

    \n
  • \n
  • \n

    \n key-name - The name of the key pair used when the instance was\n launched.

    \n
  • \n
  • \n

    \n launch-index - When launching multiple instances, this is the\n index for the instance in the launch group (for example, 0, 1, 2, and so on).\n

    \n
  • \n
  • \n

    \n launch-time - The time when the instance was launched, in the ISO\n 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example,\n 2021-09-29T11:04:43.305Z. You can use a wildcard\n (*), for example, 2021-09-29T*, which matches an\n entire day.

    \n
  • \n
  • \n

    \n license-pool -

    \n
  • \n
  • \n

    \n maintenance-options.auto-recovery - The current automatic\n recovery behavior of the instance (disabled | default).

    \n
  • \n
  • \n

    \n metadata-options.http-endpoint - The status of access to the HTTP\n metadata endpoint on your instance (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.http-protocol-ipv4 - Indicates whether the IPv4\n endpoint is enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n metadata-options.http-protocol-ipv6 - Indicates whether the IPv6\n endpoint is enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n metadata-options.http-put-response-hop-limit - The HTTP metadata\n request put response hop limit (integer, possible values 1 to\n 64)

    \n
  • \n
  • \n

    \n metadata-options.http-tokens - The metadata request authorization\n state (optional | required)

    \n
  • \n
  • \n

    \n metadata-options.instance-metadata-tags - The status of access to\n instance tags from the instance metadata (enabled |\n disabled)

    \n
  • \n
  • \n

    \n metadata-options.state - The state of the metadata option changes\n (pending | applied).

    \n
  • \n
  • \n

    \n monitoring-state - Indicates whether detailed monitoring is\n enabled (disabled | enabled).

    \n
  • \n
  • \n

    \n network-interface.addresses.primary - Specifies whether the IPv4\n address of the network interface is the primary private IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.addresses.private-ip-address - The private IPv4\n address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.public-ip - The ID of the\n association of an Elastic IP address (IPv4) with a network interface.

    \n
  • \n
  • \n

    \n network-interface.addresses.association.ip-owner-id - The owner\n ID of the private IPv4 address associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.public-ip - The address of the\n Elastic IP address (IPv4) bound to the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.ip-owner-id - The owner of the\n Elastic IP address (IPv4) associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.association.allocation-id - The allocation ID\n returned when you allocated the Elastic IP address (IPv4) for your network\n interface.

    \n
  • \n
  • \n

    \n network-interface.association.association-id - The association ID\n returned when the network interface was associated with an IPv4 address.

    \n
  • \n
  • \n

    \n network-interface.attachment.attachment-id - The ID of the\n interface attachment.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-id - The ID of the instance\n to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.instance-owner-id - The owner ID of\n the instance to which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.device-index - The device index to\n which the network interface is attached.

    \n
  • \n
  • \n

    \n network-interface.attachment.status - The status of the\n attachment (attaching | attached |\n detaching | detached).

    \n
  • \n
  • \n

    \n network-interface.attachment.attach-time - The time that the\n network interface was attached to an instance.

    \n
  • \n
  • \n

    \n network-interface.attachment.delete-on-termination - Specifies\n whether the attachment is deleted when an instance is terminated.

    \n
  • \n
  • \n

    \n network-interface.availability-zone - The Availability Zone for\n the network interface.

    \n
  • \n
  • \n

    \n network-interface.description - The description of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.group-id - The ID of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.group-name - The name of a security group\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.ipv6-addresses.ipv6-address - The IPv6 address\n associated with the network interface.

    \n
  • \n
  • \n

    \n network-interface.mac-address - The MAC address of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.network-interface-id - The ID of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.owner-id - The ID of the owner of the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.private-dns-name - The private DNS name of the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.requester-id - The requester ID for the network\n interface.

    \n
  • \n
  • \n

    \n network-interface.requester-managed - Indicates whether the\n network interface is being managed by Amazon Web Services.

    \n
  • \n
  • \n

    \n network-interface.status - The status of the network interface\n (available) | in-use).

    \n
  • \n
  • \n

    \n network-interface.source-dest-check - Whether the network\n interface performs source/destination checking. A value of true\n means that checking is enabled, and false means that checking is\n disabled. The value must be false for the network interface to\n perform network address translation (NAT) in your VPC.

    \n
  • \n
  • \n

    \n network-interface.subnet-id - The ID of the subnet for the\n network interface.

    \n
  • \n
  • \n

    \n network-interface.vpc-id - The ID of the VPC for the network\n interface.

    \n
  • \n
  • \n

    \n outpost-arn - The Amazon Resource Name (ARN) of the\n Outpost.

    \n
  • \n
  • \n

    \n owner-id - The Amazon Web Services account ID of the instance\n owner.

    \n
  • \n
  • \n

    \n placement-group-name - The name of the placement group for the\n instance.

    \n
  • \n
  • \n

    \n placement-partition-number - The partition in which the instance is\n located.

    \n
  • \n
  • \n

    \n platform - The platform. To list only Windows instances, use\n windows.

    \n
  • \n
  • \n

    \n platform-details - The platform (Linux/UNIX |\n Red Hat BYOL Linux | Red Hat Enterprise Linux |\n Red Hat Enterprise Linux with HA | Red Hat Enterprise\n Linux with SQL Server Standard and HA | Red Hat Enterprise\n Linux with SQL Server Enterprise and HA | Red Hat Enterprise\n Linux with SQL Server Standard | Red Hat Enterprise Linux with\n SQL Server Web | Red Hat Enterprise Linux with SQL Server\n Enterprise | SQL Server Enterprise | SQL Server\n Standard | SQL Server Web | SUSE Linux |\n Ubuntu Pro | Windows | Windows BYOL |\n Windows with SQL Server Enterprise | Windows with SQL\n Server Standard | Windows with SQL Server Web).

    \n
  • \n
  • \n

    \n private-dns-name - The private IPv4 DNS name of the\n instance.

    \n
  • \n
  • \n

    \n private-dns-name-options.enable-resource-name-dns-a-record - A\n Boolean that indicates whether to respond to DNS queries for instance hostnames\n with DNS A records.

    \n
  • \n
  • \n

    \n private-dns-name-options.enable-resource-name-dns-aaaa-record - A\n Boolean that indicates whether to respond to DNS queries for instance hostnames\n with DNS AAAA records.

    \n
  • \n
  • \n

    \n private-dns-name-options.hostname-type - The type of hostname\n (ip-name | resource-name).

    \n
  • \n
  • \n

    \n private-ip-address - The private IPv4 address of the\n instance.

    \n
  • \n
  • \n

    \n product-code - The product code associated with the AMI used to\n launch the instance.

    \n
  • \n
  • \n

    \n product-code.type - The type of product code (devpay\n | marketplace).

    \n
  • \n
  • \n

    \n ramdisk-id - The RAM disk ID.

    \n
  • \n
  • \n

    \n reason - The reason for the current state of the instance (for\n example, shows \"User Initiated [date]\" when you stop or terminate the instance).\n Similar to the state-reason-code filter.

    \n
  • \n
  • \n

    \n requester-id - The ID of the entity that launched the instance on\n your behalf (for example, Amazon Web Services Management Console, Auto Scaling, and so\n on).

    \n
  • \n
  • \n

    \n reservation-id - The ID of the instance's reservation. A\n reservation ID is created any time you launch an instance. A reservation ID has\n a one-to-one relationship with an instance launch request, but can be associated\n with more than one instance if you launch multiple instances using the same\n launch request. For example, if you launch one instance, you get one reservation\n ID. If you launch ten instances using the same launch request, you also get one\n reservation ID.

    \n
  • \n
  • \n

    \n root-device-name - The device name of the root device volume (for\n example, /dev/sda1).

    \n
  • \n
  • \n

    \n root-device-type - The type of the root device volume\n (ebs | instance-store).

    \n
  • \n
  • \n

    \n source-dest-check - Indicates whether the instance performs\n source/destination checking. A value of true means that checking is\n enabled, and false means that checking is disabled. The value must\n be false for the instance to perform network address translation\n (NAT) in your VPC.

    \n
  • \n
  • \n

    \n spot-instance-request-id - The ID of the Spot Instance\n request.

    \n
  • \n
  • \n

    \n state-reason-code - The reason code for the state change.

    \n
  • \n
  • \n

    \n state-reason-message - A message that describes the state\n change.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet for the instance.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n tenancy - The tenancy of an instance (dedicated |\n default | host).

    \n
  • \n
  • \n

    \n tpm-support - Indicates if the instance is configured for\n NitroTPM support (v2.0).

    \n
  • \n
  • \n

    \n usage-operation - The usage operation value for the instance\n (RunInstances | RunInstances:00g0 |\n RunInstances:0010 | RunInstances:1010 |\n RunInstances:1014 | RunInstances:1110 |\n RunInstances:0014 | RunInstances:0210 |\n RunInstances:0110 | RunInstances:0100 |\n RunInstances:0004 | RunInstances:0200 |\n RunInstances:000g | RunInstances:0g00 |\n RunInstances:0002 | RunInstances:0800 |\n RunInstances:0102 | RunInstances:0006 |\n RunInstances:0202).

    \n
  • \n
  • \n

    \n usage-operation-update-time - The time that the usage operation\n was last updated, for example, 2022-09-15T17:15:20.000Z.

    \n
  • \n
  • \n

    \n virtualization-type - The virtualization type of the instance\n (paravirtual | hvm).

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC that the instance is running in.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -30662,6 +31497,36 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more of your internet gateways.

", + "smithy.api#examples": [ + { + "title": "To describe the Internet gateway for a VPC", + "documentation": "This example describes the Internet gateway for the specified VPC.", + "input": { + "Filters": [ + { + "Name": "attachment.vpc-id", + "Values": [ + "vpc-a01106c2" + ] + } + ] + }, + "output": { + "InternetGateways": [ + { + "Tags": [], + "InternetGatewayId": "igw-c0a643a9", + "Attachments": [ + { + "State": "attached", + "VpcId": "vpc-a01106c2" + } + ] + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -30712,7 +31577,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n attachment.state - The current state of the attachment between the gateway\n and the VPC (available). Present only if a VPC is attached.

    \n
  • \n
  • \n

    \n attachment.vpc-id - The ID of an attached VPC.

    \n
  • \n
  • \n

    \n internet-gateway-id - The ID of the Internet gateway.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the internet gateway.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n attachment.state - The current state of the attachment between the gateway\n and the VPC (available). Present only if a VPC is attached.

    \n
  • \n
  • \n

    \n attachment.vpc-id - The ID of an attached VPC.

    \n
  • \n
  • \n

    \n internet-gateway-id - The ID of the Internet gateway.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the internet gateway.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -30730,7 +31595,7 @@ "target": "com.amazonaws.ec2#InternetGatewayIdList", "traits": { "aws.protocols#ec2QueryName": "InternetGatewayId", - "smithy.api#documentation": "

One or more internet gateway IDs.

\n

Default: Describes all your internet gateways.

", + "smithy.api#documentation": "

The IDs of the internet gateways.

\n

Default: Describes all your internet gateways.

", "smithy.api#xmlName": "internetGatewayId" } }, @@ -31303,6 +32168,25 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified key pairs or all of your key pairs.

\n

For more information about key pairs, see Amazon EC2 key pairs \n\t\t\t\tin the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To display a key pair", + "documentation": "This example displays the fingerprint for the specified key.", + "input": { + "KeyNames": [ + "my-key-pair" + ] + }, + "output": { + "KeyPairs": [ + { + "KeyName": "my-key-pair", + "KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f" + } + ] + } + } + ], "smithy.api#suppress": [ "WaitableTraitInvalidErrorType" ], @@ -31404,6 +32288,66 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more versions of a specified launch template. You can describe all\n versions, individual versions, or a range of versions. You can also describe all the\n latest versions or all the default versions of all the launch templates in your\n account.

", + "smithy.api#examples": [ + { + "title": "To describe the versions for a launch template", + "documentation": "This example describes the versions for the specified launch template.", + "input": { + "LaunchTemplateId": "068f72b72934aff71" + }, + "output": { + "LaunchTemplateVersions": [ + { + "LaunchTemplateId": "lt-068f72b72934aff71", + "LaunchTemplateName": "Webservers", + "VersionNumber": 2, + "CreatedBy": "arn:aws:iam::123456789102:root", + "LaunchTemplateData": { + "KeyName": "kp-us-east", + "ImageId": "ami-6057e21a", + "InstanceType": "t2.medium", + "NetworkInterfaces": [ + { + "SubnetId": "subnet-1a2b3c4d", + "DeviceIndex": 0, + "Groups": [ + "sg-7c227019" + ] + } + ] + }, + "DefaultVersion": false, + "CreateTime": "2017-11-20T13:12:32.000Z" + }, + { + "LaunchTemplateId": "lt-068f72b72934aff71", + "LaunchTemplateName": "Webservers", + "VersionNumber": 1, + "CreatedBy": "arn:aws:iam::123456789102:root", + "LaunchTemplateData": { + "UserData": "", + "KeyName": "kp-us-east", + "ImageId": "ami-aabbcc11", + "InstanceType": "t2.medium", + "NetworkInterfaces": [ + { + "SubnetId": "subnet-7b16de0c", + "DeviceIndex": 0, + "DeleteOnTermination": false, + "Groups": [ + "sg-7c227019" + ], + "AssociatePublicIpAddress": true + } + ] + }, + "DefaultVersion": true, + "CreateTime": "2017-11-20T12:52:33.000Z" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -31522,6 +32466,29 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more launch templates.

", + "smithy.api#examples": [ + { + "title": "To describe a launch template", + "documentation": "This example describes the specified launch template.", + "input": { + "LaunchTemplateIds": [ + "lt-01238c059e3466abc" + ] + }, + "output": { + "LaunchTemplates": [ + { + "LatestVersionNumber": 1, + "LaunchTemplateName": "my-template", + "LaunchTemplateId": "lt-01238c059e3466abc", + "CreatedBy": "arn:aws:iam::123456789012:root", + "CreateTime": "2018-01-16T04:32:57.000Z", + "DefaultVersionNumber": 1 + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -32227,6 +33194,20 @@ }, "traits": { "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Describes your Elastic IP addresses that are being moved from or being restored to the EC2-Classic platform. \n This request does not return information about any other Elastic IP addresses in your account.

", + "smithy.api#examples": [ + { + "title": "To describe your moving addresses", + "documentation": "This example describes all of your moving Elastic IP addresses.", + "output": { + "MovingAddressStatuses": [ + { + "PublicIp": "198.51.100.0", + "MoveStatus": "movingToVpc" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -32331,6 +33312,41 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more of your NAT gateways.

", + "smithy.api#examples": [ + { + "title": "To describe a NAT gateway", + "documentation": "This example describes the NAT gateway for the specified VPC.", + "input": { + "Filter": [ + { + "Name": "vpc-id", + "Values": [ + "vpc-1a2b3c4d" + ] + } + ] + }, + "output": { + "NatGateways": [ + { + "NatGatewayAddresses": [ + { + "PublicIp": "198.11.222.333", + "NetworkInterfaceId": "eni-9dec76cd", + "AllocationId": "eipalloc-89c620ec", + "PrivateIp": "10.0.0.149" + } + ], + "VpcId": "vpc-1a2b3c4d", + "State": "available", + "NatGatewayId": "nat-05dba92075d71c408", + "SubnetId": "subnet-847e4dc2", + "CreateTime": "2015-12-01T12:26:55.983Z" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -32440,7 +33456,7 @@ "Filter": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n nat-gateway-id - The ID of the NAT gateway.

    \n
  • \n
  • \n

    \n state - The state of the NAT gateway (pending |\n failed | available | deleting | deleted).

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet in which the NAT gateway resides.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC in which the NAT gateway resides.

    \n
  • \n
" + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n nat-gateway-id - The ID of the NAT gateway.

    \n
  • \n
  • \n

    \n state - The state of the NAT gateway (pending |\n failed | available | deleting | deleted).

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet in which the NAT gateway resides.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC in which the NAT gateway resides.

    \n
  • \n
" } }, "MaxResults": { @@ -32454,7 +33470,7 @@ "NatGatewayIds": { "target": "com.amazonaws.ec2#NatGatewayIdStringList", "traits": { - "smithy.api#documentation": "

One or more NAT gateway IDs.

", + "smithy.api#documentation": "

The IDs of the NAT gateways.

", "smithy.api#xmlName": "NatGatewayId" } }, @@ -32502,7 +33518,51 @@ "target": "com.amazonaws.ec2#DescribeNetworkAclsResult" }, "traits": { - "smithy.api#documentation": "

Describes one or more of your network ACLs.

\n

For more information, see Network ACLs in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

", + "smithy.api#documentation": "

Describes one or more of your network ACLs.

\n

For more information, see Network ACLs in the\n\t\t\t\tAmazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe a network ACL", + "documentation": "This example describes the specified network ACL.", + "input": { + "NetworkAclIds": [ + "acl-5fb85d36" + ] + }, + "output": { + "NetworkAcls": [ + { + "Associations": [ + { + "SubnetId": "subnet-65ea5f08", + "NetworkAclId": "acl-9aeb5ef7", + "NetworkAclAssociationId": "aclassoc-66ea5f0b" + } + ], + "NetworkAclId": "acl-5fb85d36", + "VpcId": "vpc-a01106c2", + "Tags": [], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": false + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -32527,7 +33587,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n association.association-id - The ID of an association ID for the ACL.

    \n
  • \n
  • \n

    \n association.network-acl-id - The ID of the network ACL involved in the association.

    \n
  • \n
  • \n

    \n association.subnet-id - The ID of the subnet involved in the association.

    \n
  • \n
  • \n

    \n default - Indicates whether the ACL is the default network ACL for the VPC.

    \n
  • \n
  • \n

    \n entry.cidr - The IPv4 CIDR range specified in the entry.

    \n
  • \n
  • \n

    \n entry.icmp.code - The ICMP code specified in the entry, if any.

    \n
  • \n
  • \n

    \n entry.icmp.type - The ICMP type specified in the entry, if any.

    \n
  • \n
  • \n

    \n entry.ipv6-cidr - The IPv6 CIDR range specified in the entry.

    \n
  • \n
  • \n

    \n entry.port-range.from - The start of the port range specified in the entry.

    \n
  • \n
  • \n

    \n entry.port-range.to - The end of the port range specified in the entry.

    \n
  • \n
  • \n

    \n entry.protocol - The protocol specified in the entry (tcp | udp | icmp or a protocol number).

    \n
  • \n
  • \n

    \n entry.rule-action - Allows or denies the matching traffic (allow | deny).

    \n
  • \n
  • \n

    \n entry.egress - A Boolean that indicates the type of rule. Specify true \n\t\t for egress rules, or false for ingress rules.

    \n
  • \n
  • \n

    \n entry.rule-number - The number of an entry (in other words, rule) in\n the set of ACL entries.

    \n
  • \n
  • \n

    \n network-acl-id - The ID of the network ACL.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the network ACL.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the network ACL.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n association.association-id - The ID of an association ID for the ACL.

    \n
  • \n
  • \n

    \n association.network-acl-id - The ID of the network ACL involved in the association.

    \n
  • \n
  • \n

    \n association.subnet-id - The ID of the subnet involved in the association.

    \n
  • \n
  • \n

    \n default - Indicates whether the ACL is the default network ACL for the VPC.

    \n
  • \n
  • \n

    \n entry.cidr - The IPv4 CIDR range specified in the entry.

    \n
  • \n
  • \n

    \n entry.icmp.code - The ICMP code specified in the entry, if any.

    \n
  • \n
  • \n

    \n entry.icmp.type - The ICMP type specified in the entry, if any.

    \n
  • \n
  • \n

    \n entry.ipv6-cidr - The IPv6 CIDR range specified in the entry.

    \n
  • \n
  • \n

    \n entry.port-range.from - The start of the port range specified in the entry.

    \n
  • \n
  • \n

    \n entry.port-range.to - The end of the port range specified in the entry.

    \n
  • \n
  • \n

    \n entry.protocol - The protocol specified in the entry (tcp | udp | icmp or a protocol number).

    \n
  • \n
  • \n

    \n entry.rule-action - Allows or denies the matching traffic (allow | deny).

    \n
  • \n
  • \n

    \n entry.egress - A Boolean that indicates the type of rule. Specify true \n\t\t for egress rules, or false for ingress rules.

    \n
  • \n
  • \n

    \n entry.rule-number - The number of an entry (in other words, rule) in\n the set of ACL entries.

    \n
  • \n
  • \n

    \n network-acl-id - The ID of the network ACL.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the network ACL.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the network ACL.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -32544,7 +33604,7 @@ "NetworkAclIds": { "target": "com.amazonaws.ec2#NetworkAclIdStringList", "traits": { - "smithy.api#documentation": "

One or more network ACL IDs.

\n

Default: Describes all your network ACLs.

", + "smithy.api#documentation": "

The IDs of the network ACLs.

\n

Default: Describes all your network ACLs.

", "smithy.api#xmlName": "NetworkAclId" } }, @@ -33169,6 +34229,70 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more of your network interfaces.

", + "smithy.api#examples": [ + { + "title": "To describe a network interface", + "documentation": "", + "input": { + "NetworkInterfaceIds": [ + "eni-e5aa89a3" + ] + }, + "output": { + "NetworkInterfaces": [ + { + "Status": "in-use", + "MacAddress": "02:2f:8f:b0:cf:75", + "SourceDestCheck": true, + "VpcId": "vpc-a01106c2", + "Description": "my network interface", + "Association": { + "PublicIp": "203.0.113.12", + "AssociationId": "eipassoc-0fbb766a", + "PublicDnsName": "ec2-203-0-113-12.compute-1.amazonaws.com", + "IpOwnerId": "123456789012" + }, + "NetworkInterfaceId": "eni-e5aa89a3", + "PrivateIpAddresses": [ + { + "PrivateDnsName": "ip-10-0-1-17.ec2.internal", + "Association": { + "PublicIp": "203.0.113.12", + "AssociationId": "eipassoc-0fbb766a", + "PublicDnsName": "ec2-203-0-113-12.compute-1.amazonaws.com", + "IpOwnerId": "123456789012" + }, + "Primary": true, + "PrivateIpAddress": "10.0.1.17" + } + ], + "RequesterManaged": false, + "PrivateDnsName": "ip-10-0-1-17.ec2.internal", + "AvailabilityZone": "us-east-1d", + "Attachment": { + "Status": "attached", + "DeviceIndex": 1, + "AttachTime": "2013-11-30T23:36:42.000Z", + "InstanceId": "i-1234567890abcdef0", + "DeleteOnTermination": false, + "AttachmentId": "eni-attach-66c4350a", + "InstanceOwnerId": "123456789012" + }, + "Groups": [ + { + "GroupName": "default", + "GroupId": "sg-8637d3e3" + } + ], + "SubnetId": "subnet-b61f49f0", + "OwnerId": "123456789012", + "TagSet": [], + "PrivateIpAddress": "10.0.1.17" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -33615,7 +34739,61 @@ "target": "com.amazonaws.ec2#DescribeRegionsResult" }, "traits": { - "smithy.api#documentation": "

Describes the Regions that are enabled for your account, or all Regions.

\n

For a list of the Regions supported by Amazon EC2, see \n Amazon Elastic Compute Cloud endpoints and quotas.

\n

For information about enabling and disabling Regions for your account, see Managing Amazon Web Services Regions in the Amazon Web Services General Reference.

" + "smithy.api#documentation": "

Describes the Regions that are enabled for your account, or all Regions.

\n

For a list of the Regions supported by Amazon EC2, see \n Amazon Elastic Compute Cloud endpoints and quotas.

\n

For information about enabling and disabling Regions for your account, see Managing Amazon Web Services Regions in the Amazon Web Services General Reference.

", + "smithy.api#examples": [ + { + "title": "To describe your regions", + "documentation": "This example describes all the regions that are available to you.", + "output": { + "Regions": [ + { + "Endpoint": "ec2.ap-south-1.amazonaws.com", + "RegionName": "ap-south-1" + }, + { + "Endpoint": "ec2.eu-west-1.amazonaws.com", + "RegionName": "eu-west-1" + }, + { + "Endpoint": "ec2.ap-southeast-1.amazonaws.com", + "RegionName": "ap-southeast-1" + }, + { + "Endpoint": "ec2.ap-southeast-2.amazonaws.com", + "RegionName": "ap-southeast-2" + }, + { + "Endpoint": "ec2.eu-central-1.amazonaws.com", + "RegionName": "eu-central-1" + }, + { + "Endpoint": "ec2.ap-northeast-2.amazonaws.com", + "RegionName": "ap-northeast-2" + }, + { + "Endpoint": "ec2.ap-northeast-1.amazonaws.com", + "RegionName": "ap-northeast-1" + }, + { + "Endpoint": "ec2.us-east-1.amazonaws.com", + "RegionName": "us-east-1" + }, + { + "Endpoint": "ec2.sa-east-1.amazonaws.com", + "RegionName": "sa-east-1" + }, + { + "Endpoint": "ec2.us-west-1.amazonaws.com", + "RegionName": "us-west-1" + }, + { + "Endpoint": "ec2.us-west-2.amazonaws.com", + "RegionName": "us-west-2" + } + ] + } + } + ] } }, "com.amazonaws.ec2#DescribeRegionsRequest": { @@ -34155,7 +35333,42 @@ "target": "com.amazonaws.ec2#DescribeRouteTablesResult" }, "traits": { - "smithy.api#documentation": "

Describes one or more of your route tables.

\n

Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations.

\n

For more information, see Route tables in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

", + "smithy.api#documentation": "

Describes one or more of your route tables.

\n

Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations.

\n

For more information, see Route tables in the\n\t\t\t\tAmazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe a route table", + "documentation": "This example describes the specified route table.", + "input": { + "RouteTableIds": [ + "rtb-1f382e7d" + ] + }, + "output": { + "RouteTables": [ + { + "Associations": [ + { + "RouteTableAssociationId": "rtbassoc-d8ccddba", + "Main": true, + "RouteTableId": "rtb-1f382e7d" + } + ], + "RouteTableId": "rtb-1f382e7d", + "VpcId": "vpc-a01106c2", + "PropagatingVgws": [], + "Tags": [], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active" + } + ] + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -34180,7 +35393,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n association.route-table-association-id - The ID of an association\n ID for the route table.

    \n
  • \n
  • \n

    \n association.route-table-id - The ID of the route table involved in\n the association.

    \n
  • \n
  • \n

    \n association.subnet-id - The ID of the subnet involved in the\n association.

    \n
  • \n
  • \n

    \n association.main - Indicates whether the route table is the main\n route table for the VPC (true | false). Route tables\n that do not have an association ID are not returned in the response.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the route table.

    \n
  • \n
  • \n

    \n route-table-id - The ID of the route table.

    \n
  • \n
  • \n

    \n route.destination-cidr-block - The IPv4 CIDR range specified in a\n route in the table.

    \n
  • \n
  • \n

    \n route.destination-ipv6-cidr-block - The IPv6 CIDR range specified in a route in the route table.

    \n
  • \n
  • \n

    \n route.destination-prefix-list-id - The ID (prefix) of the Amazon Web Service\n specified in a route in the table.

    \n
  • \n
  • \n

    \n route.egress-only-internet-gateway-id - The ID of an\n egress-only Internet gateway specified in a route in the route table.

    \n
  • \n
  • \n

    \n route.gateway-id - The ID of a gateway specified in a route in the table.

    \n
  • \n
  • \n

    \n route.instance-id - The ID of an instance specified in a route in the table.

    \n
  • \n
  • \n

    \n route.nat-gateway-id - The ID of a NAT gateway.

    \n
  • \n
  • \n

    \n route.transit-gateway-id - The ID of a transit gateway.

    \n
  • \n
  • \n

    \n route.origin - Describes how the route was created. \n CreateRouteTable indicates that the route was automatically\n created when the route table was created; CreateRoute indicates\n that the route was manually added to the route table;\n EnableVgwRoutePropagation indicates that the route was\n propagated by route propagation.

    \n
  • \n
  • \n

    \n route.state - The state of a route in the route table\n (active | blackhole). The blackhole state\n indicates that the route's target isn't available (for example, the specified\n gateway isn't attached to the VPC, the specified NAT instance has been\n terminated, and so on).

    \n
  • \n
  • \n

    \n route.vpc-peering-connection-id - The ID of a VPC peering\n\t\t connection specified in a route in the table.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the route table.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n association.route-table-association-id - The ID of an association\n ID for the route table.

    \n
  • \n
  • \n

    \n association.route-table-id - The ID of the route table involved in\n the association.

    \n
  • \n
  • \n

    \n association.subnet-id - The ID of the subnet involved in the\n association.

    \n
  • \n
  • \n

    \n association.main - Indicates whether the route table is the main\n route table for the VPC (true | false). Route tables\n that do not have an association ID are not returned in the response.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the route table.

    \n
  • \n
  • \n

    \n route-table-id - The ID of the route table.

    \n
  • \n
  • \n

    \n route.destination-cidr-block - The IPv4 CIDR range specified in a\n route in the table.

    \n
  • \n
  • \n

    \n route.destination-ipv6-cidr-block - The IPv6 CIDR range specified in a route in the route table.

    \n
  • \n
  • \n

    \n route.destination-prefix-list-id - The ID (prefix) of the Amazon Web Service\n specified in a route in the table.

    \n
  • \n
  • \n

    \n route.egress-only-internet-gateway-id - The ID of an\n egress-only Internet gateway specified in a route in the route table.

    \n
  • \n
  • \n

    \n route.gateway-id - The ID of a gateway specified in a route in the table.

    \n
  • \n
  • \n

    \n route.instance-id - The ID of an instance specified in a route in the table.

    \n
  • \n
  • \n

    \n route.nat-gateway-id - The ID of a NAT gateway.

    \n
  • \n
  • \n

    \n route.transit-gateway-id - The ID of a transit gateway.

    \n
  • \n
  • \n

    \n route.origin - Describes how the route was created. \n CreateRouteTable indicates that the route was automatically\n created when the route table was created; CreateRoute indicates\n that the route was manually added to the route table;\n EnableVgwRoutePropagation indicates that the route was\n propagated by route propagation.

    \n
  • \n
  • \n

    \n route.state - The state of a route in the route table\n (active | blackhole). The blackhole state\n indicates that the route's target isn't available (for example, the specified\n gateway isn't attached to the VPC, the specified NAT instance has been\n terminated, and so on).

    \n
  • \n
  • \n

    \n route.vpc-peering-connection-id - The ID of a VPC peering\n\t\t connection specified in a route in the table.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the route table.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -34197,7 +35410,7 @@ "RouteTableIds": { "target": "com.amazonaws.ec2#RouteTableIdStringList", "traits": { - "smithy.api#documentation": "

One or more route table IDs.

\n

Default: Describes all your route tables.

", + "smithy.api#documentation": "

The IDs of the route tables.

\n

Default: Describes all your route tables.

", "smithy.api#xmlName": "RouteTableId" } }, @@ -34471,7 +35684,27 @@ "target": "com.amazonaws.ec2#DescribeSecurityGroupReferencesResult" }, "traits": { - "smithy.api#documentation": "

[VPC only] Describes the VPCs on the other side of a VPC peering connection that are referencing the security groups you've specified in this request.

" + "smithy.api#documentation": "

Describes the VPCs on the other side of a VPC peering connection that are referencing the security groups you've specified in this request.

", + "smithy.api#examples": [ + { + "title": "To describe security group references", + "documentation": "This example describes the security group references for the specified security group.", + "input": { + "GroupId": [ + "sg-903004f8" + ] + }, + "output": { + "SecurityGroupReferenceSet": [ + { + "ReferencingVpcId": "vpc-1a2b3c4d", + "GroupId": "sg-903004f8", + "VpcPeeringConnectionId": "pcx-b04deed9" + } + ] + } + } + ] } }, "com.amazonaws.ec2#DescribeSecurityGroupReferencesRequest": { @@ -34619,7 +35852,19 @@ "target": "com.amazonaws.ec2#DescribeSecurityGroupsResult" }, "traits": { - "smithy.api#documentation": "

Describes the specified security groups or all of your security groups.

\n

A security group is for use with instances either in the EC2-Classic platform \n\t\t\t\tor in a specific VPC. For more information, see\n\t\t\t\tAmazon EC2 security groups in \n\t\t\t\tthe Amazon Elastic Compute Cloud User Guide and \n\t\t\t\tSecurity groups for your VPC in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
", + "smithy.api#documentation": "

Describes the specified security groups or all of your security groups.

", + "smithy.api#examples": [ + { + "title": "To describe a security group", + "documentation": "This example describes the specified security group.", + "input": { + "GroupIds": [ + "sg-903004f8" + ] + }, + "output": {} + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -34684,7 +35929,7 @@ "GroupNames": { "target": "com.amazonaws.ec2#GroupNameStringList", "traits": { - "smithy.api#documentation": "

[EC2-Classic and default VPC only] The names of the security groups. You can specify either\n\t\t\tthe security group name or the security group ID. For security groups in a nondefault VPC, use\n\t\t\tthe group-name filter to describe security groups by name.

\n

Default: Describes all of your security groups.

", + "smithy.api#documentation": "

[Default VPC] The names of the security groups. You can specify either\n\t\t\tthe security group name or the security group ID.

\n

Default: Describes all of your security groups.

", "smithy.api#xmlName": "GroupName" } }, @@ -34750,7 +35995,21 @@ "target": "com.amazonaws.ec2#DescribeSnapshotAttributeResult" }, "traits": { - "smithy.api#documentation": "

Describes the specified attribute of the specified snapshot. You can specify only one\n attribute at a time.

\n

For more information about EBS snapshots, see Amazon EBS snapshots in the Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Describes the specified attribute of the specified snapshot. You can specify only one\n attribute at a time.

\n

For more information about EBS snapshots, see Amazon EBS snapshots in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe snapshot attributes", + "documentation": "This example describes the ``createVolumePermission`` attribute on a snapshot with the snapshot ID of ``snap-066877671789bd71b``.", + "input": { + "SnapshotId": "snap-066877671789bd71b", + "Attribute": "createVolumePermission" + }, + "output": { + "SnapshotId": "snap-066877671789bd71b", + "CreateVolumePermissions": [] + } + } + ] } }, "com.amazonaws.ec2#DescribeSnapshotAttributeRequest": { @@ -34909,6 +36168,32 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified EBS snapshots available to you or all of the EBS snapshots\n available to you.

\n

The snapshots available to you include public snapshots, private snapshots that you own,\n and private snapshots owned by other Amazon Web Services accounts for which you have explicit create volume\n permissions.

\n

The create volume permissions fall into the following categories:

\n
    \n
  • \n

    \n public: The owner of the snapshot granted create volume\n permissions for the snapshot to the all group. All Amazon Web Services accounts have create\n volume permissions for these snapshots.

    \n
  • \n
  • \n

    \n explicit: The owner of the snapshot granted create volume\n permissions to a specific Amazon Web Services account.

    \n
  • \n
  • \n

    \n implicit: An Amazon Web Services account has implicit create volume permissions\n for all snapshots it owns.

    \n
  • \n
\n

The list of snapshots returned can be filtered by specifying snapshot IDs, snapshot\n owners, or Amazon Web Services accounts with create volume permissions. If no options are specified, \n Amazon EC2 returns all snapshots for which you have create volume permissions.

\n

If you specify one or more snapshot IDs, only snapshots that have the specified IDs are\n returned. If you specify an invalid snapshot ID, an error is returned. If you specify a\n snapshot ID for which you do not have access, it is not included in the returned\n results.

\n

If you specify one or more snapshot owners using the OwnerIds option, only\n snapshots from the specified owners and for which you have access are returned. The results\n can include the Amazon Web Services account IDs of the specified owners, amazon for snapshots\n owned by Amazon, or self for snapshots that you own.

\n

If you specify a list of restorable users, only snapshots with create snapshot permissions\n for those users are returned. You can specify Amazon Web Services account IDs (if you own the snapshots),\n self for snapshots for which you own or have explicit permissions, or\n all for public snapshots.

\n

If you are describing a long list of snapshots, we recommend that you paginate the output to make the\n list more manageable. For more information, see Pagination.

\n

To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores.

\n

For more information about EBS snapshots, see Amazon EBS snapshots in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe a snapshot", + "documentation": "This example describes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``.", + "input": { + "SnapshotIds": [ + "snap-1234567890abcdef0" + ] + }, + "output": { + "Snapshots": [ + { + "Description": "This is my snapshot.", + "VolumeId": "vol-049df61146c4d7901", + "State": "completed", + "VolumeSize": 8, + "Progress": "100%", + "StartTime": "2014-02-28T21:28:32.000Z", + "SnapshotId": "snap-1234567890abcdef0", + "OwnerId": "012345678910" + } + ], + "NextToken": "" + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -35037,7 +36322,21 @@ "target": "com.amazonaws.ec2#DescribeSpotDatafeedSubscriptionResult" }, "traits": { - "smithy.api#documentation": "

Describes the data feed for Spot Instances. For more information, see Spot\n Instance data feed in the Amazon EC2 User Guide for Linux Instances.

" + "smithy.api#documentation": "

Describes the data feed for Spot Instances. For more information, see Spot\n Instance data feed in the Amazon EC2 User Guide for Linux Instances.

", + "smithy.api#examples": [ + { + "title": "To describe the datafeed for your AWS account", + "documentation": "This example describes the Spot Instance datafeed subscription for your AWS account.", + "output": { + "SpotDatafeedSubscription": { + "OwnerId": "123456789012", + "Prefix": "spotdata", + "Bucket": "my-s3-bucket", + "State": "Active" + } + } + } + ] } }, "com.amazonaws.ec2#DescribeSpotDatafeedSubscriptionRequest": { @@ -35324,6 +36623,60 @@ }, "traits": { "smithy.api#documentation": "

Describes your Spot Fleet requests.

\n

Spot Fleet requests are deleted 48 hours after they are canceled and their instances\n are terminated.

", + "smithy.api#examples": [ + { + "title": "To describe a Spot fleet request", + "documentation": "This example describes the specified Spot fleet request.", + "input": { + "SpotFleetRequestIds": [ + "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE" + ] + }, + "output": { + "SpotFleetRequestConfigs": [ + { + "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", + "SpotFleetRequestConfig": { + "TargetCapacity": 20, + "LaunchSpecifications": [ + { + "EbsOptimized": false, + "NetworkInterfaces": [ + { + "SubnetId": "subnet-a61dafcf", + "DeviceIndex": 0, + "DeleteOnTermination": false, + "AssociatePublicIpAddress": true, + "SecondaryPrivateIpAddressCount": 0 + } + ], + "InstanceType": "cc2.8xlarge", + "ImageId": "ami-1a2b3c4d" + }, + { + "EbsOptimized": false, + "NetworkInterfaces": [ + { + "SubnetId": "subnet-a61dafcf", + "DeviceIndex": 0, + "DeleteOnTermination": false, + "AssociatePublicIpAddress": true, + "SecondaryPrivateIpAddressCount": 0 + } + ], + "InstanceType": "r3.8xlarge", + "ImageId": "ami-1a2b3c4d" + } + ], + "SpotPrice": "0.05", + "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" + }, + "SpotFleetRequestState": "active" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -35412,6 +36765,58 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified Spot Instance requests.

\n

You can use DescribeSpotInstanceRequests to find a running Spot Instance by\n examining the response. If the status of the Spot Instance is fulfilled, the\n instance ID appears in the response and contains the identifier of the instance.\n Alternatively, you can use DescribeInstances\n with a filter to look for instances where the instance lifecycle is\n spot.

\n

We recommend that you set MaxResults to a value between 5 and 1000 to\n limit the number of items returned. This paginates the output, which makes the list\n more manageable and returns the items faster. If the list of items exceeds your\n MaxResults value, then that number of items is returned along with a\n NextToken value that can be passed to a subsequent\n DescribeSpotInstanceRequests request to retrieve the remaining\n items.

\n

Spot Instance requests are deleted four hours after they are canceled and their instances are\n terminated.

", + "smithy.api#examples": [ + { + "title": "To describe a Spot Instance request", + "documentation": "This example describes the specified Spot Instance request.", + "input": { + "SpotInstanceRequestIds": [ + "sir-08b93456" + ] + }, + "output": { + "SpotInstanceRequests": [ + { + "Status": { + "UpdateTime": "2014-04-30T18:16:21.000Z", + "Code": "fulfilled", + "Message": "Your Spot request is fulfilled." + }, + "ProductDescription": "Linux/UNIX", + "InstanceId": "i-1234567890abcdef0", + "SpotInstanceRequestId": "sir-08b93456", + "State": "active", + "LaunchedAvailabilityZone": "us-west-1b", + "LaunchSpecification": { + "ImageId": "ami-7aba833f", + "KeyName": "my-key-pair", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/sda1", + "Ebs": { + "DeleteOnTermination": true, + "VolumeType": "standard", + "VolumeSize": 8 + } + } + ], + "EbsOptimized": false, + "SecurityGroups": [ + { + "GroupName": "my-security-group", + "GroupId": "sg-e38f24a7" + } + ], + "InstanceType": "m1.small" + }, + "Type": "one-time", + "CreateTime": "2014-04-30T18:14:55.000Z", + "SpotPrice": "0.010000" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -35578,6 +36983,40 @@ }, "traits": { "smithy.api#documentation": "

Describes the Spot price history. For more information, see Spot Instance pricing history in the\n Amazon EC2 User Guide for Linux Instances.

\n

When you specify a start and end time, the operation returns the prices of the\n instance types within that time range. It also returns the last price change before the\n start time, which is the effective price as of the start time.

", + "smithy.api#examples": [ + { + "title": "To describe Spot price history for Linux/UNIX (Amazon VPC)", + "documentation": "This example returns the Spot Price history for m1.xlarge, Linux/UNIX (Amazon VPC) instances for a particular day in January.", + "input": { + "StartTime": "2014-01-06T07:08:09.05Z", + "EndTime": "2014-01-06T08:09:10.05Z", + "InstanceTypes": [ + "m1.xlarge" + ], + "ProductDescriptions": [ + "Linux/UNIX (Amazon VPC)" + ] + }, + "output": { + "SpotPriceHistory": [ + { + "Timestamp": "2014-01-06T04:32:53.000Z", + "ProductDescription": "Linux/UNIX (Amazon VPC)", + "InstanceType": "m1.xlarge", + "SpotPrice": "0.080000", + "AvailabilityZone": "us-west-1a" + }, + { + "Timestamp": "2014-01-05T11:28:26.000Z", + "ProductDescription": "Linux/UNIX (Amazon VPC)", + "InstanceType": "m1.xlarge", + "SpotPrice": "0.080000", + "AvailabilityZone": "us-west-1c" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -35702,7 +37141,7 @@ "target": "com.amazonaws.ec2#DescribeStaleSecurityGroupsResult" }, "traits": { - "smithy.api#documentation": "

[VPC only] Describes the stale security group rules for security groups in a specified VPC. \n Rules are stale when they reference a deleted security group in the same VPC or in a peer VPC, \n or if they reference a security group in a peer VPC for which the VPC peering connection has \n been deleted.

", + "smithy.api#documentation": "

Describes the stale security group rules for security groups in a specified VPC. \n Rules are stale when they reference a deleted security group in the same VPC or in a peer VPC, \n or if they reference a security group in a peer VPC for which the VPC peering connection has \n been deleted.

", "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -35807,6 +37246,43 @@ "outputToken": "NextToken", "items": "StoreImageTaskResults", "pageSize": "MaxResults" + }, + "smithy.waiters#waitable": { + "StoreImageTaskComplete": { + "acceptors": [ + { + "state": "success", + "matcher": { + "output": { + "path": "StoreImageTaskResults[].StoreTaskState", + "expected": "Completed", + "comparator": "allStringEquals" + } + } + }, + { + "state": "failure", + "matcher": { + "output": { + "path": "StoreImageTaskResults[].StoreTaskState", + "expected": "Failed", + "comparator": "anyStringEquals" + } + } + }, + { + "state": "retry", + "matcher": { + "output": { + "path": "StoreImageTaskResults[].StoreTaskState", + "expected": "InProgress", + "comparator": "anyStringEquals" + } + } + } + ], + "minDelay": 5 + } } } }, @@ -35897,7 +37373,37 @@ "target": "com.amazonaws.ec2#DescribeSubnetsResult" }, "traits": { - "smithy.api#documentation": "

Describes one or more of your subnets.

\n

For more information, see Your VPC and subnets in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

", + "smithy.api#documentation": "

Describes one or more of your subnets.

\n

For more information, see Subnets in the\n\t\t\t\tAmazon VPC User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe the subnets for a VPC", + "documentation": "This example describes the subnets for the specified VPC.", + "input": { + "Filters": [ + { + "Name": "vpc-id", + "Values": [ + "vpc-a01106c2" + ] + } + ] + }, + "output": { + "Subnets": [ + { + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.1.0/24", + "MapPublicIpOnLaunch": false, + "DefaultForAz": false, + "State": "available", + "AvailabilityZone": "us-east-1c", + "SubnetId": "subnet-9d4a7b6c", + "AvailableIpAddressCount": 251 + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -35939,14 +37445,14 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n availability-zone - The Availability Zone for the subnet. You can also use\n availabilityZone as the filter name.

    \n
  • \n
  • \n

    \n availability-zone-id - The ID of the Availability Zone for the subnet.\n You can also use availabilityZoneId as the filter name.

    \n
  • \n
  • \n

    \n available-ip-address-count - The number of IPv4 addresses in the\n subnet that are available.

    \n
  • \n
  • \n

    \n cidr-block - The IPv4 CIDR block of the subnet. The CIDR block\n you specify must exactly match the subnet's CIDR block for information to be\n returned for the subnet. You can also use cidr or\n cidrBlock as the filter names.

    \n
  • \n
  • \n

    \n customer-owned-ipv4-pool - The customer-owned IPv4 address pool\n associated with the subnet.

    \n
  • \n
  • \n

    \n default-for-az - Indicates whether this is the default subnet for\n the Availability Zone (true | false). You can also use\n defaultForAz as the filter name.

    \n
  • \n
  • \n

    \n enable-dns64 - Indicates whether DNS queries made to the\n Amazon-provided DNS Resolver in this subnet should return synthetic IPv6\n addresses for IPv4-only destinations.

    \n
  • \n
  • \n

    \n enable-lni-at-device-index - Indicates the device position for\n local network interfaces in this subnet. For example, 1 indicates\n local network interfaces in this subnet are the secondary network interface\n (eth1).

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR\n block associated with the subnet.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.association-id - An association ID\n for an IPv6 CIDR block associated with the subnet.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.state - The state of an IPv6 CIDR\n block associated with the subnet.

    \n
  • \n
  • \n

    \n ipv6-native - Indicates whether this is an IPv6 only subnet\n (true | false).

    \n
  • \n
  • \n

    \n map-customer-owned-ip-on-launch - Indicates whether a network\n interface created in this subnet (including a network interface created by RunInstances) receives a customer-owned IPv4 address.

    \n
  • \n
  • \n

    \n map-public-ip-on-launch - Indicates whether instances launched in\n this subnet receive a public IPv4 address.

    \n
  • \n
  • \n

    \n outpost-arn - The Amazon Resource Name (ARN) of the Outpost.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the\n subnet.

    \n
  • \n
  • \n

    \n private-dns-name-options-on-launch.hostname-type - The type of\n hostname to assign to instances in the subnet at launch. For IPv4-only and\n dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the\n instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6\n only subnets, an instance DNS name must be based on the instance ID\n (resource-name).

    \n
  • \n
  • \n

    \n private-dns-name-options-on-launch.enable-resource-name-dns-a-record\n - Indicates whether to respond to DNS queries for instance hostnames with DNS A\n records.

    \n
  • \n
  • \n

    \n private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record\n - Indicates whether to respond to DNS queries for instance hostnames with DNS\n AAAA records.

    \n
  • \n
  • \n

    \n state - The state of the subnet (pending | available).

    \n
  • \n
  • \n

    \n subnet-arn - The Amazon Resource Name (ARN) of the subnet.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the subnet.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n availability-zone - The Availability Zone for the subnet. You can also use\n availabilityZone as the filter name.

    \n
  • \n
  • \n

    \n availability-zone-id - The ID of the Availability Zone for the subnet.\n You can also use availabilityZoneId as the filter name.

    \n
  • \n
  • \n

    \n available-ip-address-count - The number of IPv4 addresses in the\n subnet that are available.

    \n
  • \n
  • \n

    \n cidr-block - The IPv4 CIDR block of the subnet. The CIDR block\n you specify must exactly match the subnet's CIDR block for information to be\n returned for the subnet. You can also use cidr or\n cidrBlock as the filter names.

    \n
  • \n
  • \n

    \n customer-owned-ipv4-pool - The customer-owned IPv4 address pool\n associated with the subnet.

    \n
  • \n
  • \n

    \n default-for-az - Indicates whether this is the default subnet for\n the Availability Zone (true | false). You can also use\n defaultForAz as the filter name.

    \n
  • \n
  • \n

    \n enable-dns64 - Indicates whether DNS queries made to the\n Amazon-provided DNS Resolver in this subnet should return synthetic IPv6\n addresses for IPv4-only destinations.

    \n
  • \n
  • \n

    \n enable-lni-at-device-index - Indicates the device position for\n local network interfaces in this subnet. For example, 1 indicates\n local network interfaces in this subnet are the secondary network interface\n (eth1).

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR\n block associated with the subnet.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.association-id - An association ID\n for an IPv6 CIDR block associated with the subnet.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.state - The state of an IPv6 CIDR\n block associated with the subnet.

    \n
  • \n
  • \n

    \n ipv6-native - Indicates whether this is an IPv6 only subnet\n (true | false).

    \n
  • \n
  • \n

    \n map-customer-owned-ip-on-launch - Indicates whether a network\n interface created in this subnet (including a network interface created by RunInstances) receives a customer-owned IPv4 address.

    \n
  • \n
  • \n

    \n map-public-ip-on-launch - Indicates whether instances launched in\n this subnet receive a public IPv4 address.

    \n
  • \n
  • \n

    \n outpost-arn - The Amazon Resource Name (ARN) of the Outpost.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the\n subnet.

    \n
  • \n
  • \n

    \n private-dns-name-options-on-launch.hostname-type - The type of\n hostname to assign to instances in the subnet at launch. For IPv4-only and\n dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the\n instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6\n only subnets, an instance DNS name must be based on the instance ID\n (resource-name).

    \n
  • \n
  • \n

    \n private-dns-name-options-on-launch.enable-resource-name-dns-a-record\n - Indicates whether to respond to DNS queries for instance hostnames with DNS A\n records.

    \n
  • \n
  • \n

    \n private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record\n - Indicates whether to respond to DNS queries for instance hostnames with DNS\n AAAA records.

    \n
  • \n
  • \n

    \n state - The state of the subnet (pending | available).

    \n
  • \n
  • \n

    \n subnet-arn - The Amazon Resource Name (ARN) of the subnet.

    \n
  • \n
  • \n

    \n subnet-id - The ID of the subnet.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC for the subnet.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, "SubnetIds": { "target": "com.amazonaws.ec2#SubnetIdStringList", "traits": { - "smithy.api#documentation": "

One or more subnet IDs.

\n

Default: Describes all your subnets.

", + "smithy.api#documentation": "

The IDs of the subnets.

\n

Default: Describes all your subnets.

", "smithy.api#xmlName": "SubnetId" } }, @@ -36013,6 +37519,38 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified tags for your EC2 resources.

\n

For more information about tags, see Tag your Amazon EC2 resources in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe the tags for a single resource", + "documentation": "This example describes the tags for the specified instance.", + "input": { + "Filters": [ + { + "Name": "resource-id", + "Values": [ + "i-1234567890abcdef8" + ] + } + ] + }, + "output": { + "Tags": [ + { + "ResourceType": "instance", + "ResourceId": "i-1234567890abcdef8", + "Value": "test", + "Key": "Stack" + }, + { + "ResourceType": "instance", + "ResourceId": "i-1234567890abcdef8", + "Value": "Beta Server", + "Key": "Name" + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -37799,7 +39337,23 @@ "target": "com.amazonaws.ec2#DescribeVolumeAttributeResult" }, "traits": { - "smithy.api#documentation": "

Describes the specified attribute of the specified volume. You can specify only one\n attribute at a time.

\n

For more information about EBS volumes, see Amazon EBS volumes in the Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Describes the specified attribute of the specified volume. You can specify only one\n attribute at a time.

\n

For more information about EBS volumes, see Amazon EBS volumes in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe a volume attribute", + "documentation": "This example describes the ``autoEnableIo`` attribute of the volume with the ID ``vol-049df61146c4d7901``.", + "input": { + "VolumeId": "vol-049df61146c4d7901", + "Attribute": "autoEnableIO" + }, + "output": { + "AutoEnableIO": { + "Value": false + }, + "VolumeId": "vol-049df61146c4d7901" + } + } + ] } }, "com.amazonaws.ec2#DescribeVolumeAttributeRequest": { @@ -37878,6 +39432,40 @@ }, "traits": { "smithy.api#documentation": "

Describes the status of the specified volumes. Volume status provides the result of the\n checks performed on your volumes to determine events that can impair the performance of your\n volumes. The performance of a volume can be affected if an issue occurs on the volume's\n underlying host. If the volume's underlying host experiences a power outage or system issue,\n after the system is restored, there could be data inconsistencies on the volume. Volume events\n notify you if this occurs. Volume actions notify you if any action needs to be taken in\n response to the event.

\n

The DescribeVolumeStatus operation provides the following information about\n the specified volumes:

\n

\n Status: Reflects the current status of the volume. The possible\n values are ok, impaired , warning, or\n insufficient-data. If all checks pass, the overall status of the volume is\n ok. If the check fails, the overall status is impaired. If the\n status is insufficient-data, then the checks might still be taking place on your\n volume at the time. We recommend that you retry the request. For more information about volume\n status, see Monitor the status of your volumes in the\n Amazon Elastic Compute Cloud User Guide.

\n

\n Events: Reflect the cause of a volume status and might require you to\n take action. For example, if your volume returns an impaired status, then the\n volume event might be potential-data-inconsistency. This means that your volume\n has been affected by an issue with the underlying host, has all I/O operations disabled, and\n might have inconsistent data.

\n

\n Actions: Reflect the actions you might have to take in response to an\n event. For example, if the status of the volume is impaired and the volume event\n shows potential-data-inconsistency, then the action shows\n enable-volume-io. This means that you may want to enable the I/O operations for\n the volume by calling the EnableVolumeIO action and then check the volume\n for data consistency.

\n

Volume status is based on the volume status checks, and does not reflect the volume state.\n Therefore, volume status does not indicate volumes in the error state (for\n example, when a volume is incapable of accepting I/O.)

", + "smithy.api#examples": [ + { + "title": "To describe the status of a single volume", + "documentation": "This example describes the status for the volume ``vol-1234567890abcdef0``.", + "input": { + "VolumeIds": [ + "vol-1234567890abcdef0" + ] + }, + "output": { + "VolumeStatuses": [ + { + "VolumeStatus": { + "Status": "ok", + "Details": [ + { + "Status": "passed", + "Name": "io-enabled" + }, + { + "Status": "not-applicable", + "Name": "io-performance" + } + ] + }, + "AvailabilityZone": "us-east-1a", + "VolumeId": "vol-1234567890abcdef0", + "Actions": [], + "Events": [] + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -37966,6 +39554,36 @@ }, "traits": { "smithy.api#documentation": "

Describes the specified EBS volumes or all of your EBS volumes.

\n

If you are describing a long list of volumes, we recommend that you paginate the output to make the list\n more manageable. For more information, see Pagination.

\n

For more information about EBS volumes, see Amazon EBS volumes in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To describe all volumes", + "documentation": "This example describes all of your volumes in the default region.", + "output": { + "Volumes": [ + { + "AvailabilityZone": "us-east-1a", + "Attachments": [ + { + "AttachTime": "2013-12-18T22:35:00.000Z", + "InstanceId": "i-1234567890abcdef0", + "VolumeId": "vol-049df61146c4d7901", + "State": "attached", + "DeleteOnTermination": true, + "Device": "/dev/sda1" + } + ], + "VolumeType": "standard", + "VolumeId": "vol-049df61146c4d7901", + "State": "in-use", + "SnapshotId": "snap-1234567890abcdef0", + "CreateTime": "2013-12-18T22:35:00.084Z", + "Size": 8 + } + ], + "NextToken": "" + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -38219,7 +39837,23 @@ "target": "com.amazonaws.ec2#DescribeVpcAttributeResult" }, "traits": { - "smithy.api#documentation": "

Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.

" + "smithy.api#documentation": "

Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.

", + "smithy.api#examples": [ + { + "title": "To describe the enableDnsSupport attribute", + "documentation": "This example describes the enableDnsSupport attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not.", + "input": { + "VpcId": "vpc-a01106c2", + "Attribute": "enableDnsSupport" + }, + "output": { + "VpcId": "vpc-a01106c2", + "EnableDnsSupport": { + "Value": true + } + } + } + ] } }, "com.amazonaws.ec2#DescribeVpcAttributeRequest": { @@ -38305,7 +39939,7 @@ "target": "com.amazonaws.ec2#DescribeVpcClassicLinkResult" }, "traits": { - "smithy.api#documentation": "

Describes the ClassicLink status of one or more VPCs.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Describes the ClassicLink status of the specified VPCs.

" } }, "com.amazonaws.ec2#DescribeVpcClassicLinkDnsSupport": { @@ -38317,7 +39951,7 @@ "target": "com.amazonaws.ec2#DescribeVpcClassicLinkDnsSupportResult" }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Describes the ClassicLink DNS support status of one or more VPCs. If enabled, the DNS\n hostname of a linked EC2-Classic instance resolves to its private IP address when\n addressed from an instance in the VPC to which it's linked. Similarly, the DNS hostname\n of an instance in a VPC resolves to its private IP address when addressed from a linked\n EC2-Classic instance. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Describes the ClassicLink DNS support status of one or more VPCs. If enabled, the DNS\n hostname of a linked EC2-Classic instance resolves to its private IP address when\n addressed from an instance in the VPC to which it's linked. Similarly, the DNS hostname\n of an instance in a VPC resolves to its private IP address when addressed from a linked\n EC2-Classic instance.

", "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -38369,7 +40003,7 @@ "VpcIds": { "target": "com.amazonaws.ec2#VpcClassicLinkIdList", "traits": { - "smithy.api#documentation": "

One or more VPC IDs.

", + "smithy.api#documentation": "

The IDs of the VPCs.

", "smithy.api#xmlName": "VpcIds" } } @@ -38408,7 +40042,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n is-classic-link-enabled - Whether the VPC is enabled for ClassicLink\n\t\t\t\t\t (true | false).

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n is-classic-link-enabled - Whether the VPC is enabled for ClassicLink\n\t\t\t\t\t (true | false).

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -38425,7 +40059,7 @@ "VpcIds": { "target": "com.amazonaws.ec2#VpcClassicLinkIdList", "traits": { - "smithy.api#documentation": "

One or more VPCs for which you want to describe the ClassicLink status.

", + "smithy.api#documentation": "

The VPCs for which you want to describe the ClassicLink status.

", "smithy.api#xmlName": "VpcId" } } @@ -38441,7 +40075,7 @@ "target": "com.amazonaws.ec2#VpcClassicLinkList", "traits": { "aws.protocols#ec2QueryName": "VpcSet", - "smithy.api#documentation": "

The ClassicLink status of one or more VPCs.

", + "smithy.api#documentation": "

The ClassicLink status of the VPCs.

", "smithy.api#xmlName": "vpcSet" } } @@ -39038,7 +40672,7 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n accepter-vpc-info.cidr-block - The IPv4 CIDR block of the accepter\n VPC.

    \n
  • \n
  • \n

    \n accepter-vpc-info.owner-id - The ID of the Amazon Web Services account that owns the\n accepter VPC.

    \n
  • \n
  • \n

    \n accepter-vpc-info.vpc-id - The ID of the accepter VPC.

    \n
  • \n
  • \n

    \n expiration-time - The expiration date and time for the VPC peering\n connection.

    \n
  • \n
  • \n

    \n requester-vpc-info.cidr-block - The IPv4 CIDR block of the\n requester's VPC.

    \n
  • \n
  • \n

    \n requester-vpc-info.owner-id - The ID of the Amazon Web Services account that owns the\n requester VPC.

    \n
  • \n
  • \n

    \n requester-vpc-info.vpc-id - The ID of the requester VPC.

    \n
  • \n
  • \n

    \n status-code - The status of the VPC peering connection\n (pending-acceptance | failed |\n expired | provisioning | active |\n deleting | deleted |\n rejected).

    \n
  • \n
  • \n

    \n status-message - A message that provides more information about the status\n of the VPC peering connection, if applicable.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-peering-connection-id - The ID of the VPC peering connection.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n accepter-vpc-info.cidr-block - The IPv4 CIDR block of the accepter\n VPC.

    \n
  • \n
  • \n

    \n accepter-vpc-info.owner-id - The ID of the Amazon Web Services account that owns the\n accepter VPC.

    \n
  • \n
  • \n

    \n accepter-vpc-info.vpc-id - The ID of the accepter VPC.

    \n
  • \n
  • \n

    \n expiration-time - The expiration date and time for the VPC peering\n connection.

    \n
  • \n
  • \n

    \n requester-vpc-info.cidr-block - The IPv4 CIDR block of the\n requester's VPC.

    \n
  • \n
  • \n

    \n requester-vpc-info.owner-id - The ID of the Amazon Web Services account that owns the\n requester VPC.

    \n
  • \n
  • \n

    \n requester-vpc-info.vpc-id - The ID of the requester VPC.

    \n
  • \n
  • \n

    \n status-code - The status of the VPC peering connection\n (pending-acceptance | failed |\n expired | provisioning | active |\n deleting | deleted |\n rejected).

    \n
  • \n
  • \n

    \n status-message - A message that provides more information about the status\n of the VPC peering connection, if applicable.

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-peering-connection-id - The ID of the VPC peering connection.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, @@ -39055,7 +40689,7 @@ "VpcPeeringConnectionIds": { "target": "com.amazonaws.ec2#VpcPeeringConnectionIdList", "traits": { - "smithy.api#documentation": "

One or more VPC peering connection IDs.

\n

Default: Describes all your VPC peering connections.

", + "smithy.api#documentation": "

The IDs of the VPC peering connections.

\n

Default: Describes all your VPC peering connections.

", "smithy.api#xmlName": "VpcPeeringConnectionId" } }, @@ -39112,6 +40746,35 @@ }, "traits": { "smithy.api#documentation": "

Describes one or more of your VPCs.

", + "smithy.api#examples": [ + { + "title": "To describe a VPC", + "documentation": "This example describes the specified VPC.", + "input": { + "VpcIds": [ + "vpc-a01106c2" + ] + }, + "output": { + "Vpcs": [ + { + "VpcId": "vpc-a01106c2", + "InstanceTenancy": "default", + "Tags": [ + { + "Value": "MyVPC", + "Key": "Name" + } + ], + "State": "available", + "DhcpOptionsId": "dopt-7a8b9c2d", + "CidrBlock": "10.0.0.0/16", + "IsDefault": false + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -39173,14 +40836,14 @@ "Filters": { "target": "com.amazonaws.ec2#FilterList", "traits": { - "smithy.api#documentation": "

One or more filters.

\n
    \n
  • \n

    \n cidr - The primary IPv4 CIDR block of the VPC. The CIDR block you\n specify must exactly match the VPC's CIDR block for information to be returned\n for the VPC. Must contain the slash followed by one or two digits (for example,\n /28).

    \n
  • \n
  • \n

    \n cidr-block-association.cidr-block - An IPv4 CIDR block associated with the\n VPC.

    \n
  • \n
  • \n

    \n cidr-block-association.association-id - The association ID for\n an IPv4 CIDR block associated with the VPC.

    \n
  • \n
  • \n

    \n cidr-block-association.state - The state of an IPv4 CIDR block\n associated with the VPC.

    \n
  • \n
  • \n

    \n dhcp-options-id - The ID of a set of DHCP options.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR\n block associated with the VPC.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.ipv6-pool - The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.association-id - The association\n ID for an IPv6 CIDR block associated with the VPC.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.state - The state of an IPv6 CIDR\n block associated with the VPC.

    \n
  • \n
  • \n

    \n is-default - Indicates whether the VPC is the default VPC.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the VPC.

    \n
  • \n
  • \n

    \n state - The state of the VPC (pending | available).

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC.

    \n
  • \n
", + "smithy.api#documentation": "

The filters.

\n
    \n
  • \n

    \n cidr - The primary IPv4 CIDR block of the VPC. The CIDR block you\n specify must exactly match the VPC's CIDR block for information to be returned\n for the VPC. Must contain the slash followed by one or two digits (for example,\n /28).

    \n
  • \n
  • \n

    \n cidr-block-association.cidr-block - An IPv4 CIDR block associated with the\n VPC.

    \n
  • \n
  • \n

    \n cidr-block-association.association-id - The association ID for\n an IPv4 CIDR block associated with the VPC.

    \n
  • \n
  • \n

    \n cidr-block-association.state - The state of an IPv4 CIDR block\n associated with the VPC.

    \n
  • \n
  • \n

    \n dhcp-options-id - The ID of a set of DHCP options.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR\n block associated with the VPC.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.ipv6-pool - The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.association-id - The association\n ID for an IPv6 CIDR block associated with the VPC.

    \n
  • \n
  • \n

    \n ipv6-cidr-block-association.state - The state of an IPv6 CIDR\n block associated with the VPC.

    \n
  • \n
  • \n

    \n is-default - Indicates whether the VPC is the default VPC.

    \n
  • \n
  • \n

    \n owner-id - The ID of the Amazon Web Services account that owns the VPC.

    \n
  • \n
  • \n

    \n state - The state of the VPC (pending | available).

    \n
  • \n
  • \n

    \n tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value.\n For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    \n
  • \n
  • \n

    \n tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    \n
  • \n
  • \n

    \n vpc-id - The ID of the VPC.

    \n
  • \n
", "smithy.api#xmlName": "Filter" } }, "VpcIds": { "target": "com.amazonaws.ec2#VpcIdStringList", "traits": { - "smithy.api#documentation": "

One or more VPC IDs.

\n

Default: Describes all your VPCs.

", + "smithy.api#documentation": "

The IDs of the VPCs.

\n

Default: Describes all your VPCs.

", "smithy.api#xmlName": "VpcId" } }, @@ -39515,7 +41178,7 @@ "target": "com.amazonaws.ec2#DetachClassicLinkVpcResult" }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, the VPC security groups are no longer associated with it. An instance is automatically unlinked from a VPC when it's stopped.

" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, \n\t\t the VPC security groups are no longer associated with it. An instance is automatically unlinked from \n\t\t a VPC when it's stopped.

" } }, "com.amazonaws.ec2#DetachClassicLinkVpcRequest": { @@ -39759,7 +41422,23 @@ "target": "com.amazonaws.ec2#VolumeAttachment" }, "traits": { - "smithy.api#documentation": "

Detaches an EBS volume from an instance. Make sure to unmount any file systems on the\n device within your operating system before detaching the volume. Failure to do so can result\n in the volume becoming stuck in the busy state while detaching. If this happens,\n detachment can be delayed indefinitely until you unmount the volume, force detachment, reboot\n the instance, or all three. If an EBS volume is the root device of an instance, it can't be\n detached while the instance is running. To detach the root volume, stop the instance\n first.

\n

When a volume with an Amazon Web Services Marketplace product code is detached from an instance, the\n product code is no longer associated with the instance.

\n

For more information, see Detach an Amazon EBS volume in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Detaches an EBS volume from an instance. Make sure to unmount any file systems on the\n device within your operating system before detaching the volume. Failure to do so can result\n in the volume becoming stuck in the busy state while detaching. If this happens,\n detachment can be delayed indefinitely until you unmount the volume, force detachment, reboot\n the instance, or all three. If an EBS volume is the root device of an instance, it can't be\n detached while the instance is running. To detach the root volume, stop the instance\n first.

\n

When a volume with an Amazon Web Services Marketplace product code is detached from an instance, the\n product code is no longer associated with the instance.

\n

For more information, see Detach an Amazon EBS volume in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To detach a volume from an instance", + "documentation": "This example detaches the volume (``vol-049df61146c4d7901``) from the instance it is attached to.", + "input": { + "VolumeId": "vol-1234567890abcdef0" + }, + "output": { + "AttachTime": "2014-02-27T19:23:06.000Z", + "InstanceId": "i-1234567890abcdef0", + "VolumeId": "vol-049df61146c4d7901", + "State": "detaching", + "Device": "/dev/sdb" + } + } + ] } }, "com.amazonaws.ec2#DetachVolumeRequest": { @@ -39920,7 +41599,7 @@ "target": "com.amazonaws.ec2#DhcpConfigurationValueList", "traits": { "aws.protocols#ec2QueryName": "ValueSet", - "smithy.api#documentation": "

One or more values for the DHCP option.

", + "smithy.api#documentation": "

The values for the DHCP option.

", "smithy.api#xmlName": "valueSet" } } @@ -39954,7 +41633,7 @@ "target": "com.amazonaws.ec2#DhcpConfigurationList", "traits": { "aws.protocols#ec2QueryName": "DhcpConfigurationSet", - "smithy.api#documentation": "

One or more DHCP options in the set.

", + "smithy.api#documentation": "

The DHCP options in the set.

", "smithy.api#xmlName": "dhcpConfigurationSet" } }, @@ -39984,7 +41663,7 @@ } }, "traits": { - "smithy.api#documentation": "

Describes a set of DHCP options.

" + "smithy.api#documentation": "

The set of DHCP options.

" } }, "com.amazonaws.ec2#DhcpOptionsId": { @@ -40824,7 +42503,17 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Disables a virtual private gateway (VGW) from propagating routes to a specified route\n table of a VPC.

" + "smithy.api#documentation": "

Disables a virtual private gateway (VGW) from propagating routes to a specified route\n table of a VPC.

", + "smithy.api#examples": [ + { + "title": "To disable route propagation", + "documentation": "This example disables the specified virtual private gateway from propagating static routes to the specified route table.", + "input": { + "RouteTableId": "rtb-22574640", + "GatewayId": "vgw-9a4cacf3" + } + } + ] } }, "com.amazonaws.ec2#DisableVgwRoutePropagationRequest": { @@ -40869,7 +42558,7 @@ "target": "com.amazonaws.ec2#DisableVpcClassicLinkResult" }, "traits": { - "smithy.api#documentation": "

Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC that has EC2-Classic instances linked to it.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC that has EC2-Classic instances\n linked to it.

" } }, "com.amazonaws.ec2#DisableVpcClassicLinkDnsSupport": { @@ -40881,7 +42570,7 @@ "target": "com.amazonaws.ec2#DisableVpcClassicLinkDnsSupportResult" }, "traits": { - "smithy.api#documentation": "

Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve to\n\t\t\tpublic IP addresses when addressed between a linked EC2-Classic instance and instances\n\t\t\tin the VPC to which it's linked. For more information, see ClassicLink in the\n\t\t\t\tAmazon Elastic Compute Cloud User Guide.

\n

You must specify a VPC ID in the request.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve to\n\t\t\tpublic IP addresses when addressed between a linked EC2-Classic instance and instances\n\t\t\tin the VPC to which it's linked.

\n

You must specify a VPC ID in the request.

" } }, "com.amazonaws.ec2#DisableVpcClassicLinkDnsSupportRequest": { @@ -40972,7 +42661,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Disassociates an Elastic IP address from the instance or network interface it's associated with.

\n

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

" + "smithy.api#documentation": "

Disassociates an Elastic IP address from the instance or network interface it's associated with.

\n

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

", + "smithy.api#examples": [ + { + "title": "To disassociate an Elastic IP address", + "documentation": "This example disassociates an Elastic IP address from an instance.", + "input": { + "AssociationId": "eipassoc-2bebb745" + } + } + ] } }, "com.amazonaws.ec2#DisassociateAddressRequest": { @@ -41144,7 +42842,27 @@ "target": "com.amazonaws.ec2#DisassociateIamInstanceProfileResult" }, "traits": { - "smithy.api#documentation": "

Disassociates an IAM instance profile from a running or stopped instance.

\n

Use DescribeIamInstanceProfileAssociations to get the association\n ID.

" + "smithy.api#documentation": "

Disassociates an IAM instance profile from a running or stopped instance.

\n

Use DescribeIamInstanceProfileAssociations to get the association\n ID.

", + "smithy.api#examples": [ + { + "title": "To disassociate an IAM instance profile", + "documentation": "This example disassociates the specified IAM instance profile from an instance.", + "input": { + "AssociationId": "iip-assoc-05020b59952902f5f" + }, + "output": { + "IamInstanceProfileAssociation": { + "InstanceId": "i-123456789abcde123", + "State": "disassociating", + "AssociationId": "iip-assoc-05020b59952902f5f", + "IamInstanceProfile": { + "Id": "AIPAI5IVIHMFFYY2DKV5Y", + "Arn": "arn:aws:iam::123456789012:instance-profile/admin-role" + } + } + } + } + ] } }, "com.amazonaws.ec2#DisassociateIamInstanceProfileRequest": { @@ -41300,7 +43018,7 @@ "target": "com.amazonaws.ec2#DisassociateNatGatewayAddressResult" }, "traits": { - "smithy.api#documentation": "

Disassociates secondary Elastic IP addresses (EIPs) from a public NAT gateway. You cannot disassociate your primary EIP. For more information, see Edit secondary IP address associations in the Amazon Virtual Private Cloud User Guide.

\n

While disassociating is in progress, you cannot associate/disassociate additional EIPs while the connections are being drained. You are, however, allowed to delete the NAT gateway.

\n

An EIP will only be released at the end of MaxDrainDurationSeconds. The EIPs stay\n associated and support the existing connections but do not support any new connections\n (new connections are distributed across the remaining associated EIPs). As the existing\n connections drain out, the EIPs (and the corresponding private IPs mapped to them) get\n released.

" + "smithy.api#documentation": "

Disassociates secondary Elastic IP addresses (EIPs) from a public NAT gateway. \n You cannot disassociate your primary EIP. For more information, see Edit secondary IP address associations in the Amazon VPC User Guide.

\n

While disassociating is in progress, you cannot associate/disassociate additional EIPs while the connections are being drained. You are, however, allowed to delete the NAT gateway.

\n

An EIP is released only at the end of MaxDrainDurationSeconds. It stays\n associated and supports the existing connections but does not support any new connections\n (new connections are distributed across the remaining associated EIPs). As the existing\n connections drain out, the EIPs (and the corresponding private IP addresses mapped to them) \n are released.

" } }, "com.amazonaws.ec2#DisassociateNatGatewayAddressRequest": { @@ -41310,7 +43028,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#required": {} } }, @@ -41351,7 +43069,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "aws.protocols#ec2QueryName": "NatGatewayId", - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#xmlName": "natGatewayId" } }, @@ -41377,7 +43095,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Disassociates a subnet or gateway from a route table.

\n

After you perform this action, the subnet no longer uses the routes in the route table.\n\t\t\t\tInstead, it uses the routes in the VPC's main route table. For more information\n\t\t\t\tabout route tables, see Route\n\t\t\t\ttables in the Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Disassociates a subnet or gateway from a route table.

\n

After you perform this action, the subnet no longer uses the routes in the route table.\n\t\t\t\tInstead, it uses the routes in the VPC's main route table. For more information\n\t\t\t\tabout route tables, see Route\n\t\t\t\ttables in the Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#DisassociateRouteTableRequest": { @@ -42309,7 +44027,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "OutpostArn", - "smithy.api#documentation": "

The ARN of the Outpost on which the snapshot is stored.

\n

This parameter is only supported on BlockDeviceMapping objects called by\n \n CreateImage.

", + "smithy.api#documentation": "

The ARN of the Outpost on which the snapshot is stored.

\n

This parameter is not supported when using CreateImage.

", "smithy.api#xmlName": "outpostArn" } }, @@ -44071,7 +45789,17 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Enables a virtual private gateway (VGW) to propagate routes to the specified route\n table of a VPC.

" + "smithy.api#documentation": "

Enables a virtual private gateway (VGW) to propagate routes to the specified route\n table of a VPC.

", + "smithy.api#examples": [ + { + "title": "To enable route propagation", + "documentation": "This example enables the specified virtual private gateway to propagate static routes to the specified route table.", + "input": { + "RouteTableId": "rtb-22574640", + "GatewayId": "vgw-9a4cacf3" + } + } + ] } }, "com.amazonaws.ec2#EnableVgwRoutePropagationRequest": { @@ -44156,7 +45884,7 @@ "target": "com.amazonaws.ec2#EnableVpcClassicLinkResult" }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Enables a VPC for ClassicLink. You can then link EC2-Classic instances to your\n\t\t\tClassicLink-enabled VPC to allow communication over private IP addresses. You cannot\n\t\t\tenable your VPC for ClassicLink if any of your VPC route tables have existing routes for\n\t\t\taddress ranges within the 10.0.0.0/8 IP address range, excluding local\n\t\t\troutes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 IP address\n\t\t\tranges. For more information, see ClassicLink in the\n\t\t\t\tAmazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Enables a VPC for ClassicLink. You can then link EC2-Classic instances to your\n\t\t\tClassicLink-enabled VPC to allow communication over private IP addresses. You cannot\n\t\t\tenable your VPC for ClassicLink if any of your VPC route tables have existing routes for\n\t\t\taddress ranges within the 10.0.0.0/8 IP address range, excluding local\n\t\t\troutes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 IP address\n\t\t\tranges.

" } }, "com.amazonaws.ec2#EnableVpcClassicLinkDnsSupport": { @@ -44168,7 +45896,7 @@ "target": "com.amazonaws.ec2#EnableVpcClassicLinkDnsSupportResult" }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Enables a VPC to support DNS hostname resolution for ClassicLink. If enabled, the DNS\n\t\t\thostname of a linked EC2-Classic instance resolves to its private IP address when\n\t\t\taddressed from an instance in the VPC to which it's linked. Similarly, the DNS hostname\n\t\t\tof an instance in a VPC resolves to its private IP address when addressed from a linked\n\t\t\tEC2-Classic instance. For more information, see ClassicLink in the\n\t\t\t\tAmazon Elastic Compute Cloud User Guide.

\n

You must specify a VPC ID in the request.

" + "smithy.api#documentation": "\n

This action is deprecated.

\n
\n

Enables a VPC to support DNS hostname resolution for ClassicLink. If enabled, the DNS\n\t\t\thostname of a linked EC2-Classic instance resolves to its private IP address when\n\t\t\taddressed from an instance in the VPC to which it's linked. Similarly, the DNS hostname\n\t\t\tof an instance in a VPC resolves to its private IP address when addressed from a linked\n\t\t\tEC2-Classic instance.

\n

You must specify a VPC ID in the request.

" } }, "com.amazonaws.ec2#EnableVpcClassicLinkDnsSupportRequest": { @@ -44465,7 +46193,7 @@ "min": 1, "max": 30 }, - "smithy.api#pattern": "^[a-zA-Z0-9\\.\\*]+$" + "smithy.api#pattern": "^[a-zA-Z0-9\\.\\*\\-]+$" } }, "com.amazonaws.ec2#ExcludedInstanceTypeSet": { @@ -46719,7 +48447,7 @@ "target": "com.amazonaws.ec2#ImageId", "traits": { "aws.protocols#ec2QueryName": "ImageId", - "smithy.api#documentation": "

The ID of the AMI. An AMI is required to launch an instance. The AMI ID must be specified here or in the launch template.

", + "smithy.api#documentation": "

The ID of the AMI. An AMI is required to launch an instance. This parameter is only\n available for fleets of type instant. For fleets of type maintain\n and request, you must specify the AMI ID in the launch template.

", "smithy.api#xmlName": "imageId" } } @@ -46804,7 +48532,7 @@ "ImageId": { "target": "com.amazonaws.ec2#ImageId", "traits": { - "smithy.api#documentation": "

The ID of the AMI. An AMI is required to launch an instance. The AMI ID must be specified here or in the launch template.

" + "smithy.api#documentation": "

The ID of the AMI. An AMI is required to launch an instance. This parameter is only\n available for fleets of type instant. For fleets of type maintain\n and request, you must specify the AMI ID in the launch template.

" } } }, @@ -48163,7 +49891,21 @@ "target": "com.amazonaws.ec2#GetConsoleOutputResult" }, "traits": { - "smithy.api#documentation": "

Gets the console output for the specified instance. For Linux instances, the instance\n console output displays the exact console output that would normally be displayed on a\n physical monitor attached to a computer. For Windows instances, the instance console\n output includes the last three system event log errors.

\n

By default, the console output returns buffered information that was posted shortly\n after an instance transition state (start, stop, reboot, or terminate). This information\n is available for at least one hour after the most recent post. Only the most recent 64\n KB of console output is available.

\n

You can optionally retrieve the latest serial console output at any time during the\n instance lifecycle. This option is supported on instance types that use the Nitro\n hypervisor.

\n

For more information, see Instance\n console output in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Gets the console output for the specified instance. For Linux instances, the instance\n console output displays the exact console output that would normally be displayed on a\n physical monitor attached to a computer. For Windows instances, the instance console\n output includes the last three system event log errors.

\n

By default, the console output returns buffered information that was posted shortly\n after an instance transition state (start, stop, reboot, or terminate). This information\n is available for at least one hour after the most recent post. Only the most recent 64\n KB of console output is available.

\n

You can optionally retrieve the latest serial console output at any time during the\n instance lifecycle. This option is supported on instance types that use the Nitro\n hypervisor.

\n

For more information, see Instance\n console output in the Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To get the console output", + "documentation": "This example gets the console output for the specified instance.", + "input": { + "InstanceId": "i-1234567890abcdef0" + }, + "output": { + "InstanceId": "i-1234567890abcdef0", + "Output": "...", + "Timestamp": "2018-05-25T21:23:53.000Z" + } + } + ] } }, "com.amazonaws.ec2#GetConsoleOutputRequest": { @@ -48436,6 +50178,14 @@ "smithy.api#documentation": "

Indicates whether encryption by default is enabled.

", "smithy.api#xmlName": "ebsEncryptionByDefault" } + }, + "SseType": { + "target": "com.amazonaws.ec2#SSEType", + "traits": { + "aws.protocols#ec2QueryName": "SseType", + "smithy.api#documentation": "

Reserved for future use.

", + "smithy.api#xmlName": "sseType" + } } }, "traits": { @@ -48451,7 +50201,7 @@ "target": "com.amazonaws.ec2#GetFlowLogsIntegrationTemplateResult" }, "traits": { - "smithy.api#documentation": "

Generates a CloudFormation template that streamlines and automates the integration of VPC flow logs \n with Amazon Athena. This make it easier for you to query and gain insights from VPC flow logs data. \n Based on the information that you provide, we configure resources in the template to do the following:

\n
    \n
  • \n

    Create a table in Athena that maps fields to a custom log format

    \n
  • \n
  • \n

    Create a Lambda function that updates the table with new partitions on a daily, weekly, or\n monthly basis

    \n
  • \n
  • \n

    Create a table partitioned between two timestamps in the past

    \n
  • \n
  • \n

    Create a set of named queries in Athena that you can use to get started quickly

    \n
  • \n
" + "smithy.api#documentation": "

Generates a CloudFormation template that streamlines and automates the integration of VPC flow logs \n with Amazon Athena. This make it easier for you to query and gain insights from VPC flow logs data. \n Based on the information that you provide, we configure resources in the template to do the following:

\n
    \n
  • \n

    Create a table in Athena that maps fields to a custom log format

    \n
  • \n
  • \n

    Create a Lambda function that updates the table with new partitions on a daily, weekly, or\n monthly basis

    \n
  • \n
  • \n

    Create a table partitioned between two timestamps in the past

    \n
  • \n
  • \n

    Create a set of named queries in Athena that you can use to get started quickly

    \n
  • \n
\n \n

\n GetFlowLogsIntegrationTemplate does not support integration between\n Amazon Web Services Transit Gateway Flow Logs and Amazon Athena.

\n
" } }, "com.amazonaws.ec2#GetFlowLogsIntegrationTemplateRequest": { @@ -49448,7 +51198,66 @@ "target": "com.amazonaws.ec2#GetLaunchTemplateDataResult" }, "traits": { - "smithy.api#documentation": "

Retrieves the configuration data of the specified instance. You can use this data to\n create a launch template.

\n

This action calls on other describe actions to get instance information. Depending on\n your instance configuration, you may need to allow the following actions in your IAM\n policy: DescribeSpotInstanceRequests,\n DescribeInstanceCreditSpecifications, DescribeVolumes,\n DescribeInstanceAttribute, and DescribeElasticGpus. Or,\n you can allow describe* depending on your instance requirements.

" + "smithy.api#documentation": "

Retrieves the configuration data of the specified instance. You can use this data to\n create a launch template.

\n

This action calls on other describe actions to get instance information. Depending on\n your instance configuration, you may need to allow the following actions in your IAM\n policy: DescribeSpotInstanceRequests,\n DescribeInstanceCreditSpecifications, DescribeVolumes,\n DescribeInstanceAttribute, and DescribeElasticGpus. Or,\n you can allow describe* depending on your instance requirements.

", + "smithy.api#examples": [ + { + "title": "To get the launch template data for an instance ", + "documentation": "This example gets the launch template data for the specified instance.", + "input": { + "InstanceId": "0123d646e8048babc" + }, + "output": { + "LaunchTemplateData": { + "NetworkInterfaces": [ + { + "DeviceIndex": 0, + "Groups": [ + "sg-d14e1bb4" + ], + "Ipv6Addresses": [], + "AssociatePublicIpAddress": false, + "NetworkInterfaceId": "eni-4338b5a9", + "DeleteOnTermination": true, + "Description": "", + "PrivateIpAddress": "10.0.3.233", + "SubnetId": "subnet-5264e837", + "PrivateIpAddresses": [ + { + "PrivateIpAddress": "10.0.3.233", + "Primary": true + } + ] + } + ], + "Placement": { + "GroupName": "", + "Tenancy": "default", + "AvailabilityZone": "us-east-2b" + }, + "InstanceType": "t2.medium", + "EbsOptimized": false, + "BlockDeviceMappings": [ + { + "Ebs": { + "VolumeType": "gp2", + "Encrypted": false, + "Iops": 100, + "VolumeSize": 8, + "SnapshotId": "snap-02594938353ef77d3", + "DeleteOnTermination": true + }, + "DeviceName": "/dev/xvda" + } + ], + "KeyName": "my-key-pair", + "ImageId": "ami-32cf7b4a", + "Monitoring": { + "Enabled": false + } + } + } + } + ] } }, "com.amazonaws.ec2#GetLaunchTemplateDataRequest": { @@ -51429,13 +53238,13 @@ "aws.protocols#ec2QueryName": "Configured", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If this parameter is set to true, your instance is enabled for\n hibernation; otherwise, it is not enabled for hibernation.

", + "smithy.api#documentation": "

If true, your instance is enabled for hibernation; otherwise, it is not\n enabled for hibernation.

", "smithy.api#xmlName": "configured" } } }, "traits": { - "smithy.api#documentation": "

Indicates whether your instance is configured for hibernation. This parameter is valid\n only if the instance meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Indicates whether your instance is configured for hibernation. This parameter is valid\n only if the instance meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

" } }, "com.amazonaws.ec2#HibernationOptionsRequest": { @@ -51446,12 +53255,12 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If you set this parameter to true, your instance is enabled for\n hibernation.

\n

Default: false\n

" + "smithy.api#documentation": "

Set to true to enable your instance for hibernation.

\n

Default: false\n

" } } }, "traits": { - "smithy.api#documentation": "

Indicates whether your instance is configured for hibernation. This parameter is valid\n only if the instance meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Indicates whether your instance is configured for hibernation. This parameter is valid\n only if the instance meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

" } }, "com.amazonaws.ec2#HistoryRecord": { @@ -51692,6 +53501,14 @@ "smithy.api#documentation": "

Indicates whether host maintenance is enabled or disabled for the Dedicated\n Host.

", "smithy.api#xmlName": "hostMaintenance" } + }, + "AssetId": { + "target": "com.amazonaws.ec2#AssetId", + "traits": { + "aws.protocols#ec2QueryName": "AssetId", + "smithy.api#documentation": "

The ID of the Outpost hardware asset on which the Dedicated Host is allocated.

", + "smithy.api#xmlName": "assetId" + } } }, "traits": { @@ -53250,7 +55067,7 @@ "KmsKeyId": { "target": "com.amazonaws.ec2#KmsKeyId", "traits": { - "smithy.api#documentation": "

An identifier for the symmetric KMS key to use when creating the\n encrypted AMI. This parameter is only required if you want to use a non-default KMS key; if this\n parameter is not specified, the default KMS key for EBS is used. If a KmsKeyId is\n specified, the Encrypted flag must also be set.

\n

The KMS key identifier may be provided in any of the following formats:

\n
    \n
  • \n

    Key ID

    \n
  • \n
  • \n

    Key alias. The alias ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

    \n
  • \n
  • \n

    ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the key namespace, and then the key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

    \n
  • \n
  • \n

    ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

    \n
  • \n
\n

Amazon Web Services parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even\n though you provided an invalid identifier. This action will eventually report failure.

\n

The specified KMS key must exist in the Region that the AMI is being copied to.

\n

Amazon EBS does not support asymmetric KMS keys.

" + "smithy.api#documentation": "

An identifier for the symmetric KMS key to use when creating the\n encrypted AMI. This parameter is only required if you want to use a non-default KMS key; if this\n parameter is not specified, the default KMS key for EBS is used. If a KmsKeyId is\n specified, the Encrypted flag must also be set.

\n

The KMS key identifier may be provided in any of the following formats:

\n
    \n
  • \n

    Key ID

    \n
  • \n
  • \n

    Key alias

    \n
  • \n
  • \n

    ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the key namespace, and then the key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

    \n
  • \n
  • \n

    ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

    \n
  • \n
\n

Amazon Web Services parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even\n though you provided an invalid identifier. This action will eventually report failure.

\n

The specified KMS key must exist in the Region that the AMI is being copied to.

\n

Amazon EBS does not support asymmetric KMS keys.

" } }, "LicenseType": { @@ -53262,7 +55079,7 @@ "Platform": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The operating system of the virtual machine.

\n

Valid values: Windows | Linux\n

" + "smithy.api#documentation": "

The operating system of the virtual machine. If you import a VM that is compatible with\n Unified Extensible Firmware Interface (UEFI) using an EBS snapshot, you must specify a value for\n the platform.

\n

Valid values: Windows | Linux\n

" } }, "RoleName": { @@ -53606,7 +55423,7 @@ "target": "com.amazonaws.ec2#ImportInstanceResult" }, "traits": { - "smithy.api#documentation": "

Creates an import instance task using metadata from the specified disk image.

\n

This API action supports only single-volume VMs. To import multi-volume VMs, use ImportImage\n instead.

\n

This API action is not supported by the Command Line Interface (CLI). For \n information about using the Amazon EC2 CLI, which is deprecated, see\n Importing a VM to Amazon EC2 in the Amazon EC2 CLI Reference PDF file.

\n

For information about the import manifest referenced by this API action, see VM Import Manifest.

" + "smithy.api#documentation": "\n

We recommend that you use the \n ImportImage\n \n API. For more information, see Importing a VM as an image using VM\n Import/Export in the VM Import/Export User Guide.

\n
\n

Creates an import instance task using metadata from the specified disk image.

\n

This API action is not supported by the Command Line Interface (CLI). For\n information about using the Amazon EC2 CLI, which is deprecated, see Importing\n a VM to Amazon EC2 in the Amazon EC2 CLI Reference PDF file.

\n

This API action supports only single-volume VMs. To import multi-volume VMs, use ImportImage\n instead.

\n

For information about the import manifest referenced by this API action, see VM Import Manifest.

" } }, "com.amazonaws.ec2#ImportInstanceLaunchSpecification": { @@ -54049,7 +55866,7 @@ "KmsKeyId": { "target": "com.amazonaws.ec2#KmsKeyId", "traits": { - "smithy.api#documentation": "

An identifier for the symmetric KMS key to use when creating the\n encrypted snapshot. This parameter is only required if you want to use a non-default KMS key; if this\n parameter is not specified, the default KMS key for EBS is used. If a KmsKeyId is\n specified, the Encrypted flag must also be set.

\n

The KMS key identifier may be provided in any of the following formats:

\n
    \n
  • \n

    Key ID

    \n
  • \n
  • \n

    Key alias. The alias ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

    \n
  • \n
  • \n

    ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the key namespace, and then the key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

    \n
  • \n
  • \n

    ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

    \n
  • \n
\n

Amazon Web Services parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even\n though you provided an invalid identifier. This action will eventually report failure.

\n

The specified KMS key must exist in the Region that the snapshot is being copied to.

\n

Amazon EBS does not support asymmetric KMS keys.

" + "smithy.api#documentation": "

An identifier for the symmetric KMS key to use when creating the\n encrypted snapshot. This parameter is only required if you want to use a non-default KMS key; if this\n parameter is not specified, the default KMS key for EBS is used. If a KmsKeyId is\n specified, the Encrypted flag must also be set.

\n

The KMS key identifier may be provided in any of the following formats:

\n
    \n
  • \n

    Key ID

    \n
  • \n
  • \n

    Key alias

    \n
  • \n
  • \n

    ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the key namespace, and then the key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

    \n
  • \n
  • \n

    ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

    \n
  • \n
\n

Amazon Web Services parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even\n though you provided an invalid identifier. This action will eventually report failure.

\n

The specified KMS key must exist in the Region that the snapshot is being copied to.

\n

Amazon EBS does not support asymmetric KMS keys.

" } }, "RoleName": { @@ -54327,6 +56144,14 @@ "smithy.api#documentation": "

Describes the Inference accelerators for the instance type.

", "smithy.api#xmlName": "accelerators" } + }, + "TotalInferenceMemoryInMiB": { + "target": "com.amazonaws.ec2#totalInferenceMemory", + "traits": { + "aws.protocols#ec2QueryName": "TotalInferenceMemoryInMiB", + "smithy.api#documentation": "

The total size of the memory for the inference accelerators for the instance type, in MiB.

", + "smithy.api#xmlName": "totalInferenceMemoryInMiB" + } } }, "traits": { @@ -54362,6 +56187,14 @@ "smithy.api#documentation": "

The manufacturer of the Inference accelerator.

", "smithy.api#xmlName": "manufacturer" } + }, + "MemoryInfo": { + "target": "com.amazonaws.ec2#InferenceDeviceMemoryInfo", + "traits": { + "aws.protocols#ec2QueryName": "MemoryInfo", + "smithy.api#documentation": "

Describes the memory available to the inference accelerator.

", + "smithy.api#xmlName": "memoryInfo" + } } }, "traits": { @@ -54377,6 +56210,25 @@ "com.amazonaws.ec2#InferenceDeviceManufacturerName": { "type": "string" }, + "com.amazonaws.ec2#InferenceDeviceMemoryInfo": { + "type": "structure", + "members": { + "SizeInMiB": { + "target": "com.amazonaws.ec2#InferenceDeviceMemorySize", + "traits": { + "aws.protocols#ec2QueryName": "SizeInMiB", + "smithy.api#documentation": "

The size of the memory available to the inference accelerator, in MiB.

", + "smithy.api#xmlName": "sizeInMiB" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes the memory available to the inference accelerator.

" + } + }, + "com.amazonaws.ec2#InferenceDeviceMemorySize": { + "type": "integer" + }, "com.amazonaws.ec2#InferenceDeviceName": { "type": "string" }, @@ -55902,6 +57754,16 @@ "smithy.api#documentation": "

The IPv6 address.

", "smithy.api#xmlName": "ipv6Address" } + }, + "IsPrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "aws.protocols#ec2QueryName": "IsPrimaryIpv6", + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

Determines if an IPv6 address associated with a network interface is the primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. \n For more information, see RunInstances.

", + "smithy.api#xmlName": "isPrimaryIpv6" + } } }, "traits": { @@ -56706,6 +58568,14 @@ "smithy.api#default": 0, "smithy.api#documentation": "

The number of IPv6 delegated prefixes to be automatically assigned to the network interface. \n You cannot use this option if you use the Ipv6Prefix option.

" } + }, + "PrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

The primary IPv6 address of the network interface. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. For more information about primary IPv6 addresses, see RunInstances.

" + } } }, "traits": { @@ -56967,7 +58837,7 @@ } }, "traits": { - "smithy.api#documentation": "

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will\n identify instance types with these attributes.

\n

When you specify multiple attributes, you get instance types that satisfy all of the\n specified attributes. If you specify multiple values for an attribute, you get instance\n types that satisfy any of the specified values.

\n

To limit the list of instance types from which Amazon EC2 can identify matching instance types, \n you can use one of the following parameters, but not both in the same request:

\n
    \n
  • \n

    \n AllowedInstanceTypes - The instance types to include in the list. All \n other instance types are ignored, even if they match your specified attributes.

    \n
  • \n
  • \n

    \n ExcludedInstanceTypes - The instance types to exclude from the list, \n even if they match your specified attributes.

    \n
  • \n
\n \n

You must specify VCpuCount and MemoryMiB. All other attributes\n are optional. Any unspecified optional attribute is set to its default.

\n
\n

For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot\n placement score in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will\n identify instance types with these attributes.

\n

You must specify VCpuCount and MemoryMiB. All other attributes\n are optional. Any unspecified optional attribute is set to its default.

\n

When you specify multiple attributes, you get instance types that satisfy all of the\n specified attributes. If you specify multiple values for an attribute, you get instance\n types that satisfy any of the specified values.

\n

To limit the list of instance types from which Amazon EC2 can identify matching instance types, \n you can use one of the following parameters, but not both in the same request:

\n
    \n
  • \n

    \n AllowedInstanceTypes - The instance types to include in the list. All \n other instance types are ignored, even if they match your specified attributes.

    \n
  • \n
  • \n

    \n ExcludedInstanceTypes - The instance types to exclude from the list, \n even if they match your specified attributes.

    \n
  • \n
\n \n

If you specify InstanceRequirements, you can't specify\n InstanceType.

\n

Attribute-based instance type selection is only supported when using Auto Scaling\n groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in\n the launch instance\n wizard or with the RunInstances API, you\n can't specify InstanceRequirements.

\n
\n

For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot\n placement score in the Amazon EC2 User Guide.

" } }, "com.amazonaws.ec2#InstanceRequirementsRequest": { @@ -57119,7 +58989,7 @@ "NetworkBandwidthGbps": { "target": "com.amazonaws.ec2#NetworkBandwidthGbpsRequest", "traits": { - "smithy.api#documentation": "

The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).

\n

Default: No minimum or maximum limits

" + "smithy.api#documentation": "

The minimum and maximum amount of baseline network bandwidth, in gigabits per second \n (Gbps). For more information, see Amazon EC2 instance network bandwidth in the Amazon EC2 User Guide.

\n

Default: No minimum or maximum limits

" } }, "AllowedInstanceTypes": { @@ -57131,7 +59001,7 @@ } }, "traits": { - "smithy.api#documentation": "

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will\n identify instance types with these attributes.

\n

When you specify multiple attributes, you get instance types that satisfy all of the\n specified attributes. If you specify multiple values for an attribute, you get instance\n types that satisfy any of the specified values.

\n

To limit the list of instance types from which Amazon EC2 can identify matching instance types, \n you can use one of the following parameters, but not both in the same request:

\n
    \n
  • \n

    \n AllowedInstanceTypes - The instance types to include in the list. All \n other instance types are ignored, even if they match your specified attributes.

    \n
  • \n
  • \n

    \n ExcludedInstanceTypes - The instance types to exclude from the list, \n even if they match your specified attributes.

    \n
  • \n
\n \n

You must specify VCpuCount and MemoryMiB. All other attributes\n are optional. Any unspecified optional attribute is set to its default.

\n
\n

For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot\n placement score in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will\n identify instance types with these attributes.

\n

You must specify VCpuCount and MemoryMiB. All other attributes\n are optional. Any unspecified optional attribute is set to its default.

\n

When you specify multiple attributes, you get instance types that satisfy all of the\n specified attributes. If you specify multiple values for an attribute, you get instance\n types that satisfy any of the specified values.

\n

To limit the list of instance types from which Amazon EC2 can identify matching instance types, \n you can use one of the following parameters, but not both in the same request:

\n
    \n
  • \n

    \n AllowedInstanceTypes - The instance types to include in the list. All \n other instance types are ignored, even if they match your specified attributes.

    \n
  • \n
  • \n

    \n ExcludedInstanceTypes - The instance types to exclude from the list, \n even if they match your specified attributes.

    \n
  • \n
\n \n

If you specify InstanceRequirements, you can't specify\n InstanceType.

\n

Attribute-based instance type selection is only supported when using Auto Scaling\n groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in\n the launch instance\n wizard, or with the RunInstances API or\n AWS::EC2::Instance Amazon Web Services CloudFormation resource, you can't specify\n InstanceRequirements.

\n
\n

For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot\n placement score in the Amazon EC2 User Guide.

" } }, "com.amazonaws.ec2#InstanceRequirementsWithMetadataRequest": { @@ -61525,6 +63395,162 @@ "traits": { "smithy.api#enumValue": "i4g.16xlarge" } + }, + "hpc7g_4xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hpc7g.4xlarge" + } + }, + "hpc7g_8xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hpc7g.8xlarge" + } + }, + "hpc7g_16xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "hpc7g.16xlarge" + } + }, + "c7gn_medium": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.medium" + } + }, + "c7gn_large": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.large" + } + }, + "c7gn_xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.xlarge" + } + }, + "c7gn_2xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.2xlarge" + } + }, + "c7gn_4xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.4xlarge" + } + }, + "c7gn_8xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.8xlarge" + } + }, + "c7gn_12xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.12xlarge" + } + }, + "c7gn_16xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "c7gn.16xlarge" + } + }, + "p5_48xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "p5.48xlarge" + } + }, + "m7i_large": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.large" + } + }, + "m7i_xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.xlarge" + } + }, + "m7i_2xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.2xlarge" + } + }, + "m7i_4xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.4xlarge" + } + }, + "m7i_8xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.8xlarge" + } + }, + "m7i_12xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.12xlarge" + } + }, + "m7i_16xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.16xlarge" + } + }, + "m7i_24xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.24xlarge" + } + }, + "m7i_48xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i.48xlarge" + } + }, + "m7i_flex_large": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i-flex.large" + } + }, + "m7i_flex_xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i-flex.xlarge" + } + }, + "m7i_flex_2xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i-flex.2xlarge" + } + }, + "m7i_flex_4xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i-flex.4xlarge" + } + }, + "m7i_flex_8xlarge": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "m7i-flex.8xlarge" + } } } }, @@ -61712,7 +63738,7 @@ "target": "com.amazonaws.ec2#BurstablePerformanceFlag", "traits": { "aws.protocols#ec2QueryName": "BurstablePerformanceSupported", - "smithy.api#documentation": "

Indicates whether the instance type is a burstable performance instance type.

", + "smithy.api#documentation": "

Indicates whether the instance type is a burstable performance T instance \n type. For more information, see Burstable \n performance instances.

", "smithy.api#xmlName": "burstablePerformanceSupported" } }, @@ -61739,6 +63765,30 @@ "smithy.api#documentation": "

The supported boot modes. For more information, see Boot modes in the\n Amazon EC2 User Guide.

", "smithy.api#xmlName": "supportedBootModes" } + }, + "NitroEnclavesSupport": { + "target": "com.amazonaws.ec2#NitroEnclavesSupport", + "traits": { + "aws.protocols#ec2QueryName": "NitroEnclavesSupport", + "smithy.api#documentation": "

Indicates whether Nitro Enclaves is supported.

", + "smithy.api#xmlName": "nitroEnclavesSupport" + } + }, + "NitroTpmSupport": { + "target": "com.amazonaws.ec2#NitroTpmSupport", + "traits": { + "aws.protocols#ec2QueryName": "NitroTpmSupport", + "smithy.api#documentation": "

Indicates whether NitroTPM is supported.

", + "smithy.api#xmlName": "nitroTpmSupport" + } + }, + "NitroTpmInfo": { + "target": "com.amazonaws.ec2#NitroTpmInfo", + "traits": { + "aws.protocols#ec2QueryName": "NitroTpmInfo", + "smithy.api#documentation": "

Describes the supported NitroTPM versions for the instance type.

", + "smithy.api#xmlName": "nitroTpmInfo" + } } }, "traits": { @@ -62006,7 +64056,7 @@ } }, "traits": { - "smithy.api#documentation": "

Describes the attachment of a VPC to an internet gateway or an egress-only internet\n\t\t\tgateway.

" + "smithy.api#documentation": "

Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.

" } }, "com.amazonaws.ec2#InternetGatewayAttachmentList": { @@ -62107,7 +64157,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "IpProtocol", - "smithy.api#documentation": "

The IP protocol name (tcp, udp, icmp, icmpv6) \n or number (see Protocol Numbers).

\n

[VPC only] Use -1 to specify all protocols. When authorizing\n security group rules, specifying -1 or a protocol number other than\n tcp, udp, icmp, or icmpv6 allows\n traffic on all ports, regardless of any port range you specify. For tcp,\n udp, and icmp, you must specify a port range. For icmpv6,\n the port range is optional; if you omit the port range, traffic for all types and codes is allowed.

", + "smithy.api#documentation": "

The IP protocol name (tcp, udp, icmp, icmpv6) \n or number (see Protocol Numbers).

\n

Use -1 to specify all protocols. When authorizing\n security group rules, specifying -1 or a protocol number other than\n tcp, udp, icmp, or icmpv6 allows\n traffic on all ports, regardless of any port range you specify. For tcp,\n udp, and icmp, you must specify a port range. For icmpv6,\n the port range is optional; if you omit the port range, traffic for all types and codes is allowed.

", "smithy.api#xmlName": "ipProtocol" } }, @@ -62123,7 +64173,7 @@ "target": "com.amazonaws.ec2#Ipv6RangeList", "traits": { "aws.protocols#ec2QueryName": "Ipv6Ranges", - "smithy.api#documentation": "

[VPC only] The IPv6 ranges.

", + "smithy.api#documentation": "

The IPv6 ranges.

", "smithy.api#xmlName": "ipv6Ranges" } }, @@ -62131,7 +64181,7 @@ "target": "com.amazonaws.ec2#PrefixListIdList", "traits": { "aws.protocols#ec2QueryName": "PrefixListIds", - "smithy.api#documentation": "

[VPC only] The prefix list IDs.

", + "smithy.api#documentation": "

The prefix list IDs.

", "smithy.api#xmlName": "prefixListIds" } }, @@ -64598,7 +66648,7 @@ } }, "traits": { - "smithy.api#documentation": "

[EC2-VPC only] Describes an IPv6 range.

" + "smithy.api#documentation": "

Describes an IPv6 range.

" } }, "com.amazonaws.ec2#Ipv6RangeList": { @@ -65293,7 +67343,7 @@ "target": "com.amazonaws.ec2#FleetLaunchTemplateSpecification", "traits": { "aws.protocols#ec2QueryName": "LaunchTemplateSpecification", - "smithy.api#documentation": "

The launch template.

", + "smithy.api#documentation": "

The launch template to use. Make sure that the launch template does not contain the\n NetworkInterfaceId parameter because you can't specify a network interface\n ID in a Spot Fleet.

", "smithy.api#xmlName": "launchTemplateSpecification" } }, @@ -65346,7 +67396,7 @@ "target": "com.amazonaws.ec2#AmdSevSnpSpecification", "traits": { "aws.protocols#ec2QueryName": "AmdSevSnp", - "smithy.api#documentation": "

Indicates whether the instance is enabled for \n AMD SEV-SNP.

", + "smithy.api#documentation": "

Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see \n AMD SEV-SNP.

", "smithy.api#xmlName": "amdSevSnp" } } @@ -65377,7 +67427,7 @@ "AmdSevSnp": { "target": "com.amazonaws.ec2#AmdSevSnpSpecification", "traits": { - "smithy.api#documentation": "

Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported \n with M6a, R6a, and C6a instance types only.

" + "smithy.api#documentation": "

Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported \n with M6a, R6a, and C6a instance types only. For more information, see \n AMD SEV-SNP.

" } } }, @@ -66204,6 +68254,16 @@ "smithy.api#documentation": "

The number of IPv6 prefixes that Amazon Web Services automatically assigned to the network\n interface.

", "smithy.api#xmlName": "ipv6PrefixCount" } + }, + "PrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "aws.protocols#ec2QueryName": "PrimaryIpv6", + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

The primary IPv6 address of the network interface. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. For more information about primary IPv6 addresses, see RunInstances.

", + "smithy.api#xmlName": "primaryIpv6" + } } }, "traits": { @@ -66356,6 +68416,14 @@ "smithy.api#default": 0, "smithy.api#documentation": "

The number of IPv6 prefixes to be automatically assigned to the network interface. You\n cannot use this option if you use the Ipv6Prefix option.

" } + }, + "PrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

The primary IPv6 address of the network interface. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. For more information about primary IPv6 addresses, see RunInstances.

" + } } }, "traits": { @@ -69538,7 +71606,24 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time.

\n

To specify the attribute, you can use the Attribute parameter, or one of the following parameters: \n Description, ImdsSupport, or LaunchPermission.

\n

Images with an Amazon Web Services Marketplace product code cannot be made public.

\n

To enable the SriovNetSupport enhanced networking attribute of an image, enable SriovNetSupport on an instance \n and create an AMI from the instance.

" + "smithy.api#documentation": "

Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time.

\n

To specify the attribute, you can use the Attribute parameter, or one of the following parameters: \n Description, ImdsSupport, or LaunchPermission.

\n

Images with an Amazon Web Services Marketplace product code cannot be made public.

\n

To enable the SriovNetSupport enhanced networking attribute of an image, enable SriovNetSupport on an instance \n and create an AMI from the instance.

", + "smithy.api#examples": [ + { + "title": "To make an AMI public", + "documentation": "This example makes the specified AMI public.", + "input": { + "ImageId": "ami-5731123e", + "LaunchPermission": { + "Add": [ + { + "Group": "all" + } + ] + } + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#ModifyImageAttributeRequest": { @@ -70182,7 +72267,7 @@ "HttpProtocolIpv6": { "target": "com.amazonaws.ec2#InstanceMetadataProtocolState", "traits": { - "smithy.api#documentation": "

Enables or disables the IPv6 endpoint for the instance metadata service. This setting\n applies only if you have enabled the HTTP metadata endpoint.

" + "smithy.api#documentation": "

Enables or disables the IPv6 endpoint for the instance metadata service. \n Applies only if you enabled the HTTP metadata endpoint.

" } }, "InstanceMetadataTags": { @@ -70271,7 +72356,7 @@ "target": "com.amazonaws.ec2#HostTenancy", "traits": { "aws.protocols#ec2QueryName": "Tenancy", - "smithy.api#documentation": "

The tenancy for the instance.

\n \n

For T3 instances, you can't change the tenancy from dedicated to\n host, or from host to dedicated.\n Attempting to make one of these unsupported tenancy changes results in the\n InvalidTenancy error code.

\n
", + "smithy.api#documentation": "

The tenancy for the instance.

\n \n

For T3 instances, you must launch the instance on a Dedicated Host to use a\n tenancy of host. You can't change the tenancy from\n host to dedicated or default.\n Attempting to make one of these unsupported tenancy changes results in an\n InvalidRequest error code.

\n
", "smithy.api#xmlName": "tenancy" } }, @@ -70286,7 +72371,7 @@ "HostResourceGroupArn": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

The ARN of the host resource group in which to place the instance.

" + "smithy.api#documentation": "

The ARN of the host resource group in which to place the instance. The instance must\n have a tenancy of host to specify this parameter.

" } }, "GroupId": { @@ -70732,7 +72817,27 @@ "target": "com.amazonaws.ec2#ModifyLaunchTemplateResult" }, "traits": { - "smithy.api#documentation": "

Modifies a launch template. You can specify which version of the launch template to\n set as the default version. When launching an instance, the default version applies when\n a launch template version is not specified.

" + "smithy.api#documentation": "

Modifies a launch template. You can specify which version of the launch template to\n set as the default version. When launching an instance, the default version applies when\n a launch template version is not specified.

", + "smithy.api#examples": [ + { + "title": "To change the default version of a launch template", + "documentation": "This example specifies version 2 as the default version of the specified launch template.", + "input": { + "LaunchTemplateId": "lt-0abcd290751193123", + "DefaultVersion": "2" + }, + "output": { + "LaunchTemplate": { + "LatestVersionNumber": 2, + "LaunchTemplateId": "lt-0abcd290751193123", + "LaunchTemplateName": "WebServers", + "DefaultVersionNumber": 2, + "CreatedBy": "arn:aws:iam::123456789012:root", + "CreateTime": "2017-12-01T13:35:46.000Z" + } + } + } + ] } }, "com.amazonaws.ec2#ModifyLaunchTemplateRequest": { @@ -71027,6 +73132,14 @@ "traits": { "smithy.api#documentation": "

Updates the ENA Express configuration for the network interface that’s attached to the\n\t\t\tinstance.

" } + }, + "EnablePrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

If you’re modifying a network interface in a dual-stack or IPv6-only subnet, you have\n the option to assign a primary IPv6 IP address. A primary IPv6 address is an IPv6 GUA\n address associated with an ENI that you have enabled to use a primary IPv6 address. Use\n this option if the instance that this ENI will be attached to relies on its IPv6 address\n not changing. Amazon Web Services will automatically assign an IPv6 address associated\n with the ENI attached to your instance to be the primary IPv6 address. Once you enable\n an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6\n GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6\n address until the instance is terminated or the network interface is detached. If you\n have multiple IPv6 addresses associated with an ENI attached to your instance and you\n enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI\n becomes the primary IPv6 address.

" + } } }, "traits": { @@ -71246,7 +73359,22 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Adds or removes permission settings for the specified snapshot. You may add or remove\n specified Amazon Web Services account IDs from a snapshot's list of create volume permissions, but you cannot\n do both in a single operation. If you need to both add and remove account IDs for a snapshot,\n you must use multiple operations. You can make up to 500 modifications to a snapshot in a single operation.

\n

Encrypted snapshots and snapshots with Amazon Web Services Marketplace product codes cannot be made\n public. Snapshots encrypted with your default KMS key cannot be shared with other accounts.

\n

For more information about modifying snapshot permissions, see Share a snapshot in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Adds or removes permission settings for the specified snapshot. You may add or remove\n specified Amazon Web Services account IDs from a snapshot's list of create volume permissions, but you cannot\n do both in a single operation. If you need to both add and remove account IDs for a snapshot,\n you must use multiple operations. You can make up to 500 modifications to a snapshot in a single operation.

\n

Encrypted snapshots and snapshots with Amazon Web Services Marketplace product codes cannot be made\n public. Snapshots encrypted with your default KMS key cannot be shared with other accounts.

\n

For more information about modifying snapshot permissions, see Share a snapshot in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To modify a snapshot attribute", + "documentation": "This example modifies snapshot ``snap-1234567890abcdef0`` to remove the create volume permission for a user with the account ID ``123456789012``. If the command succeeds, no output is returned.", + "input": { + "SnapshotId": "snap-1234567890abcdef0", + "Attribute": "createVolumePermission", + "OperationType": "remove", + "UserIds": [ + "123456789012" + ] + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#ModifySnapshotAttributeRequest": { @@ -71471,7 +73599,19 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Modifies a subnet attribute. You can only modify one attribute at a time.

\n

Use this action to modify subnets on Amazon Web Services Outposts.

\n
    \n
  • \n

    To modify a subnet on an Outpost rack, set both\n MapCustomerOwnedIpOnLaunch and\n CustomerOwnedIpv4Pool. These two parameters act as a single\n attribute.

    \n
  • \n
  • \n

    To modify a subnet on an Outpost server, set either\n EnableLniAtDeviceIndex or\n DisableLniAtDeviceIndex.

    \n
  • \n
\n

For more information about Amazon Web Services Outposts, see the following:

\n " + "smithy.api#documentation": "

Modifies a subnet attribute. You can only modify one attribute at a time.

\n

Use this action to modify subnets on Amazon Web Services Outposts.

\n
    \n
  • \n

    To modify a subnet on an Outpost rack, set both\n MapCustomerOwnedIpOnLaunch and\n CustomerOwnedIpv4Pool. These two parameters act as a single\n attribute.

    \n
  • \n
  • \n

    To modify a subnet on an Outpost server, set either\n EnableLniAtDeviceIndex or\n DisableLniAtDeviceIndex.

    \n
  • \n
\n

For more information about Amazon Web Services Outposts, see the following:

\n ", + "smithy.api#examples": [ + { + "title": "To change a subnet's public IP addressing behavior", + "documentation": "This example modifies the specified subnet so that all instances launched into this subnet are assigned a public IP address.", + "input": { + "SubnetId": "subnet-1a2b3c4d", + "MapPublicIpOnLaunch": { + "Value": true + } + } + } + ] } }, "com.amazonaws.ec2#ModifySubnetAttributeRequest": { @@ -71777,7 +73917,7 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": 0, - "smithy.api#documentation": "

The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the entire packet.

" + "smithy.api#documentation": "

The number of bytes in each packet to mirror. These are bytes after the VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the entire packet.

\n

For sessions with Network Load Balancer (NLB) traffic mirror targets, the default PacketLength will be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an error response.

" } }, "SessionNumber": { @@ -72798,7 +74938,21 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Modifies a volume attribute.

\n

By default, all I/O operations for the volume are suspended when the data on the volume is\n determined to be potentially inconsistent, to prevent undetectable, latent data corruption.\n The I/O access to the volume can be resumed by first enabling I/O access and then checking the\n data consistency on your volume.

\n

You can change the default behavior to resume I/O operations. We recommend that you change\n this only for boot volumes or for volumes that are stateless or disposable.

" + "smithy.api#documentation": "

Modifies a volume attribute.

\n

By default, all I/O operations for the volume are suspended when the data on the volume is\n determined to be potentially inconsistent, to prevent undetectable, latent data corruption.\n The I/O access to the volume can be resumed by first enabling I/O access and then checking the\n data consistency on your volume.

\n

You can change the default behavior to resume I/O operations. We recommend that you change\n this only for boot volumes or for volumes that are stateless or disposable.

", + "smithy.api#examples": [ + { + "title": "To modify a volume attribute", + "documentation": "This example sets the ``autoEnableIo`` attribute of the volume with the ID ``vol-1234567890abcdef0`` to ``true``. If the command succeeds, no output is returned.", + "input": { + "DryRun": true, + "VolumeId": "vol-1234567890abcdef0", + "AutoEnableIO": { + "Value": true + } + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#ModifyVolumeAttributeRequest": { @@ -72920,7 +75074,19 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Modifies the specified attribute of the specified VPC.

" + "smithy.api#documentation": "

Modifies the specified attribute of the specified VPC.

", + "smithy.api#examples": [ + { + "title": "To modify the enableDnsSupport attribute", + "documentation": "This example modifies the enableDnsSupport attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for instances in the VPC to their corresponding IP addresses; otherwise, it does not.", + "input": { + "VpcId": "vpc-a01106c2", + "EnableDnsSupport": { + "Value": false + } + } + } + ] } }, "com.amazonaws.ec2#ModifyVpcAttributeRequest": { @@ -73418,7 +75584,7 @@ "target": "com.amazonaws.ec2#ModifyVpcPeeringConnectionOptionsResult" }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Modifies the VPC peering connection options on one side of a VPC peering connection. You can do the following:

\n
    \n
  • \n

    Enable/disable communication over the peering connection between an EC2-Classic instance that's linked to your VPC (using ClassicLink) and instances in the peer VPC.

    \n
  • \n
  • \n

    Enable/disable communication over the peering connection between instances in your VPC and an EC2-Classic instance that's linked to the peer VPC.

    \n
  • \n
  • \n

    Enable/disable the ability to resolve public DNS hostnames to private IP\n addresses when queried from instances in the peer VPC.

    \n
  • \n
\n

If the peered VPCs are in the same Amazon Web Services account, you can enable DNS\n resolution for queries from the local VPC. This ensures that queries from the local VPC\n resolve to private IP addresses in the peer VPC. This option is not available if the\n peered VPCs are in different Amazon Web Services accounts or different Regions. For\n peered VPCs in different Amazon Web Services accounts, each Amazon Web Services account\n owner must initiate a separate request to modify the peering connection options. For\n inter-region peering connections, you must use the Region for the requester VPC to\n modify the requester VPC peering options and the Region for the accepter VPC to modify\n the accepter VPC peering options. To verify which VPCs are the accepter and the\n requester for a VPC peering connection, use the DescribeVpcPeeringConnections command.

" + "smithy.api#documentation": "

Modifies the VPC peering connection options on one side of a VPC peering connection.

\n

If the peered VPCs are in the same Amazon Web Services account, you can enable DNS\n resolution for queries from the local VPC. This ensures that queries from the local VPC\n resolve to private IP addresses in the peer VPC. This option is not available if the\n peered VPCs are in different Amazon Web Services accounts or different Regions. For\n peered VPCs in different Amazon Web Services accounts, each Amazon Web Services account\n owner must initiate a separate request to modify the peering connection options. For\n inter-region peering connections, you must use the Region for the requester VPC to\n modify the requester VPC peering options and the Region for the accepter VPC to modify\n the accepter VPC peering options. To verify which VPCs are the accepter and the\n requester for a VPC peering connection, use the DescribeVpcPeeringConnections command.

" } }, "com.amazonaws.ec2#ModifyVpcPeeringConnectionOptionsRequest": { @@ -73490,7 +75656,7 @@ "target": "com.amazonaws.ec2#ModifyVpcTenancyResult" }, "traits": { - "smithy.api#documentation": "

Modifies the instance tenancy attribute of the specified VPC. You can change the\n instance tenancy attribute of a VPC to default only. You cannot change the\n instance tenancy attribute to dedicated.

\n

After you modify the tenancy of the VPC, any new instances that you launch into the\n VPC have a tenancy of default, unless you specify otherwise during launch.\n The tenancy of any existing instances in the VPC is not affected.

\n

For more information, see Dedicated Instances in the\n\t\t\t\tAmazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Modifies the instance tenancy attribute of the specified VPC. You can change the\n instance tenancy attribute of a VPC to default only. You cannot change the\n instance tenancy attribute to dedicated.

\n

After you modify the tenancy of the VPC, any new instances that you launch into the\n VPC have a tenancy of default, unless you specify otherwise during launch.\n The tenancy of any existing instances in the VPC is not affected.

\n

For more information, see Dedicated Instances in the\n\t\t\t\tAmazon EC2 User Guide.

" } }, "com.amazonaws.ec2#ModifyVpcTenancyRequest": { @@ -73841,7 +76007,7 @@ } }, "PreSharedKey": { - "target": "com.amazonaws.ec2#String", + "target": "com.amazonaws.ec2#preSharedKey", "traits": { "smithy.api#documentation": "

The pre-shared key (PSK) to establish initial authentication between the virtual\n private gateway and the customer gateway.

\n

Constraints: Allowed characters are alphanumeric characters, periods (.), and\n underscores (_). Must be between 8 and 64 characters in length and cannot start with\n zero (0).

" } @@ -73971,7 +76137,8 @@ } }, "traits": { - "smithy.api#documentation": "

The Amazon Web Services Site-to-Site VPN tunnel options to modify.

" + "smithy.api#documentation": "

The Amazon Web Services Site-to-Site VPN tunnel options to modify.

", + "smithy.api#sensitive": {} } }, "com.amazonaws.ec2#MonitorInstances": { @@ -74575,7 +76742,7 @@ "target": "com.amazonaws.ec2#NetworkAclEntryList", "traits": { "aws.protocols#ec2QueryName": "EntrySet", - "smithy.api#documentation": "

One or more entries (rules) in the network ACL.

", + "smithy.api#documentation": "

The entries (rules) in the network ACL.

", "smithy.api#xmlName": "entrySet" } }, @@ -74857,6 +77024,22 @@ "smithy.api#documentation": "

The maximum number of network interfaces for the network card.

", "smithy.api#xmlName": "maximumNetworkInterfaces" } + }, + "BaselineBandwidthInGbps": { + "target": "com.amazonaws.ec2#BaselineBandwidthInGbps", + "traits": { + "aws.protocols#ec2QueryName": "BaselineBandwidthInGbps", + "smithy.api#documentation": "

The baseline network performance of the network card, in Gbps.

", + "smithy.api#xmlName": "baselineBandwidthInGbps" + } + }, + "PeakBandwidthInGbps": { + "target": "com.amazonaws.ec2#PeakBandwidthInGbps", + "traits": { + "aws.protocols#ec2QueryName": "PeakBandwidthInGbps", + "smithy.api#documentation": "

The peak (burst) network performance of the network card, in Gbps.

", + "smithy.api#xmlName": "peakBandwidthInGbps" + } } }, "traits": { @@ -76057,6 +78240,16 @@ "smithy.api#documentation": "

The IPv6 address.

", "smithy.api#xmlName": "ipv6Address" } + }, + "IsPrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "aws.protocols#ec2QueryName": "IsPrimaryIpv6", + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

Determines if an IPv6 address associated with a network interface is the primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. For more information, see ModifyNetworkInterfaceAttribute.

", + "smithy.api#xmlName": "isPrimaryIpv6" + } } }, "traits": { @@ -76418,7 +78611,7 @@ "Values": { "target": "com.amazonaws.ec2#ValueStringList", "traits": { - "smithy.api#documentation": "

One or more values for the DHCP option.

", + "smithy.api#documentation": "

The values for the DHCP option.

", "smithy.api#xmlName": "Value" } } @@ -76439,6 +78632,68 @@ "com.amazonaws.ec2#NextToken": { "type": "string" }, + "com.amazonaws.ec2#NitroEnclavesSupport": { + "type": "enum", + "members": { + "UNSUPPORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "unsupported" + } + }, + "SUPPORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "supported" + } + } + } + }, + "com.amazonaws.ec2#NitroTpmInfo": { + "type": "structure", + "members": { + "SupportedVersions": { + "target": "com.amazonaws.ec2#NitroTpmSupportedVersionsList", + "traits": { + "aws.protocols#ec2QueryName": "SupportedVersions", + "smithy.api#documentation": "

Indicates the supported NitroTPM versions.

", + "smithy.api#xmlName": "supportedVersions" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes the supported NitroTPM versions for the instance type.

" + } + }, + "com.amazonaws.ec2#NitroTpmSupport": { + "type": "enum", + "members": { + "UNSUPPORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "unsupported" + } + }, + "SUPPORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "supported" + } + } + } + }, + "com.amazonaws.ec2#NitroTpmSupportedVersionType": { + "type": "string" + }, + "com.amazonaws.ec2#NitroTpmSupportedVersionsList": { + "type": "list", + "member": { + "target": "com.amazonaws.ec2#NitroTpmSupportedVersionType", + "traits": { + "smithy.api#xmlName": "item" + } + } + }, "com.amazonaws.ec2#OccurrenceDayRequestSet": { "type": "list", "member": { @@ -77272,6 +79527,9 @@ "smithy.api#documentation": "

Describes the data that identifies an Amazon FPGA image (AFI) on the PCI bus.

" } }, + "com.amazonaws.ec2#PeakBandwidthInGbps": { + "type": "double" + }, "com.amazonaws.ec2#PeeringAttachmentStatus": { "type": "structure", "members": { @@ -77315,7 +79573,7 @@ "aws.protocols#ec2QueryName": "AllowEgressFromLocalClassicLinkToRemoteVpc", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If true, enables outbound communication from an EC2-Classic instance that's linked to\n a local VPC using ClassicLink to instances in a peer VPC.

", + "smithy.api#documentation": "

Deprecated.

", "smithy.api#xmlName": "allowEgressFromLocalClassicLinkToRemoteVpc" } }, @@ -77325,13 +79583,13 @@ "aws.protocols#ec2QueryName": "AllowEgressFromLocalVpcToRemoteClassicLink", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If true, enables outbound communication from instances in a local VPC to an\n EC2-Classic instance that's linked to a peer VPC using ClassicLink.

", + "smithy.api#documentation": "

Deprecated.

", "smithy.api#xmlName": "allowEgressFromLocalVpcToRemoteClassicLink" } } }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Describes the VPC peering connection options.

" + "smithy.api#documentation": "

Describes the VPC peering connection options.

" } }, "com.amazonaws.ec2#PeeringConnectionOptionsRequest": { @@ -77342,7 +79600,7 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If true, enables a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC.

" + "smithy.api#documentation": "

If true, enables a local VPC to resolve public DNS hostnames to private IP addresses \n when queried from instances in the peer VPC.

" } }, "AllowEgressFromLocalClassicLinkToRemoteVpc": { @@ -77350,7 +79608,7 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If true, enables outbound communication from an EC2-Classic instance that's linked to\n a local VPC using ClassicLink to instances in a peer VPC.

" + "smithy.api#documentation": "

Deprecated.

" } }, "AllowEgressFromLocalVpcToRemoteClassicLink": { @@ -77358,12 +79616,12 @@ "traits": { "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

If true, enables outbound communication from instances in a local VPC to an\n EC2-Classic instance that's linked to a peer VPC using ClassicLink.

" + "smithy.api#documentation": "

Deprecated.

" } } }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

The VPC peering connection options.

" + "smithy.api#documentation": "

The VPC peering connection options.

" } }, "com.amazonaws.ec2#PeeringTgwInfo": { @@ -77913,7 +80171,7 @@ "com.amazonaws.ec2#PlacementGroupArn": { "type": "string", "traits": { - "smithy.api#pattern": "^arn:aws([a-z-]+)?:ec2:[a-z\\d-]+:\\d{12}:placement-group/([^\\s].+[^\\s]){1,255}$" + "smithy.api#pattern": "^arn:aws([a-z-]+)?:ec2:[a-z\\d-]+:\\d{12}:placement-group/^.{1,255}$" } }, "com.amazonaws.ec2#PlacementGroupId": { @@ -78877,7 +81135,7 @@ "target": "com.amazonaws.ec2#SupportedAdditionalProcessorFeatureList", "traits": { "aws.protocols#ec2QueryName": "SupportedFeatures", - "smithy.api#documentation": "

Indicates whether the instance type supports AMD SEV-SNP. If the request returns \n amd-sev-snp, AMD SEV-SNP is supported. Otherwise, it is not supported.

", + "smithy.api#documentation": "

Indicates whether the instance type supports AMD SEV-SNP. If the request returns \n amd-sev-snp, AMD SEV-SNP is supported. Otherwise, it is not supported. \n For more information, see \n AMD SEV-SNP.

", "smithy.api#xmlName": "supportedFeatures" } } @@ -79940,7 +82198,19 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Requests a reboot of the specified instances. This operation is asynchronous; it only\n queues a request to reboot the specified instances. The operation succeeds if the\n instances are valid and belong to you. Requests to reboot terminated instances are\n ignored.

\n

If an instance does not cleanly shut down within a few minutes, Amazon EC2 performs a\n hard reboot.

\n

For more information about troubleshooting, see Troubleshoot an unreachable\n instance in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Requests a reboot of the specified instances. This operation is asynchronous; it only\n queues a request to reboot the specified instances. The operation succeeds if the\n instances are valid and belong to you. Requests to reboot terminated instances are\n ignored.

\n

If an instance does not cleanly shut down within a few minutes, Amazon EC2 performs a\n hard reboot.

\n

For more information about troubleshooting, see Troubleshoot an unreachable\n instance in the Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To reboot an EC2 instance", + "documentation": "This example reboots the specified EC2 instance.", + "input": { + "InstanceIds": [ + "i-1234567890abcdef5" + ] + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#RebootInstancesRequest": { @@ -80795,7 +83065,16 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Releases the specified Elastic IP address.

\n

[Default VPC] Releasing an Elastic IP address automatically disassociates it\n\t\t\t\tfrom any instance that it's associated with. To disassociate an Elastic IP address without\n\t\t\t\treleasing it, use DisassociateAddress.

\n

[Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address\n\t\t\t before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse).

\n

After releasing an Elastic IP address, it is released to the IP address pool. \n Be sure to update your DNS records and any servers or devices that communicate with the address. \n If you attempt to release an Elastic IP address that you already released, you'll get an\n AuthFailure error if the address is already allocated to another Amazon Web Services account.

\n

After you release an Elastic IP address, you might be able to recover it.\n For more information, see AllocateAddress.

" + "smithy.api#documentation": "

Releases the specified Elastic IP address.

\n

[Default VPC] Releasing an Elastic IP address automatically disassociates it\n\t\t\t\tfrom any instance that it's associated with. To disassociate an Elastic IP address without\n\t\t\t\treleasing it, use DisassociateAddress.

\n

[Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address\n\t\t\t before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse).

\n

After releasing an Elastic IP address, it is released to the IP address pool. \n Be sure to update your DNS records and any servers or devices that communicate with the address. \n If you attempt to release an Elastic IP address that you already released, you'll get an\n AuthFailure error if the address is already allocated to another Amazon Web Services account.

\n

After you release an Elastic IP address, you might be able to recover it.\n For more information, see AllocateAddress.

", + "smithy.api#examples": [ + { + "title": "To release an Elastic IP address", + "documentation": "This example releases the specified Elastic IP address.", + "input": { + "AllocationId": "eipalloc-64d5890a" + } + } + ] } }, "com.amazonaws.ec2#ReleaseAddressRequest": { @@ -80897,7 +83176,7 @@ "target": "com.amazonaws.ec2#ReleaseIpamPoolAllocationResult" }, "traits": { - "smithy.api#documentation": "

Release an allocation within an IPAM pool. The Region you use should be the IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM pool is available for allocations. You can only use this action to release manual allocations. To remove an allocation for a resource without deleting the resource, set its monitored state to false using ModifyIpamResourceCidr. For more information, see Release an allocation in the Amazon VPC IPAM User Guide.\n

\n \n

All EC2 API actions follow an eventual consistency model.

\n
" + "smithy.api#documentation": "

Release an allocation within an IPAM pool. The Region you use should be the IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM pool is available for allocations. You can only use this action to release manual allocations. To remove an allocation for a resource without deleting the resource, set its monitored state to false using ModifyIpamResourceCidr. For more information, see Release an allocation in the Amazon VPC IPAM User Guide.\n

\n \n

All EC2 API actions follow an eventual consistency model.

\n
" } }, "com.amazonaws.ec2#ReleaseIpamPoolAllocationRequest": { @@ -81073,7 +83352,7 @@ "target": "com.amazonaws.ec2#ReplaceNetworkAclAssociationResult" }, "traits": { - "smithy.api#documentation": "

Changes which network ACL a subnet is associated with. By default when you create a\n\t\t\tsubnet, it's automatically associated with the default network ACL. For more\n\t\t\tinformation, see Network\n\t\t\tACLs in the Amazon Virtual Private Cloud User Guide.

\n

This is an idempotent operation.

" + "smithy.api#documentation": "

Changes which network ACL a subnet is associated with. By default when you create a\n\t\t\tsubnet, it's automatically associated with the default network ACL. For more\n\t\t\tinformation, see Network ACLs in the Amazon VPC User Guide.

\n

This is an idempotent operation.

" } }, "com.amazonaws.ec2#ReplaceNetworkAclAssociationRequest": { @@ -81139,7 +83418,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Replaces an entry (rule) in a network ACL. For more information, see Network ACLs in the\n\t\t\t\tAmazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Replaces an entry (rule) in a network ACL. For more information, see Network ACLs in the\n\t\t\t\tAmazon VPC User Guide.

" } }, "com.amazonaws.ec2#ReplaceNetworkAclEntryRequest": { @@ -81396,7 +83675,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Replaces an existing route within a route table in a VPC.

\n

You must specify either a destination CIDR block or a prefix list ID. You must also specify \n exactly one of the resources from the parameter list, or reset the local route to its default \n target.

\n

For more information, see Route tables in the\n Amazon Virtual Private Cloud User Guide.

" + "smithy.api#documentation": "

Replaces an existing route within a route table in a VPC.

\n

You must specify either a destination CIDR block or a prefix list ID. You must also specify \n exactly one of the resources from the parameter list, or reset the local route to its default \n target.

\n

For more information, see Route tables in the\n Amazon VPC User Guide.

" } }, "com.amazonaws.ec2#ReplaceRouteRequest": { @@ -81544,7 +83823,7 @@ "target": "com.amazonaws.ec2#ReplaceRouteTableAssociationResult" }, "traits": { - "smithy.api#documentation": "

Changes the route table associated with a given subnet, internet gateway, or virtual private gateway in a VPC. After the operation\n completes, the subnet or gateway uses the routes in the new route table. For more\n information about route tables, see Route\n tables in the Amazon Virtual Private Cloud User Guide.

\n

You can also use this operation to change which table is the main route table in the VPC. Specify the main route table's association ID and the route table ID of the new main route table.

" + "smithy.api#documentation": "

Changes the route table associated with a given subnet, internet gateway, or virtual private gateway in a VPC. After the operation\n completes, the subnet or gateway uses the routes in the new route table. For more\n information about route tables, see Route\n tables in the Amazon VPC User Guide.

\n

You can also use this operation to change which table is the main route table in the VPC. Specify the main route table's association ID and the route table ID of the new main route table.

" } }, "com.amazonaws.ec2#ReplaceRouteTableAssociationRequest": { @@ -82193,7 +84472,7 @@ "InstanceRequirements": { "target": "com.amazonaws.ec2#InstanceRequirementsRequest", "traits": { - "smithy.api#documentation": "

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will\n identify instance types with these attributes.

\n

If you specify InstanceRequirements, you can't specify\n InstanceType.

" + "smithy.api#documentation": "

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will\n identify instance types with these attributes.

\n

You must specify VCpuCount and MemoryMiB. All other attributes\n are optional. Any unspecified optional attribute is set to its default.

\n

When you specify multiple attributes, you get instance types that satisfy all of the\n specified attributes. If you specify multiple values for an attribute, you get instance\n types that satisfy any of the specified values.

\n

To limit the list of instance types from which Amazon EC2 can identify matching instance types, \n you can use one of the following parameters, but not both in the same request:

\n
    \n
  • \n

    \n AllowedInstanceTypes - The instance types to include in the list. All \n other instance types are ignored, even if they match your specified attributes.

    \n
  • \n
  • \n

    \n ExcludedInstanceTypes - The instance types to exclude from the list, \n even if they match your specified attributes.

    \n
  • \n
\n \n

If you specify InstanceRequirements, you can't specify\n InstanceType.

\n

Attribute-based instance type selection is only supported when using Auto Scaling\n groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in\n the launch instance\n wizard, or with the RunInstances API or\n AWS::EC2::Instance Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements.

\n
\n

For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot\n placement score in the Amazon EC2 User Guide.

" } }, "PrivateDnsNameOptions": { @@ -82288,7 +84567,32 @@ "target": "com.amazonaws.ec2#RequestSpotInstancesResult" }, "traits": { - "smithy.api#documentation": "

Creates a Spot Instance request.

\n

For more information, see Spot Instance requests in\n the Amazon EC2 User Guide for Linux Instances.

\n \n

We strongly discourage using the RequestSpotInstances API because it is a legacy\n API with no planned investment. For options for requesting Spot Instances, see\n Which\n is the best Spot request method to use? in the\n Amazon EC2 User Guide for Linux Instances.

\n
" + "smithy.api#documentation": "

Creates a Spot Instance request.

\n

For more information, see Spot Instance requests in\n the Amazon EC2 User Guide for Linux Instances.

\n \n

We strongly discourage using the RequestSpotInstances API because it is a legacy\n API with no planned investment. For options for requesting Spot Instances, see\n Which\n is the best Spot request method to use? in the\n Amazon EC2 User Guide for Linux Instances.

\n
", + "smithy.api#examples": [ + { + "title": "To create a one-time Spot Instance request", + "documentation": "This example creates a one-time Spot Instance request for five instances in the specified Availability Zone. If your account supports EC2-VPC only, Amazon EC2 launches the instances in the default subnet of the specified Availability Zone.", + "input": { + "SpotPrice": "0.03", + "InstanceCount": 5, + "Type": "one-time", + "LaunchSpecification": { + "ImageId": "ami-1a2b3c4d", + "KeyName": "my-key-pair", + "SecurityGroupIds": [ + "sg-1a2b3c4d" + ], + "InstanceType": "m3.medium", + "Placement": { + "AvailabilityZone": "us-west-2a" + }, + "IamInstanceProfile": { + "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" + } + } + } + } + ] } }, "com.amazonaws.ec2#RequestSpotInstancesRequest": { @@ -83697,7 +86001,18 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Resets an attribute of an AMI to its default value.

" + "smithy.api#documentation": "

Resets an attribute of an AMI to its default value.

", + "smithy.api#examples": [ + { + "title": "To reset the launchPermission attribute", + "documentation": "This example resets the launchPermission attribute for the specified AMI. By default, AMIs are private.", + "input": { + "Attribute": "launchPermission", + "ImageId": "ami-5731123e" + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#ResetImageAttributeName": { @@ -83854,7 +86169,18 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "

Resets permission settings for the specified snapshot.

\n

For more information about modifying snapshot permissions, see Share a snapshot in the\n Amazon Elastic Compute Cloud User Guide.

" + "smithy.api#documentation": "

Resets permission settings for the specified snapshot.

\n

For more information about modifying snapshot permissions, see Share a snapshot in the\n Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#examples": [ + { + "title": "To reset a snapshot attribute", + "documentation": "This example resets the create volume permissions for snapshot ``snap-1234567890abcdef0``. If the command succeeds, no output is returned.", + "input": { + "SnapshotId": "snap-1234567890abcdef0", + "Attribute": "createVolumePermission" + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#ResetSnapshotAttributeRequest": { @@ -85102,6 +87428,14 @@ "smithy.api#documentation": "

The size of the volume, in GiB.

", "smithy.api#xmlName": "volumeSize" } + }, + "SseType": { + "target": "com.amazonaws.ec2#SSEType", + "traits": { + "aws.protocols#ec2QueryName": "SseType", + "smithy.api#documentation": "

Reserved for future use.

", + "smithy.api#xmlName": "sseType" + } } }, "traits": { @@ -85298,7 +87632,7 @@ "target": "com.amazonaws.ec2#RevokeSecurityGroupEgressResult" }, "traits": { - "smithy.api#documentation": "

[VPC only] Removes the specified outbound (egress) rules from a security group for EC2-VPC.\n This action does not apply to security groups for use in EC2-Classic.

\n

You can specify rules using either rule IDs or security group rule properties. If you use\n rule properties, the values that you specify (for example, ports) must match the existing rule's \n values exactly. Each rule has a protocol, from and to ports, and destination (CIDR range, \n security group, or prefix list). For the TCP and UDP protocols, you must also specify the \n destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type \n and code. If the security group rule has a description, you do not need to specify the description \n to revoke the rule.

\n

[Default VPC] If the values you specify do not match the existing rule's values, no error is\n returned, and the output describes the security group rules that were not revoked.

\n

Amazon Web Services recommends that you describe the security group to verify that the rules were removed.

\n

Rule changes are propagated to instances within the security group as quickly as possible. However, \n a small delay might occur.

" + "smithy.api#documentation": "

Removes the specified outbound (egress) rules from the specified security group.

\n

You can specify rules using either rule IDs or security group rule properties. If you use\n rule properties, the values that you specify (for example, ports) must match the existing rule's \n values exactly. Each rule has a protocol, from and to ports, and destination (CIDR range, \n security group, or prefix list). For the TCP and UDP protocols, you must also specify the \n destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type \n and code. If the security group rule has a description, you do not need to specify the description \n to revoke the rule.

\n

For a default VPC, if the values you specify do not match the existing rule's values, no error is\n returned, and the output describes the security group rules that were not revoked.

\n

Amazon Web Services recommends that you describe the security group to verify that the rules were removed.

\n

Rule changes are propagated to instances within the security group as quickly as possible. However, \n a small delay might occur.

" } }, "com.amazonaws.ec2#RevokeSecurityGroupEgressRequest": { @@ -85431,7 +87765,7 @@ "target": "com.amazonaws.ec2#RevokeSecurityGroupIngressResult" }, "traits": { - "smithy.api#documentation": "

Removes the specified inbound (ingress) rules from a security group.

\n

You can specify rules using either rule IDs or security group rule properties. If you use\n rule properties, the values that you specify (for example, ports) must match the existing rule's \n values exactly. Each rule has a protocol, from and to ports, and source (CIDR range, \n security group, or prefix list). For the TCP and UDP protocols, you must also specify the \n destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type \n and code. If the security group rule has a description, you do not need to specify the description \n to revoke the rule.

\n

[EC2-Classic, default VPC] If the values you specify do not match the existing rule's values, no error is\n returned, and the output describes the security group rules that were not revoked.

\n

Amazon Web Services recommends that you describe the security group to verify that the rules were removed.

\n

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "

Removes the specified inbound (ingress) rules from a security group.

\n

You can specify rules using either rule IDs or security group rule properties. If you use\n rule properties, the values that you specify (for example, ports) must match the existing rule's \n values exactly. Each rule has a protocol, from and to ports, and source (CIDR range, \n security group, or prefix list). For the TCP and UDP protocols, you must also specify the \n destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type \n and code. If the security group rule has a description, you do not need to specify the description \n to revoke the rule.

\n

For a default VPC, if the values you specify do not match the existing rule's values, no error is\n returned, and the output describes the security group rules that were not revoked.

\n

Amazon Web Services recommends that you describe the security group to verify that the rules were removed.

\n

Rule changes are propagated to instances within the security group as quickly as possible. \n However, a small delay might occur.

" } }, "com.amazonaws.ec2#RevokeSecurityGroupIngressRequest": { @@ -85454,13 +87788,13 @@ "GroupId": { "target": "com.amazonaws.ec2#SecurityGroupId", "traits": { - "smithy.api#documentation": "

The ID of the security group. You must specify either the security group ID or the\n security group name in the request. For security groups in a nondefault VPC, you must\n specify the security group ID.

" + "smithy.api#documentation": "

The ID of the security group.

" } }, "GroupName": { "target": "com.amazonaws.ec2#SecurityGroupName", "traits": { - "smithy.api#documentation": "

[EC2-Classic, default VPC] The name of the security group. You must specify either the\n security group ID or the security group name in the request. For security groups in a\n nondefault VPC, you must specify the security group ID.

" + "smithy.api#documentation": "

[Default VPC] The name of the security group. You must specify either the\n security group ID or the security group name in the request. For security groups in a\n nondefault VPC, you must specify the security group ID.

" } }, "IpPermissions": { @@ -85478,13 +87812,13 @@ "SourceSecurityGroupName": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the port range. For EC2-VPC, the source security group must be in the same VPC. To revoke a specific rule for an IP protocol and port range, use a set of IP permissions instead.

" + "smithy.api#documentation": "

[Default VPC] The name of the source security group. You can't specify this parameter \n in combination with the following parameters: the CIDR IP address range, the start of the port range, \n the IP protocol, and the end of the port range. The source security group must be in the same VPC. \n To revoke a specific rule for an IP protocol and port range, use a set of IP permissions instead.

" } }, "SourceSecurityGroupOwnerId": { "target": "com.amazonaws.ec2#String", "traits": { - "smithy.api#documentation": "

[EC2-Classic] The Amazon Web Services account ID of the source security group, if the source security group is in a different account. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. To revoke a specific rule for an IP protocol and port range, use a set of IP permissions instead.

" + "smithy.api#documentation": "

Not supported.

" } }, "ToPort": { @@ -86099,7 +88433,44 @@ "target": "com.amazonaws.ec2#Reservation" }, "traits": { - "smithy.api#documentation": "

Launches the specified number of instances using an AMI for which you have\n permissions.

\n

You can specify a number of options, or leave the default options. The following rules\n apply:

\n
    \n
  • \n

    If you don't specify a subnet ID, we choose a default subnet from\n your default VPC for you. If you don't have a default VPC, you must specify a\n subnet ID in the request.

    \n
  • \n
  • \n

    All instances have a network interface with a primary private IPv4\n address. If you don't specify this address, we choose one from the IPv4 range of\n your subnet.

    \n
  • \n
  • \n

    Not all instance types support IPv6 addresses. For more information, see\n Instance\n types.

    \n
  • \n
  • \n

    If you don't specify a security group ID, we use the default security group.\n For more information, see Security\n groups.

    \n
  • \n
  • \n

    If any of the AMIs have a product code attached for which the user has not\n subscribed, the request fails.

    \n
  • \n
\n

You can create a launch template,\n which is a resource that contains the parameters to launch an instance. When you launch\n an instance using RunInstances, you can specify the launch template\n instead of specifying the launch parameters.

\n

To ensure faster instance launches, break up large requests into smaller batches. For\n example, create five separate launch requests for 100 instances each instead of one\n launch request for 500 instances.

\n

An instance is ready for you to use when it's in the running state. You\n can check the state of your instance using DescribeInstances. You can\n tag instances and EBS volumes during launch, after launch, or both. For more\n information, see CreateTags and Tagging your Amazon EC2\n resources.

\n

Linux instances have access to the public key of the key pair at boot. You can use\n this key to provide secure access to the instance. Amazon EC2 public images use this\n feature to provide secure access without passwords. For more information, see Key\n pairs.

\n

For troubleshooting, see What to do if\n an instance immediately terminates, and Troubleshooting connecting to your instance.

" + "smithy.api#documentation": "

Launches the specified number of instances using an AMI for which you have\n permissions.

\n

You can specify a number of options, or leave the default options. The following rules\n apply:

\n
    \n
  • \n

    If you don't specify a subnet ID, we choose a default subnet from\n your default VPC for you. If you don't have a default VPC, you must specify a\n subnet ID in the request.

    \n
  • \n
  • \n

    All instances have a network interface with a primary private IPv4\n address. If you don't specify this address, we choose one from the IPv4 range of\n your subnet.

    \n
  • \n
  • \n

    Not all instance types support IPv6 addresses. For more information, see\n Instance\n types.

    \n
  • \n
  • \n

    If you don't specify a security group ID, we use the default security group.\n For more information, see Security\n groups.

    \n
  • \n
  • \n

    If any of the AMIs have a product code attached for which the user has not\n subscribed, the request fails.

    \n
  • \n
\n

You can create a launch template,\n which is a resource that contains the parameters to launch an instance. When you launch\n an instance using RunInstances, you can specify the launch template\n instead of specifying the launch parameters.

\n

To ensure faster instance launches, break up large requests into smaller batches. For\n example, create five separate launch requests for 100 instances each instead of one\n launch request for 500 instances.

\n

An instance is ready for you to use when it's in the running state. You\n can check the state of your instance using DescribeInstances. You can\n tag instances and EBS volumes during launch, after launch, or both. For more\n information, see CreateTags and Tagging your Amazon EC2\n resources.

\n

Linux instances have access to the public key of the key pair at boot. You can use\n this key to provide secure access to the instance. Amazon EC2 public images use this\n feature to provide secure access without passwords. For more information, see Key\n pairs.

\n

For troubleshooting, see What to do if\n an instance immediately terminates, and Troubleshooting connecting to your instance.

", + "smithy.api#examples": [ + { + "title": "To launch an instance", + "documentation": "This example launches an instance using the specified AMI, instance type, security group, subnet, block device mapping, and tags.", + "input": { + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/sdh", + "Ebs": { + "VolumeSize": 100 + } + } + ], + "ImageId": "ami-abc12345", + "InstanceType": "t2.micro", + "KeyName": "my-key-pair", + "MaxCount": 1, + "MinCount": 1, + "SecurityGroupIds": [ + "sg-1a2b3c4d" + ], + "SubnetId": "subnet-6e7f829e", + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Purpose", + "Value": "test" + } + ] + } + ] + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#RunInstancesMonitoringEnabled": { @@ -86140,7 +88511,7 @@ "InstanceType": { "target": "com.amazonaws.ec2#InstanceType", "traits": { - "smithy.api#documentation": "

The instance type. For more information, see Instance types in the\n Amazon EC2 User Guide.

\n

Default: m1.small\n

" + "smithy.api#documentation": "

The instance type. For more information, see Instance types in the\n Amazon EC2 User Guide.

" } }, "Ipv6AddressCount": { @@ -86364,7 +88735,7 @@ "HibernationOptions": { "target": "com.amazonaws.ec2#HibernationOptionsRequest", "traits": { - "smithy.api#documentation": "

Indicates whether an instance is enabled for hibernation. For more information, see\n Hibernate\n your instance in the Amazon EC2 User Guide.

\n

You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same\n instance.

" + "smithy.api#documentation": "

Indicates whether an instance is enabled for hibernation. This parameter is valid only\n if the instance meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

\n

You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same\n instance.

" } }, "LicenseSpecifications": { @@ -86383,13 +88754,13 @@ "EnclaveOptions": { "target": "com.amazonaws.ec2#EnclaveOptionsRequest", "traits": { - "smithy.api#documentation": "

Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For\n more information, see What is Amazon Web Services Nitro\n Enclaves? in the Amazon Web Services Nitro Enclaves User\n Guide.

\n

You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same\n instance.

" + "smithy.api#documentation": "

Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For\n more information, see What is Amazon Web Services Nitro\n Enclaves? in the Amazon Web Services Nitro Enclaves User\n Guide.

\n

You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same\n instance.

" } }, "PrivateDnsNameOptions": { "target": "com.amazonaws.ec2#PrivateDnsNameOptionsRequest", "traits": { - "smithy.api#documentation": "

The options for the instance hostname. The default values are inherited from the\n subnet.

" + "smithy.api#documentation": "

The options for the instance hostname. \n The default values are inherited from the subnet.\n Applies only if creating a network interface, not attaching an existing one.

" } }, "MaintenanceOptions": { @@ -86405,6 +88776,14 @@ "smithy.api#default": false, "smithy.api#documentation": "

Indicates whether an instance is enabled for stop protection. For more information,\n see Stop\n protection.

" } + }, + "EnablePrimaryIpv6": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable\n assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address\n associated with an ENI that you have enabled to use a primary IPv6 address. Use this\n option if an instance relies on its IPv6 address not changing. When you launch the\n instance, Amazon Web Services will automatically assign an IPv6 address associated with\n the ENI attached to your instance to be the primary IPv6 address. Once you enable an\n IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6\n GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6\n address until the instance is terminated or the network interface is detached. If you\n have multiple IPv6 addresses associated with an ENI attached to your instance and you\n enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI\n becomes the primary IPv6 address.

" + } } }, "traits": { @@ -86569,6 +88948,29 @@ "smithy.api#documentation": "

Describes the storage parameters for Amazon S3 and Amazon S3 buckets for an instance store-backed AMI.

" } }, + "com.amazonaws.ec2#SSEType": { + "type": "enum", + "members": { + "sse_ebs": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "sse-ebs" + } + }, + "sse_kms": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "sse-kms" + } + }, + "none": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "none" + } + } + } + }, "com.amazonaws.ec2#ScheduledInstance": { "type": "structure", "members": { @@ -87653,7 +90055,7 @@ "target": "com.amazonaws.ec2#IpPermissionList", "traits": { "aws.protocols#ec2QueryName": "IpPermissionsEgress", - "smithy.api#documentation": "

[VPC only] The outbound rules associated with the security group.

", + "smithy.api#documentation": "

The outbound rules associated with the security group.

", "smithy.api#xmlName": "ipPermissionsEgress" } }, @@ -87669,7 +90071,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "VpcId", - "smithy.api#documentation": "

[VPC only] The ID of the VPC for the security group.

", + "smithy.api#documentation": "

The ID of the VPC for the security group.

", "smithy.api#xmlName": "vpcId" } } @@ -88720,6 +91122,14 @@ "smithy.api#documentation": "

Only for archived snapshots that are temporarily restored. Indicates the date and \n time when a temporarily restored snapshot will be automatically re-archived.

", "smithy.api#xmlName": "restoreExpiryTime" } + }, + "SseType": { + "target": "com.amazonaws.ec2#SSEType", + "traits": { + "aws.protocols#ec2QueryName": "SseType", + "smithy.api#documentation": "

Reserved for future use.

", + "smithy.api#xmlName": "sseType" + } } }, "traits": { @@ -88980,6 +91390,14 @@ "smithy.api#documentation": "

The ARN of the Outpost on which the snapshot is stored. For more information, see Amazon EBS local snapshots on Outposts in the \n \t\tAmazon Elastic Compute Cloud User Guide.

", "smithy.api#xmlName": "outpostArn" } + }, + "SseType": { + "target": "com.amazonaws.ec2#SSEType", + "traits": { + "aws.protocols#ec2QueryName": "SseType", + "smithy.api#documentation": "

Reserved for future use.

", + "smithy.api#xmlName": "sseType" + } } }, "traits": { @@ -90173,6 +92591,12 @@ "traits": { "smithy.api#enumValue": "failed" } + }, + "disabled": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "disabled" + } } } }, @@ -90761,7 +93185,33 @@ "target": "com.amazonaws.ec2#StartInstancesResult" }, "traits": { - "smithy.api#documentation": "

Starts an Amazon EBS-backed instance that you've previously stopped.

\n

Instances that use Amazon EBS volumes as their root devices can be quickly stopped and\n started. When an instance is stopped, the compute resources are released and you are not\n billed for instance usage. However, your root partition Amazon EBS volume remains and\n continues to persist your data, and you are charged for Amazon EBS volume usage. You can\n restart your instance at any time. Every time you start your instance, Amazon EC2\n charges a one-minute minimum for instance usage, and thereafter charges per second for\n instance usage.

\n

Before stopping an instance, make sure it is in a state from which it can be\n restarted. Stopping an instance does not preserve data stored in RAM.

\n

Performing this operation on an instance that uses an instance store as its root\n device returns an error.

\n

If you attempt to start a T3 instance with host tenancy and the\n unlimted CPU credit option, the request fails. The\n unlimited CPU credit option is not supported on Dedicated Hosts. Before\n you start the instance, either change its CPU credit option to standard, or\n change its tenancy to default or dedicated.

\n

For more information, see Stop and start your instance\n in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Starts an Amazon EBS-backed instance that you've previously stopped.

\n

Instances that use Amazon EBS volumes as their root devices can be quickly stopped and\n started. When an instance is stopped, the compute resources are released and you are not\n billed for instance usage. However, your root partition Amazon EBS volume remains and\n continues to persist your data, and you are charged for Amazon EBS volume usage. You can\n restart your instance at any time. Every time you start your instance, Amazon EC2\n charges a one-minute minimum for instance usage, and thereafter charges per second for\n instance usage.

\n

Before stopping an instance, make sure it is in a state from which it can be\n restarted. Stopping an instance does not preserve data stored in RAM.

\n

Performing this operation on an instance that uses an instance store as its root\n device returns an error.

\n

If you attempt to start a T3 instance with host tenancy and the\n unlimted CPU credit option, the request fails. The\n unlimited CPU credit option is not supported on Dedicated Hosts. Before\n you start the instance, either change its CPU credit option to standard, or\n change its tenancy to default or dedicated.

\n

For more information, see Stop and start your instance\n in the Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To start a stopped EC2 instance", + "documentation": "This example starts the specified EC2 instance.", + "input": { + "InstanceIds": [ + "i-1234567890abcdef0" + ] + }, + "output": { + "StartingInstances": [ + { + "InstanceId": "i-1234567890abcdef0", + "CurrentState": { + "Code": 0, + "Name": "pending" + }, + "PreviousState": { + "Code": 80, + "Name": "stopped" + } + } + ] + } + } + ] } }, "com.amazonaws.ec2#StartInstancesRequest": { @@ -91196,7 +93646,33 @@ "target": "com.amazonaws.ec2#StopInstancesResult" }, "traits": { - "smithy.api#documentation": "

Stops an Amazon EBS-backed instance. For more information, see Stop and start\n your instance in the Amazon EC2 User Guide.

\n

You can use the Stop action to hibernate an instance if the instance is enabled for\n hibernation and it meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

\n

We don't charge usage for a stopped instance, or data transfer fees; however, your\n root partition Amazon EBS volume remains and continues to persist your data, and you are\n charged for Amazon EBS volume usage. Every time you start your instance, Amazon EC2\n charges a one-minute minimum for instance usage, and thereafter charges per second for\n instance usage.

\n

You can't stop or hibernate instance store-backed instances. You can't use the Stop\n action to hibernate Spot Instances, but you can specify that Amazon EC2 should hibernate\n Spot Instances when they are interrupted. For more information, see Hibernating interrupted Spot Instances in the\n Amazon EC2 User Guide.

\n

When you stop or hibernate an instance, we shut it down. You can restart your instance\n at any time. Before stopping or hibernating an instance, make sure it is in a state from\n which it can be restarted. Stopping an instance does not preserve data stored in RAM,\n but hibernating an instance does preserve data stored in RAM. If an instance cannot\n hibernate successfully, a normal shutdown occurs.

\n

Stopping and hibernating an instance is different to rebooting or terminating it. For\n example, when you stop or hibernate an instance, the root device and any other devices\n attached to the instance persist. When you terminate an instance, the root device and\n any other devices attached during the instance launch are automatically deleted. For\n more information about the differences between rebooting, stopping, hibernating, and\n terminating instances, see Instance lifecycle\n in the Amazon EC2 User Guide.

\n

When you stop an instance, we attempt to shut it down forcibly after a short while. If\n your instance appears stuck in the stopping state after a period of time, there may be\n an issue with the underlying host computer. For more information, see Troubleshoot\n stopping your instance in the Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Stops an Amazon EBS-backed instance. For more information, see Stop and start\n your instance in the Amazon EC2 User Guide.

\n

You can use the Stop action to hibernate an instance if the instance is enabled for\n hibernation and it meets the hibernation\n prerequisites. For more information, see Hibernate your instance in the\n Amazon EC2 User Guide.

\n

We don't charge usage for a stopped instance, or data transfer fees; however, your\n root partition Amazon EBS volume remains and continues to persist your data, and you are\n charged for Amazon EBS volume usage. Every time you start your instance, Amazon EC2\n charges a one-minute minimum for instance usage, and thereafter charges per second for\n instance usage.

\n

You can't stop or hibernate instance store-backed instances. You can't use the Stop\n action to hibernate Spot Instances, but you can specify that Amazon EC2 should hibernate\n Spot Instances when they are interrupted. For more information, see Hibernating interrupted Spot Instances in the\n Amazon EC2 User Guide.

\n

When you stop or hibernate an instance, we shut it down. You can restart your instance\n at any time. Before stopping or hibernating an instance, make sure it is in a state from\n which it can be restarted. Stopping an instance does not preserve data stored in RAM,\n but hibernating an instance does preserve data stored in RAM. If an instance cannot\n hibernate successfully, a normal shutdown occurs.

\n

Stopping and hibernating an instance is different to rebooting or terminating it. For\n example, when you stop or hibernate an instance, the root device and any other devices\n attached to the instance persist. When you terminate an instance, the root device and\n any other devices attached during the instance launch are automatically deleted. For\n more information about the differences between rebooting, stopping, hibernating, and\n terminating instances, see Instance lifecycle\n in the Amazon EC2 User Guide.

\n

When you stop an instance, we attempt to shut it down forcibly after a short while. If\n your instance appears stuck in the stopping state after a period of time, there may be\n an issue with the underlying host computer. For more information, see Troubleshoot\n stopping your instance in the Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To stop a running EC2 instance", + "documentation": "This example stops the specified EC2 instance.", + "input": { + "InstanceIds": [ + "i-1234567890abcdef0" + ] + }, + "output": { + "StoppingInstances": [ + { + "InstanceId": "i-1234567890abcdef0", + "CurrentState": { + "Code": 64, + "Name": "stopping" + }, + "PreviousState": { + "Code": 16, + "Name": "running" + } + } + ] + } + } + ] } }, "com.amazonaws.ec2#StopInstancesRequest": { @@ -91748,7 +94224,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "Description", - "smithy.api#documentation": "

The\n description\n assigned to the subnet CIDR\n reservation.

", + "smithy.api#documentation": "

The description assigned to the subnet CIDR reservation.

", "smithy.api#xmlName": "description" } }, @@ -92568,7 +95044,7 @@ } }, "ConnectionId": { - "target": "com.amazonaws.ec2#VpnConnectionId", + "target": "com.amazonaws.ec2#String", "traits": { "smithy.api#documentation": "

The ID of the client connection to be terminated.

" } @@ -92674,7 +95150,33 @@ "target": "com.amazonaws.ec2#TerminateInstancesResult" }, "traits": { - "smithy.api#documentation": "

Shuts down the specified instances. This operation is idempotent; if you terminate an\n instance more than once, each call succeeds.

\n

If you specify multiple instances and the request fails (for example, because of a\n single incorrect instance ID), none of the instances are terminated.

\n

If you terminate multiple instances across multiple Availability Zones, and one or\n more of the specified instances are enabled for termination protection, the request\n fails with the following results:

\n
    \n
  • \n

    The specified instances that are in the same Availability Zone as the\n protected instance are not terminated.

    \n
  • \n
  • \n

    The specified instances that are in different Availability Zones, where no\n other specified instances are protected, are successfully terminated.

    \n
  • \n
\n

For example, say you have the following instances:

\n
    \n
  • \n

    Instance A: us-east-1a; Not protected

    \n
  • \n
  • \n

    Instance B: us-east-1a; Not protected

    \n
  • \n
  • \n

    Instance C: us-east-1b; Protected

    \n
  • \n
  • \n

    Instance D: us-east-1b; not protected

    \n
  • \n
\n

If you attempt to terminate all of these instances in the same request, the request\n reports failure with the following results:

\n
    \n
  • \n

    Instance A and Instance B are successfully terminated because none of the\n specified instances in us-east-1a are enabled for termination\n protection.

    \n
  • \n
  • \n

    Instance C and Instance D fail to terminate because at least one of the\n specified instances in us-east-1b (Instance C) is enabled for\n termination protection.

    \n
  • \n
\n

Terminated instances remain visible after termination (for approximately one\n hour).

\n

By default, Amazon EC2 deletes all EBS volumes that were attached when the instance\n launched. Volumes attached after instance launch continue running.

\n

You can stop, start, and terminate EBS-backed instances. You can only terminate\n instance store-backed instances. What happens to an instance differs if you stop it or\n terminate it. For example, when you stop an instance, the root device and any other\n devices attached to the instance persist. When you terminate an instance, any attached\n EBS volumes with the DeleteOnTermination block device mapping parameter set\n to true are automatically deleted. For more information about the\n differences between stopping and terminating instances, see Instance lifecycle\n in the Amazon EC2 User Guide.

\n

For more information about troubleshooting, see Troubleshooting terminating your instance in the\n Amazon EC2 User Guide.

" + "smithy.api#documentation": "

Shuts down the specified instances. This operation is idempotent; if you terminate an\n instance more than once, each call succeeds.

\n

If you specify multiple instances and the request fails (for example, because of a\n single incorrect instance ID), none of the instances are terminated.

\n

If you terminate multiple instances across multiple Availability Zones, and one or\n more of the specified instances are enabled for termination protection, the request\n fails with the following results:

\n
    \n
  • \n

    The specified instances that are in the same Availability Zone as the\n protected instance are not terminated.

    \n
  • \n
  • \n

    The specified instances that are in different Availability Zones, where no\n other specified instances are protected, are successfully terminated.

    \n
  • \n
\n

For example, say you have the following instances:

\n
    \n
  • \n

    Instance A: us-east-1a; Not protected

    \n
  • \n
  • \n

    Instance B: us-east-1a; Not protected

    \n
  • \n
  • \n

    Instance C: us-east-1b; Protected

    \n
  • \n
  • \n

    Instance D: us-east-1b; not protected

    \n
  • \n
\n

If you attempt to terminate all of these instances in the same request, the request\n reports failure with the following results:

\n
    \n
  • \n

    Instance A and Instance B are successfully terminated because none of the\n specified instances in us-east-1a are enabled for termination\n protection.

    \n
  • \n
  • \n

    Instance C and Instance D fail to terminate because at least one of the\n specified instances in us-east-1b (Instance C) is enabled for\n termination protection.

    \n
  • \n
\n

Terminated instances remain visible after termination (for approximately one\n hour).

\n

By default, Amazon EC2 deletes all EBS volumes that were attached when the instance\n launched. Volumes attached after instance launch continue running.

\n

You can stop, start, and terminate EBS-backed instances. You can only terminate\n instance store-backed instances. What happens to an instance differs if you stop it or\n terminate it. For example, when you stop an instance, the root device and any other\n devices attached to the instance persist. When you terminate an instance, any attached\n EBS volumes with the DeleteOnTermination block device mapping parameter set\n to true are automatically deleted. For more information about the\n differences between stopping and terminating instances, see Instance lifecycle\n in the Amazon EC2 User Guide.

\n

For more information about troubleshooting, see Troubleshooting terminating your instance in the\n Amazon EC2 User Guide.

", + "smithy.api#examples": [ + { + "title": "To terminate an EC2 instance", + "documentation": "This example terminates the specified EC2 instance.", + "input": { + "InstanceIds": [ + "i-1234567890abcdef0" + ] + }, + "output": { + "TerminatingInstances": [ + { + "InstanceId": "i-1234567890abcdef0", + "CurrentState": { + "Code": 32, + "Name": "shutting-down" + }, + "PreviousState": { + "Code": 16, + "Name": "running" + } + } + ] + } + } + ] } }, "com.amazonaws.ec2#TerminateInstancesRequest": { @@ -96580,7 +99082,7 @@ } }, "PreSharedKey": { - "target": "com.amazonaws.ec2#String", + "target": "com.amazonaws.ec2#preSharedKey", "traits": { "aws.protocols#ec2QueryName": "PreSharedKey", "smithy.api#documentation": "

The pre-shared key (PSK) to establish initial authentication between the virtual\n private gateway and the customer gateway.

", @@ -96883,7 +99385,7 @@ "target": "com.amazonaws.ec2#UnassignPrivateNatGatewayAddressResult" }, "traits": { - "smithy.api#documentation": "

Unassigns secondary private IPv4 addresses from a private NAT gateway. You cannot unassign your primary private IP. For more information, see Edit secondary IP address associations in the Amazon Virtual Private Cloud User Guide.

\n

While unassigning is in progress, you cannot assign/unassign additional IP addresses while the connections are being drained. You are, however, allowed to delete the NAT gateway.

\n

A private IP address will only be released at the end of MaxDrainDurationSeconds. The\n private IP addresses stay associated and support the existing connections but do not\n support any new connections (new connections are distributed across the remaining\n assigned private IP address). After the existing connections drain out, the private IP\n addresses get released.

\n

\n

" + "smithy.api#documentation": "

Unassigns secondary private IPv4 addresses from a private NAT gateway. You cannot unassign your primary private IP. For more information, see Edit secondary IP address associations in the Amazon VPC User Guide.

\n

While unassigning is in progress, you cannot assign/unassign additional IP addresses while the connections are being drained. You are, however, allowed to delete the NAT gateway.

\n

A private IP address will only be released at the end of MaxDrainDurationSeconds. The\n private IP addresses stay associated and support the existing connections, but do not\n support any new connections (new connections are distributed across the remaining\n assigned private IP address). After the existing connections drain out, the private IP\n addresses are released.

\n

\n

" } }, "com.amazonaws.ec2#UnassignPrivateNatGatewayAddressRequest": { @@ -96893,7 +99395,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#required": {} } }, @@ -96934,7 +99436,7 @@ "target": "com.amazonaws.ec2#NatGatewayId", "traits": { "aws.protocols#ec2QueryName": "NatGatewayId", - "smithy.api#documentation": "

The NAT gateway ID.

", + "smithy.api#documentation": "

The ID of the NAT gateway.

", "smithy.api#xmlName": "natGatewayId" } }, @@ -97196,7 +99698,30 @@ "target": "com.amazonaws.ec2#UpdateSecurityGroupRuleDescriptionsEgressResult" }, "traits": { - "smithy.api#documentation": "

[VPC only] Updates the description of an egress (outbound) security group rule. You\n\t\t\tcan replace an existing description, or add a description to a rule that did not have one\n\t\t\tpreviously. You can remove a description for a security group rule by omitting the \n\t\t\tdescription parameter in the request.

" + "smithy.api#documentation": "

Updates the description of an egress (outbound) security group rule. You\n\t\t\tcan replace an existing description, or add a description to a rule that did not have one\n\t\t\tpreviously. You can remove a description for a security group rule by omitting the \n\t\t\tdescription parameter in the request.

", + "smithy.api#examples": [ + { + "title": "To update an outbound security group rule description", + "documentation": "This example updates the description for the specified security group rule.", + "input": { + "GroupId": "sg-123abc12", + "IpPermissions": [ + { + "IpProtocol": "tcp", + "FromPort": 80, + "ToPort": 80, + "IpRanges": [ + { + "CidrIp": "203.0.113.0/24", + "Description": "Outbound HTTP access to server 2" + } + ] + } + ] + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#UpdateSecurityGroupRuleDescriptionsEgressRequest": { @@ -97219,7 +99744,7 @@ "GroupName": { "target": "com.amazonaws.ec2#SecurityGroupName", "traits": { - "smithy.api#documentation": "

[Default VPC] The name of the security group. You must specify either the security group\n\t\t\tID or the security group name in the request.

" + "smithy.api#documentation": "

[Default VPC] The name of the security group. You must specify either the security group\n\t\t\tID or the security group name.

" } }, "IpPermissions": { @@ -97267,7 +99792,30 @@ "target": "com.amazonaws.ec2#UpdateSecurityGroupRuleDescriptionsIngressResult" }, "traits": { - "smithy.api#documentation": "

Updates the description of an ingress (inbound) security group rule. You can replace an\n\t\t\texisting description, or add a description to a rule that did not have one previously.\n\t\t You can remove a description for a security group rule by omitting the description \n\t\t parameter in the request.

" + "smithy.api#documentation": "

Updates the description of an ingress (inbound) security group rule. You can replace an\n\t\t\texisting description, or add a description to a rule that did not have one previously.\n\t\t You can remove a description for a security group rule by omitting the description \n\t\t parameter in the request.

", + "smithy.api#examples": [ + { + "title": "To update an inbound security group rule description", + "documentation": "This example updates the description for the specified security group rule.", + "input": { + "GroupId": "sg-123abc12", + "IpPermissions": [ + { + "IpProtocol": "tcp", + "FromPort": 22, + "ToPort": 22, + "IpRanges": [ + { + "CidrIp": "203.0.113.0/16", + "Description": "SSH access from the LA office" + } + ] + } + ] + }, + "output": {} + } + ] } }, "com.amazonaws.ec2#UpdateSecurityGroupRuleDescriptionsIngressRequest": { @@ -97290,7 +99838,7 @@ "GroupName": { "target": "com.amazonaws.ec2#SecurityGroupName", "traits": { - "smithy.api#documentation": "

[EC2-Classic, default VPC] The name of the security group. You must specify either the\n security group ID or the security group name in the request. For security groups in a\n nondefault VPC, you must specify the security group ID.

" + "smithy.api#documentation": "

[Default VPC] The name of the security group. You must specify either the\n security group ID or the security group name. For security groups in a\n nondefault VPC, you must specify the security group ID.

" } }, "IpPermissions": { @@ -97302,7 +99850,7 @@ "SecurityGroupRuleDescriptions": { "target": "com.amazonaws.ec2#SecurityGroupRuleDescriptionList", "traits": { - "smithy.api#documentation": "

[VPC only] The description for the ingress security group rules. You must specify either\n a description or IP permissions.

", + "smithy.api#documentation": "

The description for the ingress security group rules. You must specify either\n a description or IP permissions.

", "smithy.api#xmlName": "SecurityGroupRuleDescription" } } @@ -97448,7 +99996,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "GroupName", - "smithy.api#documentation": "

The name of the security group. In a request, use this parameter for a security group\n in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the\n security group ID.

\n

For a referenced security group in another VPC, this value is not returned if the\n referenced security group is deleted.

", + "smithy.api#documentation": "

[Default VPC] The name of the security group. For a security group in a nondefault VPC, \n use the security group ID.

\n

For a referenced security group in another VPC, this value is not returned if the\n referenced security group is deleted.

", "smithy.api#xmlName": "groupName" } }, @@ -97464,7 +100012,7 @@ "target": "com.amazonaws.ec2#String", "traits": { "aws.protocols#ec2QueryName": "UserId", - "smithy.api#documentation": "

The ID of an Amazon Web Services account.

\n

For a referenced security group in another VPC, the account ID of the referenced\n security group is returned in the response. If the referenced security group is deleted,\n this value is not returned.

\n

[EC2-Classic] Required when adding or removing rules that reference a security group\n in another Amazon Web Services account.

", + "smithy.api#documentation": "

The ID of an Amazon Web Services account.

\n

For a referenced security group in another VPC, the account ID of the referenced\n security group is returned in the response. If the referenced security group is deleted,\n this value is not returned.

", "smithy.api#xmlName": "userId" } }, @@ -97486,7 +100034,7 @@ } }, "traits": { - "smithy.api#documentation": "

Describes a security group and Amazon Web Services account ID pair.

\n \n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
" + "smithy.api#documentation": "

Describes a security group and Amazon Web Services account ID pair.

" } }, "com.amazonaws.ec2#UserIdGroupPairList": { @@ -98444,10 +100992,24 @@ "traits": { "smithy.api#documentation": "

Sends Verified Access logs to Kinesis.

" } + }, + "LogVersion": { + "target": "com.amazonaws.ec2#String", + "traits": { + "smithy.api#documentation": "

\n\t\t The logging version to use.\n\t

\n

Valid values: ocsf-0.1 | ocsf-1.0.0-rc.2\n

" + } + }, + "IncludeTrustContext": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

\n\t\t Include trust data sent by trust providers into the logs. \n\t

" + } } }, "traits": { - "smithy.api#documentation": "

Describes the destinations for Verified Access logs.

" + "smithy.api#documentation": "

Options for Verified Access logs.

" } }, "com.amazonaws.ec2#VerifiedAccessLogS3Destination": { @@ -98561,10 +101123,28 @@ "smithy.api#documentation": "

Kinesis logging destination.

", "smithy.api#xmlName": "kinesisDataFirehose" } + }, + "LogVersion": { + "target": "com.amazonaws.ec2#String", + "traits": { + "aws.protocols#ec2QueryName": "LogVersion", + "smithy.api#documentation": "

\n Describes current setting for the logging version.\n

", + "smithy.api#xmlName": "logVersion" + } + }, + "IncludeTrustContext": { + "target": "com.amazonaws.ec2#Boolean", + "traits": { + "aws.protocols#ec2QueryName": "IncludeTrustContext", + "smithy.api#clientOptional": {}, + "smithy.api#default": false, + "smithy.api#documentation": "

\n\t\t Describes current setting for including trust data into the logs.\n\t

", + "smithy.api#xmlName": "includeTrustContext" + } } }, "traits": { - "smithy.api#documentation": "

Describes the destinations for Verified Access logs.

" + "smithy.api#documentation": "

Describes the options for Verified Access logs.

" } }, "com.amazonaws.ec2#VerifiedAccessTrustProvider": { @@ -99009,6 +101589,14 @@ "smithy.api#documentation": "

The throughput that the volume supports, in MiB/s.

", "smithy.api#xmlName": "throughput" } + }, + "SseType": { + "target": "com.amazonaws.ec2#SSEType", + "traits": { + "aws.protocols#ec2QueryName": "SseType", + "smithy.api#documentation": "

Reserved for future use.

", + "smithy.api#xmlName": "sseType" + } } }, "traits": { @@ -100060,7 +102648,7 @@ } }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Describes whether a VPC is enabled for ClassicLink.

" + "smithy.api#documentation": "\n

Deprecated.

\n
\n

Describes whether a VPC is enabled for ClassicLink.

" } }, "com.amazonaws.ec2#VpcClassicLinkIdList": { @@ -100603,7 +103191,7 @@ "aws.protocols#ec2QueryName": "AllowDnsResolutionFromRemoteVpc", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.

", + "smithy.api#documentation": "

Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses \n when queried from instances in a peer VPC.

", "smithy.api#xmlName": "allowDnsResolutionFromRemoteVpc" } }, @@ -100613,7 +103201,7 @@ "aws.protocols#ec2QueryName": "AllowEgressFromLocalClassicLinkToRemoteVpc", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.

", + "smithy.api#documentation": "

Deprecated.

", "smithy.api#xmlName": "allowEgressFromLocalClassicLinkToRemoteVpc" } }, @@ -100623,13 +103211,13 @@ "aws.protocols#ec2QueryName": "AllowEgressFromLocalVpcToRemoteClassicLink", "smithy.api#clientOptional": {}, "smithy.api#default": false, - "smithy.api#documentation": "

Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.

", + "smithy.api#documentation": "

Deprecated.

", "smithy.api#xmlName": "allowEgressFromLocalVpcToRemoteClassicLink" } } }, "traits": { - "smithy.api#documentation": "\n

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.

\n
\n

Describes the VPC peering connection options.

" + "smithy.api#documentation": "

Describes the VPC peering connection options.

" } }, "com.amazonaws.ec2#VpcPeeringConnectionStateReason": { @@ -100811,7 +103399,7 @@ "type": "structure", "members": { "CustomerGatewayConfiguration": { - "target": "com.amazonaws.ec2#String", + "target": "com.amazonaws.ec2#customerGatewayConfiguration", "traits": { "aws.protocols#ec2QueryName": "CustomerGatewayConfiguration", "smithy.api#documentation": "

The configuration information for the VPN connection's customer gateway (in the native\n XML format). This element is always present in the CreateVpnConnection\n response; however, it's present in the DescribeVpnConnections response\n only if the VPN connection is in the pending or available\n state.

", @@ -101422,7 +104010,7 @@ } }, "PreSharedKey": { - "target": "com.amazonaws.ec2#String", + "target": "com.amazonaws.ec2#preSharedKey", "traits": { "smithy.api#documentation": "

The pre-shared key (PSK) to establish initial authentication between the virtual\n private gateway and customer gateway.

\n

Constraints: Allowed characters are alphanumeric characters, periods (.), and\n underscores (_). Must be between 8 and 64 characters in length and cannot start with\n zero (0).

" } @@ -101678,6 +104266,18 @@ } } }, + "com.amazonaws.ec2#customerGatewayConfiguration": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.ec2#preSharedKey": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, "com.amazonaws.ec2#scope": { "type": "enum", "members": { @@ -101709,6 +104309,9 @@ }, "com.amazonaws.ec2#totalGpuMemory": { "type": "integer" + }, + "com.amazonaws.ec2#totalInferenceMemory": { + "type": "integer" } } } diff --git a/aws/sdk/aws-models/route53.json b/aws/sdk/aws-models/route53.json index 72d97074e3..388346dd5b 100644 --- a/aws/sdk/aws-models/route53.json +++ b/aws/sdk/aws-models/route53.json @@ -1628,6 +1628,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#ActivateKeySigningKeyResponse": { @@ -1639,6 +1642,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#AlarmIdentifier": { @@ -1780,7 +1786,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to associate a VPC with a\n\t\t\tprivate hosted zone.

" + "smithy.api#documentation": "

A complex type that contains information about the request to associate a VPC with a\n\t\t\tprivate hosted zone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#AssociateVPCWithHostedZoneResponse": { @@ -1795,7 +1802,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tAssociateVPCWithHostedZone request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tAssociateVPCWithHostedZone request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#Change": { @@ -1925,6 +1933,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#ChangeCidrCollectionResponse": { @@ -1937,6 +1948,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ChangeId": { @@ -2009,7 +2023,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates, changes, or deletes a resource record set, which contains authoritative DNS\n\t\t\tinformation for a specified domain name or subdomain name. For example, you can use\n\t\t\t\tChangeResourceRecordSets to create a resource record set that routes\n\t\t\ttraffic for test.example.com to a web server that has an IP address of\n\t\t\t192.0.2.44.

\n

\n Deleting Resource Record Sets\n

\n

To delete a resource record set, you must specify all the same values that you\n\t\t\tspecified when you created it.

\n

\n Change Batches and Transactional Changes\n

\n

The request body must include a document with a\n\t\t\t\tChangeResourceRecordSetsRequest element. The request body contains a\n\t\t\tlist of change items, known as a change batch. Change batches are considered\n\t\t\ttransactional changes. Route 53 validates the changes in the request and then either\n\t\t\tmakes all or none of the changes in the change batch request. This ensures that DNS\n\t\t\trouting isn't adversely affected by partial changes to the resource record sets in a\n\t\t\thosted zone.

\n

For example, suppose a change batch request contains two changes: it deletes the\n\t\t\t\tCNAME resource record set for www.example.com and creates an alias\n\t\t\tresource record set for www.example.com. If validation for both records succeeds, Route\n\t\t\t53 deletes the first resource record set and creates the second resource record set in a\n\t\t\tsingle operation. If validation for either the DELETE or the\n\t\t\t\tCREATE action fails, then the request is canceled, and the original\n\t\t\t\tCNAME record continues to exist.

\n \n

If you try to delete the same resource record set more than once in a single\n\t\t\t\tchange batch, Route 53 returns an InvalidChangeBatch error.

\n
\n

\n Traffic Flow\n

\n

To create resource record sets for complex routing configurations, use either the\n\t\t\ttraffic flow visual editor in the Route 53 console or the API actions for traffic\n\t\t\tpolicies and traffic policy instances. Save the configuration as a traffic policy, then\n\t\t\tassociate the traffic policy with one or more domain names (such as example.com) or\n\t\t\tsubdomain names (such as www.example.com), in the same hosted zone or in multiple hosted\n\t\t\tzones. You can roll back the updates if the new configuration isn't performing as\n\t\t\texpected. For more information, see Using Traffic Flow to Route\n\t\t\t\tDNS Traffic in the Amazon Route 53 Developer\n\t\t\tGuide.

\n

\n Create, Delete, and Upsert\n

\n

Use ChangeResourceRecordsSetsRequest to perform the following\n\t\t\tactions:

\n
    \n
  • \n

    \n CREATE: Creates a resource record set that has the specified\n\t\t\t\t\tvalues.

    \n
  • \n
  • \n

    \n DELETE: Deletes an existing resource record set that has the\n\t\t\t\t\tspecified values.

    \n
  • \n
  • \n

    \n UPSERT: If a resource set exists Route 53 updates it with the\n\t\t\t\t\tvalues in the request.

    \n
  • \n
\n

\n Syntaxes for Creating, Updating, and Deleting Resource Record\n\t\t\t\tSets\n

\n

The syntax for a request depends on the type of resource record set that you want to\n\t\t\tcreate, delete, or update, such as weighted, alias, or failover. The XML elements in\n\t\t\tyour request must appear in the order listed in the syntax.

\n

For an example for each type of resource record set, see \"Examples.\"

\n

Don't refer to the syntax in the \"Parameter Syntax\" section, which includes\n\t\t\tall of the elements for every kind of resource record set that you can create, delete,\n\t\t\tor update by using ChangeResourceRecordSets.

\n

\n Change Propagation to Route 53 DNS Servers\n

\n

When you submit a ChangeResourceRecordSets request, Route 53 propagates\n\t\t\tyour changes to all of the Route 53 authoritative DNS servers. While your changes are\n\t\t\tpropagating, GetChange returns a status of PENDING. When\n\t\t\tpropagation is complete, GetChange returns a status of INSYNC.\n\t\t\tChanges generally propagate to all Route 53 name servers within 60 seconds. For more\n\t\t\tinformation, see GetChange.

\n

\n Limits on ChangeResourceRecordSets Requests\n

\n

For information about the limits on a ChangeResourceRecordSets request,\n\t\t\tsee Limits in the Amazon Route 53 Developer Guide.

", + "smithy.api#documentation": "

Creates, changes, or deletes a resource record set, which contains authoritative DNS\n\t\t\tinformation for a specified domain name or subdomain name. For example, you can use\n\t\t\t\tChangeResourceRecordSets to create a resource record set that routes\n\t\t\ttraffic for test.example.com to a web server that has an IP address of\n\t\t\t192.0.2.44.

\n

\n Deleting Resource Record Sets\n

\n

To delete a resource record set, you must specify all the same values that you\n\t\t\tspecified when you created it.

\n

\n Change Batches and Transactional Changes\n

\n

The request body must include a document with a\n\t\t\t\tChangeResourceRecordSetsRequest element. The request body contains a\n\t\t\tlist of change items, known as a change batch. Change batches are considered\n\t\t\ttransactional changes. Route 53 validates the changes in the request and then either\n\t\t\tmakes all or none of the changes in the change batch request. This ensures that DNS\n\t\t\trouting isn't adversely affected by partial changes to the resource record sets in a\n\t\t\thosted zone.

\n

For example, suppose a change batch request contains two changes: it deletes the\n\t\t\t\tCNAME resource record set for www.example.com and creates an alias\n\t\t\tresource record set for www.example.com. If validation for both records succeeds, Route\n\t\t\t53 deletes the first resource record set and creates the second resource record set in a\n\t\t\tsingle operation. If validation for either the DELETE or the\n\t\t\t\tCREATE action fails, then the request is canceled, and the original\n\t\t\t\tCNAME record continues to exist.

\n \n

If you try to delete the same resource record set more than once in a single\n\t\t\t\tchange batch, Route 53 returns an InvalidChangeBatch error.

\n
\n

\n Traffic Flow\n

\n

To create resource record sets for complex routing configurations, use either the\n\t\t\ttraffic flow visual editor in the Route 53 console or the API actions for traffic\n\t\t\tpolicies and traffic policy instances. Save the configuration as a traffic policy, then\n\t\t\tassociate the traffic policy with one or more domain names (such as example.com) or\n\t\t\tsubdomain names (such as www.example.com), in the same hosted zone or in multiple hosted\n\t\t\tzones. You can roll back the updates if the new configuration isn't performing as\n\t\t\texpected. For more information, see Using Traffic Flow to Route\n\t\t\t\tDNS Traffic in the Amazon Route 53 Developer\n\t\t\tGuide.

\n

\n Create, Delete, and Upsert\n

\n

Use ChangeResourceRecordsSetsRequest to perform the following\n\t\t\tactions:

\n
    \n
  • \n

    \n CREATE: Creates a resource record set that has the specified\n\t\t\t\t\tvalues.

    \n
  • \n
  • \n

    \n DELETE: Deletes an existing resource record set that has the\n\t\t\t\t\tspecified values.

    \n
  • \n
  • \n

    \n UPSERT: If a resource set exists Route 53 updates it with the\n\t\t\t\t\tvalues in the request.

    \n
  • \n
\n

\n Syntaxes for Creating, Updating, and Deleting Resource Record\n\t\t\t\tSets\n

\n

The syntax for a request depends on the type of resource record set that you want to\n\t\t\tcreate, delete, or update, such as weighted, alias, or failover. The XML elements in\n\t\t\tyour request must appear in the order listed in the syntax.

\n

For an example for each type of resource record set, see \"Examples.\"

\n

Don't refer to the syntax in the \"Parameter Syntax\" section, which includes\n\t\t\tall of the elements for every kind of resource record set that you can create, delete,\n\t\t\tor update by using ChangeResourceRecordSets.

\n

\n Change Propagation to Route 53 DNS Servers\n

\n

When you submit a ChangeResourceRecordSets request, Route 53 propagates your\n\t\t\tchanges to all of the Route 53 authoritative DNS servers managing the hosted zone. While\n\t\t\tyour changes are propagating, GetChange returns a status of\n\t\t\t\tPENDING. When propagation is complete, GetChange returns a\n\t\t\tstatus of INSYNC. Changes generally propagate to all Route 53 name servers\n\t\t\tmanaging the hosted zone within 60 seconds. For more information, see GetChange.

\n

\n Limits on ChangeResourceRecordSets Requests\n

\n

For information about the limits on a ChangeResourceRecordSets request,\n\t\t\tsee Limits in the Amazon Route 53 Developer Guide.

", "smithy.api#http": { "method": "POST", "uri": "/2013-04-01/hostedzone/{HostedZoneId}/rrset", @@ -2037,7 +2051,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains change information for the resource record set.

" + "smithy.api#documentation": "

A complex type that contains change information for the resource record set.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ChangeResourceRecordSetsResponse": { @@ -2052,7 +2067,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type containing the response for the request.

" + "smithy.api#documentation": "

A complex type containing the response for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ChangeStatus": { @@ -2139,14 +2155,16 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the tags that you want to add, edit, or\n\t\t\tdelete.

" + "smithy.api#documentation": "

A complex type that contains information about the tags that you want to add, edit, or\n\t\t\tdelete.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ChangeTagsForResourceResponse": { "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

Empty response for the request.

" + "smithy.api#documentation": "

Empty response for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#Changes": { @@ -2700,6 +2718,12 @@ "traits": { "smithy.api#enumValue": "ap-southeast-4" } + }, + "il_central_1": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "il-central-1" + } } }, "traits": { @@ -2886,6 +2910,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateCidrCollectionResponse": { @@ -2904,6 +2931,9 @@ "smithy.api#httpHeader": "Location" } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateHealthCheck": { @@ -2953,7 +2983,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the health check request information.

" + "smithy.api#documentation": "

A complex type that contains the health check request information.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateHealthCheckResponse": { @@ -2976,7 +3007,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type containing the response information for the new health check.

" + "smithy.api#documentation": "

A complex type containing the response information for the new health check.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateHostedZone": { @@ -3057,12 +3089,13 @@ "DelegationSetId": { "target": "com.amazonaws.route53#ResourceId", "traits": { - "smithy.api#documentation": "

If you want to associate a reusable delegation set with this hosted zone, the ID that\n\t\t\t\tAmazon Route 53 assigned to the reusable delegation set when you created it.\n\t\t\tFor more information about reusable delegation sets, see CreateReusableDelegationSet.

" + "smithy.api#documentation": "

If you want to associate a reusable delegation set with this hosted zone, the ID that\n\t\t\t\tAmazon Route 53 assigned to the reusable delegation set when you created it.\n\t\t\tFor more information about reusable delegation sets, see CreateReusableDelegationSet.

\n

If you are using a reusable delegation set to create a public hosted zone for a subdomain,\n\t\t\tmake sure that the parent hosted zone doesn't use one or more of the same name servers.\n\t\t\tIf you have overlapping nameservers, the operation will cause a\n\t\t\t\tConflictingDomainsExist error.

" } } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to create a public or\n\t\t\tprivate hosted zone.

" + "smithy.api#documentation": "

A complex type that contains information about the request to create a public or\n\t\t\tprivate hosted zone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateHostedZoneResponse": { @@ -3105,7 +3138,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type containing the response information for the hosted zone.

" + "smithy.api#documentation": "

A complex type containing the response information for the hosted zone.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateKeySigningKey": { @@ -3195,6 +3229,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateKeySigningKeyResponse": { @@ -3221,6 +3258,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateQueryLoggingConfig": { @@ -3277,6 +3317,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateQueryLoggingConfigResponse": { @@ -3297,6 +3340,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateReusableDelegationSet": { @@ -3355,6 +3401,9 @@ "smithy.api#documentation": "

If you want to mark the delegation set for an existing hosted zone as reusable, the ID\n\t\t\tfor that hosted zone.

" } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateReusableDelegationSetResponse": { @@ -3375,6 +3424,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateTrafficPolicy": { @@ -3482,7 +3534,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the resource record sets that you want\n\t\t\tto create based on a specified traffic policy.

" + "smithy.api#documentation": "

A complex type that contains information about the resource record sets that you want\n\t\t\tto create based on a specified traffic policy.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateTrafficPolicyInstanceResponse": { @@ -3505,7 +3558,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tCreateTrafficPolicyInstance request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tCreateTrafficPolicyInstance request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateTrafficPolicyRequest": { @@ -3533,7 +3587,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the traffic policy that you want to\n\t\t\tcreate.

" + "smithy.api#documentation": "

A complex type that contains information about the traffic policy that you want to\n\t\t\tcreate.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateTrafficPolicyResponse": { @@ -3556,7 +3611,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tCreateTrafficPolicy request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tCreateTrafficPolicy request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateTrafficPolicyVersion": { @@ -3619,7 +3675,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the traffic policy that you want to\n\t\t\tcreate a new version for.

" + "smithy.api#documentation": "

A complex type that contains information about the traffic policy that you want to\n\t\t\tcreate a new version for.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateTrafficPolicyVersionResponse": { @@ -3642,7 +3699,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tCreateTrafficPolicyVersion request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the\n\t\t\t\tCreateTrafficPolicyVersion request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#CreateVPCAssociationAuthorization": { @@ -3699,7 +3757,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to authorize associating a\n\t\t\tVPC with your private hosted zone. Authorization is only required when a private hosted\n\t\t\tzone and a VPC were created by using different accounts.

" + "smithy.api#documentation": "

A complex type that contains information about the request to authorize associating a\n\t\t\tVPC with your private hosted zone. Authorization is only required when a private hosted\n\t\t\tzone and a VPC were created by using different accounts.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#CreateVPCAssociationAuthorizationResponse": { @@ -3721,7 +3780,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information from a\n\t\t\t\tCreateVPCAssociationAuthorization request.

" + "smithy.api#documentation": "

A complex type that contains the response information from a\n\t\t\t\tCreateVPCAssociationAuthorization request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#DNSName": { @@ -3828,6 +3888,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#DeactivateKeySigningKeyResponse": { @@ -3839,6 +3902,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#DelegationSet": { @@ -4008,11 +4074,17 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteCidrCollectionResponse": { "type": "structure", - "members": {} + "members": {}, + "traits": { + "smithy.api#output": {} + } }, "com.amazonaws.route53#DeleteHealthCheck": { "type": "operation", @@ -4055,14 +4127,16 @@ } }, "traits": { - "smithy.api#documentation": "

This action deletes a health check.

" + "smithy.api#documentation": "

This action deletes a health check.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteHealthCheckResponse": { "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

An empty element.

" + "smithy.api#documentation": "

An empty element.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#DeleteHostedZone": { @@ -4112,7 +4186,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to delete a hosted zone.

" + "smithy.api#documentation": "

A request to delete a hosted zone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteHostedZoneResponse": { @@ -4127,7 +4202,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a DeleteHostedZone\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to a DeleteHostedZone\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#DeleteKeySigningKey": { @@ -4186,6 +4262,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteKeySigningKeyResponse": { @@ -4197,6 +4276,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#DeleteQueryLoggingConfig": { @@ -4238,11 +4320,17 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteQueryLoggingConfigResponse": { "type": "structure", - "members": {} + "members": {}, + "traits": { + "smithy.api#output": {} + } }, "com.amazonaws.route53#DeleteReusableDelegationSet": { "type": "operation", @@ -4288,14 +4376,16 @@ } }, "traits": { - "smithy.api#documentation": "

A request to delete a reusable delegation set.

" + "smithy.api#documentation": "

A request to delete a reusable delegation set.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteReusableDelegationSetResponse": { "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

An empty element.

" + "smithy.api#documentation": "

An empty element.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#DeleteTrafficPolicy": { @@ -4370,14 +4460,16 @@ } }, "traits": { - "smithy.api#documentation": "

A request to delete a specified traffic policy instance.

" + "smithy.api#documentation": "

A request to delete a specified traffic policy instance.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteTrafficPolicyInstanceResponse": { "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

An empty element.

" + "smithy.api#documentation": "

An empty element.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#DeleteTrafficPolicyRequest": { @@ -4401,14 +4493,16 @@ } }, "traits": { - "smithy.api#documentation": "

A request to delete a specified traffic policy version.

" + "smithy.api#documentation": "

A request to delete a specified traffic policy version.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteTrafficPolicyResponse": { "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

An empty element.

" + "smithy.api#documentation": "

An empty element.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#DeleteVPCAssociationAuthorization": { @@ -4465,14 +4559,16 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to remove authorization to\n\t\t\tassociate a VPC that was created by one Amazon Web Services account with a hosted zone\n\t\t\tthat was created with a different Amazon Web Services account.

" + "smithy.api#documentation": "

A complex type that contains information about the request to remove authorization to\n\t\t\tassociate a VPC that was created by one Amazon Web Services account with a hosted zone\n\t\t\tthat was created with a different Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DeleteVPCAssociationAuthorizationResponse": { "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

Empty response for the request.

" + "smithy.api#documentation": "

Empty response for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#Dimension": { @@ -4575,6 +4671,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#DisableHostedZoneDNSSECResponse": { @@ -4586,6 +4685,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#Disabled": { @@ -4654,7 +4756,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the VPC that you want to disassociate\n\t\t\tfrom a specified private hosted zone.

" + "smithy.api#documentation": "

A complex type that contains information about the VPC that you want to disassociate\n\t\t\tfrom a specified private hosted zone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#DisassociateVPCFromHostedZoneResponse": { @@ -4669,7 +4772,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the disassociate\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response information for the disassociate\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#EnableHostedZoneDNSSEC": { @@ -4729,6 +4833,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#EnableHostedZoneDNSSECResponse": { @@ -4740,6 +4847,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#EnableSNI": { @@ -4951,7 +5061,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to create a hosted\n\t\t\tzone.

" + "smithy.api#documentation": "

A complex type that contains information about the request to create a hosted\n\t\t\tzone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetAccountLimitResponse": { @@ -4974,7 +5085,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the requested limit.

" + "smithy.api#documentation": "

A complex type that contains the requested limit.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetChange": { @@ -4994,7 +5106,7 @@ } ], "traits": { - "smithy.api#documentation": "

Returns the current status of a change batch request. The status is one of the\n\t\t\tfollowing values:

\n
    \n
  • \n

    \n PENDING indicates that the changes in this request have not\n\t\t\t\t\tpropagated to all Amazon Route 53 DNS servers. This is the initial status of all\n\t\t\t\t\tchange batch requests.

    \n
  • \n
  • \n

    \n INSYNC indicates that the changes have propagated to all Route 53\n\t\t\t\t\tDNS servers.

    \n
  • \n
", + "smithy.api#documentation": "

Returns the current status of a change batch request. The status is one of the\n\t\t\tfollowing values:

\n
    \n
  • \n

    \n PENDING indicates that the changes in this request have not\n\t\t\t\t\tpropagated to all Amazon Route 53 DNS servers managing the hosted zone. This is the initial status of all\n\t\t\t\t\tchange batch requests.

    \n
  • \n
  • \n

    \n INSYNC indicates that the changes have propagated to all Route 53\n\t\t\t\t\tDNS servers managing the hosted zone.

    \n
  • \n
", "smithy.api#http": { "method": "GET", "uri": "/2013-04-01/change/{Id}", @@ -5032,7 +5144,8 @@ } }, "traits": { - "smithy.api#documentation": "

The input for a GetChange request.

" + "smithy.api#documentation": "

The input for a GetChange request.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetChangeResponse": { @@ -5047,7 +5160,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the ChangeInfo element.

" + "smithy.api#documentation": "

A complex type that contains the ChangeInfo element.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetCheckerIpRanges": { @@ -5071,7 +5185,8 @@ "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

Empty request.

" + "smithy.api#documentation": "

Empty request.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetCheckerIpRangesResponse": { @@ -5086,7 +5201,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the CheckerIpRanges element.

" + "smithy.api#documentation": "

A complex type that contains the CheckerIpRanges element.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetDNSSEC": { @@ -5128,6 +5244,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#GetDNSSECResponse": { @@ -5147,6 +5266,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#GetGeoLocation": { @@ -5200,7 +5322,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request for information about whether a specified geographic location is supported\n\t\t\tfor Amazon Route 53 geolocation resource record sets.

" + "smithy.api#documentation": "

A request for information about whether a specified geographic location is supported\n\t\t\tfor Amazon Route 53 geolocation resource record sets.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetGeoLocationResponse": { @@ -5215,7 +5338,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the specified geolocation\n\t\t\tcode.

" + "smithy.api#documentation": "

A complex type that contains the response information for the specified geolocation\n\t\t\tcode.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHealthCheck": { @@ -5267,7 +5391,8 @@ "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

A request for the number of health checks that are associated with the current Amazon Web Services account.

" + "smithy.api#documentation": "

A request for the number of health checks that are associated with the current Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHealthCheckCountResponse": { @@ -5282,7 +5407,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a GetHealthCheckCount\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to a GetHealthCheckCount\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHealthCheckLastFailureReason": { @@ -5323,7 +5449,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request for the reason that a health check failed most recently.

" + "smithy.api#documentation": "

A request for the reason that a health check failed most recently.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHealthCheckLastFailureReasonResponse": { @@ -5338,7 +5465,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a\n\t\t\t\tGetHealthCheckLastFailureReason request.

" + "smithy.api#documentation": "

A complex type that contains the response to a\n\t\t\t\tGetHealthCheckLastFailureReason request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHealthCheckRequest": { @@ -5354,7 +5482,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get information about a specified health check.

" + "smithy.api#documentation": "

A request to get information about a specified health check.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHealthCheckResponse": { @@ -5369,7 +5498,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a GetHealthCheck\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to a GetHealthCheck\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHealthCheckStatus": { @@ -5410,7 +5540,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get the status for a health check.

" + "smithy.api#documentation": "

A request to get the status for a health check.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHealthCheckStatusResponse": { @@ -5425,7 +5556,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a GetHealthCheck\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to a GetHealthCheck\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHostedZone": { @@ -5479,7 +5611,8 @@ "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

A request to retrieve a count of all the hosted zones that are associated with the\n\t\t\tcurrent Amazon Web Services account.

" + "smithy.api#documentation": "

A request to retrieve a count of all the hosted zones that are associated with the\n\t\t\tcurrent Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHostedZoneCountResponse": { @@ -5494,7 +5627,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a GetHostedZoneCount\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to a GetHostedZoneCount\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHostedZoneLimit": { @@ -5546,7 +5680,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to create a hosted\n\t\t\tzone.

" + "smithy.api#documentation": "

A complex type that contains information about the request to create a hosted\n\t\t\tzone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHostedZoneLimitResponse": { @@ -5569,7 +5704,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the requested limit.

" + "smithy.api#documentation": "

A complex type that contains the requested limit.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetHostedZoneRequest": { @@ -5585,7 +5721,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get information about a specified hosted zone.

" + "smithy.api#documentation": "

A request to get information about a specified hosted zone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetHostedZoneResponse": { @@ -5612,7 +5749,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contain the response to a GetHostedZone\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contain the response to a GetHostedZone\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetQueryLoggingConfig": { @@ -5651,6 +5789,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#GetQueryLoggingConfigResponse": { @@ -5663,6 +5804,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#GetReusableDelegationSet": { @@ -5739,7 +5883,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the request to create a hosted\n\t\t\tzone.

" + "smithy.api#documentation": "

A complex type that contains information about the request to create a hosted\n\t\t\tzone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetReusableDelegationSetLimitResponse": { @@ -5762,7 +5907,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the requested limit.

" + "smithy.api#documentation": "

A complex type that contains the requested limit.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetReusableDelegationSetRequest": { @@ -5778,7 +5924,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get information about a specified reusable delegation set.

" + "smithy.api#documentation": "

A request to get information about a specified reusable delegation set.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetReusableDelegationSetResponse": { @@ -5793,7 +5940,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to the GetReusableDelegationSet\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to the GetReusableDelegationSet\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetTrafficPolicy": { @@ -5867,7 +6015,8 @@ "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

Request to get the number of traffic policy instances that are associated with the\n\t\t\tcurrent Amazon Web Services account.

" + "smithy.api#documentation": "

Request to get the number of traffic policy instances that are associated with the\n\t\t\tcurrent Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetTrafficPolicyInstanceCountResponse": { @@ -5882,7 +6031,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the resource record sets that Amazon\n\t\t\tRoute 53 created based on a specified traffic policy.

" + "smithy.api#documentation": "

A complex type that contains information about the resource record sets that Amazon\n\t\t\tRoute 53 created based on a specified traffic policy.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetTrafficPolicyInstanceRequest": { @@ -5898,7 +6048,8 @@ } }, "traits": { - "smithy.api#documentation": "

Gets information about a specified traffic policy instance.

" + "smithy.api#documentation": "

Gets information about a specified traffic policy instance.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetTrafficPolicyInstanceResponse": { @@ -5913,7 +6064,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the resource record sets that Amazon\n\t\t\tRoute 53 created based on a specified traffic policy.

" + "smithy.api#documentation": "

A complex type that contains information about the resource record sets that Amazon\n\t\t\tRoute 53 created based on a specified traffic policy.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#GetTrafficPolicyRequest": { @@ -5937,7 +6089,8 @@ } }, "traits": { - "smithy.api#documentation": "

Gets information about a specific traffic policy version.

" + "smithy.api#documentation": "

Gets information about a specific traffic policy version.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#GetTrafficPolicyResponse": { @@ -5952,7 +6105,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#HealthCheck": { @@ -7160,6 +7314,9 @@ "smithy.api#httpQuery": "maxresults" } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#ListCidrBlocksResponse": { @@ -7177,6 +7334,9 @@ "smithy.api#documentation": "

A complex type that contains information about the CIDR blocks.

" } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ListCidrCollections": { @@ -7224,6 +7384,9 @@ "smithy.api#httpQuery": "maxresults" } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#ListCidrCollectionsResponse": { @@ -7241,6 +7404,9 @@ "smithy.api#documentation": "

A complex type with information about the CIDR collection.

" } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ListCidrLocations": { @@ -7299,6 +7465,9 @@ "smithy.api#httpQuery": "maxresults" } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#ListCidrLocationsResponse": { @@ -7316,6 +7485,9 @@ "smithy.api#documentation": "

A complex type that contains information about the list of CIDR locations.

" } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ListGeoLocations": { @@ -7373,7 +7545,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get a list of geographic locations that Amazon Route 53 supports for\n\t\t\tgeolocation resource record sets.

" + "smithy.api#documentation": "

A request to get a list of geographic locations that Amazon Route 53 supports for\n\t\t\tgeolocation resource record sets.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListGeoLocationsResponse": { @@ -7421,7 +7594,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type containing the response information for the request.

" + "smithy.api#documentation": "

A complex type containing the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListHealthChecks": { @@ -7474,7 +7648,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to retrieve a list of the health checks that are associated with the current\n\t\t\t\tAmazon Web Services account.

" + "smithy.api#documentation": "

A request to retrieve a list of the health checks that are associated with the current\n\t\t\t\tAmazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListHealthChecksResponse": { @@ -7517,7 +7692,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a ListHealthChecks\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to a ListHealthChecks\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListHostedZones": { @@ -7605,7 +7781,8 @@ } }, "traits": { - "smithy.api#documentation": "

Retrieves a list of the public and private hosted zones that are associated with the\n\t\t\tcurrent Amazon Web Services account in ASCII order by domain name.

" + "smithy.api#documentation": "

Retrieves a list of the public and private hosted zones that are associated with the\n\t\t\tcurrent Amazon Web Services account in ASCII order by domain name.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListHostedZonesByNameResponse": { @@ -7659,7 +7836,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListHostedZonesByVPC": { @@ -7722,7 +7900,8 @@ } }, "traits": { - "smithy.api#documentation": "

Lists all the private hosted zones that a specified VPC is associated with, regardless\n\t\t\tof which Amazon Web Services account created the hosted zones.

" + "smithy.api#documentation": "

Lists all the private hosted zones that a specified VPC is associated with, regardless\n\t\t\tof which Amazon Web Services account created the hosted zones.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListHostedZonesByVPCResponse": { @@ -7748,6 +7927,9 @@ "smithy.api#documentation": "

The value that you will use for NextToken in the next\n\t\t\t\tListHostedZonesByVPC request.

" } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ListHostedZonesRequest": { @@ -7776,7 +7958,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to retrieve a list of the public and private hosted zones that are\n\t\t\tassociated with the current Amazon Web Services account.

" + "smithy.api#documentation": "

A request to retrieve a list of the public and private hosted zones that are\n\t\t\tassociated with the current Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListHostedZonesResponse": { @@ -7817,6 +8000,9 @@ "smithy.api#required": {} } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ListQueryLoggingConfigs": { @@ -7877,6 +8063,9 @@ "smithy.api#httpQuery": "maxresults" } } + }, + "traits": { + "smithy.api#input": {} } }, "com.amazonaws.route53#ListQueryLoggingConfigsResponse": { @@ -7895,6 +8084,9 @@ "smithy.api#documentation": "

If a response includes the last of the query logging configurations that are\n\t\t\tassociated with the current Amazon Web Services account, NextToken doesn't\n\t\t\tappear in the response.

\n

If a response doesn't include the last of the configurations, you can get more\n\t\t\tconfigurations by submitting another ListQueryLoggingConfigs request. Get the value of NextToken\n\t\t\tthat Amazon Route 53 returned in the previous response and include it in\n\t\t\t\tNextToken in the next request.

" } } + }, + "traits": { + "smithy.api#output": {} } }, "com.amazonaws.route53#ListResourceRecordSets": { @@ -7963,7 +8155,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request for the resource record sets that are associated with a specified hosted\n\t\t\tzone.

" + "smithy.api#documentation": "

A request for the resource record sets that are associated with a specified hosted\n\t\t\tzone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListResourceRecordSetsResponse": { @@ -8011,7 +8204,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains list information for the resource record set.

" + "smithy.api#documentation": "

A complex type that contains list information for the resource record set.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListReusableDelegationSets": { @@ -8055,7 +8249,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get a list of the reusable delegation sets that are associated with the\n\t\t\tcurrent Amazon Web Services account.

" + "smithy.api#documentation": "

A request to get a list of the reusable delegation sets that are associated with the\n\t\t\tcurrent Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListReusableDelegationSetsResponse": { @@ -8098,7 +8293,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the reusable delegation sets that are\n\t\t\tassociated with the current Amazon Web Services account.

" + "smithy.api#documentation": "

A complex type that contains information about the reusable delegation sets that are\n\t\t\tassociated with the current Amazon Web Services account.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTagsForResource": { @@ -8156,7 +8352,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type containing information about a request for a list of the tags that are\n\t\t\tassociated with an individual resource.

" + "smithy.api#documentation": "

A complex type containing information about a request for a list of the tags that are\n\t\t\tassociated with an individual resource.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTagsForResourceResponse": { @@ -8171,7 +8368,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the health checks or hosted zones for\n\t\t\twhich you want to list tags.

" + "smithy.api#documentation": "

A complex type that contains information about the health checks or hosted zones for\n\t\t\twhich you want to list tags.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTagsForResources": { @@ -8228,7 +8426,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the health checks or hosted zones for\n\t\t\twhich you want to list tags.

" + "smithy.api#documentation": "

A complex type that contains information about the health checks or hosted zones for\n\t\t\twhich you want to list tags.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTagsForResourcesResponse": { @@ -8243,7 +8442,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type containing tags for the specified resources.

" + "smithy.api#documentation": "

A complex type containing tags for the specified resources.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTrafficPolicies": { @@ -8287,7 +8487,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the information about the request to list the traffic\n\t\t\tpolicies that are associated with the current Amazon Web Services account.

" + "smithy.api#documentation": "

A complex type that contains the information about the request to list the traffic\n\t\t\tpolicies that are associated with the current Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTrafficPoliciesResponse": { @@ -8324,7 +8525,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTrafficPolicyInstances": { @@ -8414,7 +8616,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request for the traffic policy instances that you created in a specified hosted\n\t\t\tzone.

" + "smithy.api#documentation": "

A request for the traffic policy instances that you created in a specified hosted\n\t\t\tzone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTrafficPolicyInstancesByHostedZoneResponse": { @@ -8456,7 +8659,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTrafficPolicyInstancesByPolicy": { @@ -8536,7 +8740,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the information about the request to list your traffic\n\t\t\tpolicy instances.

" + "smithy.api#documentation": "

A complex type that contains the information about the request to list your traffic\n\t\t\tpolicy instances.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTrafficPolicyInstancesByPolicyResponse": { @@ -8584,7 +8789,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTrafficPolicyInstancesRequest": { @@ -8620,7 +8826,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to get information about the traffic policy instances that you created by\n\t\t\tusing the current Amazon Web Services account.

" + "smithy.api#documentation": "

A request to get information about the traffic policy instances that you created by\n\t\t\tusing the current Amazon Web Services account.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTrafficPolicyInstancesResponse": { @@ -8668,7 +8875,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListTrafficPolicyVersions": { @@ -8723,7 +8931,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the information about the request to list your traffic\n\t\t\tpolicies.

" + "smithy.api#documentation": "

A complex type that contains the information about the request to list your traffic\n\t\t\tpolicies.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListTrafficPolicyVersionsResponse": { @@ -8760,7 +8969,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#ListVPCAssociationAuthorizations": { @@ -8818,7 +9028,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about that can be associated with your hosted\n\t\t\tzone.

" + "smithy.api#documentation": "

A complex type that contains information about that can be associated with your hosted\n\t\t\tzone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#ListVPCAssociationAuthorizationsResponse": { @@ -8846,7 +9057,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the request.

" + "smithy.api#documentation": "

A complex type that contains the response information for the request.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#LocationSummaries": { @@ -9744,6 +9956,12 @@ "traits": { "smithy.api#enumValue": "ap-southeast-4" } + }, + "il_central_1": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "il-central-1" + } } }, "traits": { @@ -10147,7 +10365,7 @@ } ], "traits": { - "smithy.api#documentation": "

Gets the value that Amazon Route 53 returns in response to a DNS request for a\n\t\t\tspecified record name and type. You can optionally specify the IP address of a DNS\n\t\t\tresolver, an EDNS0 client subnet IP address, and a subnet mask.

\n

This call only supports querying public hosted zones.

", + "smithy.api#documentation": "

Gets the value that Amazon Route 53 returns in response to a DNS request for a\n\t\t\tspecified record name and type. You can optionally specify the IP address of a DNS\n\t\t\tresolver, an EDNS0 client subnet IP address, and a subnet mask.

\n

This call only supports querying public hosted zones.

\n \n

The TestDnsAnswer returns information similar to what you would expect from the answer\n\t\t\tsection of the dig command. Therefore, if you query for the name\n\t\t\tservers of a subdomain that point to the parent name servers, those will not be\n\t\t\treturned.

\n
", "smithy.api#http": { "method": "GET", "uri": "/2013-04-01/testdnsanswer", @@ -10205,7 +10423,8 @@ } }, "traits": { - "smithy.api#documentation": "

Gets the value that Amazon Route 53 returns in response to a DNS request for a\n\t\t\tspecified record name and type. You can optionally specify the IP address of a DNS\n\t\t\tresolver, an EDNS0 client subnet IP address, and a subnet mask.

" + "smithy.api#documentation": "

Gets the value that Amazon Route 53 returns in response to a DNS request for a\n\t\t\tspecified record name and type. You can optionally specify the IP address of a DNS\n\t\t\tresolver, an EDNS0 client subnet IP address, and a subnet mask.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#TestDNSAnswerResponse": { @@ -10255,7 +10474,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to a TestDNSAnswer request.\n\t\t

" + "smithy.api#documentation": "

A complex type that contains the response to a TestDNSAnswer request.\n\t\t

", + "smithy.api#output": {} } }, "com.amazonaws.route53#Threshold": { @@ -10834,7 +11054,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about a request to update a health\n\t\t\tcheck.

" + "smithy.api#documentation": "

A complex type that contains information about a request to update a health\n\t\t\tcheck.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#UpdateHealthCheckResponse": { @@ -10849,7 +11070,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to the UpdateHealthCheck\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to the UpdateHealthCheck\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#UpdateHostedZoneComment": { @@ -10899,7 +11121,8 @@ } }, "traits": { - "smithy.api#documentation": "

A request to update the comment for a hosted zone.

" + "smithy.api#documentation": "

A request to update the comment for a hosted zone.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#UpdateHostedZoneCommentResponse": { @@ -10914,7 +11137,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response to the UpdateHostedZoneComment\n\t\t\trequest.

" + "smithy.api#documentation": "

A complex type that contains the response to the UpdateHostedZoneComment\n\t\t\trequest.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#UpdateTrafficPolicyComment": { @@ -10973,7 +11197,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the traffic policy that you want to\n\t\t\tupdate the comment for.

" + "smithy.api#documentation": "

A complex type that contains information about the traffic policy that you want to\n\t\t\tupdate the comment for.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#UpdateTrafficPolicyCommentResponse": { @@ -10988,7 +11213,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains the response information for the traffic policy.

" + "smithy.api#documentation": "

A complex type that contains the response information for the traffic policy.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#UpdateTrafficPolicyInstance": { @@ -11059,7 +11285,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the resource record sets that you want\n\t\t\tto update based on a specified traffic policy instance.

" + "smithy.api#documentation": "

A complex type that contains information about the resource record sets that you want\n\t\t\tto update based on a specified traffic policy instance.

", + "smithy.api#input": {} } }, "com.amazonaws.route53#UpdateTrafficPolicyInstanceResponse": { @@ -11074,7 +11301,8 @@ } }, "traits": { - "smithy.api#documentation": "

A complex type that contains information about the resource record sets that Amazon\n\t\t\tRoute 53 created based on a specified traffic policy.

" + "smithy.api#documentation": "

A complex type that contains information about the resource record sets that Amazon\n\t\t\tRoute 53 created based on a specified traffic policy.

", + "smithy.api#output": {} } }, "com.amazonaws.route53#UsageCount": { @@ -11345,6 +11573,12 @@ "traits": { "smithy.api#enumValue": "ap-southeast-4" } + }, + "il_central_1": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "il-central-1" + } } }, "traits": { diff --git a/aws/sdk/integration-tests/Cargo.toml b/aws/sdk/integration-tests/Cargo.toml index 42a1385840..f18a443839 100644 --- a/aws/sdk/integration-tests/Cargo.toml +++ b/aws/sdk/integration-tests/Cargo.toml @@ -11,7 +11,6 @@ members = [ "no-default-features", "polly", "qldbsession", - "route53", "s3", "s3control", "sts", diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt index 1c25b22317..a58dbc2a57 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt @@ -187,13 +187,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte } } -// if (structureSymbol.isOptional()) { -// rustBlock("if let Some(${safeName()}) = ${context.valueExpression.asRef()}") { -// rust("#T(${context.writerExpression}, ${safeName()})?;", structureSerializer) -// } -// } else { rust("#T(${context.writerExpression}, ${context.valueExpression.asRef()})?;", structureSerializer) -// } } private fun RustWriter.serializeStructureInner(context: Context) { @@ -250,7 +244,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte ) } is BlobShape -> rust( - "$writer.string(&#T(&${value.name}));", + "$writer.string(&#T(${value.asRef()}));", RuntimeType.base64Encode(runtimeConfig), ) is TimestampShape -> { diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt index 0a4a52f839..3dbcba28ef 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt @@ -343,7 +343,7 @@ fun TestWriterDelegator.compileAndTest( val env = mapOf("RUSTFLAGS" to "-A dead_code") val testOutput = "cargo test".runCommand(baseDir, env) if (runClippy) { - "cargo clippy".runCommand(baseDir, env) + "cargo clippy --all-features --tests".runCommand(baseDir, env) } return testOutput } diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt index 6ed9f79edc..4b5f490e13 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/Ec2QuerySerializerGeneratorTest.kt @@ -207,6 +207,8 @@ class Ec2QuerySerializerGeneratorTest { map: MyMap, @required top: Top, + @required + blob: Blob } @http(uri: "/top", method: "POST") @@ -262,6 +264,7 @@ class Ec2QuerySerializerGeneratorTest { $maybeUnwrap ) .boolean(true) + .blob(aws_smithy_types::Blob::new(&b"test"[..])) .build() .unwrap(); let serialized = ${format(operationGenerator!!)}(&input).unwrap(); @@ -277,7 +280,8 @@ class Ec2QuerySerializerGeneratorTest { &Top.Extra=45\ &Top.Rec.1.Choice.Choice=true\ &Top.Rec.1.Field=World%21\ - &Top.Rec.1.Extra=55" + &Top.Rec.1.Extra=55\ + &Blob=dGVzdA%3D%3D" ); """, ) From ae6a636c08d8b7dda61eb659c40bcf0876392f83 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Aug 2023 14:09:36 -0500 Subject: [PATCH 20/36] Update codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt Co-authored-by: John DiSanti --- .../smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt index eb8daccdef..6f5871db3b 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt @@ -82,7 +82,6 @@ class ClientCodegenVisitor( nameBuilderFor = { symbol -> "${symbol.name}Builder" }, ) - println("rustSymbolProviderConfig:\n$rustSymbolProviderConfig") val baseModel = baselineTransform(context.model) val untransformedService = settings.getService(baseModel) val (protocol, generator) = ClientProtocolLoader( From 491ca43e3234e2043dca9c788ab720dfe2083101 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Aug 2023 14:33:04 -0500 Subject: [PATCH 21/36] respond to PR comments --- .../protocols/serialize/QuerySerializerGenerator.kt | 10 +--------- .../amazon/smithy/rust/codegen/core/testutil/Rust.kt | 2 +- .../smithy/rust/codegen/core/testutil/TestHelpers.kt | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt index a58dbc2a57..c18a67ebca 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/QuerySerializerGenerator.kt @@ -174,15 +174,7 @@ abstract class QuerySerializerGenerator(private val codegenContext: CodegenConte "Input" to structureSymbol, *codegenScope, ) { - context.copy(writerExpression = "writer", valueExpression = ValueExpression.Reference("input")) - .also { inner -> - for (member in inner.shape.members()) { - val memberContext = MemberContext.structMember(inner, member, symbolProvider) - structWriter(memberContext) { writerExpression -> - serializeMember(memberContext.copy(writerExpression = writerExpression)) - } - } - } + serializeStructureInner(context) rust("Ok(())") } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt index 3dbcba28ef..d2f303e54e 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/Rust.kt @@ -343,7 +343,7 @@ fun TestWriterDelegator.compileAndTest( val env = mapOf("RUSTFLAGS" to "-A dead_code") val testOutput = "cargo test".runCommand(baseDir, env) if (runClippy) { - "cargo clippy --all-features --tests".runCommand(baseDir, env) + "cargo clippy --all-features".runCommand(baseDir, env) } return testOutput } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt index e52ba106bb..0323f63023 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt @@ -100,7 +100,7 @@ private object CodegenCoreTestModules { } } -fun testRustSymbolProviderConfig(nullabilityCheckMode: NullableIndex.CheckMode = NullableIndex.CheckMode.CLIENT) = RustSymbolProviderConfig( +fun testRustSymbolProviderConfig(nullabilityCheckMode: NullableIndex.CheckMode) = RustSymbolProviderConfig( runtimeConfig = TestRuntimeConfig, renameExceptions = true, nullabilityCheckMode = nullabilityCheckMode, From c4b99589cb4791db0f9a6b3023b9a6050852946d Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Aug 2023 15:14:18 -0500 Subject: [PATCH 22/36] add missing author to changelog remove test symbol provider default for NullableIndex.CheckMode --- CHANGELOG.next.toml | 11 ++++++----- .../codegen/core/rustlang/RustReservedWordsTest.kt | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 448d873e89..007733a769 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -46,11 +46,6 @@ references = ["smithy-rs#2921"] meta = { "breaking" = true, "tada" = false, "bug" = false } author = "rcoh" -[[smithy-rs]] -message = "Support for Smithy IDLv2 nullability can now be enabled by setting `generateOptionsForRequiredShapes = false` in your codegen config. This will render `@required` struct members without an `Option`." -references = ["smithy-rs#2916", "smithy-rs#1767"] -meta = { "breaking" = false, "tada" = true, "bug" = false, "target" = "client"} - [[aws-sdk-rust]] message = "In sigV4-related code, rename 'signing service' to 'signing name'. This aligns with the terminology used by the endpoint resolver." references = ["smithy-rs#2911"] @@ -62,3 +57,9 @@ message = "Struct members modeled as required are no longer wrapped in `Option`s references = ["smithy-rs#2916", "aws-sdk-rust#536"] meta = { "breaking" = true, "tada" = true, "bug" = false } author = "Velfi" + +[[smithy-rs]] +message = "Support for Smithy IDLv2 nullability can now be enabled by setting `generateOptionsForRequiredShapes = false` in your codegen config. This will render `@required` struct members without an `Option`." +references = ["smithy-rs#2916", "smithy-rs#1767"] +meta = { "breaking" = false, "tada" = true, "bug" = false, "target" = "client"} +author = "Velfi" diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt index a1d9062827..ec97799af4 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt @@ -8,6 +8,7 @@ package software.amazon.smithy.rust.codegen.core.rustlang import io.kotest.matchers.shouldBe import org.junit.jupiter.api.Test import software.amazon.smithy.model.Model +import software.amazon.smithy.model.knowledge.NullableIndex import software.amazon.smithy.model.shapes.MemberShape import software.amazon.smithy.model.shapes.ShapeId import software.amazon.smithy.rust.codegen.core.smithy.MaybeRenamed @@ -20,8 +21,8 @@ import software.amazon.smithy.rust.codegen.core.testutil.testRustSymbolProviderC import software.amazon.smithy.rust.codegen.core.util.lookup internal class RustReservedWordSymbolProviderTest { - private class TestSymbolProvider(model: Model) : - WrappingSymbolProvider(SymbolVisitor(testRustSettings(), model, null, testRustSymbolProviderConfig())) + private class TestSymbolProvider(model: Model, nullabilityCheckMode: NullableIndex.CheckMode) : + WrappingSymbolProvider(SymbolVisitor(testRustSettings(), model, null, testRustSymbolProviderConfig(nullabilityCheckMode))) private val emptyConfig = RustReservedWordConfig(emptyMap(), emptyMap(), emptyMap()) @Test @@ -30,13 +31,13 @@ internal class RustReservedWordSymbolProviderTest { namespace test structure Self {} """.asSmithyModel() - val provider = RustReservedWordSymbolProvider(TestSymbolProvider(model), emptyConfig) + val provider = RustReservedWordSymbolProvider(TestSymbolProvider(model, NullableIndex.CheckMode.CLIENT), emptyConfig) val symbol = provider.toSymbol(model.lookup("test#Self")) symbol.name shouldBe "SelfValue" } private fun mappingTest(config: RustReservedWordConfig, model: Model, id: String, test: (String) -> Unit) { - val provider = RustReservedWordSymbolProvider(TestSymbolProvider(model), config) + val provider = RustReservedWordSymbolProvider(TestSymbolProvider(model, NullableIndex.CheckMode.CLIENT), config) val symbol = provider.toMemberName(model.lookup("test#Container\$$id")) test(symbol) } @@ -132,7 +133,7 @@ internal class RustReservedWordSymbolProviderTest { async: String } """.asSmithyModel() - val provider = RustReservedWordSymbolProvider(TestSymbolProvider(model), emptyConfig) + val provider = RustReservedWordSymbolProvider(TestSymbolProvider(model, NullableIndex.CheckMode.CLIENT), emptyConfig) provider.toMemberName( MemberShape.builder().id("namespace#container\$async").target("namespace#Integer").build(), ) shouldBe "r##async" @@ -149,7 +150,7 @@ internal class RustReservedWordSymbolProviderTest { @enum([{ name: "dontcare", value: "dontcare" }]) string Container """.asSmithyModel() val provider = RustReservedWordSymbolProvider( - TestSymbolProvider(model), + TestSymbolProvider(model, NullableIndex.CheckMode.CLIENT), reservedWordConfig = emptyConfig.copy( enumMemberMap = mapOf( "Unknown" to "UnknownValue", From dac4679a20fcb13aefd75f26f1dac8f5b3440f18 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Aug 2023 15:48:50 -0500 Subject: [PATCH 23/36] update CHANGELOG --- CHANGELOG.next.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 007733a769..eea7136b5d 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -53,13 +53,17 @@ meta = { "breaking" = true, "tada" = false, "bug" = false } author = "Velfi" [[aws-sdk-rust]] -message = "Struct members modeled as required are no longer wrapped in `Option`s." +message = "Struct members modeled as required are no longer wrapped in `Option`s. For upgrade guidance and more info, see [here](https://github.com/awslabs/smithy-rs/discussions/2929)." references = ["smithy-rs#2916", "aws-sdk-rust#536"] meta = { "breaking" = true, "tada" = true, "bug" = false } author = "Velfi" [[smithy-rs]] -message = "Support for Smithy IDLv2 nullability can now be enabled by setting `generateOptionsForRequiredShapes = false` in your codegen config. This will render `@required` struct members without an `Option`." +message = """ +Support for Smithy IDLv2 nullability can now be enabled by setting `generateOptionsForRequiredShapes = false` in your codegen config. +This will render `@required` struct members without an `Option`. +For upgrade guidance and more info, see [here](https://github.com/awslabs/smithy-rs/discussions/2929). +""" references = ["smithy-rs#2916", "smithy-rs#1767"] meta = { "breaking" = false, "tada" = true, "bug" = false, "target" = "client"} author = "Velfi" From 5e6f6b92880e3653ed3e33c573e16a76468b5ebf Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Tue, 12 Sep 2023 09:40:05 -0400 Subject: [PATCH 24/36] Fix endpoints decorator test --- .../codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt | 1 + .../rust/codegen/core/smithy/generators/BuilderGenerator.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt index d6878f1b96..390e9d2880 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt @@ -109,6 +109,7 @@ class EndpointsDecoratorTest { input: TestOperationInput } + @input structure TestOperationInput { @contextParam(name: "Bucket") @required diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt index 9697cc624f..c7ec7cd947 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt @@ -89,6 +89,8 @@ fun MemberShape.enforceRequired( return field } val shape = this + val isOptional = codegenContext.symbolProvider.toSymbol(shape).isOptional() + val field = field.letIf(!isOptional) { field.map { rust("Some(#T)", it) } } val error = OperationBuildError(codegenContext.runtimeConfig).missingField( codegenContext.symbolProvider.toMemberName(shape), "A required field was not set", ) From 94c8dbbaf398e3a25f87608b83ebd4a336597e3e Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Tue, 12 Sep 2023 12:50:27 -0400 Subject: [PATCH 25/36] Create ClientBuilderInstatiator & manuall create BuildError --- .../smithy/generators/BuilderGenerator.kt | 28 ++++++++ .../codegen/core/smithy/protocols/AwsJson.kt | 2 + .../codegen/core/smithy/protocols/RestJson.kt | 3 +- .../parse/EventStreamUnmarshallerGenerator.kt | 12 +++- .../protocols/parse/JsonParserGenerator.kt | 66 ++++++------------- .../parse/JsonParserGeneratorTest.kt | 2 + .../generators/protocol/ServerProtocol.kt | 37 +++++++++++ rust-runtime/aws-smithy-http/Cargo.toml | 1 - .../aws-smithy-http/src/operation/error.rs | 19 ------ 9 files changed, 103 insertions(+), 67 deletions(-) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt index c7ec7cd947..eb192cc02d 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGenerator.kt @@ -129,6 +129,34 @@ fun MemberShape.setterName() = "set_${this.memberName.toSnakeCase()}" // Getter names will never hit a reserved word and therefore never need escaping. fun MemberShape.getterName() = "get_${this.memberName.toSnakeCase()}" +interface BuilderInstantiator { + fun setField(builder: String, value: Writable, e: MemberShape): Writable + fun finalizeBuilder(builder: String, shape: StructureShape, mapErr: Writable? = null): Writable +} + +class ClientBuilderInstantiator(private val symbolProvider: RustSymbolProvider) : BuilderInstantiator { + override fun setField(builder: String, value: Writable, e: MemberShape): Writable { + return writable { + rustTemplate("$builder = $builder.${e.setterName()}(#{value})", "value" to value) + } + } + + override fun finalizeBuilder(builder: String, shape: StructureShape, mapErr: Writable?): Writable = writable { + if (BuilderGenerator.hasFallibleBuilder(shape, symbolProvider)) { + rustTemplate( + "$builder.build()#{mapErr}?", + "mapErr" to ( + mapErr?.map { + rust(".map_err(#T)", it) + } ?: writable { } + ), + ) + } else { + rust("$builder.build()") + } + } +} + class BuilderGenerator( private val model: Model, private val symbolProvider: RustSymbolProvider, diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt index 0a53422552..fbb994110e 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt @@ -18,6 +18,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rustBlockTemplate import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.generators.ClientBuilderInstantiator import software.amazon.smithy.rust.codegen.core.smithy.generators.serializationError import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.JsonParserGenerator import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.StructuredDataParserGenerator @@ -148,6 +149,7 @@ open class AwsJson( codegenContext, httpBindingResolver, ::awsJsonFieldName, + builderInstantiator = ClientBuilderInstantiator(codegenContext.symbolProvider), ) override fun structuredDataSerializer(): StructuredDataSerializerGenerator = diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/RestJson.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/RestJson.kt index ba526d0c87..01759c8a7d 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/RestJson.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/RestJson.kt @@ -18,6 +18,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.generators.ClientBuilderInstantiator import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.JsonParserGenerator import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.StructuredDataParserGenerator import software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize.JsonSerializerGenerator @@ -95,7 +96,7 @@ open class RestJson(val codegenContext: CodegenContext) : Protocol { listOf("x-amzn-errortype" to errorShape.id.name) override fun structuredDataParser(): StructuredDataParserGenerator = - JsonParserGenerator(codegenContext, httpBindingResolver, ::restJsonFieldName) + JsonParserGenerator(codegenContext, httpBindingResolver, ::restJsonFieldName, builderInstantiator = ClientBuilderInstantiator(codegenContext.symbolProvider)) override fun structuredDataSerializer(): StructuredDataSerializerGenerator = JsonSerializerGenerator(codegenContext, httpBindingResolver, ::restJsonFieldName) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt index 415586b40f..f04876a2d7 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/EventStreamUnmarshallerGenerator.kt @@ -29,10 +29,12 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rustBlock import software.amazon.smithy.rust.codegen.core.rustlang.rustBlockTemplate import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.rustlang.withBlock +import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator +import software.amazon.smithy.rust.codegen.core.smithy.generators.ClientBuilderInstantiator import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.renderUnknownVariant import software.amazon.smithy.rust.codegen.core.smithy.generators.setterName @@ -356,10 +358,18 @@ class EventStreamUnmarshallerGenerator( builder.set_meta(Some(generic)); return Ok(#{UnmarshalledMessage}::Error( #{OpError}::${member.target.name}( - builder.build()${if (builderIsFallible) { "?" } else { "" }} + #{build} ) )) """, + "build" to ClientBuilderInstantiator(symbolProvider).finalizeBuilder( + "builder", target, + writable { + rustTemplate( + """|err|#{Error}::unmarshalling(format!("{}", err))""", *codegenScope, + ) + }, + ), "parser" to parser, *codegenScope, ) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt index 9905d7ddce..a3e220c7a9 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGenerator.kt @@ -33,17 +33,15 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rustBlockTemplate import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.rustlang.withBlock import software.amazon.smithy.rust.codegen.core.rustlang.withBlockTemplate +import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext -import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.canUseDefault import software.amazon.smithy.rust.codegen.core.smithy.customize.NamedCustomization import software.amazon.smithy.rust.codegen.core.smithy.customize.Section -import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator.Companion.hasFallibleBuilder +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderInstantiator import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.renderUnknownVariant -import software.amazon.smithy.rust.codegen.core.smithy.generators.setterName -import software.amazon.smithy.rust.codegen.core.smithy.isOptional import software.amazon.smithy.rust.codegen.core.smithy.isRustBoxed import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpBindingResolver import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpLocation @@ -60,13 +58,16 @@ import software.amazon.smithy.utils.StringUtils * Class describing a JSON parser section that can be used in a customization. */ sealed class JsonParserSection(name: String) : Section(name) { - data class BeforeBoxingDeserializedMember(val shape: MemberShape) : JsonParserSection("BeforeBoxingDeserializedMember") + data class BeforeBoxingDeserializedMember(val shape: MemberShape) : + JsonParserSection("BeforeBoxingDeserializedMember") - data class AfterTimestampDeserializedMember(val shape: MemberShape) : JsonParserSection("AfterTimestampDeserializedMember") + data class AfterTimestampDeserializedMember(val shape: MemberShape) : + JsonParserSection("AfterTimestampDeserializedMember") data class AfterBlobDeserializedMember(val shape: MemberShape) : JsonParserSection("AfterBlobDeserializedMember") - data class AfterDocumentDeserializedMember(val shape: MemberShape) : JsonParserSection("AfterDocumentDeserializedMember") + data class AfterDocumentDeserializedMember(val shape: MemberShape) : + JsonParserSection("AfterDocumentDeserializedMember") } /** @@ -94,6 +95,7 @@ class JsonParserGenerator( ReturnSymbolToParse(codegenContext.symbolProvider.toSymbol(shape), false) }, private val customizations: List = listOf(), + private val builderInstantiator: BuilderInstantiator, ) : StructuredDataParserGenerator { private val model = codegenContext.model private val symbolProvider = codegenContext.symbolProvider @@ -246,30 +248,7 @@ class JsonParserGenerator( rustBlock("match key.to_unescaped()?.as_ref()") { for (member in members) { rustBlock("${jsonName(member).dq()} =>") { - when (codegenTarget) { - CodegenTarget.CLIENT -> { - withBlock("builder = builder.${member.setterName()}(", ");") { - deserializeMember(member) - } - } - CodegenTarget.SERVER -> { - if (symbolProvider.toSymbol(member).isOptional()) { - withBlock("builder = builder.${member.setterName()}(", ");") { - deserializeMember(member) - } - } else { - rust("if let Some(v) = ") - deserializeMember(member) - rust( - """ - { - builder = builder.${member.setterName()}(v); - } - """, - ) - } - } - } + builderInstantiator.setField("builder", writable { deserializeMember(member) }, member)(this) } } rustTemplate("_ => #{skip_value}(tokens)?", *codegenScope) @@ -509,20 +488,17 @@ class JsonParserGenerator( "Builder" to symbolProvider.symbolForBuilder(shape), ) deserializeStructInner(shape.members()) - - if (codegenContext.target == CodegenTarget.SERVER) { - if (returnSymbolToParse.isUnconstrained) { - rust("Ok(Some(builder))") - } else { - rust("Ok(Some(builder.build()))") - } - } else { - if (hasFallibleBuilder(shape, symbolProvider)) { - rust("Ok(Some(builder.build()?))") - } else { - rust("Ok(Some(builder.build()))") - } - } + val builder = builderInstantiator.finalizeBuilder( + "builder", + shape, + writable { + rustTemplate( + """|err|#{Error}::custom_source("Response was invalid", err)""", + *codegenScope, + ) + }, + ) + rustTemplate("Ok(Some(#{builder}))", "builder" to builder) } } } diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt index 108207473f..106e7e2ede 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/JsonParserGeneratorTest.kt @@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.codegen.core.smithy.generators.ClientBuilderInstantiator import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.TestEnumType import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator @@ -120,6 +121,7 @@ class JsonParserGeneratorTest { codegenContext, HttpTraitHttpBindingResolver(model, ProtocolContentTypes.consistent("application/json")), ::restJsonFieldName, + builderInstantiator = ClientBuilderInstantiator(symbolProvider), ) val operationGenerator = parserGenerator.operationParser(model.lookup("test#Op")) val payloadGenerator = parserGenerator.payloadParser(model.lookup("test#OpOutput\$top")) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt index 77ba711fd2..b4957742a4 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt @@ -11,10 +11,15 @@ import software.amazon.smithy.model.shapes.Shape import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.rust.codegen.core.rustlang.Writable import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderInstantiator +import software.amazon.smithy.rust.codegen.core.smithy.generators.ClientBuilderInstantiator +import software.amazon.smithy.rust.codegen.core.smithy.isOptional import software.amazon.smithy.rust.codegen.core.smithy.protocols.AwsJson import software.amazon.smithy.rust.codegen.core.smithy.protocols.AwsJsonVersion import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpBindingResolver @@ -92,6 +97,37 @@ interface ServerProtocol : Protocol { .toType().resolve("protocol::$protocolModulePath::runtime_error::RuntimeError") } +class ServerBuilderInstantiator(private val symbolProvider: RustSymbolProvider, private val symbolParseFn: (Shape) -> ReturnSymbolToParse) : + BuilderInstantiator { + override fun setField(builder: String, value: Writable, e: MemberShape): Writable { + val setValue = { v: Writable -> ClientBuilderInstantiator(symbolProvider).setField(builder, v, e) } + return if (!symbolProvider.toSymbol(e).isOptional()) { + writable { + val n = safeName() + rustTemplate( + """ + if let Some($n) = #{value} { + #{setter} + } + """, + "value" to value, "setter" to setValue(writable(n)), + ) + } + } else { + setValue(value) + } + } + + override fun finalizeBuilder(builder: String, shape: StructureShape): Writable = writable { + val returnSymbolToParse = symbolParseFn(shape) + if (returnSymbolToParse.isUnconstrained) { + rust(builder) + } else { + rust("$builder.build()") + } + } +} + fun returnSymbolToParseFn(codegenContext: ServerCodegenContext): (Shape) -> ReturnSymbolToParse { fun returnSymbolToParse(shape: Shape): ReturnSymbolToParse = if (shape.canReachConstrainedShape(codegenContext.model, codegenContext.symbolProvider)) { @@ -116,6 +152,7 @@ fun jsonParserGenerator( listOf( ServerRequestBeforeBoxingDeserializedMemberConvertToMaybeConstrainedJsonParserCustomization(codegenContext), ) + additionalParserCustomizations, + ServerBuilderInstantiator(codegenContext.symbolProvider, returnSymbolToParseFn(codegenContext)), ) class ServerAwsJsonProtocol( diff --git a/rust-runtime/aws-smithy-http/Cargo.toml b/rust-runtime/aws-smithy-http/Cargo.toml index 784222bd30..0238f5dfc6 100644 --- a/rust-runtime/aws-smithy-http/Cargo.toml +++ b/rust-runtime/aws-smithy-http/Cargo.toml @@ -17,7 +17,6 @@ event-stream = ["aws-smithy-eventstream"] [dependencies] aws-smithy-eventstream = { path = "../aws-smithy-eventstream", optional = true } aws-smithy-types = { path = "../aws-smithy-types" } -aws-smithy-json = { path = "../aws-smithy-json" } bytes = "1" bytes-utils = "0.1" http = "0.2.3" diff --git a/rust-runtime/aws-smithy-http/src/operation/error.rs b/rust-runtime/aws-smithy-http/src/operation/error.rs index 10d5942edb..5b2024396f 100644 --- a/rust-runtime/aws-smithy-http/src/operation/error.rs +++ b/rust-runtime/aws-smithy-http/src/operation/error.rs @@ -5,7 +5,6 @@ //! Errors for operations -use aws_smithy_json::deserialize::error::DeserializeError; use aws_smithy_types::date_time::DateTimeFormatError; use http::uri::InvalidUri; use std::borrow::Cow; @@ -186,21 +185,3 @@ impl Error for BuildError { } } } - -impl From for DeserializeError { - fn from(build_error: BuildError) -> Self { - DeserializeError::custom_source( - "deserialization failed because a required field was missing", - build_error, - ) - } -} - -#[cfg(feature = "event-stream")] -impl From for aws_smithy_eventstream::error::Error { - fn from(build_error: BuildError) -> Self { - aws_smithy_eventstream::error::Error::unmarshalling(format!( - "error unmarshalling failed because a required field was missing: {build_error}" - )) - } -} From cd5e33cc7759ddd3b24c9a95623fd6ae2831f7d1 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Tue, 12 Sep 2023 13:27:40 -0400 Subject: [PATCH 26/36] Update ChangeLog --- CHANGELOG.next.toml | 5 ++--- .../smithy/rust/codegen/client/smithy/ClientRustSettings.kt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 5f59984a99..b08a94f4a7 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -35,15 +35,14 @@ meta = { "breaking" = true, "tada" = false, "bug" = false } author = "Velfi" [[aws-sdk-rust]] -message = "Struct members modeled as required are no longer wrapped in `Option`s. For upgrade guidance and more info, see [here](https://github.com/awslabs/smithy-rs/discussions/2929)." +message = "Struct members modeled as required are no longer wrapped in `Option`s [when possible](https://smithy.io/2.0/spec/aggregate-types.html#structure-member-optionality). For upgrade guidance and more info, see [here](https://github.com/awslabs/smithy-rs/discussions/2929)." references = ["smithy-rs#2916", "aws-sdk-rust#536"] meta = { "breaking" = true, "tada" = true, "bug" = false } author = "Velfi" [[smithy-rs]] message = """ -Support for Smithy IDLv2 nullability can now be enabled by setting `generateOptionsForRequiredShapes = false` in your codegen config. -This will render `@required` struct members without an `Option`. +Support for Smithy IDLv2 nullability is now enabled by default. You can maintain the old behavior by setting `nullabilityCheckMode: "CLIENT_ZERO_VALUE_V1" in your codegen config. For upgrade guidance and more info, see [here](https://github.com/awslabs/smithy-rs/discussions/2929). """ references = ["smithy-rs#2916", "smithy-rs#1767"] diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt index 2616a71c63..acc0a59184 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt @@ -101,7 +101,7 @@ data class ClientCodegenConfig( private val defaultEventStreamAllowList: Set = emptySet() private const val defaultIncludeEndpointUrlConfig = true private const val defaultEnableUserConfigurableRuntimePlugins = true - private val defaultNullabilityCheckMode = "CLIENT" + private const val defaultNullabilityCheckMode = "CLIENT" fun fromCodegenConfigAndNode(coreCodegenConfig: CoreCodegenConfig, node: Optional) = if (node.isPresent) { From 1374e951f4660ba15b5629bd7a8bd9778de84b21 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Tue, 12 Sep 2023 13:30:19 -0400 Subject: [PATCH 27/36] Fix server --- .../codegen/server/smithy/generators/protocol/ServerProtocol.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt index b4957742a4..0255c45645 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt @@ -118,7 +118,7 @@ class ServerBuilderInstantiator(private val symbolProvider: RustSymbolProvider, } } - override fun finalizeBuilder(builder: String, shape: StructureShape): Writable = writable { + override fun finalizeBuilder(builder: String, shape: StructureShape, mapErr: Writable?): Writable = writable { val returnSymbolToParse = symbolParseFn(shape) if (returnSymbolToParse.isUnconstrained) { rust(builder) From 09c02f7e542042f5df2fe0be2efc8551613afa39 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Wed, 20 Sep 2023 13:02:24 -0400 Subject: [PATCH 28/36] Fix unit tests --- .../protocols/serialize/JsonSerializerGeneratorTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt index 8612e0721c..61140ecd42 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/JsonSerializerGeneratorTest.kt @@ -88,6 +88,7 @@ class JsonSerializerGeneratorTest { member: Top } + @input structure OpInput { @httpHeader("x-test") someHeader: String, @@ -121,7 +122,7 @@ class JsonSerializerGeneratorTest { val operationGenerator = parserSerializer.operationInputSerializer(model.lookup("test#Op")) val documentGenerator = parserSerializer.documentSerializer() - val project = TestWorkspace.testProject(testSymbolProvider(model)) + val project = TestWorkspace.testProject(symbolProvider) project.lib { unitTest( "json_serializers", @@ -226,6 +227,7 @@ class JsonSerializerGeneratorTest { member: Top } + @input structure OpInput { @httpHeader("x-test") someHeader: String, @@ -312,7 +314,7 @@ class JsonSerializerGeneratorTest { .extra(45) .build() $maybeUnwrap - ).build().unwrap(); + ).boolean(false).build().unwrap(); ${format(operationGenerator)}(&input).expect_err("cannot serialize unknown variant"); """, ) From b41797761c894fdb7327014b214a89f7a753ce86 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Wed, 20 Sep 2023 13:36:57 -0400 Subject: [PATCH 29/36] Add a default instantiator that works for tests --- .../smithy/generators/ClientBuilderInstantiator.kt | 3 --- .../smithy/protocols/ClientProtocolLoader.kt | 4 ++-- .../rust/codegen/core/smithy/protocols/AwsJson.kt | 2 -- .../core/testutil/DefaultBuilderInstantiator.kt | 14 ++++++++++++-- .../codegen/core/testutil/EventStreamTestModels.kt | 2 +- .../rust/codegen/core/testutil/TestHelpers.kt | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt index c4120cb32a..bd1f5b3c6a 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt @@ -7,7 +7,6 @@ package software.amazon.smithy.rust.codegen.client.smithy.generators import software.amazon.smithy.model.shapes.MemberShape import software.amazon.smithy.model.shapes.StructureShape -import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.core.rustlang.Writable import software.amazon.smithy.rust.codegen.core.rustlang.map import software.amazon.smithy.rust.codegen.core.rustlang.rust @@ -17,8 +16,6 @@ import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderInstantiator -fun ClientCodegenContext.builderInstantiator(): BuilderInstantiator = ClientBuilderInstantiator(symbolProvider) - class ClientBuilderInstantiator(private val symbolProvider: RustSymbolProvider) : BuilderInstantiator { override fun setField(builder: String, value: Writable, field: MemberShape): Writable { return setFieldWithSetter(builder, value, field) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/ClientProtocolLoader.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/ClientProtocolLoader.kt index d7cdd7594c..cb9c7db7e5 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/ClientProtocolLoader.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/ClientProtocolLoader.kt @@ -63,9 +63,9 @@ private class ClientAwsJsonFactory(private val version: AwsJsonVersion) : ProtocolGeneratorFactory { override fun protocol(codegenContext: ClientCodegenContext): Protocol = if (compatibleWithAwsQuery(codegenContext.serviceShape, version)) { - AwsQueryCompatible(codegenContext, AwsJson(codegenContext, version, codegenContext.builderInstantiator())) + AwsQueryCompatible(codegenContext, AwsJson(codegenContext, version)) } else { - AwsJson(codegenContext, version, codegenContext.builderInstantiator()) + AwsJson(codegenContext, version) } override fun buildProtocolGenerator(codegenContext: ClientCodegenContext): OperationGenerator = diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt index 0b3178095c..0a53422552 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsJson.kt @@ -18,7 +18,6 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rustBlockTemplate import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType -import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderInstantiator import software.amazon.smithy.rust.codegen.core.smithy.generators.serializationError import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.JsonParserGenerator import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.StructuredDataParserGenerator @@ -123,7 +122,6 @@ class AwsJsonSerializerGenerator( open class AwsJson( val codegenContext: CodegenContext, val awsJsonVersion: AwsJsonVersion, - val builderInstantiator: BuilderInstantiator, ) : Protocol { private val runtimeConfig = codegenContext.runtimeConfig private val errorScope = arrayOf( diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/DefaultBuilderInstantiator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/DefaultBuilderInstantiator.kt index 6147f84e2f..96af195c76 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/DefaultBuilderInstantiator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/DefaultBuilderInstantiator.kt @@ -10,18 +10,28 @@ import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.rust.codegen.core.rustlang.Writable import software.amazon.smithy.rust.codegen.core.rustlang.rust import software.amazon.smithy.rust.codegen.core.rustlang.writable +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider +import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderInstantiator /** * A Default instantiator that uses `builder.build()` in all cases. This exists to support tests in codegen-core * and to serve as the base behavior for client and server instantiators. */ -class DefaultBuilderInstantiator : BuilderInstantiator { +class DefaultBuilderInstantiator(private val checkFallibleBuilder: Boolean, private val symbolProvider: RustSymbolProvider) : BuilderInstantiator { override fun setField(builder: String, value: Writable, field: MemberShape): Writable { return setFieldWithSetter(builder, value, field) } override fun finalizeBuilder(builder: String, shape: StructureShape, mapErr: Writable?): Writable { - return writable { rust("builder.build()") } + return writable { + rust("builder.build()") + if (checkFallibleBuilder && BuilderGenerator.hasFallibleBuilder(shape, symbolProvider)) { + if (mapErr != null) { + rust(".map_err(#T)", mapErr) + } + rust("?") + } + } } } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt index d6b43b97cb..e944a552a0 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt @@ -145,7 +145,7 @@ object EventStreamTestModels { validTestUnion = """{"Foo":"hello"}""", validSomeError = """{"Message":"some error"}""", validUnmodeledError = """{"Message":"unmodeled error"}""", - ) { AwsJson(it, AwsJsonVersion.Json11, builderInstantiator = DefaultBuilderInstantiator()) }, + ) { AwsJson(it, AwsJsonVersion.Json11) }, // // restXml diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt index 48354b2276..87ebb679cc 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt @@ -180,7 +180,7 @@ internal fun testCodegenContext( codegenTarget, ) { override fun builderInstantiator(): BuilderInstantiator { - return DefaultBuilderInstantiator() + return DefaultBuilderInstantiator(codegenTarget == CodegenTarget.CLIENT, symbolProvider) } } From 0bffcc09bd6e2989242703589f184b505a540022 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Wed, 20 Sep 2023 14:05:27 -0400 Subject: [PATCH 30/36] add protocol test for error correction & nullability --- codegen-client-test/build.gradle.kts | 1 + .../error-correction-nullability-test.smithy | 90 +++++++++++++++++++ .../core/smithy/generators/Instantiator.kt | 2 +- 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 codegen-client-test/model/error-correction-nullability-test.smithy diff --git a/codegen-client-test/build.gradle.kts b/codegen-client-test/build.gradle.kts index d7173e31d7..dbd24349a2 100644 --- a/codegen-client-test/build.gradle.kts +++ b/codegen-client-test/build.gradle.kts @@ -106,6 +106,7 @@ val allCodegenTests = listOf( "pokemon-service-awsjson-client", dependsOn = listOf("pokemon-awsjson.smithy", "pokemon-common.smithy"), ), + ClientTest("aws.protocoltests.json#RequiredValue", "required-values"), ).map(ClientTest::toCodegenTest) project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) diff --git a/codegen-client-test/model/error-correction-nullability-test.smithy b/codegen-client-test/model/error-correction-nullability-test.smithy new file mode 100644 index 0000000000..16e2a0d89d --- /dev/null +++ b/codegen-client-test/model/error-correction-nullability-test.smithy @@ -0,0 +1,90 @@ +$version: "2.0" + + +namespace aws.protocoltests.json + +use aws.protocols#awsJson1_0 +use smithy.test#httpResponseTests + +@awsJson1_0 +service RequiredValue { + operations: [SayHello], + version: "1" +} + +operation SayHello { output: TestOutput } + +structure TestOutput with [TestStruct] { innerField: Nested } + +@mixin +structure TestStruct { + @required + foo: String, + @required + byteValue: Byte, + @required + listValue: StringList, + @required + mapValue: ListMap, + @required + doubleListValue: DoubleList + @required + document: Document + @required + nested: Nested + @required + blob: Blob + @required + enum: Enum + @required + union: U + notRequired: String +} + +enum Enum { + A, + B, + C +} +union U { + A: Integer, + B: String, + C: Unit +} + +structure Nested { + @required + a: String +} + +list StringList { + member: String +} + +list DoubleList { + member: StringList +} + +map ListMap { + key: String, + value: StringList +} + +apply SayHello @httpResponseTests([{ + id: "error_recovery", + protocol: awsJson1_0, + params: { + union: { A: 5 }, + enum: "A", + foo: "", + byteValue: 0, + blob: "", + listValue: [], + mapValue: {}, + doubleListValue: [] + document: null + nested: { a: "" } + }, + code: 200, + body: "{}" + }]) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/Instantiator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/Instantiator.kt index 799aa1a000..a01ad09545 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/Instantiator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/Instantiator.kt @@ -141,7 +141,7 @@ open class Instantiator( private fun renderMember(writer: RustWriter, memberShape: MemberShape, data: Node, ctx: Ctx) { val targetShape = model.expectShape(memberShape.target) val symbol = symbolProvider.toSymbol(memberShape) - if (data is NullNode) { + if (data is NullNode && !targetShape.isDocumentShape) { check(symbol.isOptional()) { "A null node was provided for $memberShape but the symbol was not optional. This is invalid input data." } From 58cf1846ef5c187b54001fe1140e68f12eba1e10 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Wed, 20 Sep 2023 15:21:45 -0400 Subject: [PATCH 31/36] Add nullability test and fix some bugs --- codegen-client-test/build.gradle.kts | 3 +- .../error-correction-nullability-test.smithy | 41 ++++++++++++++++--- .../generators/ClientBuilderInstantiator.kt | 4 +- .../smithy/generators/ErrorCorrection.kt | 12 +++++- .../protocol/ProtocolParserGenerator.kt | 10 ++--- 5 files changed, 52 insertions(+), 18 deletions(-) diff --git a/codegen-client-test/build.gradle.kts b/codegen-client-test/build.gradle.kts index dbd24349a2..0d39e4b754 100644 --- a/codegen-client-test/build.gradle.kts +++ b/codegen-client-test/build.gradle.kts @@ -106,7 +106,8 @@ val allCodegenTests = listOf( "pokemon-service-awsjson-client", dependsOn = listOf("pokemon-awsjson.smithy", "pokemon-common.smithy"), ), - ClientTest("aws.protocoltests.json#RequiredValue", "required-values"), + ClientTest("aws.protocoltests.json#RequiredValueJson", "required-values-json"), + ClientTest("aws.protocoltests.json#RequiredValueXml", "required-values-xml"), ).map(ClientTest::toCodegenTest) project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) diff --git a/codegen-client-test/model/error-correction-nullability-test.smithy b/codegen-client-test/model/error-correction-nullability-test.smithy index 16e2a0d89d..9a252abf71 100644 --- a/codegen-client-test/model/error-correction-nullability-test.smithy +++ b/codegen-client-test/model/error-correction-nullability-test.smithy @@ -4,16 +4,29 @@ $version: "2.0" namespace aws.protocoltests.json use aws.protocols#awsJson1_0 +use aws.protocols#restXml use smithy.test#httpResponseTests @awsJson1_0 -service RequiredValue { +service RequiredValueJson { operations: [SayHello], version: "1" } -operation SayHello { output: TestOutput } +@restXml +service RequiredValueXml { + operations: [SayHelloXml], + version: "1" +} + +@http(method: "POST", uri: "/") +operation SayHello { output: TestOutputDocument } + +@http(method: "POST", uri: "/") +operation SayHelloXml { output: TestOutput } + +structure TestOutputDocument with [TestStruct] { innerField: Nested, @required document: Document } structure TestOutput with [TestStruct] { innerField: Nested } @mixin @@ -29,8 +42,6 @@ structure TestStruct { @required doubleListValue: DoubleList @required - document: Document - @required nested: Nested @required blob: Blob @@ -71,7 +82,7 @@ map ListMap { } apply SayHello @httpResponseTests([{ - id: "error_recovery", + id: "error_recovery_json", protocol: awsJson1_0, params: { union: { A: 5 }, @@ -86,5 +97,23 @@ apply SayHello @httpResponseTests([{ nested: { a: "" } }, code: 200, - body: "{}" + body: "{\"union\": { \"A\": 5 }, \"enum\": \"A\" }" }]) + +apply SayHelloXml @httpResponseTests([{ + id: "error_recovery_xml", + protocol: restXml, + params: { + union: { A: 5 }, + enum: "A", + foo: "", + byteValue: 0, + blob: "", + listValue: [], + mapValue: {}, + doubleListValue: [] + nested: { a: "" } + }, + code: 200, + body: "5A" + }]) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt index 34d315a3f3..453568c8c5 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientBuilderInstantiator.kt @@ -34,11 +34,11 @@ class ClientBuilderInstantiator(private val clientCodegenContext: ClientCodegenC } if (BuilderGenerator.hasFallibleBuilder(shape, clientCodegenContext.symbolProvider)) { rustTemplate( - "#{builder}.build()#{mapErr}?", + "#{builder}.build()#{mapErr}", "builder" to builderW, "mapErr" to ( mapErr?.map { - rust(".map_err(#T)", it) + rust(".map_err(#T)?", it) } ?: writable { } ), ) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrection.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrection.kt index 6f212014de..b05c014383 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrection.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrection.kt @@ -58,8 +58,15 @@ private fun ClientCodegenContext.errorCorrectedDefault(member: MemberShape): Wri val instantiator = PrimitiveInstantiator(runtimeConfig, symbolProvider) return writable { when { - target is EnumShape || target.hasTrait() -> rustTemplate(""""no value was set".parse::<#{Shape}>().ok()""", "Shape" to targetSymbol) - target is BooleanShape || target is NumberShape || target is StringShape || target is DocumentShape || target is ListShape || target is MapShape -> rust("Some(Default::default())") + target is EnumShape || target.hasTrait() -> rustTemplate( + """"no value was set".parse::<#{Shape}>().ok()""", + "Shape" to targetSymbol, + ) + + target is BooleanShape || target is NumberShape || target is StringShape || target is DocumentShape || target is ListShape || target is MapShape -> rust( + "Some(Default::default())", + ) + target is StructureShape -> rustTemplate( "{ let builder = #{Builder}::default(); #{instantiate} }", "Builder" to symbolProvider.symbolForBuilder(target), @@ -73,6 +80,7 @@ private fun ClientCodegenContext.errorCorrectedDefault(member: MemberShape): Wri it.plus { rustTemplate(".map(#{Box}::new)", *preludeScope) } }, ) + target is TimestampShape -> instantiator.instantiate(target, Node.from(0)).some()(this) target is BlobShape -> instantiator.instantiate(target, Node.from("")).some()(this) target is UnionShape -> rust("Some(#T::Unknown)", targetSymbol) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt index 01b5f73278..17632df46f 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolParserGenerator.kt @@ -26,7 +26,6 @@ import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider import software.amazon.smithy.rust.codegen.core.smithy.customize.writeCustomizations -import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.setterName import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpBindingDescriptor import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpLocation @@ -261,18 +260,15 @@ class ProtocolParserGenerator( } } - val err = if (BuilderGenerator.hasFallibleBuilder(outputShape, symbolProvider)) { - ".map_err(${format(errorSymbol)}::unhandled)?" - } else { - "" + val mapErr = writable { + rust("#T::unhandled", errorSymbol) } writeCustomizations( customizations, OperationSection.MutateOutput(customizations, operationShape, "_response_headers"), ) - - rust("output.build()$err") + codegenContext.builderInstantiator().finalizeBuilder("output", outputShape, mapErr)(this) } /** From 7a4fd417decd6d58528a6d277b21dd85e42e84c8 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 21 Sep 2023 08:51:06 -0400 Subject: [PATCH 32/36] A few more fixes --- .../src/route53_resource_id_preprocessor.rs | 50 ++++++++++++------- aws/sdk-adhoc-test/build.gradle.kts | 3 +- .../models/required-value-test.smithy | 24 +++++++++ .../customize/route53/Route53Decorator.kt | 3 +- .../generators/protocol/ServerProtocol.kt | 2 +- 5 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 aws/sdk-adhoc-test/models/required-value-test.smithy diff --git a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs index 590cb39081..32fad6b160 100644 --- a/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs +++ b/aws/rust-runtime/aws-inlineable/src/route53_resource_id_preprocessor.rs @@ -16,7 +16,7 @@ use std::marker::PhantomData; // This function is only used to strip prefixes from resource IDs at the time they're passed as // input to a request. Resource IDs returned in responses may or may not include a prefix. /// Strip the resource type prefix from resource ID return -fn trim_resource_id(resource_id: &mut String) { +fn trim_resource_id(resource_id: &mut Option) { const PREFIXES: &[&str] = &[ "/hostedzone/", "hostedzone/", @@ -27,8 +27,12 @@ fn trim_resource_id(resource_id: &mut String) { ]; for prefix in PREFIXES { - if let Some(trimmed_id) = resource_id.strip_prefix(prefix) { - *resource_id = trimmed_id.to_string(); + if let Some(id) = resource_id + .as_deref() + .unwrap_or_default() + .strip_prefix(prefix) + { + *resource_id = Some(id.to_string()); return; } } @@ -36,7 +40,7 @@ fn trim_resource_id(resource_id: &mut String) { pub(crate) struct Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> Option<&'a mut String>, + G: for<'a> Fn(&'a mut T) -> &'a mut Option, { get_mut_resource_id: G, _phantom: PhantomData, @@ -44,7 +48,7 @@ where impl fmt::Debug for Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> Option<&'a mut String>, + G: for<'a> Fn(&'a mut T) -> &'a mut Option, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Route53ResourceIdInterceptor").finish() @@ -53,7 +57,7 @@ where impl Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> Option<&'a mut String>, + G: for<'a> Fn(&'a mut T) -> &'a mut Option, { pub(crate) fn new(get_mut_resource_id: G) -> Self { Self { @@ -65,7 +69,7 @@ where impl Interceptor for Route53ResourceIdInterceptor where - G: for<'a> Fn(&'a mut T) -> Option<&'a mut String> + Send + Sync, + G: for<'a> Fn(&'a mut T) -> &'a mut Option + Send + Sync, T: fmt::Debug + Send + Sync + 'static, { fn name(&self) -> &'static str { @@ -79,9 +83,8 @@ where _cfg: &mut ConfigBag, ) -> Result<(), BoxError> { let input: &mut T = context.input_mut().downcast_mut().expect("correct type"); - if let Some(field) = (self.get_mut_resource_id)(input) { - trim_resource_id(field) - } + let field = (self.get_mut_resource_id)(input); + trim_resource_id(field); Ok(()) } } @@ -93,39 +96,48 @@ mod test { #[test] fn does_not_change_regular_zones() { struct OperationInput { - resource: String, + resource: Option, } let mut operation = OperationInput { - resource: "Z0441723226OZ66S5ZCNZ".to_string(), + resource: Some("Z0441723226OZ66S5ZCNZ".to_string()), }; trim_resource_id(&mut operation.resource); - assert_eq!(&operation.resource, "Z0441723226OZ66S5ZCNZ"); + assert_eq!( + &operation.resource.unwrap_or_default(), + "Z0441723226OZ66S5ZCNZ" + ); } #[test] fn sanitizes_prefixed_zone() { struct OperationInput { - change_id: String, + change_id: Option, } let mut operation = OperationInput { - change_id: "/change/Z0441723226OZ66S5ZCNZ".to_string(), + change_id: Some("/change/Z0441723226OZ66S5ZCNZ".to_string()), }; trim_resource_id(&mut operation.change_id); - assert_eq!(&operation.change_id, "Z0441723226OZ66S5ZCNZ"); + assert_eq!( + &operation.change_id.unwrap_or_default(), + "Z0441723226OZ66S5ZCNZ" + ); } #[test] fn allow_no_leading_slash() { struct OperationInput { - hosted_zone: String, + hosted_zone: Option, } let mut operation = OperationInput { - hosted_zone: "hostedzone/Z0441723226OZ66S5ZCNZ".to_string(), + hosted_zone: Some("hostedzone/Z0441723226OZ66S5ZCNZ".to_string()), }; trim_resource_id(&mut operation.hosted_zone); - assert_eq!(&operation.hosted_zone, "Z0441723226OZ66S5ZCNZ"); + assert_eq!( + &operation.hosted_zone.unwrap_or_default(), + "Z0441723226OZ66S5ZCNZ" + ); } } diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 83a2592414..4a4d07e19a 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -35,6 +35,7 @@ dependencies { implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion") implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion") implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion") + implementation("software.amazon.smithy:smithy-model:$smithyVersion") } fun getNullabilityCheckMode(): String = properties.get("nullability.check.mode") ?: "CLIENT_CAREFUL" @@ -48,7 +49,7 @@ val allCodegenTests = listOf( , "codegen": { "includeFluentClient": false, - "nullabilityCheckMode": ${getNullabilityCheckMode()} + "nullabilityCheckMode": \"${getNullabilityCheckMode()}\" }, "customizationConfig": { "awsSdk": { diff --git a/aws/sdk-adhoc-test/models/required-value-test.smithy b/aws/sdk-adhoc-test/models/required-value-test.smithy new file mode 100644 index 0000000000..6e0d532976 --- /dev/null +++ b/aws/sdk-adhoc-test/models/required-value-test.smithy @@ -0,0 +1,24 @@ +$version: "1.0" + +namespace com.amazonaws.requiredvalues + +@restJson1 +@title("Test Service") +@service(sdkId: "Test") +@aws.auth#sigv4(name: "test-service") +service RequiredValues { + operations: [TestOperation] +} + +operation TestOperation { + errors: [Error] +} + +@error +structure Error { + @required + requestId: String + + @required + message: String +} diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt index e3e4a44bdf..bf1b386249 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/route53/Route53Decorator.kt @@ -80,11 +80,10 @@ class TrimResourceIdCustomization( RuntimeType.forInlineDependency( InlineAwsDependency.forRustFile("route53_resource_id_preprocessor"), ).resolve("Route53ResourceIdInterceptor") - rustTemplate( """ #{Route53ResourceIdInterceptor}::new(|input: &mut #{Input}| { - input.$fieldName.as_mut() + &mut input.$fieldName }) """, "Input" to codegenContext.symbolProvider.toSymbol(inputShape), diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt index 622123cd4a..f86c547da1 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocol.kt @@ -122,7 +122,7 @@ class ServerAwsJsonProtocol( private val serverCodegenContext: ServerCodegenContext, awsJsonVersion: AwsJsonVersion, private val additionalParserCustomizations: List = listOf(), -) : AwsJson(serverCodegenContext, awsJsonVersion, serverCodegenContext.builderInstantiator()), ServerProtocol { +) : AwsJson(serverCodegenContext, awsJsonVersion), ServerProtocol { private val runtimeConfig = codegenContext.runtimeConfig override val protocolModulePath: String From e75ad168bf4278c4df12fd389b76ddc1a36085d4 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 21 Sep 2023 09:42:59 -0400 Subject: [PATCH 33/36] wip --- aws/sdk-adhoc-test/build.gradle.kts | 17 +++++++++++++++++ .../models/required-value-test.smithy | 2 +- .../error-correction-nullability-test.smithy | 13 +++++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 4a4d07e19a..596d958fe7 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -75,6 +75,23 @@ val allCodegenTests = listOf( } """, ), + CodegenTest( + "com.amazonaws.testservice#RequiredValues", + "required-values", + imports = listOf("models/required-value-test.smithy"), + extraConfig = """ + , + "codegen": { + "includeFluentClient": false, + "nullabilityCheckMode": ${getNullabilityCheckMode()} + }, + "customizationConfig": { + "awsSdk": { + "generateReadme": false + } + } + """, + ), ) project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) diff --git a/aws/sdk-adhoc-test/models/required-value-test.smithy b/aws/sdk-adhoc-test/models/required-value-test.smithy index 6e0d532976..52ab534449 100644 --- a/aws/sdk-adhoc-test/models/required-value-test.smithy +++ b/aws/sdk-adhoc-test/models/required-value-test.smithy @@ -1,6 +1,6 @@ $version: "1.0" -namespace com.amazonaws.requiredvalues +namespace com.amazonaws.testservice @restJson1 @title("Test Service") diff --git a/codegen-client-test/model/error-correction-nullability-test.smithy b/codegen-client-test/model/error-correction-nullability-test.smithy index 9a252abf71..8a125d3004 100644 --- a/codegen-client-test/model/error-correction-nullability-test.smithy +++ b/codegen-client-test/model/error-correction-nullability-test.smithy @@ -20,11 +20,20 @@ service RequiredValueXml { version: "1" } +@error("client") +structure Error { + @required + requestId: String + + @required + message: String +} + @http(method: "POST", uri: "/") -operation SayHello { output: TestOutputDocument } +operation SayHello { output: TestOutputDocument, errors: [Error] } @http(method: "POST", uri: "/") -operation SayHelloXml { output: TestOutput } +operation SayHelloXml { output: TestOutput, errors: [Error] } structure TestOutputDocument with [TestStruct] { innerField: Nested, @required document: Document } structure TestOutput with [TestStruct] { innerField: Nested } From 99de898f64a14500eb87bf2c5a1b8420fe2d3297 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 21 Sep 2023 10:10:10 -0400 Subject: [PATCH 34/36] Fix request id accessor when it is marked as required --- aws/sdk-adhoc-test/build.gradle.kts | 9 ++++---- .../models/required-value-test.smithy | 6 ++++- .../smithy/rustsdk/BaseRequestIdDecorator.kt | 23 ++++++++++++++++++- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 596d958fe7..6fc9fe2b00 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -49,7 +49,7 @@ val allCodegenTests = listOf( , "codegen": { "includeFluentClient": false, - "nullabilityCheckMode": \"${getNullabilityCheckMode()}\" + "nullabilityCheckMode": "${getNullabilityCheckMode()}" }, "customizationConfig": { "awsSdk": { @@ -66,7 +66,7 @@ val allCodegenTests = listOf( , "codegen": { "includeFluentClient": false, - "nullabilityCheckMode": ${getNullabilityCheckMode()} + "nullabilityCheckMode": "${getNullabilityCheckMode()}" }, "customizationConfig": { "awsSdk": { @@ -83,11 +83,12 @@ val allCodegenTests = listOf( , "codegen": { "includeFluentClient": false, - "nullabilityCheckMode": ${getNullabilityCheckMode()} + "nullabilityCheckMode": "${getNullabilityCheckMode()}" }, "customizationConfig": { "awsSdk": { - "generateReadme": false + "generateReadme": false, + "requireEndpointResolver": false } } """, diff --git a/aws/sdk-adhoc-test/models/required-value-test.smithy b/aws/sdk-adhoc-test/models/required-value-test.smithy index 52ab534449..efb90d9250 100644 --- a/aws/sdk-adhoc-test/models/required-value-test.smithy +++ b/aws/sdk-adhoc-test/models/required-value-test.smithy @@ -2,6 +2,9 @@ $version: "1.0" namespace com.amazonaws.testservice +use aws.api#service +use aws.protocols#restJson1 + @restJson1 @title("Test Service") @service(sdkId: "Test") @@ -10,11 +13,12 @@ service RequiredValues { operations: [TestOperation] } +@http(method: "GET", uri: "/") operation TestOperation { errors: [Error] } -@error +@error("client") structure Error { @required requestId: String diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt index 9b8adeddab..f4bc05a3ef 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt @@ -5,7 +5,9 @@ package software.amazon.smithy.rustsdk +import software.amazon.smithy.model.shapes.MemberShape import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.client.smithy.ClientRustModule import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator @@ -19,6 +21,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rustBlock import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType.Companion.preludeScope import software.amazon.smithy.rust.codegen.core.smithy.RustCrate import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderCustomization import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderSection @@ -26,6 +29,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureCusto import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureSection import software.amazon.smithy.rust.codegen.core.smithy.generators.error.ErrorImplCustomization import software.amazon.smithy.rust.codegen.core.smithy.generators.error.ErrorImplSection +import software.amazon.smithy.rust.codegen.core.smithy.isOptional import software.amazon.smithy.rust.codegen.core.smithy.traits.SyntheticOutputTrait import software.amazon.smithy.rust.codegen.core.util.hasTrait @@ -72,6 +76,11 @@ abstract class BaseRequestIdDecorator : ClientCodegenDecorator { } } + open fun asMemberShape(container: StructureShape): MemberShape? { + println(container.members()) + return container.members().firstOrNull { member -> member.memberName.lowercase() == "requestid" } + } + private inner class RequestIdOperationCustomization(private val codegenContext: ClientCodegenContext) : OperationCustomization() { override fun section(section: OperationSection): Writable = writable { @@ -82,12 +91,14 @@ abstract class BaseRequestIdDecorator : ClientCodegenDecorator { "apply_to_error" to applyToError(codegenContext), ) } + is OperationSection.MutateOutput -> { rust( "output._set_$fieldName(#T::$accessorFunctionName(${section.responseHeadersName}).map(str::to_string));", accessorTrait(codegenContext), ) } + is OperationSection.BeforeParseResponse -> { rustTemplate( "#{tracing}::debug!($fieldName = ?#{trait}::$accessorFunctionName(${section.responseName}));", @@ -95,6 +106,7 @@ abstract class BaseRequestIdDecorator : ClientCodegenDecorator { "trait" to accessorTrait(codegenContext), ) } + else -> {} } } @@ -123,8 +135,17 @@ abstract class BaseRequestIdDecorator : ClientCodegenDecorator { rustBlock("fn $accessorFunctionName(&self) -> Option<&str>") { rustBlock("match self") { section.allErrors.forEach { error -> + val optional = asMemberShape(error)?.let { member -> + codegenContext.symbolProvider.toSymbol(member).isOptional() + } ?: true + val wrapped = writable { + when (optional) { + false -> rustTemplate("#{Some}(e.$accessorFunctionName())", *preludeScope) + true -> rustTemplate("e.$accessorFunctionName()") + } + } val sym = codegenContext.symbolProvider.toSymbol(error) - rust("Self::${sym.name}(e) => e.$accessorFunctionName(),") + rust("Self::${sym.name}(e) => #T,", wrapped) } rust("Self::Unhandled(e) => e.$accessorFunctionName(),") } From 969e32fd73d787b375fc50cb871bd0b35881b569 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 21 Sep 2023 10:24:35 -0400 Subject: [PATCH 35/36] Refactor && remove println --- aws/sdk-adhoc-test/build.gradle.kts | 61 +++++++------------ .../smithy/rustsdk/BaseRequestIdDecorator.kt | 1 - .../s3/S3ExtendedRequestIdDecorator.kt | 6 ++ 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 6fc9fe2b00..eb6c8cb76a 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -40,58 +40,41 @@ dependencies { fun getNullabilityCheckMode(): String = properties.get("nullability.check.mode") ?: "CLIENT_CAREFUL" -val allCodegenTests = listOf( - CodegenTest( - "com.amazonaws.apigateway#BackplaneControlService", - "apigateway", - imports = listOf("models/apigateway-rules.smithy"), +fun baseTest(service: String, module: String, imports: List = listOf()): CodegenTest { + return CodegenTest( + service = service, + module = module, + imports = imports, + extraCodegenConfig = """ + "includeFluentClient": false, + "nullabilityCheckMode": "${getNullabilityCheckMode()}" + """, extraConfig = """ - , - "codegen": { - "includeFluentClient": false, - "nullabilityCheckMode": "${getNullabilityCheckMode()}" - }, - "customizationConfig": { + , "customizationConfig": { "awsSdk": { - "generateReadme": false + "generateReadme": false, + "requireEndpointResolver": false } } """, + ) +} + +val allCodegenTests = listOf( + baseTest( + "com.amazonaws.apigateway#BackplaneControlService", + "apigateway", + imports = listOf("models/apigateway-rules.smithy"), ), - CodegenTest( + baseTest( "com.amazonaws.testservice#TestService", "endpoint-test-service", imports = listOf("models/single-static-endpoint.smithy"), - extraConfig = """ - , - "codegen": { - "includeFluentClient": false, - "nullabilityCheckMode": "${getNullabilityCheckMode()}" - }, - "customizationConfig": { - "awsSdk": { - "generateReadme": false - } - } - """, ), - CodegenTest( + baseTest( "com.amazonaws.testservice#RequiredValues", "required-values", imports = listOf("models/required-value-test.smithy"), - extraConfig = """ - , - "codegen": { - "includeFluentClient": false, - "nullabilityCheckMode": "${getNullabilityCheckMode()}" - }, - "customizationConfig": { - "awsSdk": { - "generateReadme": false, - "requireEndpointResolver": false - } - } - """, ), ) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt index f4bc05a3ef..5025ffedab 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/BaseRequestIdDecorator.kt @@ -77,7 +77,6 @@ abstract class BaseRequestIdDecorator : ClientCodegenDecorator { } open fun asMemberShape(container: StructureShape): MemberShape? { - println(container.members()) return container.members().firstOrNull { member -> member.memberName.lowercase() == "requestid" } } diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3ExtendedRequestIdDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3ExtendedRequestIdDecorator.kt index 6b117b60da..3cd223ae44 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3ExtendedRequestIdDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3ExtendedRequestIdDecorator.kt @@ -5,6 +5,8 @@ package software.amazon.smithy.rustsdk.customize.s3 +import software.amazon.smithy.model.shapes.MemberShape +import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rustsdk.BaseRequestIdDecorator @@ -17,6 +19,10 @@ class S3ExtendedRequestIdDecorator : BaseRequestIdDecorator() { override val fieldName: String = "extended_request_id" override val accessorFunctionName: String = "extended_request_id" + override fun asMemberShape(container: StructureShape): MemberShape? { + return null + } + private val requestIdModule: RuntimeType = RuntimeType.forInlineDependency(InlineAwsDependency.forRustFile("s3_request_id")) From 7de18920cf9fff568a4724fae63fcad7b1fd044e Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 21 Sep 2023 11:21:21 -0400 Subject: [PATCH 36/36] Fix unit test & add an ignore for useless question mark --- .../smithy/generators/ErrorCorrectionTest.kt | 18 +++++++++--------- .../rust/codegen/core/rustlang/RustType.kt | 1 + .../parse/XmlBindingTraitParserGenerator.kt | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrectionTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrectionTest.kt index 5849010312..3cdc523d9c 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrectionTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ErrorCorrectionTest.kt @@ -97,24 +97,24 @@ class ErrorCorrectionTest { rustTemplate( """ let builder = #{correct_errors}(#{Shape}::builder().foo("abcd")); - let shape = builder.build(); + let shape = builder.build().unwrap(); // don't override a field already set - assert_eq!(shape.foo(), Some("abcd")); + assert_eq!(shape.foo(), "abcd"); // set nested fields - assert_eq!(shape.nested().unwrap().a(), Some("")); + assert_eq!(shape.nested().a(), ""); // don't default non-required fields assert_eq!(shape.not_required(), None); // set defaults for everything else - assert_eq!(shape.blob().unwrap().as_ref(), &[]); + assert_eq!(shape.blob().as_ref(), &[]); - assert_eq!(shape.list_value(), Some(&[][..])); - assert!(shape.map_value().unwrap().is_empty()); - assert_eq!(shape.double_list_value(), Some(&[][..])); + assert!(shape.list_value().is_empty()); + assert!(shape.map_value().is_empty()); + assert!(shape.double_list_value().is_empty()); // enums and unions become unknown variants - assert!(matches!(shape.r##enum(), Some(crate::types::Enum::Unknown(_)))); - assert!(shape.union().unwrap().is_unknown()); + assert!(matches!(shape.r##enum(), crate::types::Enum::Unknown(_))); + assert!(shape.union().is_unknown()); """, *codegenCtx, ) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt index 36e0dbdb6a..1ada2d199c 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt @@ -494,6 +494,7 @@ class Attribute(val inner: Writable, val isDeriveHelper: Boolean = false) { } companion object { + val AllowNeedlessQuestionMark = Attribute(allow("clippy::needless_question_mark")) val AllowClippyBoxedLocal = Attribute(allow("clippy::boxed_local")) val AllowClippyLetAndReturn = Attribute(allow("clippy::let_and_return")) val AllowClippyNeedlessBorrow = Attribute(allow("clippy::needless_borrow")) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt index d9fdd41b15..03caf527a8 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt @@ -476,6 +476,7 @@ class XmlBindingTraitParserGenerator( private fun RustWriter.parseStructure(shape: StructureShape, ctx: Ctx) { val symbol = symbolProvider.toSymbol(shape) val nestedParser = protocolFunctions.deserializeFn(shape) { fnName -> + Attribute.AllowNeedlessQuestionMark.render(this) rustBlockTemplate( "pub fn $fnName(decoder: &mut #{ScopedDecoder}) -> Result<#{Shape}, #{XmlDecodeError}>", *codegenScope, "Shape" to symbol,