This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string]$workspaceId, | |
[string]$workspaceKey | |
) | |
$mma = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg' | |
if ($mma.GetCloudWorkspace($workspaceId).workspaceid -ne $workspaceId) | |
{ | |
$mma.AddCloudWorkspace($workspaceId, $workspaceKey) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
targetScope = 'resourceGroup' | |
// PARAMETERS | |
param actionGroupName string | |
param actionGroupEnabled bool | |
param actionGroupShortName string | |
param actionGroupEmailName string | |
param actionGroupEmail string | |
param actionGroupAlertSchema bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
targetScope = 'subscription' | |
// PARAMETERS | |
param bicepExampleInitiativeId string | |
param assignmentIdentityLocation string | |
param assignmentEnforcementMode string | |
// RESOURCES | |
resource bicepExampleAssignment 'Microsoft.Authorization/policyAssignments@2020-09-01' = { | |
name: 'bicepExampleAssignment' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
targetScope = 'subscription' | |
// PARAMETERS | |
param actionGroupName string | |
param actionGroupRG string | |
param actionGroupId string | |
param metricAlertResourceNamespace string | |
param metricAlertName string | |
param metricAlertDimension1 string | |
param metricAlertDimension2 string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
targetScope = 'subscription' | |
// PARAMETERS | |
param resourceGroupName string = 'BicepExampleRG' | |
param resourceGrouplocation string = 'australiaeast' | |
param actionGroupName string = 'BicepExampleAG' | |
param actionGroupEnabled bool = true | |
param actionGroupShortName string = 'bicepag' | |
param actionGroupEmailName string = 'jloudon' | |
param actionGroupEmail string = '[email protected]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_policy_set_definition" "example" { | |
name = "foundations" | |
policy_type = "Custom" | |
display_name = "Foundations" | |
description = "Contains built-in policies for Foundations" | |
metadata = jsonencode({ category = "Custom", version = "1.0.0", source = "Terraform" }) | |
dynamic "policy_definition_reference" { #built-in policies without parameter_values | |
for_each = data.azurerm_policy_definition.builtin_policies_foundations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This file should be sourced | |
# Change directory to user home | |
cd /home/ansibleadmin | |
# Upgrade all packages that have available updates and remove old ones. | |
sudo apt-get update | |
sudo apt upgrade -y | |
sudo apt autoremove --assume-yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_virtual_machine_extension" "vm1extension" { | |
name = var.vmName | |
virtual_machine_id = azurerm_linux_virtual_machine.vm1.id | |
publisher = "Microsoft.Azure.Extensions" | |
type = "CustomScript" | |
type_handler_version = "2.1" | |
settings = <<SETTINGS | |
{ | |
"fileUris":["https://raw.githubusercontent.com/globalbao/terraform-azurerm-ansible-linux-vm/master/scripts/ubuntu-setup-ansible.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "vmShutdownTime" { | |
type = string | |
description = "virtual machine daily shutdown time" | |
default = "1900" | |
} | |
variable "vmShutdownTimeZone" { | |
type = string | |
description = "virtual machine daily shutdown time zone" | |
default = "AUS Eastern Standard Time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "vmName" { | |
type = string | |
description = "virtual machine name w/ technician's initials as a suffix" | |
default = "ansibledev-yourinitials" | |
} | |
variable "vmSize" { | |
type = string | |
description = "virtual machine size" | |
default = "Standard_B2s" |
NewerOlder