@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
396 lines • 14.3 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckBusinessHours = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a business hours check on a resource within Azure DevOps.
*
* ## 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 exampleCheckBusinessHours = new azuredevops.CheckBusinessHours("example", {
* projectId: example.id,
* displayName: "Managed by Pulumi",
* targetResourceId: exampleServiceEndpointGeneric.id,
* targetResourceType: "endpoint",
* startTime: "07:00",
* endTime: "15:30",
* timeZone: "UTC",
* monday: true,
* tuesday: true,
* timeout: 1440,
* });
* ```
*
* ### 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 exampleCheckBusinessHours = new azuredevops.CheckBusinessHours("example", {
* projectId: example.id,
* displayName: "Managed by Pulumi",
* targetResourceId: exampleEnvironment.id,
* targetResourceType: "environment",
* startTime: "07:00",
* endTime: "15:30",
* timeZone: "UTC",
* monday: true,
* tuesday: true,
* });
* ```
*
* ### Protect an agent queue
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {name: "Example Project"});
* const examplePool = new azuredevops.Pool("example", {name: "example-pool"});
* const exampleQueue = new azuredevops.Queue("example", {
* projectId: example.id,
* agentPoolId: examplePool.id,
* });
* const exampleCheckBusinessHours = new azuredevops.CheckBusinessHours("example", {
* projectId: example.id,
* displayName: "Managed by Pulumi",
* targetResourceId: exampleQueue.id,
* targetResourceType: "queue",
* startTime: "07:00",
* endTime: "15:30",
* timeZone: "UTC",
* monday: true,
* tuesday: true,
* });
* ```
*
* ### Protect a repository
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {name: "Example Project"});
* const exampleGit = new azuredevops.Git("example", {
* projectId: example.id,
* name: "Example Empty Git Repository",
* initialization: {
* initType: "Clean",
* },
* });
* const exampleCheckBusinessHours = new azuredevops.CheckBusinessHours("example", {
* projectId: example.id,
* displayName: "Managed by Pulumi",
* targetResourceId: pulumi.interpolate`${example.id}.${exampleGit.id}`,
* targetResourceType: "repository",
* startTime: "07:00",
* endTime: "15:30",
* timeZone: "UTC",
* monday: true,
* tuesday: true,
* });
* ```
*
* ### Protect a variable group
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {name: "Example Project"});
* const exampleVariableGroup = new azuredevops.VariableGroup("example", {
* projectId: example.id,
* name: "Example Variable Group",
* description: "Example Variable Group Description",
* allowAccess: true,
* variables: [
* {
* name: "key1",
* value: "val1",
* },
* {
* name: "key2",
* secretValue: "val2",
* isSecret: true,
* },
* ],
* });
* const exampleCheckBusinessHours = new azuredevops.CheckBusinessHours("example", {
* projectId: example.id,
* displayName: "Managed by Pulumi",
* targetResourceId: exampleVariableGroup.id,
* targetResourceType: "variablegroup",
* startTime: "07:00",
* endTime: "15:30",
* timeZone: "UTC",
* monday: true,
* tuesday: true,
* });
* ```
*
* ## Relevant Links
*
* - [Define approvals and checks](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass)
*
* ## Supported Time Zones
*
* - AUS Central Standard Time
* - AUS Eastern Standard Time
* - Afghanistan Standard Time
* - Alaskan Standard Time
* - Aleutian Standard Time
* - Altai Standard Time
* - Arab Standard Time
* - Arabian Standard Time
* - Arabic Standard Time
* - Argentina Standard Time
* - Astrakhan Standard Time
* - Atlantic Standard Time
* - Aus Central W. Standard Time
* - Azerbaijan Standard Time
* - Azores Standard Time
* - Bahia Standard Time
* - Bangladesh Standard Time
* - Belarus Standard Time
* - Bougainville Standard Time
* - Canada Central Standard Time
* - Cape Verde Standard Time
* - Caucasus Standard Time
* - Cen. Australia Standard Time
* - Central America Standard Time
* - Central Asia Standard Time
* - Central Brazilian Standard Time
* - Central Europe Standard Time
* - Central European Standard Time
* - Central Pacific Standard Time
* - Central Standard Time (Mexico)
* - Central Standard Time
* - Chatham Islands Standard Time
* - China Standard Time
* - Cuba Standard Time
* - Dateline Standard Time
* - E. Africa Standard Time
* - E. Australia Standard Time
* - E. Europe Standard Time
* - E. South America Standard Time
* - Easter Island Standard Time
* - Eastern Standard Time (Mexico)
* - Eastern Standard Time
* - Egypt Standard Time
* - Ekaterinburg Standard Time
* - FLE Standard Time
* - Fiji Standard Time
* - GMT Standard Time
* - GTB Standard Time
* - Georgian Standard Time
* - Greenland Standard Time
* - Greenwich Standard Time
* - Haiti Standard Time
* - Hawaiian Standard Time
* - India Standard Time
* - Iran Standard Time
* - Israel Standard Time
* - Jordan Standard Time
* - Kaliningrad Standard Time
* - Kamchatka Standard Time
* - Korea Standard Time
* - Libya Standard Time
* - Line Islands Standard Time
* - Lord Howe Standard Time
* - Magadan Standard Time
* - Magallanes Standard Time
* - Marquesas Standard Time
* - Mauritius Standard Time
* - Mid-Atlantic Standard Time
* - Middle East Standard Time
* - Montevideo Standard Time
* - Morocco Standard Time
* - Mountain Standard Time (Mexico)
* - Mountain Standard Time
* - Myanmar Standard Time
* - N. Central Asia Standard Time
* - Namibia Standard Time
* - Nepal Standard Time
* - New Zealand Standard Time
* - Newfoundland Standard Time
* - Norfolk Standard Time
* - North Asia East Standard Time
* - North Asia Standard Time
* - North Korea Standard Time
* - Omsk Standard Time
* - Pacific SA Standard Time
* - Pacific Standard Time (Mexico)
* - Pacific Standard Time
* - Pakistan Standard Time
* - Paraguay Standard Time
* - Qyzylorda Standard Time
* - Romance Standard Time
* - Russia Time Zone 10
* - Russia Time Zone 11
* - Russia Time Zone 3
* - Russian Standard Time
* - SA Eastern Standard Time
* - SA Pacific Standard Time
* - SA Western Standard Time
* - SE Asia Standard Time
* - Saint Pierre Standard Time
* - Sakhalin Standard Time
* - Samoa Standard Time
* - Sao Tome Standard Time
* - Saratov Standard Time
* - Singapore Standard Time
* - South Africa Standard Time
* - South Sudan Standard Time
* - Sri Lanka Standard Time
* - Sudan Standard Time
* - Syria Standard Time
* - Taipei Standard Time
* - Tasmania Standard Time
* - Tocantins Standard Time
* - Tokyo Standard Time
* - Tomsk Standard Time
* - Tonga Standard Time
* - Transbaikal Standard Time
* - Turkey Standard Time
* - Turks And Caicos Standard Time
* - US Eastern Standard Time
* - US Mountain Standard Time
* - UTC
* - UTC+12
* - UTC+13
* - UTC-02
* - UTC-08
* - UTC-09
* - UTC-11
* - Ulaanbaatar Standard Time
* - Venezuela Standard Time
* - Vladivostok Standard Time
* - Volgograd Standard Time
* - W. Australia Standard Time
* - W. Central Africa Standard Time
* - W. Europe Standard Time
* - W. Mongolia Standard Time
* - West Asia Standard Time
* - West Bank Standard Time
* - West Pacific Standard Time
* - Yakutsk Standard Time
* - Yukon Standard Time
*
* ## Import
*
* Importing this resource is not supported.
*/
class CheckBusinessHours extends pulumi.CustomResource {
/**
* Get an existing CheckBusinessHours 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, id, state, opts) {
return new CheckBusinessHours(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CheckBusinessHours. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === CheckBusinessHours.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["endTime"] = state ? state.endTime : undefined;
resourceInputs["friday"] = state ? state.friday : undefined;
resourceInputs["monday"] = state ? state.monday : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["saturday"] = state ? state.saturday : undefined;
resourceInputs["startTime"] = state ? state.startTime : undefined;
resourceInputs["sunday"] = state ? state.sunday : undefined;
resourceInputs["targetResourceId"] = state ? state.targetResourceId : undefined;
resourceInputs["targetResourceType"] = state ? state.targetResourceType : undefined;
resourceInputs["thursday"] = state ? state.thursday : undefined;
resourceInputs["timeZone"] = state ? state.timeZone : undefined;
resourceInputs["timeout"] = state ? state.timeout : undefined;
resourceInputs["tuesday"] = state ? state.tuesday : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["wednesday"] = state ? state.wednesday : undefined;
}
else {
const args = argsOrState;
if ((!args || args.endTime === undefined) && !opts.urn) {
throw new Error("Missing required property 'endTime'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.startTime === undefined) && !opts.urn) {
throw new Error("Missing required property 'startTime'");
}
if ((!args || args.targetResourceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'targetResourceId'");
}
if ((!args || args.targetResourceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'targetResourceType'");
}
if ((!args || args.timeZone === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeZone'");
}
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["endTime"] = args ? args.endTime : undefined;
resourceInputs["friday"] = args ? args.friday : undefined;
resourceInputs["monday"] = args ? args.monday : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["saturday"] = args ? args.saturday : undefined;
resourceInputs["startTime"] = args ? args.startTime : undefined;
resourceInputs["sunday"] = args ? args.sunday : undefined;
resourceInputs["targetResourceId"] = args ? args.targetResourceId : undefined;
resourceInputs["targetResourceType"] = args ? args.targetResourceType : undefined;
resourceInputs["thursday"] = args ? args.thursday : undefined;
resourceInputs["timeZone"] = args ? args.timeZone : undefined;
resourceInputs["timeout"] = args ? args.timeout : undefined;
resourceInputs["tuesday"] = args ? args.tuesday : undefined;
resourceInputs["wednesday"] = args ? args.wednesday : undefined;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CheckBusinessHours.__pulumiType, name, resourceInputs, opts);
}
}
exports.CheckBusinessHours = CheckBusinessHours;
/** @internal */
CheckBusinessHours.__pulumiType = 'azuredevops:index/checkBusinessHours:CheckBusinessHours';
//# sourceMappingURL=checkBusinessHours.js.map