1. Registry
  2. Packages
  3. Venafi Provider
  4. API Docs
  5. Policy
Viewing docs for Venafi v1.13.5
published on Wednesday, Nov 11, 2026 by Pulumi
venafi logo venafi logo
Viewing docs for Venafi v1.13.5
published on Wednesday, Nov 11, 2026 by Pulumi

    Provides access to read and write certificate policy in CyberArk Machine Identity Service. This can be used to define a new policy (folder in CyberArk Certificate Manager, Self-Hosted; application and issuing template in CyberArk Certificate Manager, SaaS).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as std from "@pulumi/std";
    import * as venafi from "@pulumi/venafi";
    
    const internalPolicy = new venafi.Policy("internal_policy", {
        zone: "My Business App\\Enterprise Trusted Certs",
        policySpecification: std.file({
            input: "/path-to/internal-policy.json",
        }).then(invoke => invoke.result),
    });
    
    import pulumi
    import pulumi_std as std
    import pulumi_venafi as venafi
    
    internal_policy = venafi.Policy("internal_policy",
        zone="My Business App\\Enterprise Trusted Certs",
        policy_specification=std.file(input="/path-to/internal-policy.json").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-std/sdk/v2/go/std"
    	"github.com/pulumi/pulumi-venafi/sdk/go/venafi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "/path-to/internal-policy.json",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = venafi.NewPolicy(ctx, "internal_policy", &venafi.PolicyArgs{
    			Zone:                pulumi.String("My Business App\\Enterprise Trusted Certs"),
    			PolicySpecification: pulumi.String(invokeFile.Result),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Std = Pulumi.Std;
    using Venafi = Pulumi.Venafi;
    
    return await Deployment.RunAsync(() => 
    {
        var internalPolicy = new Venafi.Policy("internal_policy", new()
        {
            Zone = "My Business App\\Enterprise Trusted Certs",
            PolicySpecification = Std.File.Invoke(new()
            {
                Input = "/path-to/internal-policy.json",
            }).Apply(invoke => invoke.Result),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.venafi.Policy;
    import com.pulumi.venafi.PolicyArgs;
    import com.pulumi.std.StdFunctions;
    import com.pulumi.std.inputs.FileArgs;
    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 internalPolicy = new Policy("internalPolicy", PolicyArgs.builder()
                .zone("My Business App\\Enterprise Trusted Certs")
                .policySpecification(StdFunctions.file(FileArgs.builder()
                    .input("/path-to/internal-policy.json")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      internalPolicy:
        type: venafi:Policy
        name: internal_policy
        properties:
          zone: My Business App\Enterprise Trusted Certs
          policySpecification:
            fn::invoke:
              function: std:file
              arguments:
                input: /path-to/internal-policy.json
              return: result
    
    terraform {
      required_providers {
        std = {
          source = "pulumi/std"
        }
        venafi = {
          source = "pulumi/venafi"
        }
      }
    }
    
    resource "venafi_policy" "internal_policy" {
      lifecycle {
        create_before_destroy = true
      }
      zone                 = "My Business App\\Enterprise Trusted Certs"
      policy_specification = file("/path-to/internal-policy.json")
    }
    

    Create Policy Resource

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

    Constructor syntax

    new Policy(name: string, args?: PolicyArgs, opts?: CustomResourceOptions);
    @overload
    def Policy(resource_name: str,
               args: Optional[PolicyArgs] = None,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Policy(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               policy_specification: Optional[str] = None,
               zone: Optional[str] = None)
    func NewPolicy(ctx *Context, name string, args *PolicyArgs, opts ...ResourceOption) (*Policy, error)
    public Policy(string name, PolicyArgs? args = null, CustomResourceOptions? opts = null)
    public Policy(String name, PolicyArgs args)
    public Policy(String name, PolicyArgs args, CustomResourceOptions options)
    
    type: venafi:Policy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "venafi_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PolicyArgs
    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 PolicyArgs
    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 PolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyArgs
    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 policyResource = new Venafi.Policy("policyResource", new()
    {
        PolicySpecification = "string",
        Zone = "string",
    });
    
    example, err := venafi.NewPolicy(ctx, "policyResource", &venafi.PolicyArgs{
    	PolicySpecification: pulumi.String("string"),
    	Zone:                pulumi.String("string"),
    })
    
    resource "venafi_policy" "policyResource" {
      lifecycle {
        create_before_destroy = true
      }
      policy_specification = "string"
      zone                 = "string"
    }
    
    var policyResource = new Policy("policyResource", PolicyArgs.builder()
        .policySpecification("string")
        .zone("string")
        .build());
    
    policy_resource = venafi.Policy("policyResource",
        policy_specification="string",
        zone="string")
    
    const policyResource = new venafi.Policy("policyResource", {
        policySpecification: "string",
        zone: "string",
    });
    
    type: venafi:Policy
    properties:
        policySpecification: string
        zone: string
    

    Policy 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 Policy resource accepts the following input properties:

    PolicySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    Zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    PolicySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    Zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policy_specification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policySpecification String
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone String
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policy_specification str
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone str
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policySpecification String
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone String
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Policy 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 Policy Resource

    Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy_specification: Optional[str] = None,
            zone: Optional[str] = None) -> Policy
    func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
    public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
    public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)
    resources:  existingPolicy:    type: venafi:Policy    get:      id: ${id}
    import {
      to = venafi_policy.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state PolicyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    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 resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state PolicyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state PolicyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state PolicyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    PolicySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    Zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    PolicySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    Zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policy_specification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policySpecification String
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone String
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone string
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policy_specification str
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone str
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.
    policySpecification String
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    zone String
    The CyberArk Certificate Manager, Self-Hosted policy folder or CyberArk Certificate Manager, SaaS application and issuing template.

    Import

    The venafi.Policy resource supports the Terraform import method. When used, the zone and policySpecification resource arguments are not required since the zone is a required parameter of the import method and the policy specification is populated from the existing infrastructure. Policy that is successfully imported is also output to a file named after the zone that was specified.

    import * as pulumi from "@pulumi/pulumi";
    import * as venafi from "@pulumi/venafi";
    
    const existingPolicy = new venafi.Policy("existing_policy", {});
    
    import pulumi
    import pulumi_venafi as venafi
    
    existing_policy = venafi.Policy("existing_policy")
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Venafi = Pulumi.Venafi;
    
    return await Deployment.RunAsync(() => 
    {
        var existingPolicy = new Venafi.Policy("existing_policy");
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-venafi/sdk/go/venafi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := venafi.NewPolicy(ctx, "existing_policy", nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    terraform {
      required_providers {
        venafi = {
          source = "pulumi/venafi"
        }
      }
    }
    
    resource "venafi_policy" "existing_policy" {
      lifecycle {
        create_before_destroy = true
      }
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.venafi.Policy;
    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 existingPolicy = new Policy("existingPolicy");
    
        }
    }
    
    resources:
      existingPolicy:
        type: venafi:Policy
        name: existing_policy
    
    terraform import "venafi_policy.existing_policy" "My Business App\\Enterprise Trusted Certs"
    

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

    Package Details

    Repository
    Venafi pulumi/pulumi-venafi
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the venafi Terraform Provider.
    venafi logo venafi logo
    Viewing docs for Venafi v1.13.5
    published on Wednesday, Nov 11, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial