Skip to content

Instantly share code, notes, and snippets.

View magodo's full-sized avatar
💭
babysitting😱

magodo magodo

💭
babysitting😱
View GitHub Profile
@magodo
magodo / flatten_const_callexpr.go
Created March 31, 2020 01:18
flatten const expr
package internal
import (
"go/ast"
"go/types"
"github.com/microsoft/terraform-azurerm-provider-linter/internal/log"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/ast/astutil"
)
provider "azurerm" {
features {}
}
variable "suffix" {
default = "test"
}
resource "azurerm_resource_group" "example" {
name = "example-resources-${var.suffix}"
diff --git a/authentication/builder.go b/authentication/builder.go
index 9b5c1a1..c40baac 100644
--- a/authentication/builder.go
+++ b/authentication/builder.go
@@ -69,14 +69,14 @@ func (b Builder) Build() (*Config, error) {
for _, method := range supportedAuthenticationMethods {
name := method.name()
- log.Printf("Testing if %s is applicable for Authentication..", name)
+ log.Printf("[DEBUG] Testing if %s is applicable for Authentication..", name)
@magodo
magodo / main.tf
Created June 16, 2020 02:54
NSR Perf
provider "azurerm" {
features {}
}
variable "location" {}
locals {
prefix = "benchmark"
}
resource "azurerm_resource_group" "example" {
name = "${local.prefix}-rg"
location = var.location
@magodo
magodo / keybase.md
Created July 10, 2020 02:24
keybase.md

Keybase proof

I hereby claim:

  • I am magodo on github.
  • I am magodo (https://keybase.io/magodo) on keybase.
  • I have a public key whose fingerprint is D61D 1CE4 914E 8370 485C 69FF 2A3C 3526 EE99 038E

To claim this, I am signing this object:

@magodo
magodo / terraform.log
Created July 17, 2020 02:35
terraform debug log
This file has been truncated, but you can view the full file.
2020/07/17 10:27:43 [INFO] Terraform version: 0.12.28
2020/07/17 10:27:43 [INFO] Go runtime version: go1.14.4
2020/07/17 10:27:43 [INFO] CLI args: []string{"/usr/bin/terraform", "apply", "-auto-approve"}
2020/07/17 10:27:43 [DEBUG] Attempting to open CLI config file: /home/magodo/.terraformrc
2020/07/17 10:27:43 Loading CLI configuration from /home/magodo/.terraformrc
2020/07/17 10:27:43 [DEBUG] checking for credentials in "/home/magodo/.terraform.d/plugins"
2020/07/17 10:27:43 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/07/17 10:27:43 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/07/17 10:27:43 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/07/17 10:27:43 [DEBUG] New state was assigned lineage "4de900d0-2f59-fef7-eb41-dfb3f5f47f13"
@magodo
magodo / main.tf
Last active August 25, 2020 00:28
terraform config for azurerm_cdn_endpoint_custom_domain
provider "azurerm" {
features {}
}
variable "domain_name" {
default = "magodo.in"
}
variable "dns_zone_name" {
default = "magodo.in"
@magodo
magodo / gist:b4b12a5c4a8506c4433e7824caaebef8
Created August 14, 2020 05:46
Amethyst new project failed on start
/tmp
💤 amethyst new hello-world
Project ready!
Checking for updates...
Initialized empty Git repository in /tmp/hello-world/.git/
No new versions found.
/tmp
💤 cd hello-world
@magodo
magodo / main.tf
Created August 17, 2020 05:42
terraform-provider-azurerm-8105
provider "azurerm" {
version = "=2.22.0"
features {}
}
variable "vm-size" {
type = string
description = "Preferred VM Size"
default = "Standard_E8_v3"
}
@magodo
magodo / 0.go
Last active January 10, 2021 13:05
Go: Source vs AST vs SSA
package main
import "fmt"
func hello(name string) {
if name == "" {
fmt.Print("name?")
name = readString()
}