vault.EgpPolicy
Explore with Pulumi AI
Provides a resource to manage Endpoint Governing Policy (EGP) via Sentinel.
Note this feature is available only with Vault Enterprise.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var allow_all = new Vault.EgpPolicy("allow-all", new()
{
EnforcementLevel = "soft-mandatory",
Paths = new[]
{
"*",
},
Policy = @"main = rule {
true
}
",
});
});
package main
import (
"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.NewEgpPolicy(ctx, "allow-all", &vault.EgpPolicyArgs{
EnforcementLevel: pulumi.String("soft-mandatory"),
Paths: pulumi.StringArray{
pulumi.String("*"),
},
Policy: pulumi.String("main = rule {\n true\n}\n\n"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.EgpPolicy;
import com.pulumi.vault.EgpPolicyArgs;
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 allow_all = new EgpPolicy("allow-all", EgpPolicyArgs.builder()
.enforcementLevel("soft-mandatory")
.paths("*")
.policy("""
main = rule {
true
}
""")
.build());
}
}
import pulumi
import pulumi_vault as vault
allow_all = vault.EgpPolicy("allow-all",
enforcement_level="soft-mandatory",
paths=["*"],
policy="""main = rule {
true
}
""")
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const allow_all = new vault.EgpPolicy("allow-all", {
enforcementLevel: "soft-mandatory",
paths: ["*"],
policy: `main = rule {
true
}
`,
});
resources:
allow-all:
type: vault:EgpPolicy
properties:
enforcementLevel: soft-mandatory
paths:
- '*'
policy: |+
main = rule {
true
}
Create EgpPolicy Resource
new EgpPolicy(name: string, args: EgpPolicyArgs, opts?: CustomResourceOptions);
@overload
def EgpPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
enforcement_level: Optional[str] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
paths: Optional[Sequence[str]] = None,
policy: Optional[str] = None)
@overload
def EgpPolicy(resource_name: str,
args: EgpPolicyArgs,
opts: Optional[ResourceOptions] = None)
func NewEgpPolicy(ctx *Context, name string, args EgpPolicyArgs, opts ...ResourceOption) (*EgpPolicy, error)
public EgpPolicy(string name, EgpPolicyArgs args, CustomResourceOptions? opts = null)
public EgpPolicy(String name, EgpPolicyArgs args)
public EgpPolicy(String name, EgpPolicyArgs args, CustomResourceOptions options)
type: vault:EgpPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EgpPolicyArgs
- 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 EgpPolicyArgs
- 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 EgpPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EgpPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EgpPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
EgpPolicy 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 EgpPolicy resource accepts the following input properties:
- Enforcement
Level string Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- Paths List<string>
List of paths to which the policy will be applied to
- Policy string
String containing a Sentinel policy
- Name string
The name of the policy
- Namespace string
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.
- Enforcement
Level string Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- Paths []string
List of paths to which the policy will be applied to
- Policy string
String containing a Sentinel policy
- Name string
The name of the policy
- Namespace string
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.
- enforcement
Level String Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- paths List<String>
List of paths to which the policy will be applied to
- policy String
String containing a Sentinel policy
- name String
The name of the policy
- namespace String
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.
- enforcement
Level string Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- paths string[]
List of paths to which the policy will be applied to
- policy string
String containing a Sentinel policy
- name string
The name of the policy
- namespace string
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.
- enforcement_
level str Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- paths Sequence[str]
List of paths to which the policy will be applied to
- policy str
String containing a Sentinel policy
- name str
The name of the policy
- namespace str
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.
- enforcement
Level String Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- paths List<String>
List of paths to which the policy will be applied to
- policy String
String containing a Sentinel policy
- name String
The name of the policy
- namespace String
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.
Outputs
All input properties are implicitly available as output properties. Additionally, the EgpPolicy 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 EgpPolicy Resource
Get an existing EgpPolicy 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?: EgpPolicyState, opts?: CustomResourceOptions): EgpPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
enforcement_level: Optional[str] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
paths: Optional[Sequence[str]] = None,
policy: Optional[str] = None) -> EgpPolicy
func GetEgpPolicy(ctx *Context, name string, id IDInput, state *EgpPolicyState, opts ...ResourceOption) (*EgpPolicy, error)
public static EgpPolicy Get(string name, Input<string> id, EgpPolicyState? state, CustomResourceOptions? opts = null)
public static EgpPolicy get(String name, Output<String> id, EgpPolicyState 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.
- Enforcement
Level string Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- Name string
The name of the policy
- Namespace string
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.- Paths List<string>
List of paths to which the policy will be applied to
- Policy string
String containing a Sentinel policy
- Enforcement
Level string Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- Name string
The name of the policy
- Namespace string
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.- Paths []string
List of paths to which the policy will be applied to
- Policy string
String containing a Sentinel policy
- enforcement
Level String Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- name String
The name of the policy
- namespace String
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.- paths List<String>
List of paths to which the policy will be applied to
- policy String
String containing a Sentinel policy
- enforcement
Level string Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- name string
The name of the policy
- namespace string
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.- paths string[]
List of paths to which the policy will be applied to
- policy string
String containing a Sentinel policy
- enforcement_
level str Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- name str
The name of the policy
- namespace str
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.- paths Sequence[str]
List of paths to which the policy will be applied to
- policy str
String containing a Sentinel policy
- enforcement
Level String Enforcement level of Sentinel policy. Can be either
advisory
orsoft-mandatory
orhard-mandatory
- name String
The name of the policy
- namespace String
The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The
namespace
is always relative to the provider's configured namespace. Available only for Vault Enterprise.- paths List<String>
List of paths to which the policy will be applied to
- policy String
String containing a Sentinel policy
Package Details
- Repository
- Vault pulumi/pulumi-vault
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
vault
Terraform Provider.