[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

@prairielearn/aws-imds
TypeScript icon, indicating that this package has built-in type declarations

2.0.11 • Public • Published

@prairielearn/aws-imds

Utilities for fetching data from the AWS EC2 Instance Metadata Service (IMDS).

Usage

import { fetchImdsText, fetchImdsJson } from '@prairielearn/aws-imds';

const hostname = await fetchImdsText('/latest/meta-data/hostname');
const identity = await fetchImdsJson('/latest/dynamic/instance-identity/document');

You can also use convenience functions to fetch data from common endpoints. The data is internally validated with Zod before being returned.

import { fetchInstanceHostname, fetchInstanceIdentity } from '@prairielearn/aws-imds';

const hostname = await fetchInstanceHostname();
const identity = await fetchInstanceIdentity();

Readme

Keywords

none

Package Sidebar

Install

npm i @prairielearn/aws-imds

Weekly Downloads

902

Version

2.0.11

License

none

Unpacked Size

13.3 kB

Total Files

9

Last publish

Collaborators

  • nwalters512
  • mwest1066