Class AmazonComputeInstanceMetadataResolver

java.lang.Object
io.micronaut.discovery.cloud.aws.AmazonComputeInstanceMetadataResolver
All Implemented Interfaces:
io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver

@Singleton @Requires(env="ec2") @Requires(notEnv="function") @Requires(property="micronaut.application.ec2.metadata.enabled",value="true",defaultValue="true") @Requires(classes=io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver.class) @Primary public class AmazonComputeInstanceMetadataResolver extends Object implements io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver
Resolves ComputeInstanceMetadata for Amazon EC2.
Since:
1.0
Author:
rvanderwerf, Graeme Rocher
  • Constructor Details

    • AmazonComputeInstanceMetadataResolver

      @Inject public AmazonComputeInstanceMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper, AmazonMetadataConfiguration configuration)
      Create a new instance to resolve ComputeInstanceMetadata for Amazon EC2.
      Parameters:
      objectMapper - To convert AWS EC2 metadata information into Map
      configuration - AWS Metadata configuration
    • AmazonComputeInstanceMetadataResolver

      public AmazonComputeInstanceMetadataResolver()
      Create a new instance to resolve ComputeInstanceMetadata for Amazon EC2 with default configurations.
  • Method Details

    • resolve

      public Optional<io.micronaut.discovery.cloud.ComputeInstanceMetadata> resolve(io.micronaut.context.env.Environment environment)
      Specified by:
      resolve in interface io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver