Skip to content

Commit

Permalink
feat(optional-alerts): https endpoint for SNS subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
boltdynamics committed Aug 19, 2023
1 parent 648253f commit 5df470f
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,19 @@ Parameters:
AllowedValues:
- "true"
- "false"
AlertsHttpEndpoint:
EnableAlerting:
Type: String
Description: >-
HTTP endpoint to send alerts to.
Get alerts for failed step function executions, also provide
https endpoint or email address to send alerts to.
Default: "false"
AllowedValues:
- "true"
- "false"
AlertsHttpsEndpoint:
Type: String
Description: >-
HTTPS endpoint to send alerts to.
Default: ""
AlertsEmail:
Type: String
Expand Down Expand Up @@ -120,12 +129,15 @@ Conditions:
- "true"
StateMachineTracingEnabled: !Equals [!Ref EnableStateMachineTracing, "true"]
LambdaTracingEnabled: !Equals [!Ref EnableLambdaTracing, "true"]
AlertHttpEndpointProvided: !Not [!Equals [!Ref AlertsHttpEndpoint, ""]]
SubscribeHttpEndpoint: !And
AlertHttpsEndpointProvided: !Not [!Equals [!Ref AlertsHttpsEndpoint, ""]]
EnableAlerting: !Equals [!Ref EnableAlerting, "true"]
SubscribeHttpsEndpoint: !And
- Condition: EnableAlerting
- Condition: WorkloadStateMachineEnabled
- Condition: AlertHttpEndpointProvided
- Condition: AlertHttpsEndpointProvided
AlertEmailProvided: !Not [!Equals [!Ref AlertsEmail, ""]]
SubscribeEmail: !And
- Condition: EnableAlerting
- Condition: WorkloadStateMachineEnabled
- Condition: AlertEmailProvided

Expand Down Expand Up @@ -609,12 +621,12 @@ Resources:
Type: AWS::SNS::Topic

HttpEndpointSubscription:
Condition: SubscribeHttpEndpoint
Condition: SubscribeHttpsEndpoint
Type: AWS::SNS::Subscription
Properties:
Protocol: http
Protocol: https
TopicArn: !Ref AlertsTopic
Endpoint: !Ref AlertsHttpEndpoint
Endpoint: !Ref AlertsHttpsEndpoint

EmailSubscription:
Condition: SubscribeEmail
Expand Down

0 comments on commit 5df470f

Please sign in to comment.