Skip to content

Commit

Permalink
fix: Update deployment packages
Browse files Browse the repository at this point in the history
  • Loading branch information
baolsen committed Feb 28, 2023
1 parent 868454d commit 05961ae
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions clickopsnotifier/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
LOG_LEVEL = os.environ.get("LOG_LEVEL", "WARN")
logging.getLogger().setLevel(LOG_LEVEL)

WEBHOOKS_FOR_SLACK = json.loads(os.environ.get("WEBHOOKS_FOR_SLACK", "[]"))
WEBHOOKS_FOR_MSTEAMS = json.loads(os.environ.get("WEBHOOKS_FOR_MSTEAMS", "[]"))
PARAMETER_NAMES_FOR_SLACK_WEBHOOKS = json.loads(
os.environ.get("PARAMETER_NAMES_FOR_SLACK_WEBHOOKS", "[]")
)
PARAMETER_NAMES_FOR_MSTEAMS_WEBHOOKS = json.loads(
os.environ.get("PARAMETER_NAMES_FOR_MSTEAMS_WEBHOOKS", "[]")
)

EXCLUDED_ACCOUNTS = json.loads(os.environ.get("EXCLUDED_ACCOUNTS", "[]"))
INCLUDED_ACCOUNTS = json.loads(os.environ.get("INCLUDED_ACCOUNTS", "[]"))
Expand Down Expand Up @@ -50,7 +54,7 @@ def get_messengers() -> List[Messenger]:
_MESSENGERS = []

logging.info("Configuring Slack messengers...")
for parameter_name in WEBHOOKS_FOR_SLACK:
for parameter_name in PARAMETER_NAMES_FOR_SLACK_WEBHOOKS:
webhook_url = get_webhook_url(parameter_name)
messenger = Messenger(
webhook_type="slack",
Expand All @@ -60,7 +64,7 @@ def get_messengers() -> List[Messenger]:
_MESSENGERS.append(messenger)

logging.info("Configuring MSTeams messengers...")
for parameter_name in WEBHOOKS_FOR_MSTEAMS:
for parameter_name in PARAMETER_NAMES_FOR_MSTEAMS_WEBHOOKS:
webhook_url = get_webhook_url(parameter_name)
messenger = Messenger(
webhook_type="msteams",
Expand Down
Binary file modified deployment-clickopsnotifier-python3.7.zip
Binary file not shown.
Binary file modified deployment-clickopsnotifier-python3.8.zip
Binary file not shown.
Binary file modified deployment-clickopsnotifier-python3.9.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ module "clickops_notifier_lambda" {
policy_statements = var.additional_iam_policy_statements

environment_variables = {
WEBHOOKS_FOR_SLACK = jsonencode(aws_ssm_parameter.webhooks_for_slack[*].name)
WEBHOOKS_FOR_MSTEAMS = jsonencode(aws_ssm_parameter.webhooks_for_msteams[*].name)
PARAMETER_NAMES_FOR_SLACK_WEBHOOKS = jsonencode([for p in aws_ssm_parameter.webhooks_for_slack : p.name])
PARAMETER_NAMES_FOR_MSTEAMS_WEBHOOKS = jsonencode([for p in aws_ssm_parameter.webhooks_for_msteams : p.name])

EXCLUDED_ACCOUNTS = jsonencode(var.excluded_accounts)
INCLUDED_ACCOUNTS = jsonencode(var.included_accounts)
Expand Down

0 comments on commit 05961ae

Please sign in to comment.