Skip to content

Commit

Permalink
Merge pull request #8 from BCDevOps/add-cost-and-budget-policy
Browse files Browse the repository at this point in the history
add policy for cost explorer and budgets access
  • Loading branch information
prabhukiran9999 authored Nov 23, 2023
2 parents 8503457 + b20b9dd commit f47734a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/account-sso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ No modules.

| Name | Type |
|------|------|
| [aws_iam_policy.bcgov_cost_explorer_and_budgets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.bcgov_perm_boundary](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_role.role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_saml_provider.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_saml_provider) | resource |
Expand Down
26 changes: 26 additions & 0 deletions modules/account-sso/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ resource "aws_iam_role" "role" {
]
}
EOF

depends_on = [
aws_iam_policy.bcgov_cost_explorer_and_budgets,
]
}

resource "aws_iam_policy" "bcgov_perm_boundary" {
Expand Down Expand Up @@ -153,3 +157,25 @@ resource "aws_iam_policy" "bcgov_perm_boundary" {
]
})
}

resource "aws_iam_policy" "bcgov_cost_explorer_and_budgets" {
name = "BCGOV_CostExplorerAndBudgets"
description = "Give all access to Cost Explorer and Budgets"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Sid = "AllowCostExplorer"
Effect = "Allow"
Action = "ce:*"
Resource = "*"
},
{
Sid = "AllowBudgets"
Effect = "Allow"
Action = "budgets:*"
Resource = "*"
}
]
})
}

0 comments on commit f47734a

Please sign in to comment.