Skip to content

Instantly share code, notes, and snippets.

View carljavier's full-sized avatar
☁️
Cloud DevOps Infrastructure Engineering Contract

Carl Javier carljavier

☁️
Cloud DevOps Infrastructure Engineering Contract
View GitHub Profile
@carljavier
carljavier / whoisit.py
Last active February 9, 2021 01:30
Programming/Scriptin - Using your preferred programming or scripting language, write a function that takes a number as an argument and returns the string “aunty” if that number is divisible by 3 and returns “uncle” otherwise.
import sys
# Assumes what is passed into function is integer, however prefer to type cast it to be sure.
def whoisit(index):
# Given that there are two scenarios where value could not be divisible by x could be 0 or any other number.
if (int(index) % 3 > 0) or (int(index) == 0) :
return "uncle"
else :
return "aunty"
@carljavier
carljavier / vault-server-aws.hcl
Last active November 30, 2021 11:47
Hashicorp Vault Config - AWS
ui = true
#mlock = true
disable_mlock = true
storage "raft" {
path = "/opt/vault/data"
retry_join {
auto_join = "provider=aws region=ap-southeast-2 tag_key=App tag_value=vault"
@carljavier
carljavier / consul-client-aws.hcl
Last active January 19, 2022 10:15
Hashicorp Consul Config
acl {
enabled = true
down_policy = "async-cache"
default_policy = "deny"
}
ca_file = "/opt/consul/ca.pem"
data_dir = "/opt/consul"
datacenter = "sydney"
verify_outgoing = true
@carljavier
carljavier / Workaround_M1_TF_Template_provider.md
Last active February 20, 2024 21:13
M1 Macs and Terraform template provider (Depcreated) local build
@carljavier
carljavier / hashicups-new-ui.nomad
Last active February 22, 2022 04:06
Nomad Demo Job
variable "public_api_ip" {
type = string
description = "Public Host IP Address"
default = "localhost"
}
job "hashicups" {
datacenters = ["dc1"]
@carljavier
carljavier / mermaid-test.md
Last active February 22, 2022 04:14
Mermaid Test
  graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;
flowchart LR
@carljavier
carljavier / external-service-chucknorris.json
Created March 4, 2022 08:21
Consul External Service Registration
{
"Node": "chucknorris",
"Address": "api.chucknorris.io",
"NodeMeta": {
"external-node": "true",
"external-probe": "true"
},
"Service": {
"ID": "chucknorris",
"Service": "chucknorris-api",
@carljavier
carljavier / query-template-catch-all.json
Last active April 11, 2022 00:31
Consul Vault Service Query
{
"Name": "",
"Template": {
"Type": "name_prefix_match"
},
"Service": {
"Service": "${name.full}",
"Failover": {
"NearestN": 2
}
@carljavier
carljavier / azure-pipeline.yaml
Created May 31, 2022 10:37
Azure DevOps TF Pipeline
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- script: echo Starting Terraform Run
@carljavier
carljavier / team-access.tf
Created June 1, 2022 10:49
TFE Team Access, Plan/Apply
# Two Teams, one is admin (apply) , and the other can only plan
resource "tfe_team" "gcp-network-admin" {
name = "gcp-network-admin"
organization = "my-org-name"
}
resource "tfe_team" "gcp-network-plan" {
name = "gcp-network-plan"
organization = "my-org-name"
}