PagesDomain

class PagesDomain : KotlinCustomResource

The gitlab.PagesDomain resource allows connecting custom domains and TLS certificates in GitLab Pages. Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gitlab from "@pulumi/gitlab";
// Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
const thisPagesDomain = new gitlab.PagesDomain("thisPagesDomain", {
project: "123",
domain: "example.com",
autoSslEnabled: true,
});
// Example using a manually generated certificate and key
const thisIndex_pagesDomainPagesDomain = new gitlab.PagesDomain("thisIndex/pagesDomainPagesDomain", {
project: "123",
domain: "example.com",
key: fs.readFileSync(`${path.module}/key.pem`, "utf8"),
certificate: fs.readFileSync(`${path.module}/cert.pem`, "utf8"),
});
import pulumi
import pulumi_gitlab as gitlab
# Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
this_pages_domain = gitlab.PagesDomain("thisPagesDomain",
project="123",
domain="example.com",
auto_ssl_enabled=True)
# Example using a manually generated certificate and key
this_index_pages_domain_pages_domain = gitlab.PagesDomain("thisIndex/pagesDomainPagesDomain",
project="123",
domain="example.com",
key=(lambda path: open(path).read())(f"{path['module']}/key.pem"),
certificate=(lambda path: open(path).read())(f"{path['module']}/cert.pem"))
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
// Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
var thisPagesDomain = new GitLab.PagesDomain("thisPagesDomain", new()
{
Project = "123",
Domain = "example.com",
AutoSslEnabled = true,
});
// Example using a manually generated certificate and key
var thisIndex_pagesDomainPagesDomain = new GitLab.PagesDomain("thisIndex/pagesDomainPagesDomain", new()
{
Project = "123",
Domain = "example.com",
Key = File.ReadAllText($"{path.Module}/key.pem"),
Certificate = File.ReadAllText($"{path.Module}/cert.pem"),
});
});
package main
import (
"fmt"
"os"
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
_, err := gitlab.NewPagesDomain(ctx, "thisPagesDomain", &gitlab.PagesDomainArgs{
Project: pulumi.String("123"),
Domain: pulumi.String("example.com"),
AutoSslEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
// Example using a manually generated certificate and key
_, err = gitlab.NewPagesDomain(ctx, "thisIndex/pagesDomainPagesDomain", &gitlab.PagesDomainArgs{
Project: pulumi.String("123"),
Domain: pulumi.String("example.com"),
Key: readFileOrPanic(fmt.Sprintf("%v/key.pem", path.Module)),
Certificate: readFileOrPanic(fmt.Sprintf("%v/cert.pem", path.Module)),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.PagesDomain;
import com.pulumi.gitlab.PagesDomainArgs;
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) {
// Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
var thisPagesDomain = new PagesDomain("thisPagesDomain", PagesDomainArgs.builder()
.project(123)
.domain("example.com")
.autoSslEnabled(true)
.build());
// Example using a manually generated certificate and key
var thisIndex_pagesDomainPagesDomain = new PagesDomain("thisIndex/pagesDomainPagesDomain", PagesDomainArgs.builder()
.project(123)
.domain("example.com")
.key(Files.readString(Paths.get(String.format("%s/key.pem", path.module()))))
.certificate(Files.readString(Paths.get(String.format("%s/cert.pem", path.module()))))
.build());
}
}
resources:
# Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
thisPagesDomain:
type: gitlab:PagesDomain
properties:
project: 123
domain: example.com
autoSslEnabled: true
# Example using a manually generated certificate and key
thisIndex/pagesDomainPagesDomain:
type: gitlab:PagesDomain
properties:
project: 123
domain: example.com
key:
fn::readFile: ${path.module}/key.pem
certificate:
fn::readFile: ${path.module}/cert.pem

Import

GitLab pages domain can be imported using an id made up of projectId:domain without the http protocol, e.g.

$ pulumi import gitlab:index/pagesDomain:PagesDomain this 123:example.com

Properties

Link copied to clipboard
val autoSslEnabled: Output<Boolean>

Enables automatic generation of SSL certificates issued by Let’s Encrypt for custom domains. When this is set to "true", certificate can't be provided.

Link copied to clipboard
val certificate: Output<String>

The certificate in PEM format with intermediates following in most specific to least specific order.

Link copied to clipboard
val domain: Output<String>

The custom domain indicated by the user.

Link copied to clipboard
val expired: Output<Boolean>

Whether the certificate is expired.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val key: Output<String>?

The certificate key in PEM format.

Link copied to clipboard
val project: Output<String>

The ID or URL-encoded path of the project owned by the authenticated user.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: Output<String>

The URL for the given domain.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The verification code for the domain.

Link copied to clipboard
val verified: Output<Boolean>

The certificate data.