This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description: CloudFront Functions Demo | |
# This example shows how to use CloudFront, CloudFront Functions, and CloudFormation. | |
# In this simple example we setup CloudFront so that on any request we redirect to another site. | |
# While basic, this example can be expanded to provide typical redirect scenarios, based | |
# on the event passed to the function. | |
# This example written by Mike Roberts (https://twitter.com/mikebroberts), Symphonia. | |
# For more ideas about using AWS more effectively,see our blog at https://blog.symphonia.io/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import 'source-map-support/register'; | |
import {App, Duration, Stack, StackProps} from 'aws-cdk-lib'; | |
import {Construct} from 'constructs'; | |
import {Code, Function, Runtime} from "aws-cdk-lib/aws-lambda"; | |
import {StateMachine} from "aws-cdk-lib/aws-stepfunctions"; | |
import {LambdaInvoke} from "aws-cdk-lib/aws-stepfunctions-tasks"; | |
import {Rule, RuleTargetInput, Schedule} from "aws-cdk-lib/aws-events"; | |
import {SfnStateMachine} from "aws-cdk-lib/aws-events-targets"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BatchWriteCommand, DynamoDBDocumentClient, paginateScan } from '@aws-sdk/lib-dynamodb' | |
import { DynamoDBClient } from '@aws-sdk/client-dynamodb' | |
function filterKeys<T extends object>(object: T, keyPredicate: (key: string) => boolean) { | |
return object ? Object.fromEntries(Object.entries(object).filter(([key]) => keyPredicate(key))) : object | |
} | |
function selectKeys<T extends object>(object: T, keys: string[]) { | |
return filterKeys(object, (key) => keys.includes(key)) | |
} |
OlderNewer