Skip to content

Commit

Permalink
Update_061224_4
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckingham authored and Buckingham committed Dec 6, 2024
1 parent ab02dc4 commit f8728eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 8 additions & 11 deletions terraform/environments/ppud/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1242,17 +1242,7 @@ resource "aws_iam_policy" "iam_policy_for_lambda_cloudwatch_get_metric_data_dev"
"arn:aws:ses:eu-west-2:${local.environment_management.account_ids["ppud-development"]}:*",
"arn:aws:ses:eu-west-2:${local.environment_management.account_ids["ppud-development"]}:identity/internaltest.ppud.justice.gov.uk"
]
},
{
"Sid" : "CloudwatchMetricStatsPolicy",
"Effect" : "Allow",
"Action" : [
"cloudwatch:GetMetricStatistics"
],
"Resource" : [
"arn:aws:cloudwatch:eu-west-2:${local.environment_management.account_ids["ppud-development"]}:*"
]
}
}
]
})
}
Expand All @@ -1270,6 +1260,13 @@ resource "aws_iam_policy_attachment" "attach_lambda_read_only_access_dev" {
policy_arn = "arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess"
}

resource "aws_iam_policy_attachment" "attach_lambda_cloudwatch_full_access_dev" {
count = local.is-development == true ? 1 : 0
name = "lambda-cloudwatch-full-access-iam-attachment"
roles = [aws_iam_role.lambda_role_cloudwatch_get_metric_data_dev[0].id]
policy_arn = "arn:aws:iam::aws:policy/CloudWatchFullAccessV2"
}

#resource "aws_iam_policy_attachment" "attach_ses_full_access" {
# count = local.is-development == true ? 1 : 0
# name = "ses-full-access-iam-attachment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
# SMTP Configuration
SMTP_SERVER = "10.27.9.39"
SMTP_PORT = 25
MAIL_FROM = "[email protected]"
EMAIL_TO = ["[email protected]"]

def get_metric_data(namespace, metric_name, dimensions):
response = cloudwatch.get_metric_data(
Expand Down

0 comments on commit f8728eb

Please sign in to comment.