Skip to content

Instantly share code, notes, and snippets.

Avatar
🧖‍♂️

Chris Lenard lenardchristopher

🧖‍♂️
View GitHub Profile
View github-action-operator-sdk-integration-testing.yaml
name: Testing
on:
- pull_request
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
View github-action-golang-unit-testing.yaml
name: Testing
on: [pull_request]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
View github-action-golang-lint.yml
name: Golang Lint
on: [pull_request]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
View github-action-docker-build.yaml
name: "Docker Build"
on:
pull_request:
branches:
- "main"
jobs:
docker-build:
name: Docker Build
runs-on: ubuntu-latest
@lenardchristopher
lenardchristopher / for_each.tf
Created Apr 14, 2021
An example of a for_each loop in Terraform.
View for_each.tf
resource "azurerm_resource_group" "rg" {
for_each = {
a_group = "eastus"
another_group = "westus2"
}
name = each.key
location = each.value
}
@lenardchristopher
lenardchristopher / pulumi-vnets.go
Last active Mar 15, 2021
Create virtual network peerings using Pulumi in Golang and CosmosDb config
View pulumi-vnets.go
peerings, err := getRegionPeerings(params)
for _, p := range peerings {
_, err = network.NewVirtualNetworkPeering(ctx, p.Region+"-to-"+p.Name+"-vnet", &network.VirtualNetworkPeeringArgs{
Name: pulumi.StringPtr("to-" + p.Region + "-vnet-" + p.Name),
ResourceGroupName: pulumi.String("ctus-assets"),
VirtualNetworkName: pulumi.String(p.Region + "-vnet"),
RemoteVirtualNetwork: network.SubResourcePtrInput(&network.SubResourceArgs{
Id: pulumi.StringPtr(fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", p.SubscriptionID, p.Name, p.Region+"-vnet")),
}),
@lenardchristopher
lenardchristopher / terraform-vnets.tf
Last active Mar 14, 2021
Dynamic resource creation with Terraform and CosmosDb Configuration Store
View terraform-vnets.tf
data "external" "clusters" {
program = ["python", "./cosmosdb_reader.py"]
query = {
cosmos_endpoint = var.endpoint
cosmos_key = var.primary_readonly_master_key
region = "centralus"
subscription_id = "00000000-0000-0000-0000-000000000000"
// CosmosDb query function
data_function = "get_region_peerings"
}