Creating and Assigning GCP Roles: Basic, Predefined, and Custom
📖 Scenario: You are managing access control in a Google Cloud Platform (GCP) project. You want to understand how to create and assign different types of roles: basic roles, predefined roles, and custom roles.This project will guide you step-by-step to create a custom role, assign a basic role, and assign a predefined role to a user in your GCP project.
🎯 Goal: Build a simple GCP IAM configuration that includes:A variable holding the project ID.A variable holding the user email to assign roles.A custom role definition with specific permissions.Assignments of a basic role, a predefined role, and the custom role to the user.
📋 What You'll Learn
Create a variable called
project_id with the exact value "my-gcp-project".Create a variable called
user_email with the exact value "user@example.com".Define a custom role called
customRole with the title "Custom Viewer" and the permission "storage.buckets.get".Assign the basic role
roles/viewer to the user.Assign the predefined role
roles/storage.objectViewer to the user.Assign the custom role
customRole to the user.💡 Why This Matters
🌍 Real World
Managing access control in GCP projects is essential for security and proper resource management. This project simulates how to define and assign roles to users.
💼 Career
Cloud engineers and administrators often create and assign roles to control who can do what in cloud environments. Understanding roles is key to secure cloud infrastructure.
Progress0 / 4 steps