CreateCliToken
Source:
src/AWS/MWAA/CreateCliToken.ts
Runtime binding for airflow:CreateCliToken.
Bind an Environment inside a function runtime to mint short-lived
(60-second) Apache Airflow CLI tokens — exchange the token against
https://{WebServerHostname}/aws_mwaa/cli to run Airflow CLI commands.
The CliToken is Redacted — unwrap it with Redacted.value when
building the request. Provide the implementation with
Effect.provide(AWS.MWAA.CreateCliTokenHttp).
Creating CLI Tokens
Section titled “Creating CLI Tokens”// init — bind the operation to the environmentconst createCliToken = yield* AWS.MWAA.CreateCliToken(environment);
// runtime — mint a token and POST a CLI command to the webserverconst token = yield* createCliToken();const response = yield* HttpClient.execute( HttpClientRequest.post( `https://${token.WebServerHostname}/aws_mwaa/cli`, ).pipe( HttpClientRequest.setHeader( "Authorization", `Bearer ${Redacted.value(token.CliToken!)}`, ), HttpClientRequest.bodyText("dags list -o json"), ),);