Skip to content

Instantly share code, notes, and snippets.

View simonbrady's full-sized avatar

Simon Brady simonbrady

View GitHub Profile
@simonbrady
simonbrady / infer-keysize-from-curve.diff
Created March 7, 2021 08:09
Attempt at inferring EC certificate key size from curve
diff --git a/azurerm/internal/services/keyvault/key_vault_certificate_resource.go b/azurerm/internal/services/keyvault/key_vault_certificate_resource.go
index 3d226ef65..273e1aee2 100644
--- a/azurerm/internal/services/keyvault/key_vault_certificate_resource.go
+++ b/azurerm/internal/services/keyvault/key_vault_certificate_resource.go
@@ -127,12 +127,9 @@ func resourceKeyVaultCertificate() *schema.Resource {
},
"key_size": {
Type: schema.TypeInt,
- Required: true,
+ Optional: true,
@simonbrady
simonbrady / cert-policy-self-signed.json
Created March 7, 2021 02:20
ECDSA certificate policy for Azure CLI "az keyvault certificate create" command
{
"issuerParameters": {
"certificateTransparency": null,
"name": "Self"
},
"keyProperties": {
"curve": "P-256K",
"exportable": true,
"keyType": "EC",
"reuseKey": true
@simonbrady
simonbrady / main.tf
Last active September 20, 2023 13:02
Azure App Service with specified Node.js runtime versions in Terraform
# Demonstrates Azure App Service with specified Node.js runtime versions
#
# The supported runtimes are poorly documented and subject to change: see
# comments for windows_fx_version and linux_fx_version below for how to
# determine which ones are available.
terraform {
required_version = ">= 0.13"
required_providers {
azurerm = {
@simonbrady
simonbrady / trace.log
Created August 23, 2020 11:02
azurerm_app_service data source error with subnet IP restriction
This file has been truncated, but you can view the full file.
2020/08/23 23:01:33 [INFO] Terraform version: 0.13.0
2020/08/23 23:01:33 [INFO] Go runtime version: go1.14.2
2020/08/23 23:01:33 [INFO] CLI args: []string{"/u01/home/simon/bin/terraform-0.13.0", "apply", "-no-color"}
2020/08/23 23:01:33 [DEBUG] Attempting to open CLI config file: /home/simon/.terraformrc
2020/08/23 23:01:33 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/08/23 23:01:33 [DEBUG] checking for credentials in "/home/simon/.terraform.d/plugins"
2020/08/23 23:01:33 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/08/23 23:01:33 [DEBUG] will search for provider plugins in /home/simon/.terraform.d/plugins
2020/08/23 23:01:33 [DEBUG] ignoring non-existing provider search directory /home/simon/.local/share/terraform/plugins
2020/08/23 23:01:33 [DEBUG] ignoring non-existing provider search directory /home/simon/.local/share/flatpak/exports/share/terraform/plugins
@simonbrady
simonbrady / main.tf
Created August 23, 2020 06:03
Test case for azurerm_application_gateway with empty backend IP list
provider "azurerm" {
version = "~>2"
features {}
}
locals {
prefix = "appgw-test"
}
resource "azurerm_resource_group" "test" {
2019/10/17 22:41:29 [INFO] Terraform version: 0.12.10
2019/10/17 22:41:29 [INFO] Go runtime version: go1.12.9
2019/10/17 22:41:29 [INFO] CLI args: []string{"/u01/home/simon/bin/terraform-0.12.10", "plan"}
2019/10/17 22:41:29 [DEBUG] Attempting to open CLI config file: /home/simon/.terraformrc
2019/10/17 22:41:29 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/10/17 22:41:29 [INFO] CLI command args: []string{"plan"}
2019/10/17 22:41:29 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/10/17 22:41:29 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/10/17 22:41:29 [DEBUG] New state was assigned lineage "6b2792ce-d781-7cdf-94e6-7d3495ef6730"
2019/10/17 22:41:29 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
@simonbrady
simonbrady / main.go
Created October 16, 2019 23:43
Go's json.Decoder ignores whitespace around "null"
package main
// Demonstrate that json.Decoder ignores whitespace when tokenising
// the string "null" to a nil value
import (
"encoding/json"
"fmt"
"log"
"strings"