File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
infrastructure/terraform/components/acct Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ resource "aws_iam_role" "grafana_access" {
2+ name = " ${ local . csi } -grafana-cross-access-role"
3+ assume_role_policy = data. aws_iam_policy_document . observability_grafana_role_assume_role_policy . json
4+ }
5+
6+ data "aws_iam_policy_document" "observability_grafana_role_assume_role_policy" {
7+ statement {
8+ actions = [" sts:AssumeRole" ]
9+ effect = " Allow"
10+ principals {
11+ type = " AWS"
12+ identifiers = [" arn:aws:iam::${ var . observability_account_id } :role/${ local . csi } -grafana-workspace-role" ]
13+ }
14+ }
15+ }
16+
17+ resource "aws_iam_role_policy_attachment" "grafana_workspace_cloudwatch" {
18+ role = aws_iam_role. grafana_access . name
19+ policy_arn = " arn:aws:iam::aws:policy/CloudWatchReadOnlyAccess"
20+ }
Original file line number Diff line number Diff line change @@ -70,3 +70,8 @@ variable "initial_cli_secrets_provision_override" {
7070 # Usage like:
7171 # ... -a apply -- -var initial_cli_secrets_provision_override={\"github_pat\":\"l0ngstr1ng"}
7272}
73+
74+ variable "observability_account_id" {
75+ type = string
76+ description = " The Observability Account ID that needs access"
77+ }
You can’t perform that action at this time.
0 commit comments