diff --git a/modules/account-sso/README.md b/modules/account-sso/README.md index 8c5500a..71d4a4d 100644 --- a/modules/account-sso/README.md +++ b/modules/account-sso/README.md @@ -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 | diff --git a/modules/account-sso/main.tf b/modules/account-sso/main.tf index 8773fb9..cae3eb4 100644 --- a/modules/account-sso/main.tf +++ b/modules/account-sso/main.tf @@ -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" { @@ -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 = "*" + } + ] + }) +}