Skip to content

Instantly share code, notes, and snippets.

@HunterLarco
Created February 9, 2021 18:04
Show Gist options
  • Save HunterLarco/0c97d58fc67ff5763f4d034d7f1669dc to your computer and use it in GitHub Desktop.
Save HunterLarco/0c97d58fc67ff5763f4d034d7f1669dc to your computer and use it in GitHub Desktop.
resource "aws_iam_policy" "billing_read_only" {
name = "billing-read-only"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"aws-portal:ViewBilling",
"aws-portal:ViewUsage",
"budgets:DescribeBudgetAction",
"budgets:DescribeBudgetActionHistories",
"budgets:DescribeBudgetActionsForAccount",
"budgets:DescribeBudgetActionsForBudget",
"budgets:ViewBudget",
"ce:DescribeCostCategoryDefinition",
"ce:DescribeNotificationSubscription",
"ce:DescribeReport",
"ce:GetAnomalies",
"ce:GetAnomalyMonitors",
"ce:GetAnomalySubscriptions",
"ce:GetCostAndUsage",
"ce:GetCostAndUsageWithResources",
"ce:GetCostCategories",
"ce:GetCostForecast",
"ce:GetDimensionValues",
"ce:GetPreferences",
"ce:GetReservationCoverage",
"ce:GetReservationPurchaseRecommendation",
"ce:GetReservationUtilization",
"ce:GetRightsizingRecommendation",
"ce:GetSavingsPlansCoverage",
"ce:GetSavingsPlansPurchaseRecommendation",
"ce:GetSavingsPlansUtilization",
"ce:GetSavingsPlansUtilizationDetails",
"ce:GetTags",
"ce:GetUsageForecast",
"ce:ListCostCategoryDefinitions",
"cur:DescribeReportDefinitions",
"savingsplans:DescribeSavingsPlanRates",
"savingsplans:DescribeSavingsPlans",
"savingsplans:DescribeSavingsPlansOfferingRates",
"savingsplans:DescribeSavingsPlansOfferings",
"savingsplans:ListTagsForResource"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Action": [
"aws-portal:ModifyAccount",
"aws-portal:ModifyBilling",
"aws-portal:ModifyPaymentMethods",
"aws-portal:ViewAccount",
"aws-portal:ViewPaymentMethods",
"budgets:CreateBudgetAction",
"budgets:DeleteBudgetAction",
"budgets:ExecuteBudgetAction",
"budgets:ModifyBudget",
"budgets:UpdateBudgetAction",
"ce:UpdateCostCategoryDefinition",
"savingsplans:CreateSavingsPlan",
"savingsplans:DeleteQueuedSavingsPlan"
],
"Effect": "Deny",
"Resource": "*"
}
]
}
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment