UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

162 lines (161 loc) 6.54 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Manages a Required Template Check. * * ## Example Usage * * ### Protect a service connection * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", {name: "Example Project"}); * const exampleServiceEndpointGeneric = new azuredevops.ServiceEndpointGeneric("example", { * projectId: example.id, * serverUrl: "https://some-server.example.com", * username: "username", * password: "password", * serviceEndpointName: "Example Generic", * description: "Managed by Pulumi", * }); * const exampleCheckRequiredTemplate = new azuredevops.CheckRequiredTemplate("example", { * projectId: example.id, * targetResourceId: exampleServiceEndpointGeneric.id, * targetResourceType: "endpoint", * requiredTemplates: [{ * repositoryType: "azuregit", * repositoryName: "project/repository", * repositoryRef: "refs/heads/main", * templatePath: "template/path.yml", * }], * }); * ``` * * ### Protect an environment * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", {name: "Example Project"}); * const exampleEnvironment = new azuredevops.Environment("example", { * projectId: example.id, * name: "Example Environment", * }); * const exampleCheckRequiredTemplate = new azuredevops.CheckRequiredTemplate("example", { * projectId: example.id, * targetResourceId: exampleEnvironment.id, * targetResourceType: "environment", * requiredTemplates: [ * { * repositoryName: "project/repository", * repositoryRef: "refs/heads/main", * templatePath: "template/path.yml", * }, * { * repositoryName: "project/repository", * repositoryRef: "refs/heads/main", * templatePath: "template/alternate-path.yml", * }, * ], * }); * ``` * * ## Import * * Importing this resource is not supported. */ export declare class CheckRequiredTemplate extends pulumi.CustomResource { /** * Get an existing CheckRequiredTemplate 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?: CheckRequiredTemplateState, opts?: pulumi.CustomResourceOptions): CheckRequiredTemplate; /** * Returns true if the given object is an instance of CheckRequiredTemplate. 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 CheckRequiredTemplate; /** * The project ID. Changing this forces a new Required Template Check to be created. */ readonly projectId: pulumi.Output<string>; /** * One or more `requiredTemplate` blocks documented below. */ readonly requiredTemplates: pulumi.Output<outputs.CheckRequiredTemplateRequiredTemplate[]>; /** * The ID of the resource being protected by the check. Changing this forces a new Required Template Check to be created. */ readonly targetResourceId: pulumi.Output<string>; /** * The type of resource being protected by the check. Valid values: `endpoint`, `environment`, `queue`, `repository`, `securefile`, `variablegroup`. Changing this forces a new Required Template Check to be created. */ readonly targetResourceType: pulumi.Output<string>; /** * The version of the check. */ readonly version: pulumi.Output<number>; /** * Create a CheckRequiredTemplate 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: CheckRequiredTemplateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CheckRequiredTemplate resources. */ export interface CheckRequiredTemplateState { /** * The project ID. Changing this forces a new Required Template Check to be created. */ projectId?: pulumi.Input<string>; /** * One or more `requiredTemplate` blocks documented below. */ requiredTemplates?: pulumi.Input<pulumi.Input<inputs.CheckRequiredTemplateRequiredTemplate>[]>; /** * The ID of the resource being protected by the check. Changing this forces a new Required Template Check to be created. */ targetResourceId?: pulumi.Input<string>; /** * The type of resource being protected by the check. Valid values: `endpoint`, `environment`, `queue`, `repository`, `securefile`, `variablegroup`. Changing this forces a new Required Template Check to be created. */ targetResourceType?: pulumi.Input<string>; /** * The version of the check. */ version?: pulumi.Input<number>; } /** * The set of arguments for constructing a CheckRequiredTemplate resource. */ export interface CheckRequiredTemplateArgs { /** * The project ID. Changing this forces a new Required Template Check to be created. */ projectId: pulumi.Input<string>; /** * One or more `requiredTemplate` blocks documented below. */ requiredTemplates: pulumi.Input<pulumi.Input<inputs.CheckRequiredTemplateRequiredTemplate>[]>; /** * The ID of the resource being protected by the check. Changing this forces a new Required Template Check to be created. */ targetResourceId: pulumi.Input<string>; /** * The type of resource being protected by the check. Valid values: `endpoint`, `environment`, `queue`, `repository`, `securefile`, `variablegroup`. Changing this forces a new Required Template Check to be created. */ targetResourceType: pulumi.Input<string>; }