Skip to content

Instantly share code, notes, and snippets.

View olafurnielsen's full-sized avatar
🚀
In Orbit

Olafur Nielsen olafurnielsen

🚀
In Orbit
View GitHub Profile
@olafurnielsen
olafurnielsen / gist:a25085a4d4b9d4d1c23b3ffd125b5f04
Last active August 21, 2024 19:53
Importing specific Pulumi API versions
# Python
from pulumi_azure_native.network import v20230901 as network
# Typescript
import VirtualNetwork from "@pulumi/azure-native/network/v20230901";
# Go
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v2/v20230901"
)
@olafurnielsen
olafurnielsen / pulumi_drift_detect.sh
Created April 12, 2024 12:23
Recursively search for Pulumi projects and run drift/error detection
#!/bin/bash
# Recursively searches for Pulumi projects and stacks
#
# Runs:
# pulumi pre --expect-no-changes
#
# Reports back whether there are any errors or pending changes in stacks.
#
# Usage
@olafurnielsen
olafurnielsen / pulumi_async_sorted_secrets.py
Created April 6, 2024 00:28
Sorting Pulumi outputs based on whether they are secrets or not
from typing import Any
import pulumi
from pulumi_random import RandomPassword, RandomString
env_vars: dict[str, pulumi.Output[str] | str] = {
"password": RandomPassword(resource_name="password", length=8).result,
"rand_string": RandomString(resource_name="rand-string", length=8).result,
"non_output_var": "non_output_var_value",
}
@olafurnielsen
olafurnielsen / cloudSettings
Last active February 24, 2021 23:15
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-02-24T23:15:12.231Z","extensionVersion":"v3.4.3"}