Migrate AWS SDK v1 EC2MetadataUtils

Apache 2.0

Replaces com.amazonaws.util.EC2MetadataUtils with a generated Ec2MetadataUtils that has the same static methods, caching and null-on-failure behaviour, implemented with v2's Ec2MetadataClient (imds), including the InstanceInfo, IAMInfo, IAMSecurityCredential and NetworkInterface documents.

org.openrewrite.aws.sdk.MigrateEc2MetadataUtils

Optional

generateHelpersBoolean

Whether to generate the helper classes that the changes use. Compositions that limit where helpers are generated set it to false and generate them with org.openrewrite.aws.sdk.GenerateAwsSdkV2Helpers. Defaults to true.

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

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