Expose instance signature through EC2MetadataUtils
@@ -62,6 +62,7 @@ public class EC2MetadataUtils {
private static final String REGION = "region";
private static final String INSTANCE_IDENTITY_DOCUMENT = "instance-identity/document";
+ private static final String INSTANCE_IDENTITY_SIGNATURE = "instance-identity/signature";
private static final String EC2_METADATA_ROOT = "/latest/meta-data";
private static final String EC2_USERDATA_ROOT = "/latest/user-data/";
private static final String EC2_DYNAMICDATA_ROOT = "/latest/dynamic/";
@@ -259,6 +260,13 @@ public class EC2MetadataUtils {
return null;
}
+ /**
+ * Get the signature of the instance.
+ */
+ public static String getInstanceSignature() {
+ return fetchData(EC2_DYNAMICDATA_ROOT + INSTANCE_IDENTITY_SIGNATURE);
+ }
+
/**
* Returns the current region of this running EC2 instance; or null if
* it is unable to do so. The method avoids interpreting other parts of the
