You can use the Pulumi Metabase Component to help you get started quickly running Metabase in the cloud.
Currently this Component only supports AWS. The code below will show you examples of each resources
supported in this Component, but please refer to the API Docs for more detailed descriptions and
information about each resource.
Quick Start
The following steps will get you up and running with Metabase on AWS with very little effort. Once you
have completed the steps you will have an RDS Database, Metabase running in a Fargate Task, and a Load
Balancer.
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.
Good news! You don’t have to install anything else to write Pulumi programs in YAML.
Configure Pulumi to access your AWS account
Pulumi requires cloud credentials to manage and provision resources. You must use an IAM user account that has Programmatic access with rights to deploy and manage resources handled through Pulumi.
If you have previously installed and configured the AWS CLI, Pulumi will respect and use your configuration settings.
If you do not have the AWS CLI installed or plan on using Pulumi from within a CI/CD pipeline, retrieve your access key ID and secret access key and then set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables on your workstation.
Now that you have set up your environment by installing Pulumi, installing your preferred language runtime,
and configuring your AWS credentials, let’s create your first Pulumi program.
$ mkdir metabase-quickstart &&cd metabase-quickstart
$ pulumi new aws-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.
Finally, you will be prompted for some configuration values for the stack. For AWS projects, you will be prompted for the AWS region. You can accept the default value or choose another value like us-west-2.
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.
Once you have updated your code you are ready to deploy your Metabase Component. To do so, just 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 resources will take a few minutes to fully provision. Once the update has completed it is likely it will take a few more minutes for the Metabase
task to finishing provisioning and start accepting traffic.
(Optional) Destroy
You can destroy all the resources by running pulumi destroy. This will ultimately delete your Metabase Service’s database so you will lose all stored
data and have to start from scratch if you provision a new Metabase service.
Full Examples
Below you will find complete examples (all arguments supplied) for the Metabase Components.