UNPKG

@aws-amplify/data-construct

Version:

AppSync GraphQL Api Construct using Amplify GraphQL Transformer - Aliased to use `Data` name scheme.

14 lines (13 loc) 524 B
export const isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string"; export const fromImdsCredentials = (creds) => ({ accessKeyId: creds.AccessKeyId, secretAccessKey: creds.SecretAccessKey, sessionToken: creds.Token, expiration: new Date(creds.Expiration), ...(creds.AccountId && { accountId: creds.AccountId }), });