How do I create a Google-managed SSL certificate?
In this guide, we will create a Google-managed SSL certificate using Pulumi. A Google-managed SSL certificate is a free SSL certificate provided by Google Cloud that can be used to secure your applications. The certificate is automatically managed by Google Cloud, which means it will be automatically renewed and updated.
We will use the gcp.compute.ManagedSslCertificate
resource from the Pulumi GCP provider to create the certificate. This resource allows us to specify the domains for which the certificate should be valid.
Key Points
- We will create a Google-managed SSL certificate.
- We will specify the domains for which the certificate should be valid.
- The certificate will be automatically managed by Google Cloud.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
// Create a Google-managed SSL certificate
const managedSslCertificate = new gcp.compute.ManagedSslCertificate("managedSslCertificate", {
name: "example-ssl-cert",
managed: {
domains: ["example.com", "www.example.com"],
},
project: "your-gcp-project-id", // Replace with your GCP project ID
});
// Export the name and selfLink of the SSL certificate
export const certificateName = managedSslCertificate.name;
export const certificateSelfLink = managedSslCertificate.selfLink;
Summary
In this guide, we created a Google-managed SSL certificate using Pulumi. We specified the domains for which the certificate should be valid, and the certificate is automatically managed by Google Cloud. The certificate will be automatically renewed and updated by Google Cloud.
Deploy this code
Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.
Sign upNew to Pulumi?
Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.
Sign upThank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.