ProjectMirror

# gitlab_project_mirror

This resource allows you to add a mirror target for the repository, all changes will be synced to the remote target.

This is for pushing changes to a remote repository. Pull Mirroring can be configured using a combination of the import_url, mirror, and mirror_trigger_builds properties on the gitlab.Project resource.

For further information on mirroring, consult the gitlab documentation.

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = new GitLab.ProjectMirror("foo", new GitLab.ProjectMirrorArgs
        {
            Project = "1",
            Url = "https://username:password@github.com/org/repository.git",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v4/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.NewProjectMirror(ctx, "foo", &gitlab.ProjectMirrorArgs{
			Project: pulumi.String("1"),
			Url:     pulumi.String("https://username:password@github.com/org/repository.git"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_gitlab as gitlab

foo = gitlab.ProjectMirror("foo",
    project="1",
    url="https://username:password@github.com/org/repository.git")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const foo = new gitlab.ProjectMirror("foo", {
    project: "1",
    url: "https://username:password@github.com/org/repository.git",
});

Create a ProjectMirror Resource

new ProjectMirror(name: string, args: ProjectMirrorArgs, opts?: CustomResourceOptions);
@overload
def ProjectMirror(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  enabled: Optional[bool] = None,
                  keep_divergent_refs: Optional[bool] = None,
                  only_protected_branches: Optional[bool] = None,
                  project: Optional[str] = None,
                  url: Optional[str] = None)
@overload
def ProjectMirror(resource_name: str,
                  args: ProjectMirrorArgs,
                  opts: Optional[ResourceOptions] = None)
func NewProjectMirror(ctx *Context, name string, args ProjectMirrorArgs, opts ...ResourceOption) (*ProjectMirror, error)
public ProjectMirror(string name, ProjectMirrorArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ProjectMirrorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ProjectMirrorArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ProjectMirrorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ProjectMirrorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ProjectMirror Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ProjectMirror resource accepts the following input properties:

Project string
The id of the project.
Url string
The URL of the remote repository to be mirrored.
Enabled bool
Determines if the mirror is enabled.
KeepDivergentRefs bool
Determines if divergent refs are skipped.
OnlyProtectedBranches bool
Determines if only protected branches are mirrored.
Project string
The id of the project.
Url string
The URL of the remote repository to be mirrored.
Enabled bool
Determines if the mirror is enabled.
KeepDivergentRefs bool
Determines if divergent refs are skipped.
OnlyProtectedBranches bool
Determines if only protected branches are mirrored.
project string
The id of the project.
url string
The URL of the remote repository to be mirrored.
enabled boolean
Determines if the mirror is enabled.
keepDivergentRefs boolean
Determines if divergent refs are skipped.
onlyProtectedBranches boolean
Determines if only protected branches are mirrored.
project str
The id of the project.
url str
The URL of the remote repository to be mirrored.
enabled bool
Determines if the mirror is enabled.
keep_divergent_refs bool
Determines if divergent refs are skipped.
only_protected_branches bool
Determines if only protected branches are mirrored.

Outputs

All input properties are implicitly available as output properties. Additionally, the ProjectMirror resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
MirrorId int
Id string
The provider-assigned unique ID for this managed resource.
MirrorId int
id string
The provider-assigned unique ID for this managed resource.
mirrorId number
id str
The provider-assigned unique ID for this managed resource.
mirror_id int

Look up an Existing ProjectMirror Resource

Get an existing ProjectMirror resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ProjectMirrorState, opts?: CustomResourceOptions): ProjectMirror
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        keep_divergent_refs: Optional[bool] = None,
        mirror_id: Optional[int] = None,
        only_protected_branches: Optional[bool] = None,
        project: Optional[str] = None,
        url: Optional[str] = None) -> ProjectMirror
func GetProjectMirror(ctx *Context, name string, id IDInput, state *ProjectMirrorState, opts ...ResourceOption) (*ProjectMirror, error)
public static ProjectMirror Get(string name, Input<string> id, ProjectMirrorState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Enabled bool
Determines if the mirror is enabled.
KeepDivergentRefs bool
Determines if divergent refs are skipped.
MirrorId int
OnlyProtectedBranches bool
Determines if only protected branches are mirrored.
Project string
The id of the project.
Url string
The URL of the remote repository to be mirrored.
Enabled bool
Determines if the mirror is enabled.
KeepDivergentRefs bool
Determines if divergent refs are skipped.
MirrorId int
OnlyProtectedBranches bool
Determines if only protected branches are mirrored.
Project string
The id of the project.
Url string
The URL of the remote repository to be mirrored.
enabled boolean
Determines if the mirror is enabled.
keepDivergentRefs boolean
Determines if divergent refs are skipped.
mirrorId number
onlyProtectedBranches boolean
Determines if only protected branches are mirrored.
project string
The id of the project.
url string
The URL of the remote repository to be mirrored.
enabled bool
Determines if the mirror is enabled.
keep_divergent_refs bool
Determines if divergent refs are skipped.
mirror_id int
only_protected_branches bool
Determines if only protected branches are mirrored.
project str
The id of the project.
url str
The URL of the remote repository to be mirrored.

Import

GitLab project mirror can be imported using an id made up of project_id:mirror_id, e.g.

 $ pulumi import gitlab:index/projectMirror:ProjectMirror foo "12345:1337"

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.