1. Registry
  2. Packages
  3. HashiCorp Vault Provider
  4. API Docs
  5. config
  6. UiHeader
Viewing docs for HashiCorp Vault v7.12.0
published on Saturday, Aug 15, 2026 by Pulumi
vault logo vault logo
Viewing docs for HashiCorp Vault v7.12.0
published on Saturday, Aug 15, 2026 by Pulumi

    Manages custom HTTP headers for the Vault UI. This resource allows you to configure custom HTTP response headers that will be sent by the Vault UI, enabling security policies, CORS configuration, and custom organizational headers.

    Important This resource requires Vault 1.16.0 or later. The sys/config/ui/headers API endpoint was introduced in Vault 1.16.0.

    Important All operations on this resource require the sudo capability on the sys/config/ui/headers/* path.

    Example Usage

    Basic Header Configuration

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const custom = new vault.config.UiHeader("custom", {
        name: "X-Custom-Header",
        values: ["custom-value"],
    });
    
    import pulumi
    import pulumi_vault as vault
    
    custom = vault.config.UiHeader("custom",
        name="X-Custom-Header",
        values=["custom-value"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault/config"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := config.NewUiHeader(ctx, "custom", &config.UiHeaderArgs{
    			Name: pulumi.String("X-Custom-Header"),
    			Values: pulumi.StringArray{
    				pulumi.String("custom-value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var custom = new Vault.Config.UiHeader("custom", new()
        {
            Name = "X-Custom-Header",
            Values = new[]
            {
                "custom-value",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.config.UiHeader;
    import com.pulumi.vault.config.UiHeaderArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var custom = new UiHeader("custom", UiHeaderArgs.builder()
                .name("X-Custom-Header")
                .values("custom-value")
                .build());
    
        }
    }
    
    resources:
      custom:
        type: vault:config:UiHeader
        properties:
          name: X-Custom-Header
          values:
            - custom-value
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    resource "vault_config_uiheader" "custom" {
      name   = "X-Custom-Header"
      values = ["custom-value"]
    }
    

    Security Headers

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    // Content Security Policy
    const csp = new vault.config.UiHeader("csp", {
        name: "Content-Security-Policy",
        values: ["default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'"],
    });
    // X-Frame-Options
    const frameOptions = new vault.config.UiHeader("frame_options", {
        name: "X-Frame-Options",
        values: ["DENY"],
    });
    // Strict Transport Security
    const hsts = new vault.config.UiHeader("hsts", {
        name: "Strict-Transport-Security",
        values: ["max-age=31536000; includeSubDomains; preload"],
    });
    // X-Content-Type-Options
    const contentTypeOptions = new vault.config.UiHeader("content_type_options", {
        name: "X-Content-Type-Options",
        values: ["nosniff"],
    });
    
    import pulumi
    import pulumi_vault as vault
    
    # Content Security Policy
    csp = vault.config.UiHeader("csp",
        name="Content-Security-Policy",
        values=["default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'"])
    # X-Frame-Options
    frame_options = vault.config.UiHeader("frame_options",
        name="X-Frame-Options",
        values=["DENY"])
    # Strict Transport Security
    hsts = vault.config.UiHeader("hsts",
        name="Strict-Transport-Security",
        values=["max-age=31536000; includeSubDomains; preload"])
    # X-Content-Type-Options
    content_type_options = vault.config.UiHeader("content_type_options",
        name="X-Content-Type-Options",
        values=["nosniff"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault/config"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Content Security Policy
    		_, err := config.NewUiHeader(ctx, "csp", &config.UiHeaderArgs{
    			Name: pulumi.String("Content-Security-Policy"),
    			Values: pulumi.StringArray{
    				pulumi.String("default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// X-Frame-Options
    		_, err = config.NewUiHeader(ctx, "frame_options", &config.UiHeaderArgs{
    			Name: pulumi.String("X-Frame-Options"),
    			Values: pulumi.StringArray{
    				pulumi.String("DENY"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Strict Transport Security
    		_, err = config.NewUiHeader(ctx, "hsts", &config.UiHeaderArgs{
    			Name: pulumi.String("Strict-Transport-Security"),
    			Values: pulumi.StringArray{
    				pulumi.String("max-age=31536000; includeSubDomains; preload"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// X-Content-Type-Options
    		_, err = config.NewUiHeader(ctx, "content_type_options", &config.UiHeaderArgs{
    			Name: pulumi.String("X-Content-Type-Options"),
    			Values: pulumi.StringArray{
    				pulumi.String("nosniff"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        // Content Security Policy
        var csp = new Vault.Config.UiHeader("csp", new()
        {
            Name = "Content-Security-Policy",
            Values = new[]
            {
                "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'",
            },
        });
    
        // X-Frame-Options
        var frameOptions = new Vault.Config.UiHeader("frame_options", new()
        {
            Name = "X-Frame-Options",
            Values = new[]
            {
                "DENY",
            },
        });
    
        // Strict Transport Security
        var hsts = new Vault.Config.UiHeader("hsts", new()
        {
            Name = "Strict-Transport-Security",
            Values = new[]
            {
                "max-age=31536000; includeSubDomains; preload",
            },
        });
    
        // X-Content-Type-Options
        var contentTypeOptions = new Vault.Config.UiHeader("content_type_options", new()
        {
            Name = "X-Content-Type-Options",
            Values = new[]
            {
                "nosniff",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.config.UiHeader;
    import com.pulumi.vault.config.UiHeaderArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // Content Security Policy
            var csp = new UiHeader("csp", UiHeaderArgs.builder()
                .name("Content-Security-Policy")
                .values("default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'")
                .build());
    
            // X-Frame-Options
            var frameOptions = new UiHeader("frameOptions", UiHeaderArgs.builder()
                .name("X-Frame-Options")
                .values("DENY")
                .build());
    
            // Strict Transport Security
            var hsts = new UiHeader("hsts", UiHeaderArgs.builder()
                .name("Strict-Transport-Security")
                .values("max-age=31536000; includeSubDomains; preload")
                .build());
    
            // X-Content-Type-Options
            var contentTypeOptions = new UiHeader("contentTypeOptions", UiHeaderArgs.builder()
                .name("X-Content-Type-Options")
                .values("nosniff")
                .build());
    
        }
    }
    
    resources:
      # Content Security Policy
      csp:
        type: vault:config:UiHeader
        properties:
          name: Content-Security-Policy
          values:
            - default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'
      # X-Frame-Options
      frameOptions:
        type: vault:config:UiHeader
        name: frame_options
        properties:
          name: X-Frame-Options
          values:
            - DENY
      # Strict Transport Security
      hsts:
        type: vault:config:UiHeader
        properties:
          name: Strict-Transport-Security
          values:
            - max-age=31536000; includeSubDomains; preload
      # X-Content-Type-Options
      contentTypeOptions:
        type: vault:config:UiHeader
        name: content_type_options
        properties:
          name: X-Content-Type-Options
          values:
            - nosniff
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    # Content Security Policy
    resource "vault_config_uiheader" "csp" {
      name   = "Content-Security-Policy"
      values = ["default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'"]
    }
    # X-Frame-Options
    resource "vault_config_uiheader" "frame_options" {
      name   = "X-Frame-Options"
      values = ["DENY"]
    }
    # Strict Transport Security
    resource "vault_config_uiheader" "hsts" {
      name   = "Strict-Transport-Security"
      values = ["max-age=31536000; includeSubDomains; preload"]
    }
    # X-Content-Type-Options
    resource "vault_config_uiheader" "content_type_options" {
      name   = "X-Content-Type-Options"
      values = ["nosniff"]
    }
    

    CORS Configuration

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const corsOrigin = new vault.config.UiHeader("cors_origin", {
        name: "Access-Control-Allow-Origin",
        values: [
            "https://example.com",
            "https://app.example.com",
        ],
    });
    const corsMethods = new vault.config.UiHeader("cors_methods", {
        name: "Access-Control-Allow-Methods",
        values: [
            "GET",
            "POST",
            "OPTIONS",
        ],
    });
    const corsHeaders = new vault.config.UiHeader("cors_headers", {
        name: "Access-Control-Allow-Headers",
        values: [
            "Content-Type",
            "Authorization",
        ],
    });
    
    import pulumi
    import pulumi_vault as vault
    
    cors_origin = vault.config.UiHeader("cors_origin",
        name="Access-Control-Allow-Origin",
        values=[
            "https://example.com",
            "https://app.example.com",
        ])
    cors_methods = vault.config.UiHeader("cors_methods",
        name="Access-Control-Allow-Methods",
        values=[
            "GET",
            "POST",
            "OPTIONS",
        ])
    cors_headers = vault.config.UiHeader("cors_headers",
        name="Access-Control-Allow-Headers",
        values=[
            "Content-Type",
            "Authorization",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault/config"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := config.NewUiHeader(ctx, "cors_origin", &config.UiHeaderArgs{
    			Name: pulumi.String("Access-Control-Allow-Origin"),
    			Values: pulumi.StringArray{
    				pulumi.String("https://example.com"),
    				pulumi.String("https://app.example.com"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = config.NewUiHeader(ctx, "cors_methods", &config.UiHeaderArgs{
    			Name: pulumi.String("Access-Control-Allow-Methods"),
    			Values: pulumi.StringArray{
    				pulumi.String("GET"),
    				pulumi.String("POST"),
    				pulumi.String("OPTIONS"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = config.NewUiHeader(ctx, "cors_headers", &config.UiHeaderArgs{
    			Name: pulumi.String("Access-Control-Allow-Headers"),
    			Values: pulumi.StringArray{
    				pulumi.String("Content-Type"),
    				pulumi.String("Authorization"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var corsOrigin = new Vault.Config.UiHeader("cors_origin", new()
        {
            Name = "Access-Control-Allow-Origin",
            Values = new[]
            {
                "https://example.com",
                "https://app.example.com",
            },
        });
    
        var corsMethods = new Vault.Config.UiHeader("cors_methods", new()
        {
            Name = "Access-Control-Allow-Methods",
            Values = new[]
            {
                "GET",
                "POST",
                "OPTIONS",
            },
        });
    
        var corsHeaders = new Vault.Config.UiHeader("cors_headers", new()
        {
            Name = "Access-Control-Allow-Headers",
            Values = new[]
            {
                "Content-Type",
                "Authorization",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.config.UiHeader;
    import com.pulumi.vault.config.UiHeaderArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var corsOrigin = new UiHeader("corsOrigin", UiHeaderArgs.builder()
                .name("Access-Control-Allow-Origin")
                .values(            
                    "https://example.com",
                    "https://app.example.com")
                .build());
    
            var corsMethods = new UiHeader("corsMethods", UiHeaderArgs.builder()
                .name("Access-Control-Allow-Methods")
                .values(            
                    "GET",
                    "POST",
                    "OPTIONS")
                .build());
    
            var corsHeaders = new UiHeader("corsHeaders", UiHeaderArgs.builder()
                .name("Access-Control-Allow-Headers")
                .values(            
                    "Content-Type",
                    "Authorization")
                .build());
    
        }
    }
    
    resources:
      corsOrigin:
        type: vault:config:UiHeader
        name: cors_origin
        properties:
          name: Access-Control-Allow-Origin
          values:
            - https://example.com
            - https://app.example.com
      corsMethods:
        type: vault:config:UiHeader
        name: cors_methods
        properties:
          name: Access-Control-Allow-Methods
          values:
            - GET
            - POST
            - OPTIONS
      corsHeaders:
        type: vault:config:UiHeader
        name: cors_headers
        properties:
          name: Access-Control-Allow-Headers
          values:
            - Content-Type
            - Authorization
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    resource "vault_config_uiheader" "cors_origin" {
      name   = "Access-Control-Allow-Origin"
      values = ["https://example.com", "https://app.example.com"]
    }
    resource "vault_config_uiheader" "cors_methods" {
      name   = "Access-Control-Allow-Methods"
      values = ["GET", "POST", "OPTIONS"]
    }
    resource "vault_config_uiheader" "cors_headers" {
      name   = "Access-Control-Allow-Headers"
      values = ["Content-Type", "Authorization"]
    }
    

    Multiple Values

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const multiValue = new vault.config.UiHeader("multi_value", {
        name: "X-Multi-Value-Header",
        values: [
            "value1",
            "value2",
            "value3",
        ],
    });
    
    import pulumi
    import pulumi_vault as vault
    
    multi_value = vault.config.UiHeader("multi_value",
        name="X-Multi-Value-Header",
        values=[
            "value1",
            "value2",
            "value3",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault/config"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := config.NewUiHeader(ctx, "multi_value", &config.UiHeaderArgs{
    			Name: pulumi.String("X-Multi-Value-Header"),
    			Values: pulumi.StringArray{
    				pulumi.String("value1"),
    				pulumi.String("value2"),
    				pulumi.String("value3"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var multiValue = new Vault.Config.UiHeader("multi_value", new()
        {
            Name = "X-Multi-Value-Header",
            Values = new[]
            {
                "value1",
                "value2",
                "value3",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.config.UiHeader;
    import com.pulumi.vault.config.UiHeaderArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var multiValue = new UiHeader("multiValue", UiHeaderArgs.builder()
                .name("X-Multi-Value-Header")
                .values(            
                    "value1",
                    "value2",
                    "value3")
                .build());
    
        }
    }
    
    resources:
      multiValue:
        type: vault:config:UiHeader
        name: multi_value
        properties:
          name: X-Multi-Value-Header
          values:
            - value1
            - value2
            - value3
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    resource "vault_config_uiheader" "multi_value" {
      name   = "X-Multi-Value-Header"
      values = ["value1", "value2", "value3"]
    }
    

    Migration from vault.generic.Endpoint

    If you’re currently managing UI headers using vault.generic.Endpoint, you can migrate to this dedicated resource:

    Before (using generic_endpoint)

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const cspHeader = new vault.generic.Endpoint("csp_header", {
        path: "sys/config/ui/headers/Content-Security-Policy",
        dataJson: JSON.stringify({
            values: ["default-src 'self'"],
        }),
    });
    
    import pulumi
    import json
    import pulumi_vault as vault
    
    csp_header = vault.generic.Endpoint("csp_header",
        path="sys/config/ui/headers/Content-Security-Policy",
        data_json=json.dumps({
            "values": ["default-src 'self'"],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault/generic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal(map[string][]string{
    			"values": []string{
    				"default-src 'self'",
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = generic.NewEndpoint(ctx, "csp_header", &generic.EndpointArgs{
    			Path:     pulumi.String("sys/config/ui/headers/Content-Security-Policy"),
    			DataJson: pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var cspHeader = new Vault.Generic.Endpoint("csp_header", new()
        {
            Path = "sys/config/ui/headers/Content-Security-Policy",
            DataJson = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["values"] = new[]
                {
                    "default-src 'self'",
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.generic.Endpoint;
    import com.pulumi.vault.generic.EndpointArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var cspHeader = new Endpoint("cspHeader", EndpointArgs.builder()
                .path("sys/config/ui/headers/Content-Security-Policy")
                .dataJson(serializeJson(
                    jsonObject(
                        jsonProperty("values", jsonArray("default-src 'self'"))
                    )))
                .build());
    
        }
    }
    
    resources:
      cspHeader:
        type: vault:generic:Endpoint
        name: csp_header
        properties:
          path: sys/config/ui/headers/Content-Security-Policy
          dataJson:
            fn::toJSON:
              values:
                - default-src 'self'
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    resource "vault_generic_endpoint" "csp_header" {
      path = "sys/config/ui/headers/Content-Security-Policy"
      data_json = jsonencode({
        "values" = ["default-src 'self'"]
      })
    }
    

    After (using dedicated resource)

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const csp = new vault.config.UiHeader("csp", {
        name: "Content-Security-Policy",
        values: ["default-src 'self'"],
    });
    
    import pulumi
    import pulumi_vault as vault
    
    csp = vault.config.UiHeader("csp",
        name="Content-Security-Policy",
        values=["default-src 'self'"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault/config"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := config.NewUiHeader(ctx, "csp", &config.UiHeaderArgs{
    			Name: pulumi.String("Content-Security-Policy"),
    			Values: pulumi.StringArray{
    				pulumi.String("default-src 'self'"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var csp = new Vault.Config.UiHeader("csp", new()
        {
            Name = "Content-Security-Policy",
            Values = new[]
            {
                "default-src 'self'",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.config.UiHeader;
    import com.pulumi.vault.config.UiHeaderArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var csp = new UiHeader("csp", UiHeaderArgs.builder()
                .name("Content-Security-Policy")
                .values("default-src 'self'")
                .build());
    
        }
    }
    
    resources:
      csp:
        type: vault:config:UiHeader
        properties:
          name: Content-Security-Policy
          values:
            - default-src 'self'
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    resource "vault_config_uiheader" "csp" {
      name   = "Content-Security-Policy"
      values = ["default-src 'self'"]
    }
    

    Migration Steps

    1. Add the new vault.config.UiHeader resource to your configuration
    2. Import the existing header: terraform import vault_config_ui_header.csp Content-Security-Policy
    3. Remove the old vault.generic.Endpoint resource from your configuration
    4. Run pulumi preview to verify no changes are required

    Create UiHeader Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new UiHeader(name: string, args: UiHeaderArgs, opts?: CustomResourceOptions);
    @overload
    def UiHeader(resource_name: str,
                 args: UiHeaderArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def UiHeader(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 values: Optional[Sequence[str]] = None,
                 name: Optional[str] = None)
    func NewUiHeader(ctx *Context, name string, args UiHeaderArgs, opts ...ResourceOption) (*UiHeader, error)
    public UiHeader(string name, UiHeaderArgs args, CustomResourceOptions? opts = null)
    public UiHeader(String name, UiHeaderArgs args)
    public UiHeader(String name, UiHeaderArgs args, CustomResourceOptions options)
    
    type: vault:config:UiHeader
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "vault_config_ui_header" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args UiHeaderArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UiHeaderArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UiHeaderArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UiHeaderArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UiHeaderArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var uiHeaderResource = new Vault.Config.UiHeader("uiHeaderResource", new()
    {
        Values = new[]
        {
            "string",
        },
        Name = "string",
    });
    
    example, err := config.NewUiHeader(ctx, "uiHeaderResource", &config.UiHeaderArgs{
    	Values: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    resource "vault_config_ui_header" "uiHeaderResource" {
      lifecycle {
        create_before_destroy = true
      }
      values = ["string"]
      name   = "string"
    }
    
    var uiHeaderResource = new UiHeader("uiHeaderResource", UiHeaderArgs.builder()
        .values("string")
        .name("string")
        .build());
    
    ui_header_resource = vault.config.UiHeader("uiHeaderResource",
        values=["string"],
        name="string")
    
    const uiHeaderResource = new vault.config.UiHeader("uiHeaderResource", {
        values: ["string"],
        name: "string",
    });
    
    type: vault:config:UiHeader
    properties:
        name: string
        values:
            - string
    

    UiHeader Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The UiHeader resource accepts the following input properties:

    Values List<string>

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    Name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    Values []string

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    Name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values list(string)

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values List<String>

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name String
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values string[]

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values Sequence[str]

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name str
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values List<String>

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name String
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UiHeader resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing UiHeader Resource

    Get an existing UiHeader resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: UiHeaderState, opts?: CustomResourceOptions): UiHeader
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            values: Optional[Sequence[str]] = None) -> UiHeader
    func GetUiHeader(ctx *Context, name string, id IDInput, state *UiHeaderState, opts ...ResourceOption) (*UiHeader, error)
    public static UiHeader Get(string name, Input<string> id, UiHeaderState? state, CustomResourceOptions? opts = null)
    public static UiHeader get(String name, Output<String> id, UiHeaderState state, CustomResourceOptions options)
    resources:  _:    type: vault:config:UiHeader    get:      id: ${id}
    import {
      to = vault_config_ui_header.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    Values List<string>

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    Name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    Values []string

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values list(string)

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name String
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values List<String>

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name string
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values string[]

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name str
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values Sequence[str]

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    name String
    The name of the custom header (e.g., "Content-Security-Policy", "X-Frame-Options"). Changing this will recreate the resource.
    values List<String>

    A set of values for the header. At least one value is required. Multiple values can be provided for headers that support them. Because this argument uses set semantics, value order is not preserved and duplicate values are removed.

    Important This resource must be called from the root namespace. UI header configuration is a global setting that applies to the entire Vault cluster.

    Import

    ant Notes

    State Management

    This resource follows Terraform best practices by reading the actual configuration from Vault after create and update operations. This ensures that the Terraform state always reflects the actual state in Vault, including any server-side processing or normalization of values.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo vault logo
    Viewing docs for HashiCorp Vault v7.12.0
    published on Saturday, Aug 15, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial