'| /? () \/\/
| const sleep = (duration) => { | |
| return new Promise((resolve) => { | |
| setTimeout(() => { | |
| resolve(); | |
| }, duration); | |
| }); | |
| }; |
| { | |
| "Version": "2008-10-17", | |
| "Id": "PolicyForCloudFrontPrivateContent", | |
| "Statement": [ | |
| { | |
| "Sid": "AllowCloudFrontServicePrincipal", | |
| "Effect": "Allow", | |
| "Principal": { | |
| "Service": "cloudfront.amazonaws.com" | |
| }, |
| import http from "node:http" | |
| const hostname = '0.0.0.0'; | |
| const port = 80; | |
| const server = http.createServer((req, res) => { | |
| res.statusCode = 200; | |
| res.setHeader("Content-Type", "text/html"); | |
| res.end("<h1>Hello from LearnAWS.io</h1>\n"); | |
| }); |
| import { | |
| CognitoIdentityProviderClient, | |
| ListUsersCommand, | |
| AdminDeleteUserCommand, | |
| } from "@aws-sdk/client-cognito-identity-provider"; | |
| const USER_POOL_ID = "your-pool-id"; | |
| const client = new CognitoIdentityProviderClient({ region: "us-east-1" }); |
| export const createGqlClient = (authToken: string, API: string) => (async (query) => { | |
| if (!authToken) { | |
| throw "Invalid Auth Token passed"; | |
| } | |
| if (!API) { | |
| throw "Invalid API URL passed"; | |
| } | |
| const response = await fetch(`https://${API}/graphql`, { |