Skip to content

Instantly share code, notes, and snippets.

@rueedlinger
Last active February 24, 2023 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rueedlinger/2c25d2bf59708f01a303172fb15d769b to your computer and use it in GitHub Desktop.
Save rueedlinger/2c25d2bf59708f01a303172fb15d769b to your computer and use it in GitHub Desktop.
Pulumni with MinIO

Pulumni with MinIO

Notes for using Pulumni and store the deployed state to MinIO (s3)

Start MinIO, log in with minioadmin:minioadmin and create the bucket my-bucket.

docker run -p 9000:9000 -p 9001:9001 quay.io/minio/minio server /data --console-address ":9001"

Pulumni needs the credentials as env variables for storing the state in s3.

export AWS_ACCESS_KEY_ID=minioadmin
export AWS_SECRET_ACCESS_KEY=minioadmin
export AWS_REGION=us-east-1

The following coammdn will store your state information in the s3 bucket my-bucket.

pulumi login 's3://my-bucket?endpoint=127.0.0.1:9000&disableSSL=true&s3ForcePathStyle=true'

Create a new Pulumi project and stack from a template.

mkdir quickstart-pulmni
cd quickstart-pulmni
pulumi new [java|python|javascript|go]

Deploy your project

pulumi up

Import Pulumni Configuration

The goal is to import the Pulumni configuration from a exsiting Keycloak server.

pulumi config set keycloak:url http://localhost:8080
pulumi config set keycloak:clientId admin-cli --secret
pulumi config set keycloak:username admin --secret
pulumi config set keycloak:password admin --secret

Start up a Keycloak server with Docker

docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:21.0.0 start-dev

The following coammdn will import a exsiting relam and client.

pulumi import keycloak:index/realm:Realm realm my-realm
pulumi import keycloak:openid/client:Client openid_client my-realm/ac4c124a-4200-4e9e-8531-0019e953821a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment