Skip to content

Instantly share code, notes, and snippets.

:octocat:
yalla

Omer Barel jungopro

:octocat:
yalla
Block or report user

Report or block jungopro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jungopro
jungopro / TerraformInitAzureBackend.sh
Created Jun 4, 2019
Bash Script to Initialize Terraform with Remote State in Azure Storage
View TerraformInitAzureBackend.sh
#!/bin/bash
#
# Maintainer: Omer Barel (jungo@jungopro.com)
######################################################################################################################################################################
# Examples:
#
#
# Run with minimum values (Note that the defaults should pre-exist in your shell environment: TFM_STORAGE_NAME, TFM_STORAGE_CONTAINER, TFM_STORAGE_ACCESS_KEY)
# TerraformInitAzureBackend.sh -f "terraform.tfstate"
View vm_and_secret.tf
provide "azurerm" {}
## Declare Variables
variable "resource_group_name" {
default = "my-resource-group"
}
variable "location" {
default = "West Europe"
View secret.tf
resource "random_string" "password" {
length = 14
min_upper = 2
min_lower = 2
min_numeric = 2
min_special = 2
}
resource "azurerm_key_vault_secret" "secret" {
name = "${var.secret_name}"
@jungopro
jungopro / variables.tf
Created Oct 5, 2018
Sample Terraform Variables
View variables.tf
# Variables
variable "ad_tenant_id" {}
@jungopro
jungopro / mytfvars.sh
Created Oct 5, 2018
Sample Terraform Variables shell export
View mytfvars.sh
$ vi .mytfvars
# TF Azure configuration
export TF_VAR_ad_tenant_id=11111111-1111-1111-1111-111111111111
@jungopro
jungopro / createsecrets.sh
Last active Mar 19, 2019
Sample Azure Credentials shell export
View createsecrets.sh
az keyvault secret set --name ARM-SUBSCRIPTION-ID --vault-name myVault --value ##ARM_SUBSCRIPTION_ID##
az keyvault secret set --name ARM-CLIENT-ID --vault-name myVault --value ##ARM_CLIENT_ID##
az keyvault secret set --name ARM-CLIENT-SECRET --vault-name myVault --value ##ARM_CLIENT_SECRET##
az keyvault secret set --name ARM-TENANT-ID --vault-name myVault --value ##ARM_TENANT_ID##
@jungopro
jungopro / main.tf
Created Oct 5, 2018
Basic provider with hardcoded credentials
View main.tf
provider "azurerm" {
subscription_id = "xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"
client_id ="xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"
client_secret ="xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"
tenant_id ="xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"
}
@jungopro
jungopro / custom-dashboards.yaml
Created Sep 10, 2018
custom-dashboards.yaml configMap
View custom-dashboards.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: custom-dashboards
data:
{{ (.Files.Glob "custom-dashboards/*.json").AsConfig | indent 2 }}
@jungopro
jungopro / values.yaml
Created Sep 10, 2018
Grafana modified values.yaml
View values.yaml
...
## A list of additional configmaps that contain -dashboard.json and/or -datasource.json files
## that should be imported into grafana.
serverDashboardConfigmaps:
- custom-dashboards
...
@jungopro
jungopro / customized-dashboard.json
Created Sep 10, 2018
Sample Customised Grafana Dashboard
View customized-dashboard.json
{
"__inputs": [
{
"name": "DS_DEV-PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
You can’t perform that action at this time.