@@ -204,7 +204,7 @@ module AwsCryptographyKeyStoreAdminOperations refines AbstractAwsCryptographyKey
204
204
return Success (internal);
205
205
}
206
206
207
- method ResolveHierarchyVersion (
207
+ method ResolveHierarchyVersionForCreateKey (
208
208
hierarchyVersion?: Option <KeyStoreTypes .HierarchyVersion>,
209
209
config: InternalConfig
210
210
)
@@ -279,7 +279,7 @@ module AwsCryptographyKeyStoreAdminOperations refines AbstractAwsCryptographyKey
279
279
// See Smithy-Dafny : https://github.com/smithy-lang/smithy-dafny/pull/543
280
280
assume {:axiom} legacyConfig. kmsClient. Modifies < MutationLie ();
281
281
282
- var hvInput :- ResolveHierarchyVersion (input.HierarchyVersion, config);
282
+ var hvInput :- ResolveHierarchyVersionForCreateKey (input.HierarchyVersion, config);
283
283
:- Need (
284
284
hvInput.v1?,
285
285
Types.KeyStoreAdminException(message :="Only hierarchy-version-1 is supported at this time.")
@@ -349,11 +349,12 @@ module AwsCryptographyKeyStoreAdminOperations refines AbstractAwsCryptographyKey
349
349
Types. KeyStoreAdminException (message := "At this time, Mutations do not support KeyManagementStrategy#AwsKmsSimple.")
350
350
);
351
351
352
- var hvInput :- ResolveHierarchyVersion (input.Mutations.TerminalHierarchyVersion, config);
353
- :- Need (
354
- hvInput.v1?,
355
- Types.KeyStoreAdminException(message :="Only hierarchy-version-1 is supported at this time.")
356
- );
352
+ if (
353
+ && input. Mutations. TerminalHierarchyVersion. Some?
354
+ && input. Mutations. TerminalHierarchyVersion. value. v2?
355
+ ) {
356
+ return Failure (Types.KeyStoreAdminException(message :="At this time, Mutations do not support mutations to hierarchy-version-2."));
357
+ }
357
358
var internalInput := KSAInitializeMutation. InternalInitializeMutationInput (
358
359
Identifier := input.Identifier,
359
360
Mutations := input.Mutations,
0 commit comments