@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
163 lines (162 loc) • 6.34 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manage a max file size repository policy within Azure DevOps project.
*
* > If both project and project policy are enabled, the repository policy has high priority.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* visibility: "private",
* versionControl: "Git",
* workItemTemplate: "Agile",
* description: "Managed by Pulumi",
* });
* const exampleGit = new azuredevops.Git("example", {
* projectId: example.id,
* name: "Example Repository",
* initialization: {
* initType: "Clean",
* },
* });
* const exampleRepositoryPolicyMaxFileSize = new azuredevops.RepositoryPolicyMaxFileSize("example", {
* projectId: example.id,
* enabled: true,
* blocking: true,
* maxFileSize: 1,
* repositoryIds: [exampleGit.id],
* });
* ```
*
* # Set project level repository policy
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* visibility: "private",
* versionControl: "Git",
* workItemTemplate: "Agile",
* description: "Managed by Pulumi",
* });
* const exampleRepositoryPolicyMaxFileSize = new azuredevops.RepositoryPolicyMaxFileSize("example", {
* projectId: example.id,
* enabled: true,
* blocking: true,
* maxFileSize: 1,
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Policy Configurations](https://docs.microsoft.com/en-us/rest/api/azure/devops/policy/configurations?view=azure-devops-rest-7.0)
*
* ## Import
*
* Azure DevOps repository policies can be imported using the projectID/policyID or projectName/policyID:
*
* ```sh
* $ pulumi import azuredevops:index/repositoryPolicyMaxFileSize:RepositoryPolicyMaxFileSize example 00000000-0000-0000-0000-000000000000/0
* ```
*/
export declare class RepositoryPolicyMaxFileSize extends pulumi.CustomResource {
/**
* Get an existing RepositoryPolicyMaxFileSize 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?: RepositoryPolicyMaxFileSizeState, opts?: pulumi.CustomResourceOptions): RepositoryPolicyMaxFileSize;
/**
* Returns true if the given object is an instance of RepositoryPolicyMaxFileSize. 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 RepositoryPolicyMaxFileSize;
/**
* A flag indicating if the policy should be blocking. Defaults to `true`.
*/
readonly blocking: pulumi.Output<boolean | undefined>;
/**
* A flag indicating if the policy should be enabled. Defaults to `true`.
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* Block pushes that contain new or updated files larger than this limit. Possible values are: `1, 2, 5, 10, 50, 100, 200` (MB).
*/
readonly maxFileSize: pulumi.Output<number>;
/**
* The ID of the project in which the policy will be created.
*/
readonly projectId: pulumi.Output<string>;
/**
* Control whether the policy is enabled for the repository or the project. If `repositoryIds` not configured, the policy will be set to the project.
*/
readonly repositoryIds: pulumi.Output<string[] | undefined>;
/**
* Create a RepositoryPolicyMaxFileSize 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: RepositoryPolicyMaxFileSizeArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RepositoryPolicyMaxFileSize resources.
*/
export interface RepositoryPolicyMaxFileSizeState {
/**
* A flag indicating if the policy should be blocking. Defaults to `true`.
*/
blocking?: pulumi.Input<boolean>;
/**
* A flag indicating if the policy should be enabled. Defaults to `true`.
*/
enabled?: pulumi.Input<boolean>;
/**
* Block pushes that contain new or updated files larger than this limit. Possible values are: `1, 2, 5, 10, 50, 100, 200` (MB).
*/
maxFileSize?: pulumi.Input<number>;
/**
* The ID of the project in which the policy will be created.
*/
projectId?: pulumi.Input<string>;
/**
* Control whether the policy is enabled for the repository or the project. If `repositoryIds` not configured, the policy will be set to the project.
*/
repositoryIds?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a RepositoryPolicyMaxFileSize resource.
*/
export interface RepositoryPolicyMaxFileSizeArgs {
/**
* A flag indicating if the policy should be blocking. Defaults to `true`.
*/
blocking?: pulumi.Input<boolean>;
/**
* A flag indicating if the policy should be enabled. Defaults to `true`.
*/
enabled?: pulumi.Input<boolean>;
/**
* Block pushes that contain new or updated files larger than this limit. Possible values are: `1, 2, 5, 10, 50, 100, 200` (MB).
*/
maxFileSize: pulumi.Input<number>;
/**
* The ID of the project in which the policy will be created.
*/
projectId: pulumi.Input<string>;
/**
* Control whether the policy is enabled for the repository or the project. If `repositoryIds` not configured, the policy will be set to the project.
*/
repositoryIds?: pulumi.Input<pulumi.Input<string>[]>;
}