@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
156 lines (155 loc) • 6.12 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* This resource allows you to create and manage environment deployment branch policies for a GitHub repository.
*
* ## Example Usage
*
* Create a branch-based deployment policy:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const current = github.getUser({
* username: "",
* });
* const test = new github.Repository("test", {name: "tf-acc-test-%s"});
* const testRepositoryEnvironment = new github.RepositoryEnvironment("test", {
* repository: test.name,
* environment: "environment/test",
* waitTimer: 10000,
* reviewers: [{
* users: [current.then(current => current.id)],
* }],
* deploymentBranchPolicy: {
* protectedBranches: false,
* customBranchPolicies: true,
* },
* });
* const testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy("test", {
* repository: test.name,
* environment: testRepositoryEnvironment.environment,
* branchPattern: "releases/*",
* });
* ```
*
* Create a tag-based deployment policy:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const current = github.getUser({
* username: "",
* });
* const test = new github.Repository("test", {name: "tf-acc-test-%s"});
* const testRepositoryEnvironment = new github.RepositoryEnvironment("test", {
* repository: test.name,
* environment: "environment/test",
* waitTimer: 10000,
* reviewers: [{
* users: [current.then(current => current.id)],
* }],
* deploymentBranchPolicy: {
* protectedBranches: false,
* customBranchPolicies: true,
* },
* });
* const testRepositoryEnvironmentDeploymentPolicy = new github.RepositoryEnvironmentDeploymentPolicy("test", {
* repository: test.name,
* environment: testRepositoryEnvironment.environment,
* tagPattern: "v*",
* });
* ```
*
* ## Import
*
* GitHub Repository Environment Deployment Policy can be imported using an ID made up of `name` of the repository combined with the `environment` name of the environment with the `Id` of the deployment policy, separated by a `:` character, e.g.
*
* ```sh
* $ pulumi import github:index/repositoryEnvironmentDeploymentPolicy:RepositoryEnvironmentDeploymentPolicy daily terraform:daily:123456
* ```
*/
export declare class RepositoryEnvironmentDeploymentPolicy extends pulumi.CustomResource {
/**
* Get an existing RepositoryEnvironmentDeploymentPolicy 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?: RepositoryEnvironmentDeploymentPolicyState, opts?: pulumi.CustomResourceOptions): RepositoryEnvironmentDeploymentPolicy;
/**
* Returns true if the given object is an instance of RepositoryEnvironmentDeploymentPolicy. 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 RepositoryEnvironmentDeploymentPolicy;
/**
* The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified.
*/
readonly branchPattern: pulumi.Output<string | undefined>;
/**
* The name of the environment.
*/
readonly environment: pulumi.Output<string>;
/**
* The repository of the environment.
*/
readonly repository: pulumi.Output<string>;
/**
* The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified.
*/
readonly tagPattern: pulumi.Output<string | undefined>;
/**
* Create a RepositoryEnvironmentDeploymentPolicy 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: RepositoryEnvironmentDeploymentPolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RepositoryEnvironmentDeploymentPolicy resources.
*/
export interface RepositoryEnvironmentDeploymentPolicyState {
/**
* The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified.
*/
branchPattern?: pulumi.Input<string>;
/**
* The name of the environment.
*/
environment?: pulumi.Input<string>;
/**
* The repository of the environment.
*/
repository?: pulumi.Input<string>;
/**
* The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified.
*/
tagPattern?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a RepositoryEnvironmentDeploymentPolicy resource.
*/
export interface RepositoryEnvironmentDeploymentPolicyArgs {
/**
* The name pattern that branches must match in order to deploy to the environment. If not specified, `tagPattern` must be specified.
*/
branchPattern?: pulumi.Input<string>;
/**
* The name of the environment.
*/
environment: pulumi.Input<string>;
/**
* The repository of the environment.
*/
repository: pulumi.Input<string>;
/**
* The name pattern that tags must match in order to deploy to the environment. If not specified, `branchPattern` must be specified.
*/
tagPattern?: pulumi.Input<string>;
}