File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ func StartMetadataServer() error {
29
29
router := http .NewServeMux ()
30
30
router .HandleFunc ("/latest/meta-data/iam/security-credentials/" , indexHandler )
31
31
router .HandleFunc ("/latest/meta-data/iam/security-credentials/local-credentials" , credentialsHandler )
32
+ // The AWS Go SDK checks the instance-id endpoint to validate the existence of EC2 Metadata
33
+ router .HandleFunc ("/latest/meta-data/instance-id/" , instanceIdHandler )
32
34
33
35
l , err := net .Listen ("tcp" , metadataBind )
34
36
if err != nil {
@@ -63,6 +65,10 @@ func credentialsHandler(w http.ResponseWriter, r *http.Request) {
63
65
io .Copy (w , resp .Body )
64
66
}
65
67
68
+ func instanceIdHandler (w http.ResponseWriter , r * http.Request ) {
69
+ fmt .Fprintf (w , "aws-vault" )
70
+ }
71
+
66
72
func checkServerRunning (bind string ) bool {
67
73
_ , err := net .DialTimeout ("tcp" , bind , time .Millisecond * 10 )
68
74
return err == nil
You can’t perform that action at this time.
0 commit comments