{"id":23165941,"url":"https://github.com/ndejong/aws-local-instancedata","last_synced_at":"2026-04-10T22:32:12.579Z","repository":{"id":143026034,"uuid":"140678113","full_name":"ndejong/aws-local-instancedata","owner":"ndejong","description":"Shell tool that uses curl/fetch to walk the AWS instancedata from http://169.254.169.254 and create a local copy of that data","archived":false,"fork":false,"pushed_at":"2018-07-12T09:17:17.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T06:14:12.641Z","etag":null,"topics":["aws","aws-ec2","user-data"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ndejong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-12T07:32:48.000Z","updated_at":"2022-03-28T07:17:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d65376a-af95-4b1a-9dc2-1336c0335efc","html_url":"https://github.com/ndejong/aws-local-instancedata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndejong%2Faws-local-instancedata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndejong%2Faws-local-instancedata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndejong%2Faws-local-instancedata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndejong%2Faws-local-instancedata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndejong","download_url":"https://codeload.github.com/ndejong/aws-local-instancedata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247251423,"owners_count":20908502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-ec2","user-data"],"created_at":"2024-12-18T01:30:42.283Z","updated_at":"2026-04-10T22:32:07.544Z","avatar_url":"https://github.com/ndejong.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS local-instancedata\n\nThis tool is a simple `/bin/sh` tool that uses `curl` (*nix) or `fetch` (BSD) to walk the AWS instancedata \nfrom http://169.254.169.254 and create a local copy of that data.\n\nThe AWS instancedata end-point at http://169.254.169.254 provides your instance various meta-data and \nuser-data that assists the instance to spin-up, configure itself and operate.  Obtaining this data via \nthis transport mechanism is great unless you are operating an edge case (perhaps unusual) scenario \nthat (a) restricts access to the reserved local-net 169.254.0.0/16 netblock, or (b) requests data from \nthis endpoint quick enough that [AWS throttle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-retrieval) \nthose requests which can leave you with null/empty response data making the scripts and tooling that \nrelies on this data to behave inconsistently or unpredictably.\n\nThe code is wrapped in an outer `aws_local_instancedata` function with local variables inside making \nthe whole thing easy to cut-n-paste into your user-data startup scripts.  The examples below show the \ncode being imported via a standard `.` import mechanism\n\nNB: this is `/bin/sh` not `/bin/bash` or some other shell.\n\n**Example** - using defaults, a full copy of the latest instancedata will be saved at \nthe `/var/lib/cloud/instance/instance-data` path:-\n```bash\n#/bin/sh \n. aws-local-instancedata.sh\naws_local_instancedata\n```\n\n**Example** - writing the instancedata to an alternative `/tmp/instancedata` path:-\n```bash\n#/bin/sh \n. aws-local-instancedata.sh\naws_local_instancedata /tmp/instancedata\n```\n\n**Example** - only create a local copy of the instance meta-data and write to an \nalternative `/tmp/meta-data` path - NB: the second `/user-data/` parameter with \nforward-slash at beginning and end:-\n```bash\n#/bin/sh \n. aws-local-instancedata.sh\naws_local_instancedata /tmp/meta-data /meta-data/\n```\n\nThis toolchain helpful when bootstrapping firewall instances in AWS because network traffic rules with \nfirewall instances can (rightly or wrongly) have opinionated rules and filters that prevent access to \nthe local-net 169.254.0.0/16 address space.\n\n#### Warning\nDepending on the deployment arrangement, the instancedata may contain sensitive data, you need to consider\nif this is appropriate for your use case and manage accordingly.\n\n## Authors\nThis code is managed by [Verb Networks](https://github.com/verbnetworks).\n\n## License\nApache 2 Licensed. See LICENSE file for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndejong%2Faws-local-instancedata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndejong%2Faws-local-instancedata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndejong%2Faws-local-instancedata/lists"}