A Lambda function to send notifications for transactions in an ESPN Fantasy Hockey league.
import { FantasyHockeyNotifier } from 'fantasy-hockey-notifier-cdk'
new FantasyHockeyNotifier(scope: Construct, id: string, props: FantasyHockeyNotifierProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
Scope. |
id |
string |
ID. |
props |
FantasyHockeyNotifierProps |
Construct Properties. |
- Type: constructs.Construct
Scope.
- Type: string
ID.
Construct Properties.
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { FantasyHockeyNotifier } from 'fantasy-hockey-notifier-cdk'
FantasyHockeyNotifier.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
dynamoTable |
aws-cdk-lib.aws_dynamodb.ITable |
The DynamoDB Table used for storing state. |
dynamoTableRemovalPolicy |
aws-cdk-lib.RemovalPolicy |
The removal policy for the DynamoDB table. |
eventRule |
aws-cdk-lib.aws_events.Rule |
The event rule for the Lambda function. |
lambdaArchitecture |
aws-cdk-lib.aws_lambda.Architecture |
The system architecture for the Lambda function. |
lambdaFunction |
aws-cdk-lib.aws_lambda_nodejs.NodejsFunction |
The Lambda function. |
snsTopic |
aws-cdk-lib.aws_sns.ITopic |
The SNS topic that recieves notifications about league events. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly dynamoTable: ITable;
- Type: aws-cdk-lib.aws_dynamodb.ITable
The DynamoDB Table used for storing state.
public readonly dynamoTableRemovalPolicy: RemovalPolicy;
- Type: aws-cdk-lib.RemovalPolicy
The removal policy for the DynamoDB table.
public readonly eventRule: Rule;
- Type: aws-cdk-lib.aws_events.Rule
The event rule for the Lambda function.
public readonly lambdaArchitecture: Architecture;
- Type: aws-cdk-lib.aws_lambda.Architecture
The system architecture for the Lambda function.
public readonly lambdaFunction: NodejsFunction;
- Type: aws-cdk-lib.aws_lambda_nodejs.NodejsFunction
The Lambda function.
public readonly snsTopic: ITopic;
- Type: aws-cdk-lib.aws_sns.ITopic
The SNS topic that recieves notifications about league events.
Environment variables for the Lambda function.
import { FantasyHockeyEnvVars } from 'fantasy-hockey-notifier-cdk'
const fantasyHockeyEnvVars: FantasyHockeyEnvVars = { ... }
Name | Type | Description |
---|---|---|
discordWebhook |
string |
Value for DISCORD_WEBHOOK. |
espnS2Cookie |
string |
Value for ESPN_S2_COOKIE. |
fhLeagueId |
string |
Value for FH_LEAGUE_ID. |
fhSeason |
string |
Value for FH_SEASON. |
public readonly discordWebhook: string;
- Type: string
Value for DISCORD_WEBHOOK.
public readonly espnS2Cookie: string;
- Type: string
Value for ESPN_S2_COOKIE.
This is a required parameter and must be set via SSM or clear text env vars
public readonly fhLeagueId: string;
- Type: string
Value for FH_LEAGUE_ID.
This is a required parameter and must be set via SSM or clear text env vars
public readonly fhSeason: string;
- Type: string
Value for FH_SEASON.
This is a required parameter and must be set via SSM or clear text env vars
Properties for a FantasyHockeyNotifier.
import { FantasyHockeyNotifierProps } from 'fantasy-hockey-notifier-cdk'
const fantasyHockeyNotifierProps: FantasyHockeyNotifierProps = { ... }
Name | Type | Description |
---|---|---|
dynamoTable |
aws-cdk-lib.aws_dynamodb.ITable |
An existing DynamoDB Table to use. |
dynamoTableRemovalPolicy |
aws-cdk-lib.RemovalPolicy |
The removal policy for the DynamoDB table. |
envVarValues |
FantasyHockeyEnvVars |
Values for the env vars. |
kmsKeys |
aws-cdk-lib.aws_kms.IKey[] |
Existing KMS keys that are used to encrypt the SSM parameters. |
lambdaArchitecture |
aws-cdk-lib.aws_lambda.Architecture |
The system architecture to use for the lambda function. |
lambdaSchedule |
aws-cdk-lib.aws_events.Schedule |
The schedule to use for the Lambda function. |
memorySize |
number |
The amount of memory, in MB, to allocate to the Lambda function. |
snsTopic |
aws-cdk-lib.aws_sns.ITopic |
An existing SNS topic to send league event notifications to. |
ssmPaths |
FantasyHockeyEnvVars |
Paths for existing SSM parmeters with values for the env vars. |
timeout |
aws-cdk-lib.Duration |
The function execution time after which Lambda terminates the function. |
public readonly dynamoTable: ITable;
- Type: aws-cdk-lib.aws_dynamodb.ITable
- Default: a new Table will be created
An existing DynamoDB Table to use.
public readonly dynamoTableRemovalPolicy: RemovalPolicy;
- Type: aws-cdk-lib.RemovalPolicy
- Default: RemovalPolicy.RETAIN
The removal policy for the DynamoDB table.
public readonly envVarValues: FantasyHockeyEnvVars;
- Type: FantasyHockeyEnvVars
Values for the env vars.
If a value is specifed here and in ssmPaths
, the value in ssmPaths
takes prescedence
public readonly kmsKeys: IKey[];
- Type: aws-cdk-lib.aws_kms.IKey[]
Existing KMS keys that are used to encrypt the SSM parameters.
This must be specified to allow Lambda to read SecureString SSM parameteers
public readonly lambdaArchitecture: Architecture;
- Type: aws-cdk-lib.aws_lambda.Architecture
- Default: Architecture.ARM_64
The system architecture to use for the lambda function.
public readonly lambdaSchedule: Schedule;
- Type: aws-cdk-lib.aws_events.Schedule
- Default: Schedule.rate(Duration.minutes(1))
The schedule to use for the Lambda function.
public readonly memorySize: number;
- Type: number
- Default: 128
The amount of memory, in MB, to allocate to the Lambda function.
public readonly snsTopic: ITopic;
- Type: aws-cdk-lib.aws_sns.ITopic
An existing SNS topic to send league event notifications to.
public readonly ssmPaths: FantasyHockeyEnvVars;
- Type: FantasyHockeyEnvVars
Paths for existing SSM parmeters with values for the env vars.
If a value is specifed here and in envVarValues
, this value takes prescedence
public readonly timeout: Duration;
- Type: aws-cdk-lib.Duration
- Default: Duration.seconds(10)
The function execution time after which Lambda terminates the function.