0

Edit a terraform deployment restriction

by
Published Oct 17, 2025

Edit a terraform deployment restriction

Script qovery Verified

The script

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

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

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

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