Package io.micronaut.discovery.cloud.aws
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 Summary
ConstructorDescriptionCreate a new instance to resolveComputeInstanceMetadata
for Amazon EC2 with default configurations.AmazonComputeInstanceMetadataResolver
(com.fasterxml.jackson.databind.ObjectMapper objectMapper, AmazonMetadataConfiguration configuration) Create a new instance to resolveComputeInstanceMetadata
for Amazon EC2. -
Method Summary
-
Constructor Details
-
AmazonComputeInstanceMetadataResolver
@Inject public AmazonComputeInstanceMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper, AmazonMetadataConfiguration configuration) Create a new instance to resolveComputeInstanceMetadata
for Amazon EC2.- Parameters:
objectMapper
- To convert AWS EC2 metadata information into Mapconfiguration
- AWS Metadata configuration
-
AmazonComputeInstanceMetadataResolver
public AmazonComputeInstanceMetadataResolver()Create a new instance to resolveComputeInstanceMetadata
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 interfaceio.micronaut.discovery.cloud.ComputeInstanceMetadataResolver
-