amazon-ec2-metadata-mock
amazon-ec2-metadata-mock copied to clipboard
Passing null value in AEMM config parameter
Hi i would like to ask whether is there any way how to pass null value in some of property by env variable such as AEMM_METADATA_VALUES_IAM_SECURITY_CREDENTIALS_TOKEN: null
or maybe like AEMM_METADATA_VALUES_IAM_SECURITY_CREDENTIALS: '{"Code":"Success"","LastUpdated":"2020-04-02T18:50:40Z","Type":"AWS-HMAC","AccessKeyId":"MY_ACCESS_KEY","SecretAccessKey":"MY_SECRET_KEY","Token":null,"Expiration":"2040-04-02T00:49:51Z"}"'
.
In my case it's still overriden by default values from the code, or in case of passing the whole json content i cannot obtain the specified values, they're empty.
Thank you a lot for any hint/workaround.
I think we would need a change to the formatting logic to customize the output of null
. I was able to override the value via env; however, the null
is in quotes which does not match reality.
Repro Steps
-
export AEMM_METADATA_VALUES_IAM_SECURITY_CREDENTIALS_TOKEN=null
-
./ec2-metadata-mock
-
curl localhost:1338/latest/meta-data/iam/security-credentials/baskinc-role
:
curl localhost:1338/latest/meta-data/iam/security-credentials/baskinc-role
{
"Code": "Success",
"LastUpdated": "2020-04-02T18:50:40Z",
"Type": "AWS-HMAC",
"AccessKeyId": "12345678901",
"SecretAccessKey": "v/12345678901",
"Token": "null", --> real IMDS shows no quotes
"Expiration": "2020-04-02T00:49:51Z"
}%
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.
Hi, any chance to figure this issue out or possible workaround?
@richardgalestok per my explanation, this would require a code change. I'll remove stale
because we should align null output with IMDS; however, I'm not sure if we'll be able to get to it this year.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.
This issue was closed because it has become stale with no activity.