File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ resource "aws_chatbot_slack_channel_configuration" "fhir_api_perf_alerts" {
2+ configuration_name = " ${ var . environment } -fhir-api-perf-alerts-slack-channel-config"
3+ iam_role_arn = aws_iam_role. fhir_api_perf_alerts_chatbot . arn
4+ slack_channel_id = var. environment == " prod" ? " C0B11MJPQ6A" : " C0B1GKZ5S4R"
5+ slack_team_id = " TJ00QR03U"
6+ sns_topic_arns = [aws_sns_topic . fhir_api_perf_alerts . arn ]
7+ }
8+
9+ resource "aws_iam_role" "fhir_api_perf_alerts_chatbot" {
10+ name = " ${ var . environment } -fhir-api-perf-alerts-chatbot-channel-role"
11+ assume_role_policy = jsonencode ({
12+ Version = " 2012-10-17"
13+ Statement = [
14+ {
15+ Action = " sts:AssumeRole"
16+ Effect = " Allow"
17+ Sid = " AssumeChatbotRole"
18+ Principal = {
19+ Service = " chatbot.amazonaws.com"
20+ }
21+ },
22+ ]
23+ })
24+ }
Original file line number Diff line number Diff line change 1+ resource "aws_sns_topic" "fhir_api_perf_alerts" {
2+ name = " ${ var . environment } -fhir-api-perf-alerts"
3+ kms_master_key_id = aws_kms_key. error_alerts_sns_encryption_key . arn
4+ }
5+
6+ resource "aws_sns_topic_policy" "fhir_api_perf_alerts_topic_policy" {
7+ arn = aws_sns_topic. fhir_api_perf_alerts . arn
8+ policy = jsonencode ({
9+ Version = " 2012-10-17" ,
10+ Statement = [
11+ {
12+ Sid = " AllowCloudWatchToPublish" ,
13+ Effect = " Allow" ,
14+ Principal = {
15+ Service = " cloudwatch.amazonaws.com"
16+ },
17+ Action = " SNS:Publish" ,
18+ Resource = aws_sns_topic.fhir_api_perf_alerts.arn
19+ }
20+ ]
21+ })
22+ }
Original file line number Diff line number Diff line change @@ -225,3 +225,9 @@ resource "aws_kms_alias" "fhir_api_errors_sns_encryption_key" {
225225 name = " alias/${ var . environment } -fhir-api-errors-imms-sns-encryption"
226226 target_key_id = aws_kms_key. error_alerts_sns_encryption_key . key_id
227227}
228+
229+ resource "aws_kms_alias" "fhir_api_perf_alerts_sns_encryption_key" {
230+ name = " alias/${ var . environment } -fhir-api-perf-alerts-imms-sns-encryption"
231+ target_key_id = aws_kms_key. error_alerts_sns_encryption_key . key_id
232+ }
233+
You can’t perform that action at this time.
0 commit comments