> Developer Access Use-case

Per request giant wiggle optimize

Feugiat quisque bibendum duis sed nec sit id commodo ut. Maecenas aliquet iaculis id.

Use Case Masthead Placeholder
Parafin-Bio-Logo-2
Notion-Logo-3
Gusto-Bio-Logo-2
Formation-Bio-Logo-2
Cadence-Logo-2
Modern-Health-Logo-2
Ramp-Logo-2
ManoMano logo
> Introduction

Introducing the all-in-one platform that allows data and security teams to understand their infrastructure.

Accordion Placeholder
Nothing works well together. We've low lot bed crack bells ocean problem sorry. Prioritize identify monday cob dive.
Accordion Placeholder
Nothing works well together. We've low lot bed crack bells ocean problem sorry. Prioritize identify monday cob dive.
Accordion Placeholder
Nothing works well together. We've low lot bed crack bells ocean problem sorry. Prioritize identify monday cob dive.

Lorem ipsum dolor sit adipiscing elit sed do.

We've low lot bed crack bells ocean problem sorry. Prioritize identify monday cob dive incentivization hammer.

Stacked-Two-Col-Placeholder

Lorem ipsum dolor sit adipiscing elit sed do.

We've low lot bed crack bells ocean problem sorry. Prioritize identify monday cob dive incentivization hammer.

Stacked-Two-Col-Placeholder

Lorem ipsum dolor sit adipiscing elit sed do.

We've low lot bed crack bells ocean problem sorry. Prioritize identify monday cob dive incentivization hammer.

Stacked-Two-Col-Placeholder
Grid Links Card BG
> For developers

A unified data security framework for all your cloud applications.

> Integrations

Introducing data security — as code.

We build Formal with DevOps teams top-of-mind. Continue working at your speed with an API-first design that seamlessly integrates with your stack. Choose your IaC, pick your VPC, and deploy a single built-from-scratch Docker image.

terraform {
    required_providers {
        formal = {
        source  = "formalco/formal"
        version = "~>4.0.0"
        }
    }
    required_version = ">= 0.14.9"
}
provider "formal" {
    api_key = var.formal_api_key
    }
    resource "formal_sidecar" "main" {
    name = var.name
    technology = "mysql"
    hostname = var.mysql_sidecar_hostname
    }
resource "formal_resource" "main" {
    technology = "mysql"
    name = var.name
    hostname = var.mysql_hostname
    port = var.main_port
    }
resource "formal_sidecar_resource_link" "main" {
    resource_id = formal_resource.main.id
    sidecar_id = formal_sidecar.main.id
    port = 3306
    }
# Native Role
resource "formal_native_user" "main_mysql" {
    resource_id = formal_datastore.main.id
    native_user_id = var.mysql_username
    native_user_secret = var.mysql_password
    use_as_default = true 
    // per sidecar, exactly one native role must be marked    
    as the default.
    }
    
func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        cfg := config.New(ctx, "")

        // Load required configuration
        formalApiKey := cfg.Require("formal_api_key")
        name := cfg.Require("name")
        mysqlSidecarHostname := cfg.Require("mysql_sidecar_hostname")

        // Initialize the Formal provider
        provider, err := formal.NewProvider(ctx, "formal", &formal.ProviderArgs{
            ApiKey: pulumi.String(formalApiKey),
        })
        if err != nil {
            return err
        }

        // Create the formal_sidecar resource
        sidecar, err := formal.NewSidecar(ctx, "main", &formal.SidecarArgs{
            Name:      pulumi.String(name),
            Technology: pulumi.String("mysql"),
            Hostname:   pulumi.String(mysqlSidecarHostname),
        }, pulumi.Provider(provider))
        if err != nil {
            return err
        }

        // Create the formal_resource resource
        resource, err := formal.NewResource(ctx, "main", &formal.ResourceArgs{
            Technology: pulumi.String("mysql"),
            Name:       pulumi.String(name),
            Hostname:   pulumi.String(mysqlHostname),
            Port:       pulumi.Int(mainPort),
        }, pulumi.Provider(provider))
        if err != nil {
            return err
        }

        // Create the formal_sidecar_resource_link resource
        _, err = formal.NewSidecarResourceLink(ctx, "main", &formal.SidecarResourceLinkArgs{
            ResourceId: resource.ID(),
            SidecarId:  sidecar.ID(),
            Port:       pulumi.Int(3306),
        }, pulumi.Provider(provider))
        if err != nil {
            return err
        }

        // Create the formal_native_user resource
        _, err = formal.NewNativeUser(ctx, "main_mysql", &formal.NativeUserArgs{
            ResourceId:       resource.ID(),
            NativeUserId:     pulumi.String(mysqlUsername),
            NativeUserSecret: pulumi.String(mysqlPassword),
            UseAsDefault:     pulumi.Bool(true),
        }, pulumi.Provider(provider))
        if err != nil {
            return err
        }

        return nil
    })
}
import * as formal_sdk from 'formal-sdk';
import { CreateSidecarRequest } from 'formal-sdk/gen/admin/v1/sidecar_pb';

// Get the API key from environment variables
const apiKey = process.env.API_KEY;
if (!apiKey) {
    throw new Error('API_KEY environment variable is not set');
}

// Initialize the Formal client
const formalClient = new formal_sdk.Client(apiKey);

// Create a sidecar
const request = new CreateSidecarRequest({
    name: '<string>',
    resource_id: '<string>',
    hostname: '<string>',
    technology: '<string>',
    termination_protection: <boolean>
});

formalClient.SidecarClient.CreateSidecar(request)
    .then(response => {
        console.log('Sidecar created successfully:', response);
    })
    .catch(error => {
        console.error('Error creating sidecar:', error);
    });
import os
import formal_sdk

from formal_sdk.gen.admin.v1.sidecar_pb2 import CreateSidecarRequest

api_key = os.environ.get('API_KEY')
formal_client = formal_sdk.Client(api_key) # Formal base client

formal_client.SidecarClient.CreateSidecar(
    CreateSidecarRequest("name": <string>,
                         "resource_id": <string>,
                         "hostname": <string>,
                         "technology": <string>,
                         "termination_protection": <bool>)
)
CTA BG

Speak to an Engineer

Learn the platform in less than an hour. Secure your data stack in less than a day.