ec2_metadata_credentials.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {Credentials} from '../credentials';
  2. import {Logger} from '../config-base';
  3. export class EC2MetadataCredentials extends Credentials {
  4. /**
  5. * Creates credentials from the metadata service on an EC2 instance.
  6. * @param {object} options - Override the default (1s) timeout period.
  7. */
  8. constructor(options?: EC2MetadataCredentialsOptions);
  9. /**
  10. * The original expiration of the current credential. In case of AWS
  11. * outage, the EC2 metadata will extend expiration of the existing
  12. * credential.
  13. */
  14. originalExpiration?: Date;
  15. }
  16. interface EC2MetadataCredentialsOptions {
  17. httpOptions?: {
  18. /**
  19. * Timeout in milliseconds.
  20. */
  21. timeout?: number
  22. /**
  23. * Connection timeout in milliseconds.
  24. */
  25. connectTimeout?: number
  26. }
  27. maxRetries?: number
  28. logger?: Logger
  29. /**
  30. * Prevent IMDSv1 fallback.
  31. */
  32. ec2MetadataV1Disabled?: boolean
  33. /**
  34. * profile name to check for IMDSv1 settings.
  35. */
  36. profile?: string
  37. /**
  38. * optional file from which to to get config.
  39. */
  40. filename?: string
  41. }