pulumi-gitlab 9.7.0__py3-none-any.whl → 9.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,837 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import builtins as _builtins
6
+ import warnings
7
+ import sys
8
+ import pulumi
9
+ import pulumi.runtime
10
+ from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
15
+ from . import _utilities
16
+
17
+ __all__ = ['ProjectPullMirrorArgs', 'ProjectPullMirror']
18
+
19
+ @pulumi.input_type
20
+ class ProjectPullMirrorArgs:
21
+ def __init__(__self__, *,
22
+ project: pulumi.Input[_builtins.str],
23
+ url: pulumi.Input[_builtins.str],
24
+ auth_password: Optional[pulumi.Input[_builtins.str]] = None,
25
+ auth_user: Optional[pulumi.Input[_builtins.str]] = None,
26
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
27
+ mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
28
+ mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
29
+ mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
30
+ only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None):
31
+ """
32
+ The set of arguments for constructing a ProjectPullMirror resource.
33
+ :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
34
+ :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
35
+ :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
36
+ :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
37
+ :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
38
+ :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
39
+ :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
40
+ :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
41
+ :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
42
+ """
43
+ pulumi.set(__self__, "project", project)
44
+ pulumi.set(__self__, "url", url)
45
+ if auth_password is not None:
46
+ pulumi.set(__self__, "auth_password", auth_password)
47
+ if auth_user is not None:
48
+ pulumi.set(__self__, "auth_user", auth_user)
49
+ if enabled is not None:
50
+ pulumi.set(__self__, "enabled", enabled)
51
+ if mirror_branch_regex is not None:
52
+ pulumi.set(__self__, "mirror_branch_regex", mirror_branch_regex)
53
+ if mirror_overwrites_diverged_branches is not None:
54
+ pulumi.set(__self__, "mirror_overwrites_diverged_branches", mirror_overwrites_diverged_branches)
55
+ if mirror_trigger_builds is not None:
56
+ pulumi.set(__self__, "mirror_trigger_builds", mirror_trigger_builds)
57
+ if only_mirror_protected_branches is not None:
58
+ pulumi.set(__self__, "only_mirror_protected_branches", only_mirror_protected_branches)
59
+
60
+ @_builtins.property
61
+ @pulumi.getter
62
+ def project(self) -> pulumi.Input[_builtins.str]:
63
+ """
64
+ The ID or URL-encoded path of the project owned by the authenticated user.
65
+ """
66
+ return pulumi.get(self, "project")
67
+
68
+ @project.setter
69
+ def project(self, value: pulumi.Input[_builtins.str]):
70
+ pulumi.set(self, "project", value)
71
+
72
+ @_builtins.property
73
+ @pulumi.getter
74
+ def url(self) -> pulumi.Input[_builtins.str]:
75
+ """
76
+ The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
77
+ """
78
+ return pulumi.get(self, "url")
79
+
80
+ @url.setter
81
+ def url(self, value: pulumi.Input[_builtins.str]):
82
+ pulumi.set(self, "url", value)
83
+
84
+ @_builtins.property
85
+ @pulumi.getter(name="authPassword")
86
+ def auth_password(self) -> Optional[pulumi.Input[_builtins.str]]:
87
+ """
88
+ Authentication password or token for the remote repository.
89
+ """
90
+ return pulumi.get(self, "auth_password")
91
+
92
+ @auth_password.setter
93
+ def auth_password(self, value: Optional[pulumi.Input[_builtins.str]]):
94
+ pulumi.set(self, "auth_password", value)
95
+
96
+ @_builtins.property
97
+ @pulumi.getter(name="authUser")
98
+ def auth_user(self) -> Optional[pulumi.Input[_builtins.str]]:
99
+ """
100
+ Authentication username for the remote repository.
101
+ """
102
+ return pulumi.get(self, "auth_user")
103
+
104
+ @auth_user.setter
105
+ def auth_user(self, value: Optional[pulumi.Input[_builtins.str]]):
106
+ pulumi.set(self, "auth_user", value)
107
+
108
+ @_builtins.property
109
+ @pulumi.getter
110
+ def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
111
+ """
112
+ Enable or disable the pull mirror. Defaults to `true`.
113
+ """
114
+ return pulumi.get(self, "enabled")
115
+
116
+ @enabled.setter
117
+ def enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
118
+ pulumi.set(self, "enabled", value)
119
+
120
+ @_builtins.property
121
+ @pulumi.getter(name="mirrorBranchRegex")
122
+ def mirror_branch_regex(self) -> Optional[pulumi.Input[_builtins.str]]:
123
+ """
124
+ Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
125
+ """
126
+ return pulumi.get(self, "mirror_branch_regex")
127
+
128
+ @mirror_branch_regex.setter
129
+ def mirror_branch_regex(self, value: Optional[pulumi.Input[_builtins.str]]):
130
+ pulumi.set(self, "mirror_branch_regex", value)
131
+
132
+ @_builtins.property
133
+ @pulumi.getter(name="mirrorOverwritesDivergedBranches")
134
+ def mirror_overwrites_diverged_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
135
+ """
136
+ Overwrite diverged branches on the target project.
137
+ """
138
+ return pulumi.get(self, "mirror_overwrites_diverged_branches")
139
+
140
+ @mirror_overwrites_diverged_branches.setter
141
+ def mirror_overwrites_diverged_branches(self, value: Optional[pulumi.Input[_builtins.bool]]):
142
+ pulumi.set(self, "mirror_overwrites_diverged_branches", value)
143
+
144
+ @_builtins.property
145
+ @pulumi.getter(name="mirrorTriggerBuilds")
146
+ def mirror_trigger_builds(self) -> Optional[pulumi.Input[_builtins.bool]]:
147
+ """
148
+ Trigger CI/CD pipelines when the mirror updates.
149
+ """
150
+ return pulumi.get(self, "mirror_trigger_builds")
151
+
152
+ @mirror_trigger_builds.setter
153
+ def mirror_trigger_builds(self, value: Optional[pulumi.Input[_builtins.bool]]):
154
+ pulumi.set(self, "mirror_trigger_builds", value)
155
+
156
+ @_builtins.property
157
+ @pulumi.getter(name="onlyMirrorProtectedBranches")
158
+ def only_mirror_protected_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
159
+ """
160
+ Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
161
+ """
162
+ return pulumi.get(self, "only_mirror_protected_branches")
163
+
164
+ @only_mirror_protected_branches.setter
165
+ def only_mirror_protected_branches(self, value: Optional[pulumi.Input[_builtins.bool]]):
166
+ pulumi.set(self, "only_mirror_protected_branches", value)
167
+
168
+
169
+ @pulumi.input_type
170
+ class _ProjectPullMirrorState:
171
+ def __init__(__self__, *,
172
+ auth_password: Optional[pulumi.Input[_builtins.str]] = None,
173
+ auth_user: Optional[pulumi.Input[_builtins.str]] = None,
174
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
175
+ last_error: Optional[pulumi.Input[_builtins.str]] = None,
176
+ last_successful_update_at: Optional[pulumi.Input[_builtins.str]] = None,
177
+ last_update_at: Optional[pulumi.Input[_builtins.str]] = None,
178
+ last_update_started_at: Optional[pulumi.Input[_builtins.str]] = None,
179
+ mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
180
+ mirror_id: Optional[pulumi.Input[_builtins.int]] = None,
181
+ mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
182
+ mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
183
+ only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
184
+ project: Optional[pulumi.Input[_builtins.str]] = None,
185
+ update_status: Optional[pulumi.Input[_builtins.str]] = None,
186
+ url: Optional[pulumi.Input[_builtins.str]] = None):
187
+ """
188
+ Input properties used for looking up and filtering ProjectPullMirror resources.
189
+ :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
190
+ :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
191
+ :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
192
+ :param pulumi.Input[_builtins.str] last_error: Last error message from the mirror operation.
193
+ :param pulumi.Input[_builtins.str] last_successful_update_at: Timestamp of the last successful mirror update.
194
+ :param pulumi.Input[_builtins.str] last_update_at: Timestamp of the last mirror update attempt.
195
+ :param pulumi.Input[_builtins.str] last_update_started_at: Timestamp when the last mirror update started.
196
+ :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
197
+ :param pulumi.Input[_builtins.int] mirror_id: The ID of the pull mirror. This ID is set by GitLab.
198
+ :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
199
+ :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
200
+ :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
201
+ :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
202
+ :param pulumi.Input[_builtins.str] update_status: Current status of the mirror update.
203
+ :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
204
+ """
205
+ if auth_password is not None:
206
+ pulumi.set(__self__, "auth_password", auth_password)
207
+ if auth_user is not None:
208
+ pulumi.set(__self__, "auth_user", auth_user)
209
+ if enabled is not None:
210
+ pulumi.set(__self__, "enabled", enabled)
211
+ if last_error is not None:
212
+ pulumi.set(__self__, "last_error", last_error)
213
+ if last_successful_update_at is not None:
214
+ pulumi.set(__self__, "last_successful_update_at", last_successful_update_at)
215
+ if last_update_at is not None:
216
+ pulumi.set(__self__, "last_update_at", last_update_at)
217
+ if last_update_started_at is not None:
218
+ pulumi.set(__self__, "last_update_started_at", last_update_started_at)
219
+ if mirror_branch_regex is not None:
220
+ pulumi.set(__self__, "mirror_branch_regex", mirror_branch_regex)
221
+ if mirror_id is not None:
222
+ pulumi.set(__self__, "mirror_id", mirror_id)
223
+ if mirror_overwrites_diverged_branches is not None:
224
+ pulumi.set(__self__, "mirror_overwrites_diverged_branches", mirror_overwrites_diverged_branches)
225
+ if mirror_trigger_builds is not None:
226
+ pulumi.set(__self__, "mirror_trigger_builds", mirror_trigger_builds)
227
+ if only_mirror_protected_branches is not None:
228
+ pulumi.set(__self__, "only_mirror_protected_branches", only_mirror_protected_branches)
229
+ if project is not None:
230
+ pulumi.set(__self__, "project", project)
231
+ if update_status is not None:
232
+ pulumi.set(__self__, "update_status", update_status)
233
+ if url is not None:
234
+ pulumi.set(__self__, "url", url)
235
+
236
+ @_builtins.property
237
+ @pulumi.getter(name="authPassword")
238
+ def auth_password(self) -> Optional[pulumi.Input[_builtins.str]]:
239
+ """
240
+ Authentication password or token for the remote repository.
241
+ """
242
+ return pulumi.get(self, "auth_password")
243
+
244
+ @auth_password.setter
245
+ def auth_password(self, value: Optional[pulumi.Input[_builtins.str]]):
246
+ pulumi.set(self, "auth_password", value)
247
+
248
+ @_builtins.property
249
+ @pulumi.getter(name="authUser")
250
+ def auth_user(self) -> Optional[pulumi.Input[_builtins.str]]:
251
+ """
252
+ Authentication username for the remote repository.
253
+ """
254
+ return pulumi.get(self, "auth_user")
255
+
256
+ @auth_user.setter
257
+ def auth_user(self, value: Optional[pulumi.Input[_builtins.str]]):
258
+ pulumi.set(self, "auth_user", value)
259
+
260
+ @_builtins.property
261
+ @pulumi.getter
262
+ def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
263
+ """
264
+ Enable or disable the pull mirror. Defaults to `true`.
265
+ """
266
+ return pulumi.get(self, "enabled")
267
+
268
+ @enabled.setter
269
+ def enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
270
+ pulumi.set(self, "enabled", value)
271
+
272
+ @_builtins.property
273
+ @pulumi.getter(name="lastError")
274
+ def last_error(self) -> Optional[pulumi.Input[_builtins.str]]:
275
+ """
276
+ Last error message from the mirror operation.
277
+ """
278
+ return pulumi.get(self, "last_error")
279
+
280
+ @last_error.setter
281
+ def last_error(self, value: Optional[pulumi.Input[_builtins.str]]):
282
+ pulumi.set(self, "last_error", value)
283
+
284
+ @_builtins.property
285
+ @pulumi.getter(name="lastSuccessfulUpdateAt")
286
+ def last_successful_update_at(self) -> Optional[pulumi.Input[_builtins.str]]:
287
+ """
288
+ Timestamp of the last successful mirror update.
289
+ """
290
+ return pulumi.get(self, "last_successful_update_at")
291
+
292
+ @last_successful_update_at.setter
293
+ def last_successful_update_at(self, value: Optional[pulumi.Input[_builtins.str]]):
294
+ pulumi.set(self, "last_successful_update_at", value)
295
+
296
+ @_builtins.property
297
+ @pulumi.getter(name="lastUpdateAt")
298
+ def last_update_at(self) -> Optional[pulumi.Input[_builtins.str]]:
299
+ """
300
+ Timestamp of the last mirror update attempt.
301
+ """
302
+ return pulumi.get(self, "last_update_at")
303
+
304
+ @last_update_at.setter
305
+ def last_update_at(self, value: Optional[pulumi.Input[_builtins.str]]):
306
+ pulumi.set(self, "last_update_at", value)
307
+
308
+ @_builtins.property
309
+ @pulumi.getter(name="lastUpdateStartedAt")
310
+ def last_update_started_at(self) -> Optional[pulumi.Input[_builtins.str]]:
311
+ """
312
+ Timestamp when the last mirror update started.
313
+ """
314
+ return pulumi.get(self, "last_update_started_at")
315
+
316
+ @last_update_started_at.setter
317
+ def last_update_started_at(self, value: Optional[pulumi.Input[_builtins.str]]):
318
+ pulumi.set(self, "last_update_started_at", value)
319
+
320
+ @_builtins.property
321
+ @pulumi.getter(name="mirrorBranchRegex")
322
+ def mirror_branch_regex(self) -> Optional[pulumi.Input[_builtins.str]]:
323
+ """
324
+ Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
325
+ """
326
+ return pulumi.get(self, "mirror_branch_regex")
327
+
328
+ @mirror_branch_regex.setter
329
+ def mirror_branch_regex(self, value: Optional[pulumi.Input[_builtins.str]]):
330
+ pulumi.set(self, "mirror_branch_regex", value)
331
+
332
+ @_builtins.property
333
+ @pulumi.getter(name="mirrorId")
334
+ def mirror_id(self) -> Optional[pulumi.Input[_builtins.int]]:
335
+ """
336
+ The ID of the pull mirror. This ID is set by GitLab.
337
+ """
338
+ return pulumi.get(self, "mirror_id")
339
+
340
+ @mirror_id.setter
341
+ def mirror_id(self, value: Optional[pulumi.Input[_builtins.int]]):
342
+ pulumi.set(self, "mirror_id", value)
343
+
344
+ @_builtins.property
345
+ @pulumi.getter(name="mirrorOverwritesDivergedBranches")
346
+ def mirror_overwrites_diverged_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
347
+ """
348
+ Overwrite diverged branches on the target project.
349
+ """
350
+ return pulumi.get(self, "mirror_overwrites_diverged_branches")
351
+
352
+ @mirror_overwrites_diverged_branches.setter
353
+ def mirror_overwrites_diverged_branches(self, value: Optional[pulumi.Input[_builtins.bool]]):
354
+ pulumi.set(self, "mirror_overwrites_diverged_branches", value)
355
+
356
+ @_builtins.property
357
+ @pulumi.getter(name="mirrorTriggerBuilds")
358
+ def mirror_trigger_builds(self) -> Optional[pulumi.Input[_builtins.bool]]:
359
+ """
360
+ Trigger CI/CD pipelines when the mirror updates.
361
+ """
362
+ return pulumi.get(self, "mirror_trigger_builds")
363
+
364
+ @mirror_trigger_builds.setter
365
+ def mirror_trigger_builds(self, value: Optional[pulumi.Input[_builtins.bool]]):
366
+ pulumi.set(self, "mirror_trigger_builds", value)
367
+
368
+ @_builtins.property
369
+ @pulumi.getter(name="onlyMirrorProtectedBranches")
370
+ def only_mirror_protected_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
371
+ """
372
+ Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
373
+ """
374
+ return pulumi.get(self, "only_mirror_protected_branches")
375
+
376
+ @only_mirror_protected_branches.setter
377
+ def only_mirror_protected_branches(self, value: Optional[pulumi.Input[_builtins.bool]]):
378
+ pulumi.set(self, "only_mirror_protected_branches", value)
379
+
380
+ @_builtins.property
381
+ @pulumi.getter
382
+ def project(self) -> Optional[pulumi.Input[_builtins.str]]:
383
+ """
384
+ The ID or URL-encoded path of the project owned by the authenticated user.
385
+ """
386
+ return pulumi.get(self, "project")
387
+
388
+ @project.setter
389
+ def project(self, value: Optional[pulumi.Input[_builtins.str]]):
390
+ pulumi.set(self, "project", value)
391
+
392
+ @_builtins.property
393
+ @pulumi.getter(name="updateStatus")
394
+ def update_status(self) -> Optional[pulumi.Input[_builtins.str]]:
395
+ """
396
+ Current status of the mirror update.
397
+ """
398
+ return pulumi.get(self, "update_status")
399
+
400
+ @update_status.setter
401
+ def update_status(self, value: Optional[pulumi.Input[_builtins.str]]):
402
+ pulumi.set(self, "update_status", value)
403
+
404
+ @_builtins.property
405
+ @pulumi.getter
406
+ def url(self) -> Optional[pulumi.Input[_builtins.str]]:
407
+ """
408
+ The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
409
+ """
410
+ return pulumi.get(self, "url")
411
+
412
+ @url.setter
413
+ def url(self, value: Optional[pulumi.Input[_builtins.str]]):
414
+ pulumi.set(self, "url", value)
415
+
416
+
417
+ @pulumi.type_token("gitlab:index/projectPullMirror:ProjectPullMirror")
418
+ class ProjectPullMirror(pulumi.CustomResource):
419
+ @overload
420
+ def __init__(__self__,
421
+ resource_name: str,
422
+ opts: Optional[pulumi.ResourceOptions] = None,
423
+ auth_password: Optional[pulumi.Input[_builtins.str]] = None,
424
+ auth_user: Optional[pulumi.Input[_builtins.str]] = None,
425
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
426
+ mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
427
+ mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
428
+ mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
429
+ only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
430
+ project: Optional[pulumi.Input[_builtins.str]] = None,
431
+ url: Optional[pulumi.Input[_builtins.str]] = None,
432
+ __props__=None):
433
+ """
434
+ The `ProjectPullMirror` resource allows managing pull mirroring for GitLab projects.
435
+
436
+ This resource uses the dedicated pull mirror API endpoint which provides reliable configuration of pull mirroring after project creation.
437
+
438
+ **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/project_pull_mirroring/#configure-pull-mirroring-for-a-project)
439
+
440
+ ## Example Usage
441
+
442
+ ```python
443
+ import pulumi
444
+ import pulumi_gitlab as gitlab
445
+
446
+ # Basic pull mirror from GitHub
447
+ # Note: Unspecified options will use GitLab's defaults
448
+ github = gitlab.ProjectPullMirror("github",
449
+ project=example["id"],
450
+ url="https://github.com/example/repo.git",
451
+ auth_user="github-username",
452
+ auth_password=github_token)
453
+ # Pull mirror with explicit options
454
+ # Only specify options you want to control; omit others to use GitLab defaults
455
+ advanced = gitlab.ProjectPullMirror("advanced",
456
+ project=example["id"],
457
+ url="https://github.com/example/repo.git",
458
+ enabled=True,
459
+ auth_user="github-username",
460
+ auth_password=github_token,
461
+ mirror_trigger_builds=True,
462
+ only_mirror_protected_branches=True,
463
+ mirror_overwrites_diverged_branches=False)
464
+ # Pull mirror with branch regex (Premium/Ultimate)
465
+ regex = gitlab.ProjectPullMirror("regex",
466
+ project=example["id"],
467
+ url="https://github.com/example/repo.git",
468
+ auth_user="github-username",
469
+ auth_password=github_token,
470
+ mirror_branch_regex="^(main|develop|release/.*)$")
471
+ ```
472
+
473
+ ## Import
474
+
475
+ Starting in Terraform v1.5.0, you can use an import block to import `gitlab_project_pull_mirror`. For example:
476
+
477
+ terraform
478
+
479
+ import {
480
+
481
+ to = gitlab_project_pull_mirror.example
482
+
483
+ id = "see CLI command below for ID"
484
+
485
+ }
486
+
487
+ Importing using the CLI is supported with the following syntax:
488
+
489
+ Import using project ID
490
+
491
+ ```sh
492
+ $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example 123
493
+ ```
494
+
495
+ Import using project path
496
+
497
+ Note: Import is not supported for disabled mirrors because the GitLab API returns
498
+
499
+ http 400 for disabled mirrors.
500
+
501
+ ```sh
502
+ $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example "group/project"
503
+ ```
504
+
505
+ :param str resource_name: The name of the resource.
506
+ :param pulumi.ResourceOptions opts: Options for the resource.
507
+ :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
508
+ :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
509
+ :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
510
+ :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
511
+ :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
512
+ :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
513
+ :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
514
+ :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
515
+ :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
516
+ """
517
+ ...
518
+ @overload
519
+ def __init__(__self__,
520
+ resource_name: str,
521
+ args: ProjectPullMirrorArgs,
522
+ opts: Optional[pulumi.ResourceOptions] = None):
523
+ """
524
+ The `ProjectPullMirror` resource allows managing pull mirroring for GitLab projects.
525
+
526
+ This resource uses the dedicated pull mirror API endpoint which provides reliable configuration of pull mirroring after project creation.
527
+
528
+ **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/project_pull_mirroring/#configure-pull-mirroring-for-a-project)
529
+
530
+ ## Example Usage
531
+
532
+ ```python
533
+ import pulumi
534
+ import pulumi_gitlab as gitlab
535
+
536
+ # Basic pull mirror from GitHub
537
+ # Note: Unspecified options will use GitLab's defaults
538
+ github = gitlab.ProjectPullMirror("github",
539
+ project=example["id"],
540
+ url="https://github.com/example/repo.git",
541
+ auth_user="github-username",
542
+ auth_password=github_token)
543
+ # Pull mirror with explicit options
544
+ # Only specify options you want to control; omit others to use GitLab defaults
545
+ advanced = gitlab.ProjectPullMirror("advanced",
546
+ project=example["id"],
547
+ url="https://github.com/example/repo.git",
548
+ enabled=True,
549
+ auth_user="github-username",
550
+ auth_password=github_token,
551
+ mirror_trigger_builds=True,
552
+ only_mirror_protected_branches=True,
553
+ mirror_overwrites_diverged_branches=False)
554
+ # Pull mirror with branch regex (Premium/Ultimate)
555
+ regex = gitlab.ProjectPullMirror("regex",
556
+ project=example["id"],
557
+ url="https://github.com/example/repo.git",
558
+ auth_user="github-username",
559
+ auth_password=github_token,
560
+ mirror_branch_regex="^(main|develop|release/.*)$")
561
+ ```
562
+
563
+ ## Import
564
+
565
+ Starting in Terraform v1.5.0, you can use an import block to import `gitlab_project_pull_mirror`. For example:
566
+
567
+ terraform
568
+
569
+ import {
570
+
571
+ to = gitlab_project_pull_mirror.example
572
+
573
+ id = "see CLI command below for ID"
574
+
575
+ }
576
+
577
+ Importing using the CLI is supported with the following syntax:
578
+
579
+ Import using project ID
580
+
581
+ ```sh
582
+ $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example 123
583
+ ```
584
+
585
+ Import using project path
586
+
587
+ Note: Import is not supported for disabled mirrors because the GitLab API returns
588
+
589
+ http 400 for disabled mirrors.
590
+
591
+ ```sh
592
+ $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example "group/project"
593
+ ```
594
+
595
+ :param str resource_name: The name of the resource.
596
+ :param ProjectPullMirrorArgs args: The arguments to use to populate this resource's properties.
597
+ :param pulumi.ResourceOptions opts: Options for the resource.
598
+ """
599
+ ...
600
+ def __init__(__self__, resource_name: str, *args, **kwargs):
601
+ resource_args, opts = _utilities.get_resource_args_opts(ProjectPullMirrorArgs, pulumi.ResourceOptions, *args, **kwargs)
602
+ if resource_args is not None:
603
+ __self__._internal_init(resource_name, opts, **resource_args.__dict__)
604
+ else:
605
+ __self__._internal_init(resource_name, *args, **kwargs)
606
+
607
+ def _internal_init(__self__,
608
+ resource_name: str,
609
+ opts: Optional[pulumi.ResourceOptions] = None,
610
+ auth_password: Optional[pulumi.Input[_builtins.str]] = None,
611
+ auth_user: Optional[pulumi.Input[_builtins.str]] = None,
612
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
613
+ mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
614
+ mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
615
+ mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
616
+ only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
617
+ project: Optional[pulumi.Input[_builtins.str]] = None,
618
+ url: Optional[pulumi.Input[_builtins.str]] = None,
619
+ __props__=None):
620
+ opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
621
+ if not isinstance(opts, pulumi.ResourceOptions):
622
+ raise TypeError('Expected resource options to be a ResourceOptions instance')
623
+ if opts.id is None:
624
+ if __props__ is not None:
625
+ raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
626
+ __props__ = ProjectPullMirrorArgs.__new__(ProjectPullMirrorArgs)
627
+
628
+ __props__.__dict__["auth_password"] = None if auth_password is None else pulumi.Output.secret(auth_password)
629
+ __props__.__dict__["auth_user"] = auth_user
630
+ __props__.__dict__["enabled"] = enabled
631
+ __props__.__dict__["mirror_branch_regex"] = mirror_branch_regex
632
+ __props__.__dict__["mirror_overwrites_diverged_branches"] = mirror_overwrites_diverged_branches
633
+ __props__.__dict__["mirror_trigger_builds"] = mirror_trigger_builds
634
+ __props__.__dict__["only_mirror_protected_branches"] = only_mirror_protected_branches
635
+ if project is None and not opts.urn:
636
+ raise TypeError("Missing required property 'project'")
637
+ __props__.__dict__["project"] = project
638
+ if url is None and not opts.urn:
639
+ raise TypeError("Missing required property 'url'")
640
+ __props__.__dict__["url"] = None if url is None else pulumi.Output.secret(url)
641
+ __props__.__dict__["last_error"] = None
642
+ __props__.__dict__["last_successful_update_at"] = None
643
+ __props__.__dict__["last_update_at"] = None
644
+ __props__.__dict__["last_update_started_at"] = None
645
+ __props__.__dict__["mirror_id"] = None
646
+ __props__.__dict__["update_status"] = None
647
+ secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["authPassword", "url"])
648
+ opts = pulumi.ResourceOptions.merge(opts, secret_opts)
649
+ super(ProjectPullMirror, __self__).__init__(
650
+ 'gitlab:index/projectPullMirror:ProjectPullMirror',
651
+ resource_name,
652
+ __props__,
653
+ opts)
654
+
655
+ @staticmethod
656
+ def get(resource_name: str,
657
+ id: pulumi.Input[str],
658
+ opts: Optional[pulumi.ResourceOptions] = None,
659
+ auth_password: Optional[pulumi.Input[_builtins.str]] = None,
660
+ auth_user: Optional[pulumi.Input[_builtins.str]] = None,
661
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
662
+ last_error: Optional[pulumi.Input[_builtins.str]] = None,
663
+ last_successful_update_at: Optional[pulumi.Input[_builtins.str]] = None,
664
+ last_update_at: Optional[pulumi.Input[_builtins.str]] = None,
665
+ last_update_started_at: Optional[pulumi.Input[_builtins.str]] = None,
666
+ mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
667
+ mirror_id: Optional[pulumi.Input[_builtins.int]] = None,
668
+ mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
669
+ mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
670
+ only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
671
+ project: Optional[pulumi.Input[_builtins.str]] = None,
672
+ update_status: Optional[pulumi.Input[_builtins.str]] = None,
673
+ url: Optional[pulumi.Input[_builtins.str]] = None) -> 'ProjectPullMirror':
674
+ """
675
+ Get an existing ProjectPullMirror resource's state with the given name, id, and optional extra
676
+ properties used to qualify the lookup.
677
+
678
+ :param str resource_name: The unique name of the resulting resource.
679
+ :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
680
+ :param pulumi.ResourceOptions opts: Options for the resource.
681
+ :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
682
+ :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
683
+ :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
684
+ :param pulumi.Input[_builtins.str] last_error: Last error message from the mirror operation.
685
+ :param pulumi.Input[_builtins.str] last_successful_update_at: Timestamp of the last successful mirror update.
686
+ :param pulumi.Input[_builtins.str] last_update_at: Timestamp of the last mirror update attempt.
687
+ :param pulumi.Input[_builtins.str] last_update_started_at: Timestamp when the last mirror update started.
688
+ :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
689
+ :param pulumi.Input[_builtins.int] mirror_id: The ID of the pull mirror. This ID is set by GitLab.
690
+ :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
691
+ :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
692
+ :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
693
+ :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
694
+ :param pulumi.Input[_builtins.str] update_status: Current status of the mirror update.
695
+ :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
696
+ """
697
+ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
698
+
699
+ __props__ = _ProjectPullMirrorState.__new__(_ProjectPullMirrorState)
700
+
701
+ __props__.__dict__["auth_password"] = auth_password
702
+ __props__.__dict__["auth_user"] = auth_user
703
+ __props__.__dict__["enabled"] = enabled
704
+ __props__.__dict__["last_error"] = last_error
705
+ __props__.__dict__["last_successful_update_at"] = last_successful_update_at
706
+ __props__.__dict__["last_update_at"] = last_update_at
707
+ __props__.__dict__["last_update_started_at"] = last_update_started_at
708
+ __props__.__dict__["mirror_branch_regex"] = mirror_branch_regex
709
+ __props__.__dict__["mirror_id"] = mirror_id
710
+ __props__.__dict__["mirror_overwrites_diverged_branches"] = mirror_overwrites_diverged_branches
711
+ __props__.__dict__["mirror_trigger_builds"] = mirror_trigger_builds
712
+ __props__.__dict__["only_mirror_protected_branches"] = only_mirror_protected_branches
713
+ __props__.__dict__["project"] = project
714
+ __props__.__dict__["update_status"] = update_status
715
+ __props__.__dict__["url"] = url
716
+ return ProjectPullMirror(resource_name, opts=opts, __props__=__props__)
717
+
718
+ @_builtins.property
719
+ @pulumi.getter(name="authPassword")
720
+ def auth_password(self) -> pulumi.Output[Optional[_builtins.str]]:
721
+ """
722
+ Authentication password or token for the remote repository.
723
+ """
724
+ return pulumi.get(self, "auth_password")
725
+
726
+ @_builtins.property
727
+ @pulumi.getter(name="authUser")
728
+ def auth_user(self) -> pulumi.Output[Optional[_builtins.str]]:
729
+ """
730
+ Authentication username for the remote repository.
731
+ """
732
+ return pulumi.get(self, "auth_user")
733
+
734
+ @_builtins.property
735
+ @pulumi.getter
736
+ def enabled(self) -> pulumi.Output[_builtins.bool]:
737
+ """
738
+ Enable or disable the pull mirror. Defaults to `true`.
739
+ """
740
+ return pulumi.get(self, "enabled")
741
+
742
+ @_builtins.property
743
+ @pulumi.getter(name="lastError")
744
+ def last_error(self) -> pulumi.Output[_builtins.str]:
745
+ """
746
+ Last error message from the mirror operation.
747
+ """
748
+ return pulumi.get(self, "last_error")
749
+
750
+ @_builtins.property
751
+ @pulumi.getter(name="lastSuccessfulUpdateAt")
752
+ def last_successful_update_at(self) -> pulumi.Output[_builtins.str]:
753
+ """
754
+ Timestamp of the last successful mirror update.
755
+ """
756
+ return pulumi.get(self, "last_successful_update_at")
757
+
758
+ @_builtins.property
759
+ @pulumi.getter(name="lastUpdateAt")
760
+ def last_update_at(self) -> pulumi.Output[_builtins.str]:
761
+ """
762
+ Timestamp of the last mirror update attempt.
763
+ """
764
+ return pulumi.get(self, "last_update_at")
765
+
766
+ @_builtins.property
767
+ @pulumi.getter(name="lastUpdateStartedAt")
768
+ def last_update_started_at(self) -> pulumi.Output[_builtins.str]:
769
+ """
770
+ Timestamp when the last mirror update started.
771
+ """
772
+ return pulumi.get(self, "last_update_started_at")
773
+
774
+ @_builtins.property
775
+ @pulumi.getter(name="mirrorBranchRegex")
776
+ def mirror_branch_regex(self) -> pulumi.Output[_builtins.str]:
777
+ """
778
+ Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
779
+ """
780
+ return pulumi.get(self, "mirror_branch_regex")
781
+
782
+ @_builtins.property
783
+ @pulumi.getter(name="mirrorId")
784
+ def mirror_id(self) -> pulumi.Output[_builtins.int]:
785
+ """
786
+ The ID of the pull mirror. This ID is set by GitLab.
787
+ """
788
+ return pulumi.get(self, "mirror_id")
789
+
790
+ @_builtins.property
791
+ @pulumi.getter(name="mirrorOverwritesDivergedBranches")
792
+ def mirror_overwrites_diverged_branches(self) -> pulumi.Output[_builtins.bool]:
793
+ """
794
+ Overwrite diverged branches on the target project.
795
+ """
796
+ return pulumi.get(self, "mirror_overwrites_diverged_branches")
797
+
798
+ @_builtins.property
799
+ @pulumi.getter(name="mirrorTriggerBuilds")
800
+ def mirror_trigger_builds(self) -> pulumi.Output[_builtins.bool]:
801
+ """
802
+ Trigger CI/CD pipelines when the mirror updates.
803
+ """
804
+ return pulumi.get(self, "mirror_trigger_builds")
805
+
806
+ @_builtins.property
807
+ @pulumi.getter(name="onlyMirrorProtectedBranches")
808
+ def only_mirror_protected_branches(self) -> pulumi.Output[_builtins.bool]:
809
+ """
810
+ Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
811
+ """
812
+ return pulumi.get(self, "only_mirror_protected_branches")
813
+
814
+ @_builtins.property
815
+ @pulumi.getter
816
+ def project(self) -> pulumi.Output[_builtins.str]:
817
+ """
818
+ The ID or URL-encoded path of the project owned by the authenticated user.
819
+ """
820
+ return pulumi.get(self, "project")
821
+
822
+ @_builtins.property
823
+ @pulumi.getter(name="updateStatus")
824
+ def update_status(self) -> pulumi.Output[_builtins.str]:
825
+ """
826
+ Current status of the mirror update.
827
+ """
828
+ return pulumi.get(self, "update_status")
829
+
830
+ @_builtins.property
831
+ @pulumi.getter
832
+ def url(self) -> pulumi.Output[_builtins.str]:
833
+ """
834
+ The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
835
+ """
836
+ return pulumi.get(self, "url")
837
+