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
#Note that Write-Log Function is not present | |
function AzureLoginApi { | |
Param ( | |
[Parameter(Mandatory = $true)][string]$ClientID, | |
[Parameter(Mandatory = $true)][string]$ClientSecret, | |
[Parameter(Mandatory = $true)][string]$Tenant, | |
[Parameter(Mandatory = $false)][switch]$StorageLogin | |
) | |
try { | |
if ($StorageLogin) { $resource = "https://storage.azure.com/" } |
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
import boto3 | |
import time | |
region = 'eu-west-1' | |
user_data_script = """#!/bin/bash | |
instanceid=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
cd / | |
mkdir moodledata | |
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-xxxxxxxxxxc.efs.eu-west-1.amazonaws.com:/ moodledata | |
tar czf mooodledata-backup-$(date +%d-%m-%Y_%H-%M).tar.gz /moodledata | |
aws s3 mv mooodledata-backup-*.tar.gz s3://xxxxxxxxx/ |