@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 java.lang.Object
implements io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver
ComputeInstanceMetadata
for Amazon EC2.Constructor and Description |
---|
AmazonComputeInstanceMetadataResolver()
Create a new instance to resolve
ComputeInstanceMetadata for Amazon EC2 with default configurations. |
AmazonComputeInstanceMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
AmazonMetadataConfiguration configuration)
Create a new instance to resolve
ComputeInstanceMetadata for Amazon EC2. |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<io.micronaut.discovery.cloud.ComputeInstanceMetadata> |
resolve(io.micronaut.context.env.Environment environment) |
@Inject public AmazonComputeInstanceMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper, AmazonMetadataConfiguration configuration)
ComputeInstanceMetadata
for Amazon EC2.objectMapper
- To convert AWS EC2 metadata information into Mapconfiguration
- AWS Metadata configurationpublic AmazonComputeInstanceMetadataResolver()
ComputeInstanceMetadata
for Amazon EC2 with default configurations.