Pulumi’s Self Signed Certificate Package makes it simple for you to quickly create a self signed
certificate. The guide below will quickly you through how to provision a self signed certificate
with the minimal set of inputs. Please refer to the API Docs for more detailed information on this
Packages’s usage.
Quick Start
The following steps will get you started with a self signed certificate.
Configure Environment
Before you get started using Pulumi, let’s run through a few quick steps to ensure your environment is set up correctly.
Install Pulumi
$ brew install pulumi/tap/pulumi
$ curl -fsSL https://get.pulumi.com | sh
All Windows examples in this tutorial assume you are running in PowerShell.
> choco install pulumi
Other installation options are available.
When the installation completes, you can test it out by reading the current version:
$ pulumi version
v2.23.1
$ pulumi version
v2.23.1
> pulumi version
v2.23.1
If this doesn't work, you may need to restart your terminal to ensure the folder containing
the pulumi command is on your PATH.
Next, install the required language runtime, if you have not already.
Install
Python. To reduce potential issues with setting up your Python environment
on Windows or macOS, you should install Python through the official Python installer.
pip is required to install dependencies. If you installed Python from source, with an installer from
python.org, or via Homebrew you should
already have pip. If Python is installed using your OS package manager, you may have to install pip separately, see
Installing pip/setuptools/wheel with Linux Package Managers. For example, on Debian/Ubuntu you must run sudo apt install python3-venv python3-pip.
If you're having trouble setting up Python on your machine, see
Python 3 Installation & Setup Guide for detailed installation instructions on various operating systems and
distributions.
Pulumi requires a supported version of Go— this typically refers to the two most recent major releases. Note that Go calls 1.20, 1.21, etc. major releases, unlike semantic versioning. If
you're using Linux, your distribution may not provide an up to date version of the Go compiler. To check what version of Go you have installed, use:
go version.
Pulumi will need the dotnet executable in order to build and run your Pulumi .NET application. Ensure that the dotnet executable can be found
on your path after installation.
$ mkdir tls-self-signed-cert-quickstart &&cd tls-self-signed-cert-quickstart
$ pulumi new yaml
The pulumi new command creates a new Pulumi project with some basic scaffolding based on the cloud and language specified.
If this is your first time running pulumi new or other pulumi commands, you may be prompted to log in to
Pulumi Cloud. The Pulumi CLI and Pulumi Cloud work in tandem to deliver a
reliable experience. It's free for individual use, with features available for teams, and
self-managed options are also available. Hitting Enter at the prompt opens a browser for you to sign in or sign up.
After logging in, the CLI will proceed with walking you through creating a new project.
First, you will be asked for a project name and description. Hit ENTER to accept the default values or specify new values.
Next, you will be asked for the name of a stack. Hit ENTER to accept the default value of dev.
What are projects and stacks? Pulumi projects and stacks let you organize Pulumi code. Consider a Pulumi project to be analogous to a GitHub repo—a single place for code—and a stack to be an instance of that code with a separate configuration. For instance, Project Foo may have multiple stacks for different development environments (Dev, Test, or Prod), or perhaps for different cloud configurations (geographic region for example). See Organizing Projects and Stacks for some best practices on organizing your Pulumi projects and stacks.
After the command completes, the project and stack will be ready.
Install the Self Signed Certificate Package
Next you will need to install the Self Signed Certificate Package so you can use it in your program.
$ dotnet add package Pulumi.TlsSelfSignedCert
Update Code
Now that you have all your dependencies installed and your project configured, you can now add the code that will
provision your self signed certificate.
Once you have updated your code you are ready to create your Self Signed Certificate. To do so, run the the following command:
$ pulumi up
First Pulumi will perform a preview showing you exactly what will be created. Once the preview is complete Pulumi will ask you if you want to continue.
Select yes to proceed to actually provisioning the service.
All the different resources need to create a self signed certificate will be created.
(Optional) Destroy
You can destroy all the resources by running pulumi destroy.
Self Signed Certificate v0.1.3 published on Monday, Jan 9, 2023 by Pulumi