Setting Up and Applying Organization Policies in GCP
📖 Scenario: You are a cloud administrator for a company using Google Cloud Platform (GCP). Your company wants to enforce rules across all projects to improve security and compliance. You will create and apply organization policies to control resource behavior.
🎯 Goal: Build a simple GCP organization policy setup that restricts VM instance creation to specific machine types and enforces a policy to disable external IP addresses on VM instances.
📋 What You'll Learn
Create a dictionary called
org_policy_constraints with two constraints and their allowed valuesCreate a variable called
target_resource with the exact resource path stringWrite a function called
apply_policy that takes resource and policy and returns a dictionary representing the applied policyCreate a final dictionary called
applied_policy by calling apply_policy with target_resource and org_policy_constraints💡 Why This Matters
🌍 Real World
Organizations use policies to enforce rules across all cloud projects to maintain security and compliance.
💼 Career
Cloud administrators and engineers must understand how to create and apply organization policies to manage resources effectively.
Progress0 / 4 steps