updated iam.tf
b928ad31
Hari Sekhon
committed
1 changed file
iam.tf
/iam.tf+25
/iam.tf
Add comment 16 # ============================================================================ #
Add comment 17
Add comment 18 # =======
Add comment 19 Plus  # AWS IAM
Add comment 20 Plus  #
Add comment 21 Plus  # https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy
Add comment 22 Plus  
Add comment 23 Plus  resource "aws_iam_policy" "test" {
Add comment 24 Plus   name = "test"
Add comment 25 Plus   path = "/"
Add comment 26 Plus   description = "My description here"
Add comment 27 Plus  
Add comment 28 Plus   # jsonencode converts Terraform code to JSON which AWS IAM needs - alternatively just copy a literal JSON policy, but the Terraform version is handy if you need to reference something dynamically like an arn
Add comment 29 Plus   policy = jsonencode({
Add comment 30 Plus   Version = "2012-10-17"
Add comment 31 Plus   Statement = [
Add comment 32 Plus   {
Add comment 33 Plus   Action = [
Add comment 34 Plus   "ec2:Describe*",
Add comment 35 Plus   ]
Add comment 36 Plus   Effect = "Allow"
Add comment 37 Plus   Resource = "*"
Add comment 38 Plus   },
Add comment 39 Plus   ]
Add comment 40 Plus   })
Add comment 41 Plus  }
Add comment 42 Plus  
Add comment 43 Plus  # =======
Add comment 19 44 # GCP IAM
Add comment 20 45 #
Add comment 21 46 # https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam