Instance Tags¶
EC2 instance tags can be exposed through the AWS Instance Metadata Service through the tags/instance instance category. The imds-mock exposes a default Name=imds-mock-ec2 tag to simulate the enablement of this feature.
Custom Tags¶
If you wish to override the default instance tags exposed by the imds-mock, the --instance-tags flag accepts a list of key=value pairs.
Querying a Tag¶
Any custom tag can be retrieved using the root metadata category tags/instance. For example, to retrieve the Environment tag:
Excluding Instance Tags¶
EC2 instance tags are omitted from the AWS Instance Metadata Service by default. Set the --exclude-instance-tags flag to simulate this in the imds-mock: