Skip to content

Latest commit

 

History

History
434 lines (262 loc) · 15.3 KB

API.md

File metadata and controls

434 lines (262 loc) · 15.3 KB

API Reference

Constructs

FantasyHockeyNotifier

A Lambda function to send notifications for transactions in an ESPN Fantasy Hockey league.

Initializers

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.

scopeRequired
  • Type: constructs.Construct

Scope.


idRequired
  • Type: string

ID.


propsRequired

Construct Properties.


Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { FantasyHockeyNotifier } from 'fantasy-hockey-notifier-cdk'

FantasyHockeyNotifier.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

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.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


dynamoTableRequired
public readonly dynamoTable: ITable;
  • Type: aws-cdk-lib.aws_dynamodb.ITable

The DynamoDB Table used for storing state.


dynamoTableRemovalPolicyRequired
public readonly dynamoTableRemovalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy

The removal policy for the DynamoDB table.


eventRuleRequired
public readonly eventRule: Rule;
  • Type: aws-cdk-lib.aws_events.Rule

The event rule for the Lambda function.


lambdaArchitectureRequired
public readonly lambdaArchitecture: Architecture;
  • Type: aws-cdk-lib.aws_lambda.Architecture

The system architecture for the Lambda function.


lambdaFunctionRequired
public readonly lambdaFunction: NodejsFunction;
  • Type: aws-cdk-lib.aws_lambda_nodejs.NodejsFunction

The Lambda function.


snsTopicOptional
public readonly snsTopic: ITopic;
  • Type: aws-cdk-lib.aws_sns.ITopic

The SNS topic that recieves notifications about league events.


Structs

FantasyHockeyEnvVars

Environment variables for the Lambda function.

Initializer

import { FantasyHockeyEnvVars } from 'fantasy-hockey-notifier-cdk'

const fantasyHockeyEnvVars: FantasyHockeyEnvVars = { ... }

Properties

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.

discordWebhookOptional
public readonly discordWebhook: string;
  • Type: string

Value for DISCORD_WEBHOOK.


espnS2CookieOptional
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


fhLeagueIdOptional
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


fhSeasonOptional
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


FantasyHockeyNotifierProps

Properties for a FantasyHockeyNotifier.

Initializer

import { FantasyHockeyNotifierProps } from 'fantasy-hockey-notifier-cdk'

const fantasyHockeyNotifierProps: FantasyHockeyNotifierProps = { ... }

Properties

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.

dynamoTableOptional
public readonly dynamoTable: ITable;
  • Type: aws-cdk-lib.aws_dynamodb.ITable
  • Default: a new Table will be created

An existing DynamoDB Table to use.


dynamoTableRemovalPolicyOptional
public readonly dynamoTableRemovalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.RETAIN

The removal policy for the DynamoDB table.


envVarValuesOptional
public readonly envVarValues: FantasyHockeyEnvVars;

Values for the env vars.

If a value is specifed here and in ssmPaths, the value in ssmPaths takes prescedence


kmsKeysOptional
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


lambdaArchitectureOptional
public readonly lambdaArchitecture: Architecture;
  • Type: aws-cdk-lib.aws_lambda.Architecture
  • Default: Architecture.ARM_64

The system architecture to use for the lambda function.


lambdaScheduleOptional
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.


memorySizeOptional
public readonly memorySize: number;
  • Type: number
  • Default: 128

The amount of memory, in MB, to allocate to the Lambda function.


snsTopicOptional
public readonly snsTopic: ITopic;
  • Type: aws-cdk-lib.aws_sns.ITopic

An existing SNS topic to send league event notifications to.


ssmPathsOptional
public readonly ssmPaths: 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


timeoutOptional
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.seconds(10)

The function execution time after which Lambda terminates the function.