@pulumi/nomad
Version:
A Pulumi package for creating and managing nomad cloud resources.
140 lines (139 loc) • 5.02 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a Sentinel policy registered in Nomad.
*
* > **Enterprise Only!** This API endpoint and functionality only exists in
* Nomad Enterprise. This is not present in the open source version of Nomad.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as nomad from "@pulumi/nomad";
*
* const exec_only = new nomad.SentinelPolicy("exec-only", {
* name: "exec-only",
* description: "Only allow jobs that are based on an exec driver.",
* policy: `main = rule { all_drivers_exec }
*
* # all_drivers_exec checks that all the drivers in use are exec
* all_drivers_exec = rule {
* all job.task_groups as tg {
* all tg.tasks as task {
* task.driver is "exec"
* }
* }
* }
* `,
* scope: "submit-job",
* enforcementLevel: "soft-mandatory",
* });
* ```
*/
export declare class SentinelPolicy extends pulumi.CustomResource {
/**
* Get an existing SentinelPolicy resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SentinelPolicyState, opts?: pulumi.CustomResourceOptions): SentinelPolicy;
/**
* Returns true if the given object is an instance of SentinelPolicy. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is SentinelPolicy;
/**
* `(string: "")` - A description of the policy.
*
* [scope]: https://www.nomadproject.io/guides/sentinel-policy.html#policy-scope
* [enforcement-level]: https://www.nomadproject.io/guides/sentinel-policy.html#enforcement-level
*/
readonly description: pulumi.Output<string | undefined>;
/**
* `(strings: <required>)` - The [enforcement level][enforcement-level]
* for this policy.
*/
readonly enforcementLevel: pulumi.Output<string>;
/**
* `(string: <required>)` - A unique name for the policy.
*/
readonly name: pulumi.Output<string>;
/**
* `(string: <required>)` - The contents of the policy to register.
*/
readonly policy: pulumi.Output<string>;
/**
* `(strings: <required>)` - The [scope][scope] for this policy.
*/
readonly scope: pulumi.Output<string>;
/**
* Create a SentinelPolicy resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: SentinelPolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering SentinelPolicy resources.
*/
export interface SentinelPolicyState {
/**
* `(string: "")` - A description of the policy.
*
* [scope]: https://www.nomadproject.io/guides/sentinel-policy.html#policy-scope
* [enforcement-level]: https://www.nomadproject.io/guides/sentinel-policy.html#enforcement-level
*/
description?: pulumi.Input<string>;
/**
* `(strings: <required>)` - The [enforcement level][enforcement-level]
* for this policy.
*/
enforcementLevel?: pulumi.Input<string>;
/**
* `(string: <required>)` - A unique name for the policy.
*/
name?: pulumi.Input<string>;
/**
* `(string: <required>)` - The contents of the policy to register.
*/
policy?: pulumi.Input<string>;
/**
* `(strings: <required>)` - The [scope][scope] for this policy.
*/
scope?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a SentinelPolicy resource.
*/
export interface SentinelPolicyArgs {
/**
* `(string: "")` - A description of the policy.
*
* [scope]: https://www.nomadproject.io/guides/sentinel-policy.html#policy-scope
* [enforcement-level]: https://www.nomadproject.io/guides/sentinel-policy.html#enforcement-level
*/
description?: pulumi.Input<string>;
/**
* `(strings: <required>)` - The [enforcement level][enforcement-level]
* for this policy.
*/
enforcementLevel: pulumi.Input<string>;
/**
* `(string: <required>)` - A unique name for the policy.
*/
name?: pulumi.Input<string>;
/**
* `(string: <required>)` - The contents of the policy to register.
*/
policy: pulumi.Input<string>;
/**
* `(strings: <required>)` - The [scope][scope] for this policy.
*/
scope: pulumi.Input<string>;
}