GCP Custom IAM role creation with Terraform

0 votes
Hi Team,

I am new to Terraform. I am trying to create a custom IAM role in GCP with Terraform. Can anyone tell me, how can I do that?
Dec 1, 2020 in Terraform by akhtar
• 38,260 points
1,385 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the google_project_iam_custom_role resource in Terraform. This resource will create an IAM role in GCP.

resource "google_project_iam_custom_role" "my-instance-role" {
  role_id     = "myInstanceRole"
  title       = "My Instance Role"
  description = "my custom iam role"
  permissions = [
    "storage.objects.create", 
    "cloudkms.cryptoKeyVersions.useToEncrypt"
  ]
}
answered Dec 1, 2020 by MD
• 95,460 points

Related Questions In Terraform

0 votes
1 answer

How to integrate kubernetes with Terraform?

Hi@akhtar, You can use Kubernetes as your Terraform ...READ MORE

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

Terraform template to create SNS topic with subscription of mail id

Hi@Lakshminarayanan, For SNS topic, you can use aws_sns_topic_subscription resource ...READ MORE

answered Jul 7, 2020 in Terraform by MD
• 95,460 points
4,301 views
0 votes
1 answer

How to launch EC2 windows instance with powershell script using terraform?

Hi, In your Terraform code, you have written ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,460 points
4,306 views
+2 votes
1 answer

How to attach an elastic load balancer with ec2 instance using Terraform?

Hi@akhtar, You can use aws_elb_attachment resource in Terraform. ...READ MORE

answered Aug 17, 2020 in Terraform by MD
• 95,460 points
2,895 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
839 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
995 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,574 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,275 views
0 votes
2 answers

How to create a customized IAM policy in GCP using Terraform?

You can visit Terraform official site for ...READ MORE

answered Sep 14, 2020 in Terraform by Peter
• 180 points
1,837 views
0 votes
1 answer

How to create GCP instance with public IP with terraform?

Hi@akhtar, You need to specify "access_config" under "network_interface" ...READ MORE

answered Dec 1, 2020 in Terraform by MD
• 95,460 points
2,033 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