View mmaAddCloudWorkspace.ps1
This file contains 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) |
View actionGroup.bicep
This file contains 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 |
View policyAssignment.bicep
This file contains 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' |
View policyDefinition.bicep
This file contains 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 |
View main.bicep
This file contains 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 = 'jesse.loudon@lab3.com.au' |
View example.tf
This file contains 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 |
View ubuntu-setup-ansible.sh
This file contains 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 |
View extension.tf
This file contains 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"] |
View shutdown.tf
This file contains 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" |
View vm.tf
This file contains 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