Skip to content

Instantly share code, notes, and snippets.

View abdrehma's full-sized avatar
💭
I may be slow to respond.

Not Abdul Rehman abdrehma

💭
I may be slow to respond.
View GitHub Profile
@abdrehma
abdrehma / main.tf
Last active October 30, 2020 16:15 — forked from arehmandev/Terraform nested for loop
Terraform nested for loop for_each
locals {
nested_loop = { for entry in flatten(values({
for k, v in var.hub_networks :
k => [
for key, val in var.firewalls :
merge(val, v, { "key" : "default-deny-${lower(val.direction)}-${v.network}" })
]
})) : entry.key => entry }
}
@abdrehma
abdrehma / filterReadJSON.groovy
Last active April 28, 2022 02:34
Jenkins readJSON is very dodgy with null values
def filterJSON(map){
map.each { key, value ->
if (value.toString() == "null"){
map[key] = null
} else if (value instanceof List){
map.eachWithIndex { item, index ->
if (item.toString() == "null"){
map[index] = null
}
variable "apigw_map" {
description = "Map for APIGW Resources and Methods"
default = {
categories = {
GET = {
authorization = "NONE"
authorizer_id = ""
key_req = true
target_path = "categories"
}
@abdrehma
abdrehma / pipeline.groovy
Created March 5, 2020 21:56
Use NO_PROXY inside Kubernetes slave pod for internal domains
stage('asdf'){
env.NO_PROXY = env.NO_PROXY + ',' + InetAddress.getByName("kubernetes.default.svc.cluster.local").hostAddress
}
post {
always {
archiveArtifacts allowEmptyArchive: true,
artifacts: "**/*.log",
fingerprint: true,
onlyIfSuccessful: false
step([$class: 'WsCleanup'])
}
}
@abdrehma
abdrehma / Corefile
Last active October 8, 2019 22:38
GCP Private Zone DNS BIND Config with OpenVPN
.:53 {
forward . 169.254.169.254
log
}