@spacelift-io/pulumi-spacelift
Version:
A Pulumi package for creating and managing Spacelift resources.
118 lines (117 loc) • 4.64 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* `spacelift.Policy` represents a Spacelift **policy** - a collection of customer-defined rules that are applied by Spacelift at one of the decision points within the application.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fs from "fs";
* import * as spacelift from "@spacelift-io/pulumi-spacelift";
*
* const no_weekend_deploysPolicy = new spacelift.Policy("no-weekend-deploysPolicy", {
* body: fs.readFileSync(`${path.module}/policies/no-weekend-deploys.rego`),
* type: "PLAN",
* });
* const core_infra_production = new spacelift.Stack("core-infra-production", {
* branch: "master",
* repository: "core-infra",
* });
* const no_weekend_deploysPolicyAttachment = new spacelift.PolicyAttachment("no-weekend-deploysPolicyAttachment", {
* policyId: no_weekend_deploysPolicy.id,
* stackId: core_infra_production.id,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import spacelift:index/policy:Policy no-weekend-deploys $POLICY_ID
* ```
*/
export declare class Policy extends pulumi.CustomResource {
/**
* Get an existing Policy 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?: PolicyState, opts?: pulumi.CustomResourceOptions): Policy;
/**
* Returns true if the given object is an instance of Policy. 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 Policy;
/**
* Body of the policy
*/
readonly body: pulumi.Output<string>;
readonly labels: pulumi.Output<string[] | undefined>;
/**
* Name of the policy - should be unique in one account
*/
readonly name: pulumi.Output<string>;
/**
* ID (slug) of the space the policy is in
*/
readonly spaceId: pulumi.Output<string>;
/**
* Type of the policy. Possible values are `ACCESS`, `APPROVAL`, `GIT_PUSH`, `INITIALIZATION`, `LOGIN`, `PLAN`, `TASK`, `TRIGGER` and `NOTIFICATION`. Deprecated values are `STACK_ACCESS` (use `ACCESS` instead), `TASK_RUN` (use `TASK` instead), and `TERRAFORM_PLAN` (use `PLAN` instead).
*/
readonly type: pulumi.Output<string>;
/**
* Create a Policy 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: PolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Policy resources.
*/
export interface PolicyState {
/**
* Body of the policy
*/
body?: pulumi.Input<string>;
labels?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Name of the policy - should be unique in one account
*/
name?: pulumi.Input<string>;
/**
* ID (slug) of the space the policy is in
*/
spaceId?: pulumi.Input<string>;
/**
* Type of the policy. Possible values are `ACCESS`, `APPROVAL`, `GIT_PUSH`, `INITIALIZATION`, `LOGIN`, `PLAN`, `TASK`, `TRIGGER` and `NOTIFICATION`. Deprecated values are `STACK_ACCESS` (use `ACCESS` instead), `TASK_RUN` (use `TASK` instead), and `TERRAFORM_PLAN` (use `PLAN` instead).
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Policy resource.
*/
export interface PolicyArgs {
/**
* Body of the policy
*/
body: pulumi.Input<string>;
labels?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Name of the policy - should be unique in one account
*/
name?: pulumi.Input<string>;
/**
* ID (slug) of the space the policy is in
*/
spaceId?: pulumi.Input<string>;
/**
* Type of the policy. Possible values are `ACCESS`, `APPROVAL`, `GIT_PUSH`, `INITIALIZATION`, `LOGIN`, `PLAN`, `TASK`, `TRIGGER` and `NOTIFICATION`. Deprecated values are `STACK_ACCESS` (use `ACCESS` instead), `TASK_RUN` (use `TASK` instead), and `TERRAFORM_PLAN` (use `PLAN` instead).
*/
type: pulumi.Input<string>;
}