-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert metadata service modules to functions (#3954)
- Loading branch information
Showing
12 changed files
with
64 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,8 @@ | ||
var getEndpoint = function() { | ||
return { | ||
IPv4: 'http://169.254.169.254', | ||
IPv6: 'http://[fd00:ec2::254]', | ||
}; | ||
}; | ||
|
||
module.exports = getEndpoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,12 @@ | ||
var ENV_ENDPOINT_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT'; | ||
var CONFIG_ENDPOINT_NAME = 'ec2_metadata_service_endpoint'; | ||
|
||
var getEndpointConfigOptions = function() { | ||
return { | ||
environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_NAME]; }, | ||
configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_NAME]; }, | ||
default: undefined, | ||
}; | ||
}; | ||
|
||
module.exports = getEndpointConfigOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,8 @@ | ||
var getEndpointMode = function() { | ||
return { | ||
IPv4: 'IPv4', | ||
IPv6: 'IPv6', | ||
}; | ||
}; | ||
|
||
module.exports = getEndpointMode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,14 @@ | ||
var EndpointMode = require('./get_endpoint_mode')(); | ||
|
||
var ENV_ENDPOINT_MODE_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE'; | ||
var CONFIG_ENDPOINT_MODE_NAME = 'ec2_metadata_service_endpoint_mode'; | ||
|
||
var getEndpointModeConfigOptions = function() { | ||
return { | ||
environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_MODE_NAME]; }, | ||
configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_MODE_NAME]; }, | ||
default: EndpointMode.IPv4, | ||
}; | ||
}; | ||
|
||
module.exports = getEndpointModeConfigOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters