Package io.micronaut.discovery.cloud.aws
Class AmazonMetadataConfiguration
java.lang.Object
io.micronaut.discovery.cloud.aws.AmazonMetadataConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("micronaut.application.ec2.metadata")
@Requires(notEnv="function") @Requires(env="ec2")
@Primary
public class AmazonMetadataConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
Default configuration for retrieving Amazon EC2 metadata for
ComputePlatform.AMAZON_EC2
.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetUrl()
boolean
void
setEnabled
(boolean enabled) Default value (true).void
setInstanceDocumentUrl
(String instanceDocumentUrl) void
setMetadataUrl
(String metadataUrl) void
Default value ("http://169.254.169.254").
-
Field Details
-
PREFIX
Prefix for Amazon EC2 configuration metadata.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_URL
The default url value.- See Also:
-
-
Constructor Details
-
AmazonMetadataConfiguration
public AmazonMetadataConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
- Returns:
- Whether the Amazon EC2 configuration is enabled
-
setEnabled
public void setEnabled(boolean enabled) Default value (true).- Parameters:
enabled
- Enable or disable the Amazon EC2 configuration
-
getUrl
- Returns:
- The Url
-
setUrl
Default value ("http://169.254.169.254").- Parameters:
url
- The url
-
getMetadataUrl
- Returns:
- The metadata Url
-
setMetadataUrl
- Parameters:
metadataUrl
- The metadata Url
-
getInstanceDocumentUrl
- Returns:
- The instance document Url
-
setInstanceDocumentUrl
- Parameters:
instanceDocumentUrl
- The instance document Url
-