Skip to content

GetAuthorizationToken

Source: src/AWS/ECRPublic/GetAuthorizationToken.ts

Runtime binding for ecr-public:GetAuthorizationToken (plus the sts:GetServiceBearerToken permission the API requires).

Retrieves a registry authorization token (valid for 12 hours) used to authenticate docker push against public.ecr.aws. The token in the response is Redacted — unwrap it with Redacted.value at the point of use. Provide the implementation with Effect.provide(AWS.ECRPublic.GetAuthorizationTokenHttp).

// init — registry-level binding takes no resource
const getAuthorizationToken = yield* AWS.ECRPublic.GetAuthorizationToken();
// runtime
const result = yield* getAuthorizationToken();
const token = result.authorizationData?.authorizationToken; // Redacted<string>