1. Packages
  2. Venafi
  3. API Docs
  4. Policy
Venafi v1.10.0 published on Wednesday, Jun 12, 2024 by Pulumi

venafi.Policy

Explore with Pulumi AI

venafi logo
Venafi v1.10.0 published on Wednesday, Jun 12, 2024 by Pulumi

    Provides access to read and write certificate policy in Venafi. This can be used to define a new policy (folder in Trust Protection Platform; application and issuing template in Venafi Control Plane).

    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/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: 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 java.util.List;
    import java.util.ArrayList;
    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
    

    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.
    
    

    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"),
    })
    
    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

    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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 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)
    Resource lookup is not supported in YAML
    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:
    PolicySpecification string
    The JSON-formatted certificate policy specification as documented here. Typically read from a file using the file function.
    Zone string
    The Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane 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 Trust Protection Plaform policy folder or Venafi Control Plane application and issuing template.

    Import

    The venafi_policy resource supports the Terraform import method.

    When used, the zone and policy_specification 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.

    hcl

    resource “venafi_policy” “existing_policy” {}

    $ pulumi import venafi:index/policy: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 v1.10.0 published on Wednesday, Jun 12, 2024 by Pulumi