HashiCorp Vault

v5.1.0 published on Thursday, Dec 30, 2021 by Pulumi

RgpPolicy

Provides a resource to manage Role Governing Policy (RGP) via Sentinel.

Note this feature is available only with Vault Enterprise.

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var allow_all = new Vault.RgpPolicy("allow-all", new Vault.RgpPolicyArgs
        {
            EnforcementLevel = "soft-mandatory",
            Policy = @"main = rule {
  true
}

",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vault.NewRgpPolicy(ctx, "allow_all", &vault.RgpPolicyArgs{
			EnforcementLevel: pulumi.String("soft-mandatory"),
			Policy:           pulumi.String(fmt.Sprintf("%v%v%v%v", "main = rule {\n", "  true\n", "}\n", "\n")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

allow_all = vault.RgpPolicy("allow-all",
    enforcement_level="soft-mandatory",
    policy="""main = rule {
  true
}

""")
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const allow_all = new vault.RgpPolicy("allow-all", {
    enforcementLevel: "soft-mandatory",
    policy: `main = rule {
  true
}
`,
});

Create a RgpPolicy Resource

new RgpPolicy(name: string, args: RgpPolicyArgs, opts?: CustomResourceOptions);
@overload
def RgpPolicy(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              enforcement_level: Optional[str] = None,
              name: Optional[str] = None,
              policy: Optional[str] = None)
@overload
def RgpPolicy(resource_name: str,
              args: RgpPolicyArgs,
              opts: Optional[ResourceOptions] = None)
func NewRgpPolicy(ctx *Context, name string, args RgpPolicyArgs, opts ...ResourceOption) (*RgpPolicy, error)
public RgpPolicy(string name, RgpPolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RgpPolicyArgs
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 RgpPolicyArgs
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 RgpPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RgpPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

EnforcementLevel string
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
Policy string
String containing a Sentinel policy
Name string
The name of the policy
EnforcementLevel string
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
Policy string
String containing a Sentinel policy
Name string
The name of the policy
enforcementLevel string
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
policy string
String containing a Sentinel policy
name string
The name of the policy
enforcement_level str
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
policy str
String containing a Sentinel policy
name str
The name of the policy

Outputs

All input properties are implicitly available as output properties. Additionally, the RgpPolicy 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing RgpPolicy Resource

Get an existing RgpPolicy 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?: RgpPolicyState, opts?: CustomResourceOptions): RgpPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enforcement_level: Optional[str] = None,
        name: Optional[str] = None,
        policy: Optional[str] = None) -> RgpPolicy
func GetRgpPolicy(ctx *Context, name string, id IDInput, state *RgpPolicyState, opts ...ResourceOption) (*RgpPolicy, error)
public static RgpPolicy Get(string name, Input<string> id, RgpPolicyState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

EnforcementLevel string
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
Name string
The name of the policy
Policy string
String containing a Sentinel policy
EnforcementLevel string
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
Name string
The name of the policy
Policy string
String containing a Sentinel policy
enforcementLevel string
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
name string
The name of the policy
policy string
String containing a Sentinel policy
enforcement_level str
Enforcement level of Sentinel policy. Can be either advisory or soft-mandatory or hard-mandatory
name str
The name of the policy
policy str
String containing a Sentinel policy

Package Details

Repository
https://github.com/pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.