<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Renjith Ravindranathan</title>
    <description>The latest articles on DEV Community by Renjith Ravindranathan (@mysticrenji).</description>
    <link>https://dev.to/mysticrenji</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F453432%2Fdc00ab0a-cc97-44ca-8f92-3fe9347bdadb.png</url>
      <title>DEV Community: Renjith Ravindranathan</title>
      <link>https://dev.to/mysticrenji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mysticrenji"/>
    <language>en</language>
    <item>
      <title>Building a Configuration-Driven Databricks Platform on AWS (Part 2)</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 05 Nov 2026 08:52:36 +0000</pubDate>
      <link>https://dev.to/mysticrenji/building-a-configuration-driven-databricks-platform-on-aws-part-2-1086</link>
      <guid>https://dev.to/mysticrenji/building-a-configuration-driven-databricks-platform-on-aws-part-2-1086</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/mysticrenji/provisioning-databricks-on-aws-with-github-actions-part-1-a-configuration-driven-approach-59j6"&gt;first part&lt;/a&gt;, we explored the architecture behind a Databricks platform on AWS and how GitHub, Terraform, and YAML configuration fit together. We also looked at why infrastructure, workspace access, compute, and data permissions have separate responsibilities. In this second part, we’ll put that design into practice.&lt;/p&gt;

&lt;p&gt;Before running the deployment workflow, we need to prepare a few things that cloning the repository does not provide: an AWS identity for GitHub Actions, a place to store Terraform state, and credentials to access the Databricks account. These bootstrap dependencies are easy to overlook because the provisioning code expects them to already exist.&lt;/p&gt;

&lt;p&gt;This walkthrough follows the working dev/demo path in the Databricks Platform repository, from initial setup and configuration through validation, deployment, and verification.&lt;/p&gt;

&lt;p&gt;By the end, we’ll have provisioned the AWS infrastructure, a Databricks workspace, persona entitlements, and approved compute configuration. Unity Catalog data objects and dataset permission requests follow separate workflows, which sit outside the deployment covered here.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prepare the accounts and tools
&lt;/h2&gt;

&lt;p&gt;Start with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An AWS account and permission to bootstrap IAM and state storage.&lt;/li&gt;
&lt;li&gt;A Databricks account and an administrator who can establish the deployment identity.&lt;/li&gt;
&lt;li&gt;A GitHub repository where you can configure Actions and Environments.&lt;/li&gt;
&lt;li&gt;Git, Python, and Terraform installed locally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Python tooling requires Python 3.10 or later. The current workflows use Python 3.12 and Terraform 1.10.5. Match the workflow version when reproducing its behavior locally.&lt;/p&gt;

&lt;p&gt;Clone the repository, or clone your fork:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/mysticrenji/databricks-platform.git
&lt;span class="nb"&gt;cd &lt;/span&gt;databricks-platform/AWS/databricks-foundation

python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; tools/environment/requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep local credentials, generated plans, state, and secret-bearing variable files out of Git. This example uses &lt;code&gt;eu-west-1&lt;/code&gt;. Check the current &lt;a href="https://docs.databricks.com/aws/en/resources/supported-regions" rel="noopener noreferrer"&gt;Databricks supported regions&lt;/a&gt; before choosing another region, including availability of the features you intend to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Bootstrap Terraform state storage
&lt;/h2&gt;

&lt;p&gt;Create the S3 bucket for Terraform state before running the workspace workflow. Use a globally unique bucket name, enable versioning and encryption, block public access, and restrict access to the deployment identities and recovery administrators. This bucket is separate from the workspace storage bucket declared later in YAML.&lt;/p&gt;

&lt;p&gt;The workflow needs permission to list the appropriate state prefix and read and write state objects. S3 lockfiles also need read, write, and delete permissions on the lock objects. If the state bucket uses a customer-managed KMS key, include the corresponding key permissions. The &lt;a href="https://developer.hashicorp.com/terraform/language/backend/s3" rel="noopener noreferrer"&gt;S3 backend documentation&lt;/a&gt; describes these requirements.&lt;/p&gt;

&lt;p&gt;The state bucket region may differ from the workspace region; record both accurately. Keep state storage under independent ownership. Removing a development workspace should leave its Terraform history available for investigation and recovery.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Establish the GitHub-to-AWS identity
&lt;/h2&gt;

&lt;p&gt;The repository includes an OIDC bootstrap root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tools/aws-oidc-github-runner/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Despite its name, this root does not create a runner machine. It creates the GitHub OIDC provider and an IAM role that workflows can assume.&lt;/p&gt;

&lt;p&gt;From the foundation directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;tools/aws-oidc-github-runner
&lt;span class="nb"&gt;cp &lt;/span&gt;terraform.tfvars.example terraform.tfvars
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit the file with your region, allowed GitHub subjects, and an existing deployment policy ARN. The deployment policy must cover the enabled AWS modules, state access, and the IAM operations required by the Databricks integration. This bootstrap root attaches the policies you supply; it does not generate a complete deployment policy or attach administrator access by default.&lt;/p&gt;

&lt;p&gt;For dev/demo, authorize the subjects for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dev-demo-plan
dev-demo-apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the exact OIDC subject format configured for your repository, including immutable owner and repository IDs where applicable. The example file contains the source repository’s values, which must be replaced for a fork.&lt;/p&gt;

&lt;p&gt;An environment subject is different from a &lt;code&gt;main&lt;/code&gt; branch subject. Configure the environment subjects required by the jobs, then restrict the branches allowed to use those GitHub Environments. GitHub explains the subject formats in its &lt;a href="https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws" rel="noopener noreferrer"&gt;AWS OIDC guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Using your existing administrative AWS session, create and inspect a bootstrap plan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform init
terraform plan &lt;span class="nt"&gt;-out&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;bootstrap.tfplan
terraform show bootstrap.tfplan
terraform apply bootstrap.tfplan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands change AWS resources. Run the apply after reviewing the plan.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;⚠️ OIDC Collision Warning:&lt;/strong&gt; If your account already has the GitHub OIDC provider, resolve its ownership before using a root that declares another one. Keep the bootstrap state protected and outside the workspace teardown lifecycle.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Record the resulting role ARN, then return to the foundation directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ../..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Create the Databricks deployment identity
&lt;/h2&gt;

&lt;p&gt;Create an account-level Databricks service principal for the automation. Have an account administrator grant the privileges required for workspace provisioning and establish the identity’s access for subsequent workspace operations. Keep an independent recovery administrator.&lt;/p&gt;

&lt;p&gt;Generate an OAuth client secret and record the client ID. Follow the &lt;a href="https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m" rel="noopener noreferrer"&gt;Databricks OAuth M2M setup guide&lt;/a&gt; for the credential setup.&lt;/p&gt;

&lt;p&gt;The workflow uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DATABRICKS_ACCOUNT_ID
DATABRICKS_CLIENT_ID
DATABRICKS_CLIENT_SECRET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Store the client secret in GitHub secrets. The account ID and client ID are configuration values. Successful authentication only proves the identity can sign in. Account operations and workspace operations still require the appropriate authorization.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Define the dev/demo deployment
&lt;/h2&gt;

&lt;p&gt;Edit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;platform/environments/dev/demo.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use your own identifiers and a unique workspace bucket name. This example contains placeholders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;

&lt;span class="na"&gt;workspace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;demo&lt;/span&gt;

&lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dev&lt;/span&gt;
  &lt;span class="na"&gt;aws_account_id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;123456789012"&lt;/span&gt;
  &lt;span class="na"&gt;aws_region&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;eu-west-1&lt;/span&gt;
  &lt;span class="na"&gt;deployment_role_arn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;arn:aws:iam::123456789012:role/github-actions-oidc&lt;/span&gt;

&lt;span class="na"&gt;databricks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;account_id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;00000000-0000-0000-0000-000000000000"&lt;/span&gt;
  &lt;span class="na"&gt;pricing_tier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PREMIUM&lt;/span&gt;

&lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;nat_gateway_mode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;single&lt;/span&gt;
  &lt;span class="na"&gt;vpc_cidr&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.40.0.0/16&lt;/span&gt;

  &lt;span class="na"&gt;workspace_subnets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;availability_zone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;eu-west-1a&lt;/span&gt;
      &lt;span class="na"&gt;cidr_block&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.40.0.0/20&lt;/span&gt;
    &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;availability_zone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;eu-west-1b&lt;/span&gt;
      &lt;span class="na"&gt;cidr_block&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.40.16.0/20&lt;/span&gt;

  &lt;span class="na"&gt;nat_subnets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;availability_zone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;eu-west-1a&lt;/span&gt;
      &lt;span class="na"&gt;cidr_block&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.40.32.0/24&lt;/span&gt;

  &lt;span class="na"&gt;workspace_subnet_nat_gateway_keys&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;a&lt;/span&gt;
    &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;a&lt;/span&gt;

  &lt;span class="na"&gt;endpoint_subnets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;availability_zone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;eu-west-1a&lt;/span&gt;
      &lt;span class="na"&gt;cidr_block&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.40.34.0/24&lt;/span&gt;
    &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;availability_zone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;eu-west-1b&lt;/span&gt;
      &lt;span class="na"&gt;cidr_block&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.40.35.0/24&lt;/span&gt;

&lt;span class="na"&gt;storage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workspace_bucket_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;replace-with-a-unique-dev-demo-bucket&lt;/span&gt;

&lt;span class="na"&gt;features&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;customer_managed_kms&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="na"&gt;observability&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the account ID, role ARN, Databricks account ID, and bucket name before validation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network Sizing Strategy:&lt;/strong&gt; Notice the CIDR breakdown. The overall VPC is given a &lt;code&gt;/16&lt;/code&gt; (65,536 IPs). The workspace subnets are given &lt;code&gt;/20&lt;/code&gt;s (4,096 IPs each) to allow for heavy cluster autoscaling, while the NAT and endpoint subnets require much less space and are constrained to &lt;code&gt;/24&lt;/code&gt;s (256 IPs each).&lt;/p&gt;

&lt;p&gt;This example uses one NAT gateway (&lt;code&gt;nat_gateway_mode: single&lt;/code&gt;) and maps both workspace subnets to it. Review that choice against your availability and network requirements. Check the address ranges against networks you may connect later, rather than checking only for overlap inside this document.&lt;/p&gt;

&lt;p&gt;Keep &lt;code&gt;dev/demo&lt;/code&gt; for this walkthrough. The additional persona entitlement and compute jobs are currently enabled specifically for that target.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Review the group and compute inputs
&lt;/h2&gt;

&lt;p&gt;Open:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;platform/terraform-inputs/dev/demo.02-account.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The supplied configuration declares these workspace roles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dev-demo-admins&lt;/code&gt;: &lt;code&gt;ADMIN&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dev-demo-engineers&lt;/code&gt;: &lt;code&gt;USER&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dev-demo-analysts&lt;/code&gt;: &lt;code&gt;USER&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dev-demo-ml&lt;/code&gt;: &lt;code&gt;USER&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The membership maps are empty. Terraform creates the configured groups and assignments without creating membership resources. Review the matching persona and principal configuration under &lt;code&gt;platform/access/&lt;/code&gt;. Their names and roles must agree with the account inputs.&lt;/p&gt;

&lt;p&gt;Then inspect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;platform/compute/dev.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This defines the approved compute choices. The current persona policies include bounded worker counts and automatic termination. The analytics warehouse is non-serverless and has a bounded cluster count and automatic stop.&lt;/p&gt;

&lt;p&gt;Before deploying, check the approved runtimes and node types. The live compute preflight verifies availability and rejects unavailable choices.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💸 Cost Warning:&lt;/strong&gt; Creating cluster policies starts no clusters, but applying the SQL warehouse configuration can start billable compute. Include it in your deployment cost review.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Validate before configuring live execution
&lt;/h2&gt;

&lt;p&gt;Run the environment and access tests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; unittest discover &lt;span class="nt"&gt;-s&lt;/span&gt; tools/environment/tests &lt;span class="nt"&gt;-v&lt;/span&gt;
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; unittest discover &lt;span class="nt"&gt;-s&lt;/span&gt; tools/databricks-access/tests &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Validate the completed environment configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 tools/environment/environment.py validate platform/environments/dev/demo.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These checks do not deploy resources. The &lt;a href="https://github.com/mysticrenji/databricks-platform/blob/main/.github/workflows/environment-validation.yml" rel="noopener noreferrer"&gt;validation workflow&lt;/a&gt; also tests the generated configuration through mocked Terraform providers. Let those checks pass on the pull request before merging deployment configuration.&lt;/p&gt;

&lt;p&gt;A clean result means the configuration satisfies the tested rules. Live IAM permissions, service quotas, bucket availability, and runtime availability remain separate checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Configure the GitHub Environment pair
&lt;/h2&gt;

&lt;p&gt;In repository settings, create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dev-demo-plan
dev-demo-apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set matching values in both environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ENVIRONMENT_CONFIG_PATH&lt;/code&gt;: &lt;code&gt;AWS/databricks-foundation/platform/environments/dev/demo.yaml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AWS_DEPLOYMENT_ROLE_ARN&lt;/code&gt;: bootstrap role ARN matching YAML&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DATABRICKS_ACCOUNT_ID&lt;/code&gt;: account ID matching YAML&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DATABRICKS_CLIENT_ID&lt;/code&gt;: deployment service principal client ID&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TF_STATE_BUCKET&lt;/code&gt;: existing state bucket&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TF_STATE_REGION&lt;/code&gt;: state bucket region&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TF_INFRA_STATE_KEY&lt;/code&gt;: &lt;code&gt;databricks/dev/demo/01-infra.tfstate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TF_ACCOUNT_STATE_KEY&lt;/code&gt;: &lt;code&gt;databricks/dev/demo/02-account.tfstate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TF_DATA_ACCESS_STATE_KEY&lt;/code&gt;: &lt;code&gt;databricks/dev/demo/03-data-access.tfstate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TF_WORKSPACE_STATE_KEY&lt;/code&gt;: &lt;code&gt;databricks/dev/demo/04-workspace.tfstate&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add &lt;code&gt;DATABRICKS_CLIENT_SECRET&lt;/code&gt; as a secret in both environments.&lt;/p&gt;

&lt;p&gt;The feature and permissions runners enforce their own state paths. Adding variables for the data and workspace states does not make the provisioning workflow execute every root.&lt;/p&gt;

&lt;p&gt;The repository also provides a &lt;a href="https://github.com/mysticrenji/databricks-platform/tree/main/AWS/databricks-foundation/tools/github-environment-setup" rel="noopener noreferrer"&gt;GitHub Environment setup helper&lt;/a&gt;. It can preview and create these settings, but it does not configure AWS trust or environment approval rules.&lt;/p&gt;

&lt;p&gt;Configure branch restrictions and the approval policy appropriate to the target. Dev/demo has a documented single-administrator exception. Set &lt;code&gt;ENVIRONMENT_YAML_APPLY_ENABLED=true&lt;/code&gt; in &lt;code&gt;dev-demo-apply&lt;/code&gt; when ready to enable that path. Other targets retain their protected-environment review requirements, and dataset permission apply has its own separate requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Run a plan and understand the first-deployment limit
&lt;/h2&gt;

&lt;p&gt;Merge the reviewed configuration and workflows to &lt;code&gt;main&lt;/code&gt;. Open &lt;strong&gt;Actions&lt;/strong&gt;, select &lt;strong&gt;Provision environment YAML&lt;/strong&gt;, and run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Branch: main
target_environment: dev
target_workspace: demo
deploy: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The infrastructure job produces a plan without applying it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;🚧 Expected Failure:&lt;/strong&gt; On a completely new deployment, the later account job cannot finish planning until infrastructure state contains the required outputs. Feature and compute plans similarly require their upstream resources. This dependency failure is expected on the first plan-only run.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inspect the infrastructure plan and resolve any unexpected resources, names, network settings, or replacements before enabling deployment. The next deployment run creates fresh plans. It does not reuse a plan from this earlier run.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Deploy through the manual workflow
&lt;/h2&gt;

&lt;p&gt;For dev/demo, a repository administrator starts the workflow from &lt;code&gt;main&lt;/code&gt; with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;target_environment: dev
target_workspace: demo
deploy: true
confirm_environment: dev/demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The workflow checks administrator permission, the target confirmation, and the apply opt-in before creating infrastructure. It checks authorization again at the relevant apply stages.&lt;/p&gt;

&lt;p&gt;Each resource stage plans and then applies its exact saved plan when the checks pass. Downstream stages stop if a dependency fails.&lt;/p&gt;

&lt;p&gt;The dev/demo exception allows this progression without a separate reviewer pause for each plan. If your deployment process requires independent approval of every plan, establish that protection before using the workflow for a broader target. Saved plan manifests bind the deployment to its source, inputs, backend, and relevant state. Changed inputs or expired artifacts require a fresh plan.&lt;/p&gt;

&lt;p&gt;Provisioning Pipeline&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fodv1if0dvfxy33t76jq2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fodv1if0dvfxy33t76jq2.png" alt="Provisioning" width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;De-provisioning Pipeline&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4fjmy60og4bzaf0dyj3s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4fjmy60og4bzaf0dyj3s.png" alt="De-provisioning" width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Verify the platform as a user
&lt;/h2&gt;

&lt;p&gt;After deployment, inspect the workspace URL and ID produced by the account layer. Have the identity administrator add test users to the appropriate account groups through the established membership process. Use one test identity per persona before onboarding a wider team.&lt;/p&gt;

&lt;p&gt;Check that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Engineers can use their approved engineering policy.&lt;/li&gt;
&lt;li&gt;ML users can use their approved ML policy.&lt;/li&gt;
&lt;li&gt;Analysts can use the analytics SQL warehouse.&lt;/li&gt;
&lt;li&gt;Analysts receive no cluster-policy grant from this configuration.&lt;/li&gt;
&lt;li&gt;Unrestricted cluster creation remains disabled for the intended personas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inspect other groups and direct grants too. A user may have broader effective access than the persona alone describes.&lt;/p&gt;

&lt;p&gt;Do not expect a successful query against business data yet. This provisioning path does not create the Unity Catalog objects or apply the separate data grants. For data onboarding, establish the objects through their owning root, then use the permissions workflow for approved access to those existing objects. Preserve one owner for each grant set and resource.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Repeat the process and plan retirement
&lt;/h2&gt;

&lt;p&gt;For another development workspace, add its complete environment YAML, matching supplemental inputs, state namespace, GitHub Environment pair, and AWS OIDC subjects. Infrastructure and account provisioning support additional development and staging targets. The automatic persona feature and compute stages remain dev/demo-specific until deliberately extended.&lt;/p&gt;

&lt;p&gt;Before retiring the workspace, inspect all downstream states. Remove separately managed data grants and objects before removing the workspace they depend on.&lt;/p&gt;

&lt;p&gt;The deprovisioning workflow has an independent destroy opt-in and target confirmation. Storage is retained by default. Permanent S3 deletion requires additional confirmation and checks, while state history remains preserved.&lt;/p&gt;

&lt;p&gt;The first successful deployment is a useful milestone. The stronger proof is being able to make a small configuration change, review its effect, deploy through the same controls, and retire the workspace without losing track of its resources or data.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;We started with a repository and worked through the steps needed to turn its configuration into a Databricks platform on AWS. That included preparing authentication and Terraform state, validating the YAML, and running the deployment workflow to create the infrastructure, workspace, persona entitlements, and approved compute configuration.&lt;/p&gt;

&lt;p&gt;The value of this approach goes beyond the first deployment. Changes can be reviewed in GitHub, checked before they reach the cloud, and applied through saved Terraform plans. Separate states give each layer clear ownership and make the platform easier to maintain as it grows.&lt;/p&gt;

&lt;p&gt;There is still a distinction between having a workspace ready and having data ready to use. Unity Catalog objects and dataset permissions follow their own workflows. With the foundation in place, those become the next steps toward giving teams access to the data they need.&lt;/p&gt;

</description>
      <category>databricks</category>
      <category>aws</category>
      <category>github</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Building a Configuration-Driven Databricks Platform on AWS (Part 1)</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 22 Oct 2026 16:46:36 +0000</pubDate>
      <link>https://dev.to/mysticrenji/provisioning-databricks-on-aws-with-github-actions-part-1-a-configuration-driven-approach-59j6</link>
      <guid>https://dev.to/mysticrenji/provisioning-databricks-on-aws-with-github-actions-part-1-a-configuration-driven-approach-59j6</guid>
      <description>&lt;p&gt;If your platform team is bottlenecked by manual AWS console clicks and fragmented Terraform scripts every time someone needs a new Databricks workspace, you have a scaling problem. &lt;/p&gt;

&lt;p&gt;A request for another Databricks workspace involves more than creating the workspace itself. Someone must choose the AWS network, configure storage and IAM, assign access, decide which compute options teams can use, and make sure the next workspace follows the same rules. &lt;/p&gt;

&lt;p&gt;Terraform can describe those resources. The harder problem is deciding how people request changes, how those requests become Terraform inputs, and how the changes reach AWS and Databricks. &lt;/p&gt;

&lt;p&gt;A configuration-driven approach gives those decisions a consistent, repeatable path:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl335fpknu9s4d739bs6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl335fpknu9s4d739bs6l.png" alt="Architecture Diagram" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This article explains that design using the &lt;a href="https://github.com/mysticrenji/databricks-platform" rel="noopener noreferrer"&gt;Databricks Platform Engineering repository&lt;/a&gt;. Part two walks through setting up its development deployment from zero. &lt;/p&gt;

&lt;p&gt;The repository has working development automation, with additional infrastructure and account provisioning for staging. Its production files are configuration scaffolds. That distinction matters when deciding which parts to reuse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the workspace request explicit
&lt;/h2&gt;

&lt;p&gt;Suppose a platform team needs a development workspace for data engineers, analysts, and machine learning users. The request includes several decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Which AWS account and region will host it?&lt;/li&gt;
&lt;li&gt;  Which address ranges belong to its network?&lt;/li&gt;
&lt;li&gt;  Which S3 bucket will hold workspace storage?&lt;/li&gt;
&lt;li&gt;  Which groups receive workspace access?&lt;/li&gt;
&lt;li&gt;  Which compute policies and SQL warehouses are available?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These decisions can live in reviewed configuration files. In this implementation, each deployment has two identifiers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;

&lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dev&lt;/span&gt;

&lt;span class="na"&gt;workspace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;demo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an excerpt; the complete document also contains AWS, Databricks, network, storage, and feature settings. The pair &lt;code&gt;dev/demo&lt;/code&gt; identifies the deployment, determining resource naming, Terraform state paths, and GitHub Environment names. The cloud workspace name becomes &lt;code&gt;dev-demo&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;That gives the platform a repeatable way to distinguish &lt;code&gt;dev/demo&lt;/code&gt;, &lt;code&gt;dev/sandbox&lt;/code&gt;, and &lt;code&gt;staging/shared&lt;/code&gt;. A configuration filename alone does not establish that identity. Adding another workspace means defining another deployment within supported boundaries, then running the same provisioning machinery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give configuration a clear owner
&lt;/h2&gt;

&lt;p&gt;Configuration becomes difficult to govern when every file can change every setting. A strong developer experience requires separating platform decisions from team requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;platform/
  environments/
  compute/
  access/
  terraform-inputs/

workloads/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Platform administrators own the environment definitions, approved compute settings, personas, and access boundaries. Workload authors request a persona and access to existing data through &lt;code&gt;workloads/&lt;/code&gt;. They do not choose arbitrary infrastructure settings or create their own compute policies through those requests. &lt;/p&gt;

&lt;p&gt;For example, the platform can define an analyst persona with SQL access. A team can request that persona without deciding the SQL warehouse size or receiving unrestricted cluster creation. &lt;/p&gt;

&lt;p&gt;Some settings still use supplemental JSON under &lt;code&gt;platform/terraform-inputs/&lt;/code&gt;. Those inputs are allowlisted and cannot override settings owned by environment YAML. This is a practical way to extend the configuration model gradually. A setting should move into YAML when its meaning and validation rules are clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Python to validate the request
&lt;/h2&gt;

&lt;p&gt;YAML is easy to read, but readability does not make it safe to deploy. &lt;/p&gt;

&lt;p&gt;Consider a configuration that contains valid YAML syntax but assigns overlapping subnet ranges. Another might name one AWS account while pointing to a deployment role in a different account. Both should fail before cloud authentication.&lt;/p&gt;

&lt;p&gt;The Python adapter checks the document against a schema and applies additional semantic checks. The repository rejects unknown fields, duplicate keys, YAML aliases, invalid types, overlapping subnets, and role/account mismatches. Once validation succeeds, Python renders the inputs consumed by Terraform.&lt;/p&gt;

&lt;p&gt;The responsibilities stay clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;YAML:&lt;/strong&gt; declares the requested configuration&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Python:&lt;/strong&gt; validates and translates that configuration&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Terraform:&lt;/strong&gt; manages the resources&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Actions:&lt;/strong&gt; controls execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The runners also use isolated copies of the Terraform source. Local variable files, backend files, cached provider directories, and Terraform environment overrides do not silently become deployment inputs. That makes the committed configuration a more dependable description of what the workflow will use.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;⚠️ Validation Limitations:&lt;/strong&gt; Offline validation still has limits. It cannot prove that an S3 bucket name is available, that the deployment identity has every required permission, or that an AWS quota allows another resource. Those checks need live planning or service calls.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Split Terraform state by responsibility
&lt;/h2&gt;

&lt;p&gt;One Terraform state for the whole platform is easy to begin with, but as the platform grows, that state accumulates resources with different owners and different dependencies. &lt;/p&gt;

&lt;p&gt;This implementation uses separate execution roots:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;01-infra&lt;/code&gt; owns AWS networking, IAM, storage, optional encryption, and monitoring.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;02-account&lt;/code&gt; owns Databricks workspace creation, account groups, workspace assignments, and budgets.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;02-workspace-access&lt;/code&gt; owns dev/demo workspace feature entitlements.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;03-data-access&lt;/code&gt; owns Unity Catalog integration, storage credentials, locations, catalogs, schemas, and volumes.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;04-workspace&lt;/code&gt; owns workspace configuration, including policies, warehouses, and jobs.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;05-permissions&lt;/code&gt; owns approved grants on existing data objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each root owns a separate state file. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;databricks/dev/demo/01-infra.tfstate
databricks/dev/demo/02-account.tfstate
databricks/dev/demo/02-workspace-access.tfstate
databricks/dev/demo/04-workspace.tfstate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The state namespace contains both deployment identifiers. The runner rejects keys outside the selected namespace. The account root reads the infrastructure outputs and verifies their environment and workspace identity. It does not simply trust that whichever state file it receives belongs to the requested deployment.&lt;/p&gt;

&lt;p&gt;Separate state also preserves a useful boundary between Databricks account APIs and workspace APIs. Workspace creation uses the account provider. Workspace configuration uses the workspace provider after the workspace exists. &lt;/p&gt;

&lt;p&gt;The tradeoff is orchestration: these roots have dependencies, so they must run in the right order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow the actual dependency chain
&lt;/h2&gt;

&lt;p&gt;The current dev/demo provisioning path is:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;graph LR
    A[01-infra] --&amp;gt; B[02-account]
    B --&amp;gt; C[02-workspace-access]
    C --&amp;gt; D[04-workspace compute]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The infrastructure root creates the AWS foundation. The account root uses its outputs to create the workspace and configured groups. The entitlement root then configures which workspace features those groups can use. Finally, the compute runner creates the approved policies, SQL warehouse configuration, and associated permissions.&lt;/p&gt;

&lt;p&gt;This path does not require datasets or a metastore to exist. The dev/demo compute runner deliberately avoids a dependency on &lt;code&gt;03-data-access&lt;/code&gt; when it has no Unity Catalog volume references. &lt;/p&gt;

&lt;p&gt;Data setup follows its own dependency path. If compute policies reference a Unity Catalog volume for logs or an init script, that storage must exist first. The important rule is to express real dependencies. Putting every task into one long workflow can create unnecessary prerequisites, while running everything independently can leave later stages without the IDs and resources they need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat access as several decisions
&lt;/h2&gt;

&lt;p&gt;“Give the engineering team access” is too vague for automation. There are several separate questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Does the group exist at account level?&lt;/li&gt;
&lt;li&gt; Is it assigned to this workspace?&lt;/li&gt;
&lt;li&gt; Which workspace features can it use?&lt;/li&gt;
&lt;li&gt; Which compute resources can it use?&lt;/li&gt;
&lt;li&gt; Which data can it read or change?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The repository gives these decisions different owners. &lt;/p&gt;

&lt;p&gt;For dev/demo, &lt;code&gt;02-account&lt;/code&gt; creates the admin, engineer, analyst, and ML groups and assigns their workspace roles. Group membership remains external. The entitlement root controls workspace, SQL, and unrestricted compute-creation capabilities. &lt;/p&gt;

&lt;p&gt;The compute root grants access to approved policies or warehouses. Engineers receive access to &lt;code&gt;engineering-standard&lt;/code&gt;; ML users receive access to &lt;code&gt;ml-standard&lt;/code&gt;. Analysts receive access to the analytics SQL warehouse without a cluster-policy grant. &lt;/p&gt;

&lt;p&gt;Unity Catalog grants remain separate. A warehouse permission does not grant permission to read a table, and a workspace role does not replace catalog and schema privileges. Effective access also depends on other memberships, direct grants, workspace defaults, and administrator privileges. Testing only the declared persona configuration can miss permissions granted through another route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep pull request checks credential-free
&lt;/h2&gt;

&lt;p&gt;A configuration pull request should receive useful feedback before anyone starts a deployment. &lt;/p&gt;

&lt;p&gt;The validation workflow runs Python tests, validates development and staging templates, renders generated inputs, checks Terraform formatting, and runs mocked Terraform tests. &lt;strong&gt;It does not need AWS or Databricks credentials.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That allows the repository to test invalid configuration and ownership rules without giving pull request code access to the platform. Live planning is a different operation. It can read state and query services, so it runs through manual workflows with the appropriate identities and target settings. &lt;/p&gt;

&lt;p&gt;A plan-only run also depends on existing upstream resources. For a new deployment, the account plan cannot use infrastructure outputs that have not been created yet. Feature planning cannot resolve groups that do not exist. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 The Reality of Planning:&lt;/strong&gt; “Plan only” means no changes are applied. It does not mean Terraform can plan every dependent layer before the first layer exists.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Authenticate to AWS and Databricks separately
&lt;/h2&gt;

&lt;p&gt;The workflow talks to two control planes, each with its own identity. &lt;/p&gt;

&lt;p&gt;For AWS, GitHub Actions uses OpenID Connect to assume an IAM role and obtain temporary credentials. The role trust policy restricts which repository and GitHub Environment subjects can assume it. GitHub documents this flow in its &lt;a href="https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws" rel="noopener noreferrer"&gt;AWS OIDC guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The trust policy and the role permissions answer different questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The trust policy decides who may assume the role.&lt;/li&gt;
&lt;li&gt;  The permission policies decide what the role may do.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Databricks, the supplied workflow uses a service principal with OAuth machine-to-machine credentials. Its client secret lives in GitHub Environment secrets. &lt;/p&gt;

&lt;p&gt;Databricks also supports workload identity federation, but that is not the authentication path configured by these workflows. Changing to federation requires changes to the integration, rather than simply deleting the existing secret. See the &lt;a href="https://docs.databricks.com/aws/en/dev-tools/auth/oauth-federation-policy" rel="noopener noreferrer"&gt;Databricks federation documentation&lt;/a&gt;. The current setup therefore avoids stored AWS access keys while still requiring management of a Databricks OAuth secret.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply the plan that was produced
&lt;/h2&gt;

&lt;p&gt;The deployment workflow saves the Terraform plan and applies that saved file. &lt;/p&gt;

&lt;p&gt;Its manifest binds the plan to the source, commit, configuration, generated inputs, backend, and plan hash. The account layer also binds upstream state metadata. The compute runner adds checks against the relevant state snapshots and its expected ownership boundaries. If those inputs change, the workflow requires a new plan.&lt;/p&gt;

&lt;p&gt;Approval policy remains a separate concern. Most supported targets use protected GitHub Environments. Dev/demo has a limited single-administrator exception: a repository administrator must manually start the workflow from &lt;code&gt;main&lt;/code&gt;, enable deployment, provide the exact target confirmation, and satisfy the apply opt-in. That exception does not provide a human pause to approve every individual plan. It authorizes the checked workflow to plan and apply through the selected run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Protect state and plan artifacts
&lt;/h2&gt;

&lt;p&gt;State isolation reduces accidental overlap, but state storage still needs protection. &lt;/p&gt;

&lt;p&gt;The S3 backend uses locking to coordinate state mutations. S3 lockfiles are enabled with &lt;code&gt;use_lockfile&lt;/code&gt;, and bucket versioning supports recovery from accidental changes. HashiCorp documents both in its &lt;a href="https://developer.hashicorp.com/terraform/language/backend/s3" rel="noopener noreferrer"&gt;S3 backend guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;GitHub Actions also serializes provisioning and deprovisioning for the same environment/workspace pair. Operators running Terraform elsewhere must still coordinate with that workflow. Plans deserve restricted access too. Marking a Terraform value as sensitive does not remove it from state or saved plans. See HashiCorp’s &lt;a href="https://developer.hashicorp.com/terraform/language/manage-sensitive-data" rel="noopener noreferrer"&gt;sensitive data guidance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The repository retains deployment artifacts for one day. Short retention reduces exposure, but it does not replace access controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Include cost and retirement in the design
&lt;/h2&gt;

&lt;p&gt;A cluster policy defines the settings a cluster may use. Creating that policy does not start a cluster. A SQL warehouse apply can start billable compute. AWS networking, storage, and monitoring can also incur charges without anyone running a notebook. &lt;/p&gt;

&lt;p&gt;The platform configuration therefore includes bounded compute choices and automatic shutdown settings. Its Databricks budget alerts are notifications, not hard spending caps or AWS budgets.&lt;/p&gt;

&lt;p&gt;Retirement needs equally explicit rules. Dependent compute and permissions must be removed before the groups, workspace, and infrastructure they rely on. The provisioning workflow does not automatically own every data resource or grant, so teardown checks for remaining downstream state. &lt;/p&gt;

&lt;p&gt;Storage is retained by default. Permanent storage deletion requires separate confirmation and checks, while Terraform backend history remains preserved.&lt;/p&gt;

&lt;p&gt;A useful starting point is one workspace with a complete lifecycle: validated configuration, clear state ownership, a controlled deployment, persona verification, and a documented retirement path. Once that works, another workspace can reuse the same process with its own identity and reviewed settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How is your team currently handling Databricks workspace sprawl? Do you use a similar config-driven approach? Let me know in the comments, or check out the full implementation in the &lt;a href="https://github.com/mysticrenji/databricks-platform" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>databricks</category>
      <category>terraform</category>
      <category>aws</category>
      <category>github</category>
    </item>
    <item>
      <title>Static Code Analysis using Semgrep App</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 20 Oct 2022 10:14:00 +0000</pubDate>
      <link>https://dev.to/mysticrenji/static-code-analysis-using-semgrep-app-2168</link>
      <guid>https://dev.to/mysticrenji/static-code-analysis-using-semgrep-app-2168</guid>
      <description>&lt;p&gt;In this short article, we will explore the static code analysis capability of Semgrep. Semgrep is a fast, open-source, static analysis tool that supports most modern languages. It works on a set of rules and rules are customizable as well according to your requirements. The tool is available in the CLI (OSS) version as well as in the SaaS version(Semgrep App). Also, it is very flexible to integrate with your CI pipelines. Let's look at integrating Semgrep with GitLab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-requisites&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/users/sign_up" rel="noopener noreferrer"&gt;Gitlab account&lt;/a&gt;&lt;br&gt;
&lt;a href="https://semgrep.dev/login" rel="noopener noreferrer"&gt;Semgrep App Account&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's build&lt;/strong&gt;&lt;br&gt;
Semgrep works in such a way that the whole code analysis is done in the agents aka build machines and no sensitive data is being sent to the cloud. The only requirement is to generate an API TOKEN from Semgrep App and pass it to your GitLab pipelines, so they can talk with each other.&lt;/p&gt;

&lt;p&gt;You can create an API token from this &lt;a href="https://semgrep.dev/orgs/mysticrenji/settings/tokens" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q5gi36wx7daqlwqhywl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q5gi36wx7daqlwqhywl.png" alt=" " width="720" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have the token generated, the next step is to add the API TOKEN to the GitLab Variables — SEMGREP_APP_TOKEN in your project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy197xkxlyw5t9fvf46g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy197xkxlyw5t9fvf46g.png" alt=" " width="720" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's look at the GitLab pipelines. The pipeline has been just to do the static code analysis for illustration purposes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stages:
  - build

# Semgrep static code analysis
semgrep:
  stage: build
  # A Docker image with Semgrep installed.
  image: returntocorp/semgrep
  # Run the "semgrep ci" command on the command line of the docker image.
  script: semgrep ci

  rules:
  # Scan changed files in MRs, (diff-aware scanning):
  - if: $CI_MERGE_REQUEST_IID

  # Scan mainline (default) branches and report all findings.
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

  variables:
    # Connect to Semgrep App through your SEMGREP_APP_TOKEN.
    # Generate a token from Semgrep App &amp;gt; Settings
    # and add it as a variable in your GitLab CI/CD project settings.
    SEMGREP_APP_TOKEN: $SEMGREP_APP_TOKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;br&gt;
For scanning, I am utilizing an old repository hosted &lt;a href="https://gitlab.com/renjithvr11/flask-mysql-k8s" rel="noopener noreferrer"&gt;here&lt;/a&gt; that consists of Python scripts, Dockerfiles, and Kubernetes Manifests. The outcome is quite nice, as Semgrep was able to catch a few common mistakes in the development. The dashboard shows an overall summary of the findings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqq2xz1bcuig9uuzvmz44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqq2xz1bcuig9uuzvmz44.png" alt=" " width="720" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's zoom in on one of the findings run-as-non-root . Typically this message is raised when you have allowed your container to be run as root or in order words you have not specified the user by which the container is executed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi32cdwptjhso0i9f80ys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi32cdwptjhso0i9f80ys.png" alt=" " width="720" height="646"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a rule editor which shows the pre-defined rules, against which your code is compared. You may go around it to see, how it evaluates the condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Semgrep is a good tool to integrate with and it can be integrated with major CI/CD engines like GitLab, GitHub Actions, Azure DevOps, Jenkins, CircleCI, Bitbucket Pipelines, etc. It is worth checking out if it suits your organization's requirements. That’s all for now. Hope you find the article useful and feedbacks are always welcome. Cheers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/renjithvr11/flask-mysql-k8s" rel="noopener noreferrer"&gt;GitLab Repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://semgrep.dev/docs/" rel="noopener noreferrer"&gt;Semgrep Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case of any queries, please feel to connect me via the below links&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/rvr88/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/mysticrenji" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://renjithvr11.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>staticcodeanalysis</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>Essential plugins for Kubectl CLI</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 20 Oct 2022 06:57:17 +0000</pubDate>
      <link>https://dev.to/mysticrenji/essential-plugins-for-kubectl-cli-5een</link>
      <guid>https://dev.to/mysticrenji/essential-plugins-for-kubectl-cli-5een</guid>
      <description>&lt;p&gt;This is a short article about handy plugins that can be used along with kubectl CLI , which helps you to can reduce a few of your operational tasks from an admin perspective. Basically, we can extend the capabilities kubectl with the power of plugins, like checking the deprecations of components in the cluster or SSHing to the nodes.&lt;/p&gt;

&lt;p&gt;We can install plugins using a plugin manager called krew and there are quite a few available on the website listed here as well. Let's look at how we can get started with plugins :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;br&gt;
The plugins are added using krew and the primary requirement is to install krew them in the system. You can use the below code snippet in Mac/Linux to install it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(
  set -x; cd "$(mktemp -d)" &amp;amp;&amp;amp;
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &amp;amp;&amp;amp;
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &amp;amp;&amp;amp;
  KREW="krew-${OS}_${ARCH}" &amp;amp;&amp;amp;
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &amp;amp;&amp;amp;
  tar zxvf "${KREW}.tar.gz" &amp;amp;&amp;amp;
  ./"${KREW}" install krew
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have krew it in the system, now it is time to install the additional plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Plugins&lt;/strong&gt;&lt;br&gt;
There are many plugins available in the OSS GitHub repos, but below are some of my personal favorites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Kubepug&lt;/strong&gt;&lt;br&gt;
KubePug/Deprecations is intended to be a kubectl plugin, which:&lt;/p&gt;

&lt;p&gt;Downloads a swagger.json from a specific Kubernetes version&lt;br&gt;
Parses this Json finding deprecation notices&lt;br&gt;
Verifies the current kubernetes cluster or input files checking whether exists objects in this deprecated API Versions, allowing the user to check before migrating&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl krew install deprecations
#Usage
kubepug --k8s-version=v1.18.6 # Will verify the current context against v1.18.6 swagger.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. net-forward&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple plugin that lest you create a local port listener on your personal machine that redirects to an arbitrary TCP service that the Cluster can see. This is similar to kubectl port-forward without the restriction that forwarding can only use Pods or Services as destinations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl krew install net-forward

#Usage
kubectl net-forward -i 169.254.169.254 -p 3389 -l 3389
I personally use this a lot to debug issues related to environment specific inside the Windows/Linux nodes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please feel to try out the plugins on the krew website also, as there are other plugins that could be beneficial to your work.&lt;br&gt;
Hope this info was helpful and thanks for reading the article.!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/rikatz/kubepug" rel="noopener noreferrer"&gt;Kubepug&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/antitree/krew-net-forward" rel="noopener noreferrer"&gt;net-forward&lt;/a&gt;&lt;br&gt;
&lt;a href="https://krew.sigs.k8s.io/plugins/" rel="noopener noreferrer"&gt;Krew&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case of any queries, please feel to connect me via the below links&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/rvr88/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.tomysticrenji"&gt;Twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://renjithvr11.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>maintainence</category>
      <category>technology</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
