Migrate the AWS Encryption SDK's KMS master key provider builders to its kmssdkv2 package

Apache 2.0

Runs before software.amazon.awssdk.v2migration.AwsSdkJavaV1ToV2, which retypes the credentials passed to the AWS Encryption SDK's com.amazonaws.encryptionsdk.kms.KmsMasterKeyProvider builder to v2 types it does not accept. The provider and its master keys move to the com.amazonaws.encryptionsdk.kmssdkv2 package, which the Encryption SDK ships from 2.4.0 on, as does the multi-Region aware AwsKmsMrkAwareMasterKeyProvider: withCredentials becomes a builderSupplier of a KmsClient builder with those credentials, and withDefaultRegion and withDiscoveryMrkRegion become defaultRegion and discoveryMrkRegion. A custom client builder or factory, and implementations of RegionalClientSupplier, are marked, as the v2 provider takes a supplier of a v2 client builder or of a v2 client for a Region instead.

org.openrewrite.aws.sdk.MigrateEncryptionSdkKmsMasterKeyProvider
mod run . --recipe=org.openrewrite.aws.sdk.MigrateEncryptionSdkKmsMasterKeyProvider

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.