File tree Expand file tree Collapse file tree
infra/deployments/integration/account Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,29 @@ resource "aws_iam_policy" "lock_state_files" {
5757 })
5858}
5959
60+ resource "aws_iam_policy" "get_sustainability_data" {
61+ name = " allow-get-sustainability_data"
62+ path = " /"
63+
64+ description = " Allow access to AWS Sustainability"
65+
66+ policy = jsonencode ({
67+ Version = " 2012-10-17"
68+ Statement = [
69+ {
70+ Action = [
71+ " sustainability:GetCarbonFootprintSummary" ,
72+ " sustainability:GetEstimatedCarbonEmissions" ,
73+ " sustainability:GetEstimatedCarbonEmissionsDimensionValues" ,
74+ ]
75+ Effect = " Allow"
76+ Resource = [
77+ " *"
78+ ]
79+ }
80+ ]
81+ })
82+ }
6083
6184
6285module "admin_role" {
@@ -76,7 +99,8 @@ module "support_role" {
7699 email = " ${ each . value } @digital.cabinet-office.gov.uk"
77100 role_suffix = " support"
78101 iam_policy_arns = [
79- aws_iam_policy . lock_state_files . arn
102+ aws_iam_policy . lock_state_files . arn ,
103+ aws_iam_policy . get_sustainability_data . arn
80104 ]
81105 ip_restrictions = local. ip_restrictions
82106}
@@ -89,7 +113,8 @@ module "readonly_role" {
89113 role_suffix = " readonly"
90114 iam_policy_arns = [
91115 " arn:aws:iam::aws:policy/ReadOnlyAccess" ,
92- aws_iam_policy . lock_state_files . arn
116+ aws_iam_policy . lock_state_files . arn ,
117+ aws_iam_policy . get_sustainability_data . arn
93118 ]
94119 ip_restrictions = local. ip_restrictions
95120}
You can’t perform that action at this time.
0 commit comments