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
| terraforming alb > alb.tf --use-bundled-cert # ALB | |
| terraforming asg > asg.tf --use-bundled-cert # AutoScaling Group | |
| terraforming cwa > cwa.tf --use-bundled-cert # CloudWatch Alarm | |
| terraforming dbpg > dbpg.tf --use-bundled-cert # Database Parameter Group | |
| terraforming dbsg > dbsg.tf --use-bundled-cert # Database Security Group | |
| terraforming dbsn > dbsn.tf --use-bundled-cert # Database Subnet Group | |
| terraforming ddb > ddb.tf --use-bundled-cert # DynamoDB | |
| terraforming ec2 > ec2.tf --use-bundled-cert # EC2 | |
| terraforming ecc > ecc.tf --use-bundled-cert # ElastiCache Cluster | |
| terraforming ecsn > ecsn.tf --use-bundled-cert # ElastiCache Subnet Group |
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 | |
| ec2Client = boto3.client('ec2') | |
| ec2Resource = boto3.resource('ec2') | |
| for instance in ec2Resource.instances.all(): | |
| for tag in instance.tags: | |
| if tag['Key'] == 'Name': | |
| list_of_snapshots = [] | |
| check_value = [] | |
| check_value.append(tag['Value'] + '*') | |
| snapshotsByTag = ec2Client.describe_snapshots(Filters=[{'Name':'tag:Name', 'Values': [check_value[0]]}])['Snapshots'] |
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
| dotnet tool update --global dotnet-outdated-tool | |
| $errorCount = 0 | |
| Get-ChildItem -Path .\ -Filter *.csproj -Recurse -File -Name| ForEach-Object { | |
| [System.IO.Path]::GetFileNameWithoutExtension($_) | |
| dotnet outdated $_ -f -inc CB. -u | |
| if ($LASTEXITCODE -ne 0) | |
| { | |
| $errorCount++ | |
| } | |
| } |
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 "az_region" { | |
| type = string | |
| default = "UK South" | |
| } | |
| variable "az_region_abbr_map" { | |
| type = map(any) | |
| description = "Map is used to obtain 3 letter azure region abreviation for naming resources" | |
| default = { | |
| "Central US" = "cus" | |
| "East US 2" = "eus2" |
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
| $blobName = "" | |
| $resourceGroup = "" | |
| $storageAccount = "" | |
| $container = "" | |
| $context = (Get-AzStorageAccount -ResourceGroupName $resourceGroup -AccountName $storageAccount).Context | |
| $blob = (Get-AzStorageBlob -Context $context -Container $container -Blob $blobName) | |
| $leaseStatus = $blob.ICloudBlob.Properties.LeaseStatus; | |
| switch ($leaseStatus) | |
| { | |
| "Locked" |
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
| function Get-AzVMStatus | |
| { | |
| param( | |
| [Parameter(Mandatory=$true)][string]$resourceGroup, | |
| [Parameter(Mandatory=$true)][string]$vmName, | |
| ) | |
| return (Get-AzVM -ResourceGroupName $resourceGroup -Name $vmName -Status).Statuses[1].DisplayStatus | |
| } |
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
| $registry = "myRegistry" | |
| $keep = 5 | |
| $prAgo = "7d" | |
| $masterAgo = "90d" | |
| $prCron = "0 0 * * *" | |
| $masterCron = "0 0 * * *" | |
| $repositories = @("foo.bar", | |
| "bar.foo", | |
| "foobar.boofoo", | |
| "barfoo.foobar" |
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
| switch ((Get-WmiObject -class Win32_OperatingSystem).Caption) | |
| { | |
| {$_.Contains("Home")} { Write-Output "Home" } | |
| {$_.Contains("Business")} { Write-Output "Business" } | |
| {$_.Contains("Enterprise")} { Write-Output "Enterprise" } | |
| Default { "Unknown" } | |
| } |
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
| #!/usr/bin/env bash | |
| cd /config | |
| git status | |
| git add . | |
| dt=$(date '+%d/%m/%Y %H:%M:%S'); | |
| git commit -m "$dt" | |
| git push origin master |
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
| $length = 10 | |
| Write-Output (-Join ((65..90) + (97..122) | Get-Random -Count $length | % {[char]$_})) |