SSLCertificateArgs

data class SSLCertificateArgs(val certificate: Output<String>? = null, val description: Output<String>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val privateKey: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<SSLCertificateArgs>

An SslCertificate resource, used for HTTPS load balancing. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. To get more information about SslCertificate, see:

Warning: All arguments including certificate and private_key will be stored in the raw state as plain-text.

Example Usage

Ssl Certificate Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.SSLCertificate;
import com.pulumi.gcp.compute.SSLCertificateArgs;
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 default_ = new SSLCertificate("default", SSLCertificateArgs.builder()
.namePrefix("my-certificate-")
.description("a description")
.privateKey(Files.readString(Paths.get("path/to/private.key")))
.certificate(Files.readString(Paths.get("path/to/certificate.crt")))
.build());
}
}

Ssl Certificate Random Provider

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.SSLCertificate;
import com.pulumi.gcp.compute.SSLCertificateArgs;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
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 default_ = new SSLCertificate("default", SSLCertificateArgs.builder()
.privateKey(Files.readString(Paths.get("path/to/private.key")))
.certificate(Files.readString(Paths.get("path/to/certificate.crt")))
.build());
var certificate = new RandomId("certificate", RandomIdArgs.builder()
.byteLength(4)
.prefix("my-certificate-")
.keepers(Map.ofEntries(
Map.entry("private_key", computeFileBase64Sha256("path/to/private.key")),
Map.entry("certificate", computeFileBase64Sha256("path/to/certificate.crt"))
))
.build());
}
}

Ssl Certificate Target Https Proxies

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.SSLCertificate;
import com.pulumi.gcp.compute.SSLCertificateArgs;
import com.pulumi.gcp.compute.HttpHealthCheck;
import com.pulumi.gcp.compute.HttpHealthCheckArgs;
import com.pulumi.gcp.compute.BackendService;
import com.pulumi.gcp.compute.BackendServiceArgs;
import com.pulumi.gcp.compute.URLMap;
import com.pulumi.gcp.compute.URLMapArgs;
import com.pulumi.gcp.compute.inputs.URLMapHostRuleArgs;
import com.pulumi.gcp.compute.inputs.URLMapPathMatcherArgs;
import com.pulumi.gcp.compute.TargetHttpsProxy;
import com.pulumi.gcp.compute.TargetHttpsProxyArgs;
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 defaultSSLCertificate = new SSLCertificate("defaultSSLCertificate", SSLCertificateArgs.builder()
.namePrefix("my-certificate-")
.privateKey(Files.readString(Paths.get("path/to/private.key")))
.certificate(Files.readString(Paths.get("path/to/certificate.crt")))
.build());
var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
.requestPath("/")
.checkIntervalSec(1)
.timeoutSec(1)
.build());
var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder()
.portName("http")
.protocol("HTTP")
.timeoutSec(10)
.healthChecks(defaultHttpHealthCheck.id())
.build());
var defaultURLMap = new URLMap("defaultURLMap", URLMapArgs.builder()
.description("a description")
.defaultService(defaultBackendService.id())
.hostRules(URLMapHostRuleArgs.builder()
.hosts("mysite.com")
.pathMatcher("allpaths")
.build())
.pathMatchers(URLMapPathMatcherArgs.builder()
.name("allpaths")
.defaultService(defaultBackendService.id())
.pathRules(URLMapPathMatcherPathRuleArgs.builder()
.paths("/*")
.service(defaultBackendService.id())
.build())
.build())
.build());
var defaultTargetHttpsProxy = new TargetHttpsProxy("defaultTargetHttpsProxy", TargetHttpsProxyArgs.builder()
.urlMap(defaultURLMap.id())
.sslCertificates(defaultSSLCertificate.id())
.build());
}
}

Import

SslCertificate can be imported using any of these accepted formats

$ pulumi import gcp:compute/sSLCertificate:SSLCertificate default projects/{{project}}/global/sslCertificates/{{name}}
$ pulumi import gcp:compute/sSLCertificate:SSLCertificate default {{project}}/{{name}}
$ pulumi import gcp:compute/sSLCertificate:SSLCertificate default {{name}}

Constructors

Link copied to clipboard
constructor(certificate: Output<String>? = null, description: Output<String>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, privateKey: Output<String>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard
val certificate: Output<String>? = null

The certificate in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. Note: This property is sensitive and will not be displayed in the plan.

Link copied to clipboard
val description: Output<String>? = null

An optional description of this resource.

Link copied to clipboard
val name: Output<String>? = null

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. These are in the same namespace as the managed SSL certificates.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name.

Link copied to clipboard
val privateKey: Output<String>? = null

The write-only private key in PEM format. Note: This property is sensitive and will not be displayed in the plan.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used. */

Functions

Link copied to clipboard
open override fun toJava(): SSLCertificateArgs