Skip to content

GetLexicon

Source: src/AWS/Polly/GetLexicon.ts

Runtime binding for polly:GetLexicon — read the PLS content and attributes of a pronunciation lexicon at runtime.

Bind it to a Lexicon resource; the deploy-time half grants polly:GetLexicon scoped to that lexicon’s ARN and the runtime callable injects the lexicon name. The returned Lexicon.Content is Redacted (distilled models it as sensitive) — unwrap with Redacted.value(...) at the point of use. Provide the implementation with Effect.provide(AWS.Polly.GetLexiconHttp).

// init
const getLexicon = yield* AWS.Polly.GetLexicon(lexicon);
// runtime
const result = yield* getLexicon();
const content = result.Lexicon?.Content;
const xml =
content === undefined
? undefined
: Redacted.isRedacted(content)
? Redacted.value(content)
: content;