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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Create a basic Amazon Linux Server", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Key Pair name", | |
"Type": "AWS::EC2::KeyPair::KeyName", | |
"Default": "keyPair" | |
}, | |
"VPC": { |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Create a basic Amazon Linux Server with security group in existing VPC and subnet | |
Parameters: | |
KeyName: | |
Description: Key Pair name | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
Default: keyPair | |
VPC: | |
Description: Select a VPC | |
Type: 'AWS::EC2::VPC::Id' |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Create a basic Amazon Linux Server with security group in existing VPC and subnet | |
Parameters: | |
KeyName: | |
Description: Key Pair name | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
Default: keyPair | |
VPC: | |
Description: Select a VPC | |
Type: 'AWS::EC2::VPC::Id' |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Create a basic Amazon Linux Server with security group in existing VPC and subnet | |
Parameters: | |
KeyName: | |
Description: Key Pair name | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
Default: keyPair | |
VPC: | |
Description: Select a VPC | |
Type: 'AWS::EC2::VPC::Id' |
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
#will return the latest Amazon Linux AMI IDs using EBS for the listed regions | |
$regions = "eu-west-1","eu-west-2","eu-central-1" | |
foreach($region in $regions){ | |
$ami = Get-EC2Image -Region $region | | |
Where-Object {$_.imageowneralias -eq "amazon" -and $_.virtualizationtype -eq "hvm" -and $_.name -like "*amzn-ami-hvm*" -and $_.rootdevicetype -eq "ebs"} | | |
Sort-Object -Property creationdate -Descending | | |
Select-Object -Property imageid -First 1 | |
$output = "$region = " + $ami.ImageId |
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
# Get latest Amazon Windows Core AMI and update the ami id in the specified file. | |
# Needs the AWSPowerShell module installed and credentials configured. | |
Import-Module -Name AWSPowerShell | |
$windowsName = 'WINDOWS_2016_Core' | |
$region = 'eu-west-2' | |
$cfFileLocation = 'c:\cloudfromation\win-servers\ec2.yml' | |
#Get the latest AMI ID | |
$imageId = (Get-EC2ImageByName -Name $windowsName -Region $region).ImageId |
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
$majorVersion = $Host.Version.Major.ToString() | |
$minorVersion = $Host.Version.Minor.ToString() | |
$version = "$majorVersion.$minorVersion" | |
#module Imports | |
Import-Module azureext | |
Import-Module AWSPowerShell | |
#aliases | |
New-Alias -Name sub -Value Select-AzureRmSubscription |
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
$rgName = 'domain-services-rg' | |
$location = 'Northeurope' | |
$vnetName = 'northeurope-vnet' | |
$addressPrefix = '10.1.0.0/16' | |
$subName1 = 'gateway-sub' | |
$subAddress1 = '10.1.0.0/28' | |
$subName2 = 'frontend-sub' | |
$subAddress2 = '10.1.1.0/24' | |
$subName3 = 'backend-sub' | |
$subAddress3 = '10.1.2.0/24' |
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
<?xml version="1.0" encoding="utf-8"?> | |
<NetworkConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration"> | |
<VirtualNetworkConfiguration> | |
<Dns /> | |
<VirtualNetworkSites> | |
<VirtualNetworkSite name="Group domain-services-rg domain-services-vnet" Location="North Europe"> | |
<AddressSpace> | |
<AddressPrefix>10.0.0.0/16</AddressPrefix> | |
</AddressSpace> | |
<Subnets> |
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
# Set up vnet perring between the classic and ARM vnet | |
$resourceGroupName = 'domain-services-rg' | |
$classicVnetName = 'domain-services-vnet' | |
# Enter the name of the AzureRM subscription the VNETs are deployed in. Run (Get-AzureRmSubscription).SubscriptionName after authenticating to AzureRM | |
$subScriptionName = '' | |
# save current vnet in var | |
$vnet = Get-AzureRmVirtualNetwork -Name northeurope-vnet -ResourceGroupName domain-services-rg | |
# create the id for the classic vnet - we need the subscription id, resource group name and classic vnet to form the id |
OlderNewer