# Functions
GenerateMetricsGraphAndLink takes the cloudwatch event and generates a graph (stored on S3) - it will then return a url based on the configured endpoint (eg: cloudfront or s3 web hosting).
GetOwnerFromTags returns the owning team name from the given tags.
GetPagerDutyRoutingKey returns the PagerDuty routing key given the service name.
GetServiceNameFromTags returns the service name from the given tags.
GetSlackChannel determines which slack channel we send messages to based on owner or the alerts:slack_channel override (fallback = default channel via env variable).
GetSlackChannelFromOwner returns the slack channel name given the owner name note: 1.
GetSlackChannelOverrideFromTags returns the slack channel override from the given tags.
HandleRequest is the main entrypoint for the lambda.
NewConfig returns a new lambda Config struct.
ProcessSQSEvent handles the cloudwatch event from SQS.
SetConfig allows injecting Config externally (ie: for testing).
Start begins the lambda handler.
WithCWClient allows overriding of the Alarms client.
WithDefaultPagerDutyRoutingKey allows setting the PagerDuty default routing key during New.
WithDefaultSlackChannel allows setting the default slack channel during New.
WithImageBucket allows setting the image bucket during New instead of fetching from env.
WithImageBucketPrefix sets the s3 bucket prefix used for writing images.
WithImageBucketRegion allows setting the image bucket region during New instead of fetching from env.
WithImageBucketRoleArn allows specifying the role arn to use for s3 writes instead of fetching from env.
WithImageHost allows setting the image host during New instead of fetching from env.
WithLogLevel allows specifying log level during New.
WithPagerDutyClient allows overriding of the pagerduty client.
WithParameterStoreClient allows overriding of the parameterstore client.
WithS3Client allows overriding of the S3 client.
WithSlackAlternativeURL allows setting the slack API url during New.
WithSlackClient allows overriding of the slack client.
WithSlackToken allows setting the slack API token during New.
# Constants
default configuration values: DefaultlOwnerTagKey is the AWS tag key to look for the team owner of the alarm.
DefaultPagerDutyRoutingKeyEnv is the environment variable key for the pagerduty routing key.
PagerDutyRoutingKeySSMPattern is the base ssm key name where other services put their routing key.
PagerDutySuppressAlarmsTagKey is the AWS tag which specifies whether we should suppress alarms in PagerDuty for this alarm must contain "true" to enable - else it will be considered false (whether empty or not) note: the logic to handle this is actually in PagerDuty event rules - since we can inspect the tags there.
DefaultServiceNameTagKey is the AWS tag key to look for the service name the alert is from.
DefaultSlackChannelEnv is the environment variable key for the default slack channel.
DefaultSlackChannelOverrideTagKey is the AWS tag which specifies the slack channel these alerts should be sent to.
ImageBucketEnv is the environment variable key for the images bucket.
ImageBucketPrefix is the env var key to find the s3 prefix used for storing images.
ImageBucketRegionEnv is the environment variable key for the images bucket region.
ImageBucketRoleArnEnv is the env var key to find the role arn to use when writing to the images bucket.
ImageHostEnv is the env variable key for the images host (ie: where images can be fetched externally).
LogLevelEnv is the environment variable key for setting the global log level.
OwnerTagKeyEnv is used to override the default owner tag key.
ServiceNameTagKey is used to override the default service name tag key.
environment variable keys: SlackTokenSSMKeyEnv is the environment variable key for the slack token ssm key value.
# Type aliases
ConfigOptions provides a way to override settings in the lambda Config struct.