Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

A simulator for the AWS EC2 instance metadata service.

License

NotificationsYou must be signed in to change notification settings

jzonthemtn/aws-metadata-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project provides an incomplete capability of simulating AWS EC2instance metadata. It was created to allow for testing of applications that utilize EC2 instance metadata in non-AWS environments or for testing applications in AWS against different metadata values.

Quick Install

wget https://raw.githubusercontent.com/mtnfog/aws-metadata-simulator/master/install.sh && chmod +x install.sh && ./install.shsudo iptables -t nat -A OUTPUT -p tcp -d 169.254.169.254 --dport 80 -j DNAT --to-destination 127.0.0.1:8080

Manual Install Steps

go get -u github.com/mtnfog/aws-metadata-simulator

To run:

If specific values for the instance metadata are desired set those values inmetadata.toml then run it:

go run main.go

To use a different file as the configuration give the filename as a command line argument:

go run main.go other.toml

To redirect traffic:

iptables -t nat -A OUTPUT -p tcp -d 169.254.169.254 --dport 80 -j DNAT --to-destination 127.0.0.1:8080

To use:

curl -X GET http://127.0.0.1:8080/latest/meta-data/ami-id

Using

Now when applications make requests to the EC2 instance metadata the simulator will answer. You can test it:

curl http://169.254.169.254/latest/meta-data/hostname

To revert back to EC2's instance metadata service you must remove theiptables rule.

About

A simulator for the AWS EC2 instance metadata service.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp