0

Create a terraform deployment restriction

by
Published Oct 17, 2025

Create a terraform deployment restriction

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Create a terraform deployment restriction
4
 * Create a terraform deployment restriction
5
 */
6
export async function main(
7
	auth: RT.Qovery,
8
	terraformId: string,
9
	body: TerraformDeploymentRestrictionRequest
10
) {
11
	const url = new URL(`https://api.qovery.com/terraform/${terraformId}/deploymentRestriction`)
12

13
	const response = await fetch(url, {
14
		method: 'POST',
15
		headers: {
16
			'Content-Type': 'application/json',
17
			Authorization: 'Token ' + auth.apiKey
18
		},
19
		body: JSON.stringify(body)
20
	})
21
	if (!response.ok) {
22
		const text = await response.text()
23
		throw new Error(`${response.status} ${text}`)
24
	}
25
	return await response.json()
26
}
27

28
/* eslint-disable */
29
/**
30
 * This file was automatically generated by json-schema-to-typescript.
31
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
32
 * and run json-schema-to-typescript to regenerate this file.
33
 */
34

35
export interface TerraformDeploymentRestrictionRequest {
36
	/**
37
	 * Match mode will rebuild app only if specified items are updated. Exclude mode will not rebuild app if specified items are updated.
38
	 */
39
	mode: 'EXCLUDE' | 'MATCH'
40
	type: 'PATH'
41
	/**
42
	 * ‘For `PATH` restrictions, the value must not start with `/`’
43
	 */
44
	value: string
45
	[k: string]: unknown
46
}
47