Skip to content

Commit

Permalink
Make email optional (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
plumdog authored and aknysh committed Feb 8, 2019
1 parent f4b68f3 commit f2e6705
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Available targets:
| datapipeline_ids | Datapipeline ids |
| logs_bucket_name | Logs bucket name |
| security_group_id | Security group id |
| sns_topic_arn | Backup notification SNS topic ARN |



Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
| datapipeline_ids | Datapipeline ids |
| logs_bucket_name | Logs bucket name |
| security_group_id | Security group id |
| sns_topic_arn | Backup notification SNS topic ARN |

5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ output "security_group_id" {
value = "${aws_security_group.datapipeline.id}"
description = "Security group id"
}

output "sns_topic_arn" {
value = "${aws_cloudformation_stack.sns.outputs.TopicArn}"
description = "Backup notification SNS topic ARN"
}
13 changes: 10 additions & 3 deletions templates/sns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ Parameters:
Email:
Type: String

Conditions:
SubscribeEmail: !Not [!Equals [ !Ref Email, ""]]

Resources:
Topic:
Type: AWS::SNS::Topic

EmailSubscription:
Condition: SubscribeEmail
Type: AWS::SNS::Subscription
Properties:
Subscription:
- Protocol: email
Endpoint: !Ref Email
TopicArn: !Ref Topic
Protocol: email
Endpoint: !Ref Email

Outputs:
TopicArn:
Expand Down

0 comments on commit f2e6705

Please sign in to comment.