Skip to content

Commit

Permalink
Update terraform variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Plowman committed Oct 20, 2023
1 parent a955334 commit f956075
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 165 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
with:
projectBaseDir: .
args: >
-Dsonar.sources=application,deployment,infrastructure,scripts,test,build/docker
-Dsonar.sources=application,infrastructure,scripts,test,build/docker
-Dsonar.organization=nhsd-exeter
-Dsonar.projectKey=uec-dos-int
-Dsonar.coverage.exclusions=tests/**,**/tests/**,deployment,infrastructure,application/dos_db_handler/**,test/**,scripts/**,application/conftest.py
-Dsonar.coverage.exclusions=tests/**,**/tests/**,infrastructure,application/dos_db_handler/**,test/**,scripts/**,application/conftest.py
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.python.version=3.11
-Dsonar.exclusions=application/**/tests/**
Expand Down
44 changes: 5 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ build-and-deploy: # Builds and Deploys whole project - mandatory: PROFILE
populate-deployment-variables:
echo "unset AWS_PROFILE"
DEPLOYMENT_SECRETS=$$(make -s secret-get-existing-value NAME=$(DEPLOYMENT_SECRETS))
echo "export SLACK_WEBHOOK_URL=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(SLACK_WEBHOOK_SECRET_KEY)')"
echo "export PROJECT_SYSTEM_EMAIL_ADDRESS=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(SYSTEM_EMAIL_KEY)')"
echo "export PROJECT_TEAM_EMAIL_ADDRESS=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(TEAM_EMAIL_KEY)')"
echo "export TF_VAR_slack_webhook_url=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(SLACK_WEBHOOK_SECRET_KEY)')"
echo "export TF_VAR_project_system_email_address=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(SYSTEM_EMAIL_KEY)')"
echo "export TF_VAR_project_team_email_address=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(TEAM_EMAIL_KEY)')"
echo "export TF_VAR_service_category=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(SERVICE_CATEGORY_KEY)')"
echo "export TF_VAR_data_classification=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(DATA_CLASSIFICATION_KEY)')"
echo "export TF_VAR_distribution_list=$$(echo $$DEPLOYMENT_SECRETS | jq -r '.$(DISTRIBUTION_LIST_KEY)')"
Expand Down Expand Up @@ -480,39 +480,6 @@ tag-commit-to-rollback-blue-green-environment: # Tags commit to rollback blue/gr
commit-date-hash-tag:
echo "$(BUILD_COMMIT_DATETIME)-$(BUILD_COMMIT_HASH)"

check-ecr-image-tag-exist: ### Check image with tag exists in ECR - mandatory: REPO=[repository name],TAG=[string to match tag of an image]
if [ $$(aws ecr batch-get-image --repository-name $(REPO) --image-ids imageTag=$(TAG) --registry-id=$(AWS_ACCOUNT_ID_MGMT) | jq '.images | length') == 1 ];
then
echo true
else
echo false
fi

check-ecr-lambda-images-exist-for-tag: ### Check all lambda images with given tag exist in ECR - mandatory: TAG=[string to match tag of an image]
for IMAGE_NAME in $$(echo $(PROJECT_LAMBDAS_LIST) | tr "," "\n"); do
IMAGE_STATUS=$$(make check-ecr-image-tag-exist REPO=uec-dos/int/$$IMAGE_NAME)
if [[ "$$IMAGE_STATUS" == "false" ]]; then
echo false
exit
fi
done
echo true

wait-for-ecr-lambda-images-to-exist-for-tag: ### Wait for lambda images to exist with given tag in ECR or timeout - mandatory: TAG=[string to match tag of an image]
TIMEOUT=600
START_TS=$$(date +%s)
echo "Checking lambda images are ready.."
while [ $$(make check-ecr-lambda-images-exist-for-tag) == "false" ]; do
ELAPSED_TIME=$$(expr $$(date +%s) - $$START_TS )
if [ "$$ELAPSED_TIME" -gt "$$TIMEOUT" ]; then
echo "Failed to find Lambda images in given timeout $$TIMEOUT secs"
exit 1
fi
echo "..Lambda images not ready, waiting 10 second before checking again.."
sleep 10
done
echo "..Lambda images ready"

docker-run-tester: ### Run python container - mandatory: CMD; optional: SH=true,DIR,ARGS=[Docker args],LIB_VOLUME_MOUNT=true,VARS_FILE=[Makefile vars file],IMAGE=[image name],CONTAINER=[container name]
make docker-config > /dev/null 2>&1
mkdir -p $(TMP_DIR)/.python/pip/{cache,packages}
Expand Down Expand Up @@ -553,8 +520,7 @@ docker-run-ruff: # Runs ruff tests - mandatory: RUFF_OPTS=[options]
python-ruff-fix: # Auto fixes ruff warnings
make docker-run-ruff RUFF_OPTS="--fix"

# ==============================================================================

.SILENT: docker-run-ruff \
commit-date-hash-tag \
check-ecr-image-tag-exist \
wait-for-ecr-lambda-images-to-exist-for-tag \
check-ecr-lambda-images-exist-for-tag
34 changes: 23 additions & 11 deletions build/automation/var/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ TF_VAR_blue_green_deployment_current_version_parameter_name := $(PROJECT_ID)-$(S

# Parameter Store (Application)
PHARMACY_FIRST_PHASE_ONE_PARAMETER := $(PROJECT_ID)-$(SHARED_ENVIRONMENT)-pharmacy-first-phase-one
TF_VAR_pharmacy_first_phase_one_parameter_name := $(PHARMACY_FIRST_PHASE_ONE_PARAMETER)
TF_VAR_pharmacy_first_phase_one_parameter:= $(PHARMACY_FIRST_PHASE_ONE_PARAMETER)

# WAF
TF_VAR_waf_enabled := $(WAF_ENABLED)
Expand Down Expand Up @@ -181,16 +181,27 @@ TF_VAR_slack_messenger := $(SLACK_MESSENGER)
TF_VAR_quality_checker := $(QUALITY_CHECKER)

# Lambda names
TF_VAR_change_event_dlq_handler_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(CHANGE_EVENT_DLQ_HANDLER)
TF_VAR_dos_db_handler_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(DOS_DB_HANDLER)
TF_VAR_dos_db_update_dlq_handler_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(DOS_DB_UPDATE_DLQ_HANDLER)
TF_VAR_event_replay_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(EVENT_REPLAY)
TF_VAR_ingest_change_event_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(INGEST_CHANGE_EVENT)
TF_VAR_send_email_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SEND_EMAIL)
TF_VAR_service_matcher_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SERVICE_MATCHER)
TF_VAR_service_sync_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SERVICE_SYNC)
TF_VAR_slack_messenger_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SLACK_MESSENGER)
TF_VAR_quality_checker_lambda := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(QUALITY_CHECKER)
CHANGE_EVENT_DLQ_HANDLER_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(CHANGE_EVENT_DLQ_HANDLER)
DOS_DB_HANDLER_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(DOS_DB_HANDLER)
DOS_DB_UPDATE_DLQ_HANDLER_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(DOS_DB_UPDATE_DLQ_HANDLER)
EVENT_REPLAY_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(EVENT_REPLAY)
INGEST_CHANGE_EVENT_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(INGEST_CHANGE_EVENT)
SEND_EMAIL_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SEND_EMAIL)
SERVICE_MATCHER_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SERVICE_MATCHER)
SERVICE_SYNC_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SERVICE_SYNC)
SLACK_MESSENGER_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(SLACK_MESSENGER)
QUALITY_CHECKER_LAMBDA := $(PROJECT_ID)-$(BLUE_GREEN_ENVIRONMENT)-$(QUALITY_CHECKER)

TF_VAR_change_event_dlq_handler_lambda := $(CHANGE_EVENT_DLQ_HANDLER_LAMBDA)
TF_VAR_dos_db_handler_lambda := $(DOS_DB_HANDLER_LAMBDA)
TF_VAR_dos_db_update_dlq_handler_lambda := $(DOS_DB_UPDATE_DLQ_HANDLER_LAMBDA)
TF_VAR_event_replay_lambda := $(EVENT_REPLAY_LAMBDA)
TF_VAR_ingest_change_event_lambda := $(INGEST_CHANGE_EVENT_LAMBDA)
TF_VAR_send_email_lambda := $(SEND_EMAIL_LAMBDA)
TF_VAR_service_matcher_lambda := $(SERVICE_MATCHER_LAMBDA)
TF_VAR_service_sync_lambda := $(SERVICE_SYNC_LAMBDA)
TF_VAR_slack_messenger_lambda := $(SLACK_MESSENGER_LAMBDA)
TF_VAR_quality_checker_lambda := $(QUALITY_CHECKER_LAMBDA)

# Lambda Versions
TF_VAR_change_event_dlq_handler_version := $(or $(CHANGE_EVENT_DLQ_HANDLER_VERSION), $(VERSION))
Expand Down Expand Up @@ -230,6 +241,7 @@ TF_VAR_service_sync_max_concurrency := $(SERVICE_SYNC_MAX_CONCURRENCY)
# Lambda Variables
TF_VAR_log_level := $(LOG_LEVEL)
TF_VAR_lambda_powertools_service_name := $(PROGRAMME)-$(TEAM_ID)-$(PROFILE)-$(BLUE_GREEN_ENVIRONMENT)
TF_VAR_slack_alert_channel := $(SLACK_ALERT_CHANNEL)
TF_VAR_dos_db_cluster_name := $(DB_CLUSTER_NAME)
TF_VAR_dos_db_writer_name := $(DB_WRITER_NAME)
TF_VAR_dos_db_reader_name := $(DB_READER_NAME)
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/stacks/application/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ data "aws_iam_policy_document" "service_matcher_policy" {
"ssm:GetParameter",
]
resources = [
"arn:aws:ssm:${var.aws_region}:${var.aws_account_id}:parameter/${var.pharmacy_first_phase_one_parameter_name}",
"arn:aws:ssm:${var.aws_region}:${var.aws_account_id}:parameter/${var.pharmacy_first_phase_one_parameter}",
]
}

Expand Down
97 changes: 49 additions & 48 deletions infrastructure/stacks/application/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module "dos_db_handler_lambda" {
"POWERTOOLS_TRACER_CAPTURE_ERROR" = true
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.change_event_dlq_handler_version
"IMAGE_VERSION" = var.dos_db_handler_version
"DB_NAME" = var.dos_db_name
"DB_PORT" = var.dos_db_port
"DB_READ_ONLY_USER_NAME" = var.dos_db_read_only_user_name_secret_name
Expand All @@ -81,8 +81,8 @@ module "dos_db_handler_lambda" {
"DB_READER_SERVER" = var.dos_db_reader_route_53
"DB_WRITER_SERVER" = var.dos_db_writer_route_53
"DB_SCHEMA" = var.dos_db_schema
"DB_WRITER_SECRET_KEY" = var.dos_db_writer_secret_name
"DB_WRITER_SECRET_NAME" = var.dos_db_writer_secret_key
"DB_WRITER_SECRET_NAME" = var.dos_db_writer_secret_name
"DB_WRITER_SECRET_KEY" = var.dos_db_writer_secret_key
"DB_READ_AND_WRITE_USER_NAME" = var.dos_db_read_and_write_user_name
}
}
Expand Down Expand Up @@ -119,7 +119,7 @@ module "dos_db_update_dlq_handler_lambda" {
"POWERTOOLS_TRACER_CAPTURE_ERROR" = true
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.change_event_dlq_handler_version
"IMAGE_VERSION" = var.dos_db_update_dlq_handler_version
}
}

Expand Down Expand Up @@ -157,6 +157,7 @@ module "event_replay_lambda" {
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.event_replay_version
"CHANGE_EVENTS_TABLE_NAME" = var.change_events_table_name
"CHANGE_EVENT_SQS_NAME" = var.holding_queue
}
}

Expand Down Expand Up @@ -195,6 +196,7 @@ module "ingest_change_event_lambda" {
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.ingest_change_event_version
"CHANGE_EVENTS_TABLE_NAME" = var.change_events_table_name
"HOLDING_QUEUE_URL" = aws_sqs_queue.holding_queue.url
}
}

Expand Down Expand Up @@ -233,9 +235,9 @@ module "send_email_lambda" {
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.send_email_version
"AWS_ACCOUNT_NAME" = "AWS_ACCOUNT_NAME"
"SYSTEM_EMAIL_ADDRESS" = "PROJECT_SYSTEM_EMAIL_ADDRESS"
"EMAIL_SECRET_NAME" = "PROJECT_DEPLOYMENT_SECRETS"
"AWS_ACCOUNT_NAME" = var.aws_account_name
"SYSTEM_EMAIL_ADDRESS" = var.project_system_email_address
"EMAIL_SECRET_NAME" = var.project_deployment_secrets
}
}

Expand Down Expand Up @@ -277,16 +279,16 @@ module "service_matcher_lambda" {
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.service_matcher_version
"CHANGE_EVENTS_TABLE_NAME" = "TF_VAR_change_events_table_name"
"UPDATE_REQUEST_QUEUE_URL" = "update_request_queue_url"
"DB_NAME" = "DB_NAME"
"DB_PORT" = "DB_PORT"
"DB_READ_ONLY_USER_NAME" = "DB_READ_ONLY_USER_NAME"
"DB_READER_SECRET_NAME" = "DB_READER_SECRET_NAME"
"DB_READER_SECRET_KEY" = "DB_READER_SECRET_KEY"
"DB_READER_SERVER" = "DB_READER_SERVER"
"DB_SCHEMA" = "DB_SCHEMA"
"PHARMACY_FIRST_PHASE_ONE_PARAMETER" = "PHARMACY_FIRST_PHASE_ONE_PARAMETER"
"UPDATE_REQUEST_QUEUE_URL" = aws_sqs_queue.update_request_queue.url
"DB_NAME" = var.dos_db_name
"DB_PORT" = var.dos_db_port
"DB_READ_ONLY_USER_NAME" = var.dos_db_read_only_user_name_secret_name
"DB_READER_SECRET_NAME" = var.dos_db_reader_secret_name
"DB_READER_SECRET_KEY" = var.dos_db_reader_secret_key
"DB_READER_SERVER" = var.dos_db_reader_route_53
"DB_WRITER_SERVER" = var.dos_db_writer_route_53
"DB_SCHEMA" = var.dos_db_schema
"PHARMACY_FIRST_PHASE_ONE_PARAMETER" = var.pharmacy_first_phase_one_parameter
}
}

Expand Down Expand Up @@ -328,23 +330,22 @@ module "service_sync_lambda" {
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.service_sync_version
"CHANGE_EVENTS_TABLE_NAME" = "TF_VAR_change_events_table_name"
"UPDATE_REQUEST_QUEUE_URL" = "update_request_queue_url"
"DB_NAME" = "DB_NAME"
"DB_PORT" = "DB_PORT"
"DB_READ_ONLY_USER_NAME" = "DB_READ_ONLY_USER_NAME"
"DB_READER_SECRET_NAME" = "DB_READER_SECRET_NAME"
"DB_READER_SECRET_KEY" = "DB_READER_SECRET_KEY"
"DB_READER_SERVER" = "DB_READER_SERVER"
"DB_WRITER_SERVER" = "DB_WRITER_SERVER"
"DB_SCHEMA" = "DB_SCHEMA"
"DB_WRITER_SECRET_KEY" = "DB_WRITER_SECRET_KEY"
"DB_WRITER_SECRET_NAME" = "DB_WRITER_SECRET_NAME"
"DB_READ_AND_WRITE_USER_NAME" = "DB_READ_AND_WRITE_USER_NAME"
"SEND_EMAIL_BUCKET_NAME" = "SEND_EMAIL_BUCKET_NAME"
"TEAM_EMAIL_ADDRESS" = "PROJECT_TEAM_EMAIL_ADDRESS"
"SYSTEM_EMAIL_ADDRESS" = "PROJECT_SYSTEM_EMAIL_ADDRESS"
"SEND_EMAIL_LAMBDA_NAME" = "TF_VAR_send_email_lambda_name"
"UPDATE_REQUEST_QUEUE_URL" = aws_sqs_queue.update_request_queue.url
"DB_NAME" = var.dos_db_name
"DB_PORT" = var.dos_db_port
"DB_READ_ONLY_USER_NAME" = var.dos_db_read_only_user_name_secret_name
"DB_READER_SECRET_NAME" = var.dos_db_reader_secret_name
"DB_READER_SECRET_KEY" = var.dos_db_reader_secret_key
"DB_READER_SERVER" = var.dos_db_reader_route_53
"DB_WRITER_SERVER" = var.dos_db_writer_route_53
"DB_SCHEMA" = var.dos_db_schema
"DB_WRITER_SECRET_NAME" = var.dos_db_writer_secret_name
"DB_WRITER_SECRET_KEY" = var.dos_db_writer_secret_key
"DB_READ_AND_WRITE_USER_NAME" = var.dos_db_read_and_write_user_name
"SEND_EMAIL_BUCKET_NAME" = var.send_email_bucket_name
"TEAM_EMAIL_ADDRESS" = var.project_team_email_address
"SYSTEM_EMAIL_ADDRESS" = var.project_system_email_address
"SEND_EMAIL_LAMBDA_NAME" = var.send_email_lambda
}
}

Expand Down Expand Up @@ -381,9 +382,9 @@ module "slack_messenger_lambda" {
"POWERTOOLS_TRACER_CAPTURE_ERROR" = true
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.service_sync_version
"SLACK_ALERT_CHANNEL" = "SLACK_ALERT_CHANNEL"
"SLACK_WEBHOOK_URL" = "SLACK_WEBHOOK_URL"
"IMAGE_VERSION" = var.slack_messenger_version
"SLACK_ALERT_CHANNEL" = var.slack_alert_channel
"SLACK_WEBHOOK_URL" = var.slack_webhook_url
}
}

Expand Down Expand Up @@ -420,16 +421,16 @@ module "quality_checker_lambda" {
"POWERTOOLS_TRACE_MIDDLEWARES" = true
"LOG_LEVEL" = var.log_level
"IMAGE_VERSION" = var.quality_checker_version
"DB_NAME" = "DB_NAME"
"DB_PORT" = "DB_PORT"
"DB_READ_ONLY_USER_NAME" = "DB_READ_ONLY_USER_NAME"
"DB_READER_SECRET_NAME" = "DB_READER_SECRET_NAME"
"DB_READER_SECRET_KEY" = "DB_READER_SECRET_KEY"
"DB_READER_SERVER" = "DB_READER_SERVER"
"DB_WRITER_SERVER" = "DB_WRITER_SERVER"
"DB_SCHEMA" = "DB_SCHEMA"
"DB_WRITER_SECRET_KEY" = "DB_WRITER_SECRET_KEY"
"DB_WRITER_SECRET_NAME" = "DB_WRITER_SECRET_NAME"
"DB_READ_AND_WRITE_USER_NAME" = "DB_READ_AND_WRITE_USER_NAME"
"DB_NAME" = var.dos_db_name
"DB_PORT" = var.dos_db_port
"DB_READ_ONLY_USER_NAME" = var.dos_db_read_only_user_name_secret_name
"DB_READER_SECRET_NAME" = var.dos_db_reader_secret_name
"DB_READER_SECRET_KEY" = var.dos_db_reader_secret_key
"DB_READER_SERVER" = var.dos_db_reader_route_53
"DB_WRITER_SERVER" = var.dos_db_writer_route_53
"DB_SCHEMA" = var.dos_db_schema
"DB_WRITER_SECRET_NAME" = var.dos_db_writer_secret_name
"DB_WRITER_SECRET_KEY" = var.dos_db_writer_secret_key
"DB_READ_AND_WRITE_USER_NAME" = var.dos_db_read_and_write_user_name
}
}
19 changes: 14 additions & 5 deletions infrastructure/stacks/application/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# output "lambda_versions" {
# value = {
# "change_event_dlq_handler" = aws_lambda_function.change_event_dlq_handler.version
# }
# }
output "lambda_versions" {
value = {
"change_event_dlq_handler" = var.change_event_dlq_handler_version
"dos_db_handler" = var.dos_db_handler_version
"dos_db_update_dlq_handler" = var.dos_db_update_dlq_handler_version
"event_replay" = var.event_replay_version
"ingest_change_event" = var.ingest_change_event_version
"send_email" = var.send_email_version
"service_matcher" = var.service_matcher_version
"service_sync" = var.service_sync_version
"slack_messenger" = var.slack_messenger_version
"quality_checker" = var.quality_checker_version
}
}
15 changes: 9 additions & 6 deletions infrastructure/stacks/application/sns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ resource "aws_sns_topic_policy" "sns_topic_app_alerts_for_slack_policy_default_r
}

resource "aws_sns_topic_subscription" "sns_topic_app_alerts_for_slack_policy_default_region_target" {
topic_arn = aws_sns_topic.sns_topic_app_alerts_for_slack_default_region.arn
protocol = "lambda"
endpoint = module.slack_messenger_lambda.lambda_function_arn
topic_arn = aws_sns_topic.sns_topic_app_alerts_for_slack_default_region.arn
protocol = "lambda"
endpoint = module.slack_messenger_lambda.lambda_function_arn
depends_on = [aws_sns_topic.sns_topic_app_alerts_for_slack_default_region, aws_sns_topic_policy.sns_topic_app_alerts_for_slack_policy_default_region]
}

resource "aws_sns_topic" "sns_topic_app_alerts_for_slack_route53_health_check_alarm_region" {
Expand All @@ -33,7 +34,9 @@ resource "aws_sns_topic_policy" "sns_topic_app_alerts_for_slack_policy_alarm_reg
}

resource "aws_sns_topic_subscription" "sns_topic_app_alerts_for_slack_route53_health_check_alarm_region_target" {
topic_arn = aws_sns_topic.sns_topic_app_alerts_for_slack_route53_health_check_alarm_region.arn
protocol = "lambda"
endpoint = module.slack_messenger_lambda.lambda_function_arn
provider = aws.route53_health_check_alarm_region
topic_arn = aws_sns_topic.sns_topic_app_alerts_for_slack_route53_health_check_alarm_region.arn
protocol = "lambda"
endpoint = module.slack_messenger_lambda.lambda_function_arn
depends_on = [aws_sns_topic.sns_topic_app_alerts_for_slack_route53_health_check_alarm_region, aws_sns_topic_policy.sns_topic_app_alerts_for_slack_policy_alarm_region]
}
Loading

0 comments on commit f956075

Please sign in to comment.