Skip to content

Commit

Permalink
Merge pull request #73 from ministryofjustice/pi-access
Browse files Browse the repository at this point in the history
Add Performance Insights API Access
  • Loading branch information
Alejandro Garrido Mota authored Oct 15, 2020
2 parents 9b181bd + 70d76ef commit 0748bdd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module "example_team_rds" {
# source RDS instance,and example-team-read-replica is the replica we are creating.

module "example_team_read_replica" {
source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.6"
source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.8"

cluster_name = var.cluster_name
cluster_state_bucket = var.cluster_state_bucket
Expand Down
11 changes: 11 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ data "aws_iam_policy_document" "policy" {
"rds:DescribeDBSnapshotAttributes",
"rds:ModifyDBSnapshot",
"rds:CreateDBSnapshot",
"rds:AmazonRDSReadOnlyAccess",
"rds:RestoreDBInstanceFromDBSnapshot",
"rds:ModifyDBSnapshotAttribute",
]
Expand All @@ -175,6 +176,16 @@ data "aws_iam_policy_document" "policy" {
"arn:aws:rds:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:snapshot:*",
]
}

statement {
actions = [
"pi:*",
]

resources = [
"arn:aws:pi:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:metrics/rds/*",
]
}
}

resource "aws_iam_user_policy" "policy" {
Expand Down

0 comments on commit 0748bdd

Please sign in to comment.