How to create a customized IAM policy in GCP using Terraform

0 votes

Hi Guys,

I am new to Terraform technology. I want to create a customized IAM policy in GCP using Terraform. How can I do that?

Sep 13, 2020 in Terraform by akhtar
• 38,260 points
1,831 views

2 answers to this question.

0 votes

Hi@akhtar,

You can use the google_project_iam_custom_role resource in your Terraform code. This resource is used to create your own customized role as shown below.

resource "google_project_iam_custom_role" "my-custom-role" {
  role_id     = "myCustomRole"
  title       = "My Custom Role"
  description = "A description"
  permissions = ["iam.roles.list", "iam.roles.create", "iam.roles.delete"]
}
answered Sep 13, 2020 by MD
• 95,460 points
0 votes

You can visit Terraform official site for this problem. I faced same problem few weeks ago.

https://www.terraform.io/docs/providers/google/r/google_project_iam_custom_role.html

answered Sep 14, 2020 by Peter
• 180 points

Related Questions In Terraform

0 votes
1 answer

How to create a VPC in GCP Cloud using Terraform code?

Hi@akhtar, You can create your own VPC in ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,460 points
1,640 views
0 votes
1 answer

How to create a folder in S3 bucket using terraform?

Hi@akhtar, You can use aws_s3_bucket_object resource to create one ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,460 points
10,914 views
0 votes
1 answer

How to create a namespace in minikube using Terraform?

Hi@akhtar, You can use kubernetes_namespace resource. It is used ...READ MORE

answered Jun 30, 2020 in Terraform by MD
• 95,460 points
1,668 views
0 votes
1 answer

How to create a rds snapshot from running rds instance in AWS using terraform?

Hi, I think you can use aws_db_instance resource to ...READ MORE

answered Jul 20, 2020 in Terraform by MD
• 95,460 points
2,657 views
0 votes
1 answer

How to launch an instance in GCP using Terraform?

Hi@akhtar, You can use the google_compute_instance resource in ...READ MORE

answered Sep 12, 2020 in Terraform by MD
• 95,460 points
824 views
0 votes
1 answer

Create a project in GCP using Terraform.

Hi@akhtar, Terraform has a resource named google_project. This ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,460 points
982 views
0 votes
1 answer

How to set an IAM policy for a project in GCP using Terraform?

Hi@akhtar, You can create a policy and give ...READ MORE

answered Sep 13, 2020 in Terraform by akhtar
• 38,260 points
1,561 views
0 votes
1 answer

How to create a security rule in GCP using Terraform?

Hi@akhtar, A Security Policy defines an IP blacklist ...READ MORE

answered Sep 14, 2020 in Terraform by MD
• 95,460 points
1,258 views
0 votes
1 answer

How to create a service account in GCP using Terraform?

Hi@akhtar, You can create a service account in ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,460 points
2,415 views
0 votes
1 answer

How to create a service account key in GCP Cloud using Terraform?

Hi@akhtar, You need to create a service account ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,460 points
1,665 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP