Project Args
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.inputs.ProjectPushRulesArgs;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetUserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Project("example", ProjectArgs.builder()
.description("My awesome codebase")
.visibilityLevel("public")
.build());
var example_two = new Project("example-two", ProjectArgs.builder()
.pushRules(ProjectPushRulesArgs.builder()
.authorEmailRegex("@example\\.com$")
.commitCommitterCheck(true)
.memberCheck(true)
.preventSecrets(true)
.build())
.build());
final var peterParker = GitlabFunctions.getUser(GetUserArgs.builder()
.username("peter_parker")
.build());
var petersRepo = new Project("petersRepo", ProjectArgs.builder()
.description("This is a description")
.namespaceId(peterParker.applyValue(getUserResult -> getUserResult.namespaceId()))
.build());
}
}
Import
$ pulumi import gitlab:index/project:Project You can import a project state using `<resource> <id>`. The
id
can be whatever the get_single_project takes for its :id
value, so for example
$ pulumi import gitlab:index/project:Project example richardc/example
Constructors
Functions
Properties
Number of merge request approvals required for merging. Default is 0. This field does not work well in combination with the gitlab.ProjectApprovalRule
resource and is most likely gonna be deprecated in a future GitLab version (see this upstream epic). In the meantime we recommend against using this attribute and use gitlab.ProjectApprovalRule
instead.
If true
, the default behavior to wait for the default branch protection to be created is skipped. This is necessary if the current user is not an admin and the default branch protection is disabled on an instance-level. There is currently no known way to determine if the default branch protection is disabled on an instance-level for non-admin users. This attribute is only used during resource creation, thus changes are suppressed and the attribute cannot be imported.
When used with usecustomtemplate, project ID of a custom project template. This is preferable to using templatename since templatename may be ambiguous (enterprise edition). This option is mutually exclusive with template_name
. See gitlab.GroupProjectFileTemplate
to set a project as a template project. If a project has not been set as a template, using it here will result in an error.