Skip to content

Instantly share code, notes, and snippets.

View guillermo-musumeci's full-sized avatar

Guillermo Musumeci guillermo-musumeci

View GitHub Profile
@guillermo-musumeci
guillermo-musumeci / keyvault-root-output.tf
Last active January 15, 2020 10:54
keyvault-root-output.tf
output "key-vault-id" {
description = "Key Vault ID"
value = module.keyvault.key-vault-id
}
output "key-vault-url" {
description = "Key Vault URI"
value = module.keyvault.key-vault-url
}
@guillermo-musumeci
guillermo-musumeci / keyvault-terraform.tfvars.tf
Created January 15, 2020 08:53
keyvault-terraform.tfvars.tf
kv-full-object-id =""
kv-read-object-id =""
kv-secrets = {
sqldb = {
value = "" # setting to "" will auto-generate the password
}
webadmin = {
value = "hLDmexfL8@m46Suevb!oao"
}
}
@guillermo-musumeci
guillermo-musumeci / keyvault-root-main.tf
Created January 15, 2020 08:51
keyvault-root-main.tf
module "keyvault" {
source = "./modules/keyvault"
name = "${var.environment}-keyvault"
location = azurerm_resource_group.security-rg.location
resource_group_name = azurerm_resource_group.security-rg.name
enabled_for_deployment = var.kv-vm-deployment
enabled_for_disk_encryption = var.kv-disk-encryption
enabled_for_template_deployment = var.kv-template-deployment
@guillermo-musumeci
guillermo-musumeci / keyvault-root-variables.tf
Created January 15, 2020 08:48
keyvault-root-variables.tf
#######################
# Key Vault variables #
#######################
variable "kv-full-object-id" {
type = string
description = "The object ID of a user, service principal or security group in the Azure Active Directory tenant for FULL access to the Azure Key Vault"
default = ""
}
@guillermo-musumeci
guillermo-musumeci / keyvault-output.tf
Created January 15, 2020 08:12
keyvault-output.tf
output "key-vault-id" {
description = "Key Vault ID"
value = azurerm_key_vault.key-vault.id
}
output "key-vault-url" {
description = "Key Vault URI"
value = azurerm_key_vault.key-vault.vault_uri
}
@guillermo-musumeci
guillermo-musumeci / keyvault-main.tf
Last active January 14, 2020 17:25
keyvault-main.tf
data "azurerm_client_config" "current" {}
# Create the Azure Key Vault
resource "azurerm_key_vault" "key-vault" {
name = var.name
location = var.location
resource_group_name = var.resource_group_name
enabled_for_deployment = var.enabled_for_deployment
enabled_for_disk_encryption = var.enabled_for_disk_encryption
##################################
# Azure Resource Group variables #
##################################
variable "resource_group_name" {
type = string
description = "The name of an existing Resource Group"
}
variable "location" {
@guillermo-musumeci
guillermo-musumeci / Set-NTP-Client.ps1
Last active September 11, 2023 20:30
Set Time Zone and NTP Client using PowerShell
# Configure Time Zone and NTP server
# Variables
$TimeZone = "Romance Standard Time"
$NTPServer = "ntp.kopicloud.local"
# Configure NTP and restart service
Set-TimeZone -Id $TimeZone -PassThru
Push-Location
Set-Location HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers
@guillermo-musumeci
guillermo-musumeci / Create-EBS-volume-snapshot.cmd
Created September 23, 2019 18:28
Create EBS volume snapshot
aws ec2 create-snapshot --volume-id vol-01234567890abcdef --description 'prod database data backup'
@guillermo-musumeci
guillermo-musumeci / Install-VSCode.ps1
Created September 9, 2019 16:25
Unattended Install of Visual Studio Code for Windows using PowerShell
# Unattended Install of Visual Studio Code
$channel = 'stable'
$platform = 'win32-x64-user'
$SourceURL = "https://vscode-update.azurewebsites.net/latest/$platform/$channel";
$Installer = $env:TEMP + "\vscode.exe";
Invoke-WebRequest $SourceURL -OutFile $Installer;
Start-Process -FilePath $Installer -Args "/verysilent /tasks=addcontextmenufiles,addcontextmenufolders,addtopath" -Wait;
Remove-Item $Installer;
Stop-Process -Name Explorer