Skip to main content
ubx validates resource attributes against a schema registry. To add support for new resource types, you update the schema registry.

Schema Registry Location

internal/compiler/schema/
  aws.go        # AWS resource schemas
  gcp.go        # GCP resource schemas
  azure.go      # Azure resource schemas
  kubernetes.go # Kubernetes resource schemas

Schema Format

Each resource type is a ResourceSchema struct:
// internal/compiler/schema/aws.go

var awsSchemas = map[string]ResourceSchema{
    "aws_s3_bucket_v2": {
        Required: []string{},
        Optional: []string{
            "bucket", "force_destroy", "tags", "acl",
            "object_lock_enabled", "policy",
        },
        Tags: true,  // supports default_tags injection
    },
    "aws_rds_instance": {
        Required: []string{"engine", "instance_class"},
        Optional: []string{
            "allocated_storage", "username", "password",
            "skip_final_snapshot", "multi_az", "storage_encrypted",
        },
        Tags: true,
    },
}

Adding a New Resource

  1. Find the resource in the Pulumi AWS Registry
  2. Add a new entry to the appropriate schema file:
"aws_cloudfront_distribution": {
    Required: []string{"origin", "default_cache_behavior", "restrictions", "viewer_certificate"},
    Optional: []string{
        "aliases", "comment", "enabled", "price_class", "tags",
    },
    Tags: true,
},
  1. Add the resource type to the codegen registry:
// internal/compiler/codegen/registry.go
"aws_cloudfront_distribution": {
    Import:    "aws",
    Module:    "cloudfront",
    ClassName: "Distribution",
},
  1. Write a test in internal/compiler/schema/aws_test.go
  2. Run go test ./...

Updating via Schema Sync

For bulk updates, the ubx schema sync command fetches schemas directly from Pulumi’s JSON schema endpoint and updates the registry automatically:
ubx schema sync aws

Opening an Issue

If a resource type you need is missing, open a GitHub issue with the resource type name and a link to the Pulumi registry page.