This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
org = "acme" | |
prj = "rockets" | |
env = "staging" | |
suffix = "01234" | |
} | |
resource "azurerm_resource_group" "example" { | |
name = # Value on next line for readability | |
regex("^[-\\w\\._\\(\\)]+$",substr("rg-${local.org}-${local.prj}-${local.env}-main-${local.suffix}", 90)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
org = "acme" | |
prj = "rockets" | |
env = "staging" | |
location = "eastus" | |
} | |
resource "random_string" "suffix" { | |
length = 13 | |
upper = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ResourceValidationPolicy, ResourceValidationArgs } from "@pulumi/policy"; | |
const requiredTags = ["owner", "environment"]; | |
const isAzureResource = (args: ResourceValidationArgs): boolean => args.type.startsWith("azure"); | |
// Subject to change since more types will fall through | |
const isAzureResourceTagFriendly = (args: ResourceValidationArgs): boolean => { | |
return ( | |
!args.type.startsWith("azure:network/subnet") && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ResourceValidationPolicy, ResourceValidationArgs } from "@pulumi/policy"; | |
const advisedComputeFamilies = [ | |
"Standard_DS?\d{1,2}_v2", | |
"Standard_DS?\d{1,2}_v3"]; | |
const escapeRegex = (expression: string): string => expression.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); | |
const isAzureVirtualMachineResource = (args: ResourceValidationArgs): boolean => args.type.startsWith("azure:compute/virtualMachine"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: snapshot-job | |
spec: | |
schedule: "@daily" | |
jobTemplate: | |
spec: | |
template: | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet tool install --global dotnet-az-snapshot-tool | |
az-snapshot-tool create --tenantId xxx --subscriptionId xxx --resourceGroup myRg --diskName myDisk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// ReceiveActor with unbounded stash implementation that sends stash depth metrics with AppMetrics. | |
/// Use when you wish to monitor the stash depth with reporting tools such as DataDog. | |
/// </summary> | |
public abstract class InstrumentedStashReceiveActor : ReceiveActor, IWithUnboundedStash | |
{ | |
private int _stashSize = 0; | |
private static readonly GaugeOptions GaugeOptions = new GaugeOptions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1. get all pod containers with istio proxy sidecars | |
# 2. get pod app labels (some have app, others have app.kubernetes.io/name) | |
# 3. return only uniques and not nulls | |
version=1.19.0 | |
kubectl get pods -A -o json | \ | |
jq "[.items[] | select(.spec.containers[].image | contains(\"istio/proxyv2:$version\"))]" | \ | |
jq '[.[].metadata.labels.app, .[].metadata.labels."app.kubernetes.io/name"]' | \ | |
jq 'unique | .[] | select( . != null)' |