-
Notifications
You must be signed in to change notification settings - Fork 1
Home
writeameer edited this page Oct 18, 2011
·
7 revisions
Helper Powershell functions to interact with the Route53 Amazon Web Service
To Install this as a powershell module, just create a folder under the "$PROFILE.AllUsersAllHosts\modules" folder and drop the Route53Tools.psm1 script there:
# Create modules folder if required $modulesfolder = Split-Path($PROFILE.AllUsersAllHosts) $modulesfolder = $modulesfolder + "\modules" mkdir -force $modulesFolder # Create a folder for this powershell module mkdir -force "$modulesFolder\Route53Tools" Copy-Item -Force ".\Route53Tools.psm1" "$modulesFolder\Route53Tools"
Import-Module Route53Tools # Import module in to current session
[Route53Helper.Authentication]::AwsAccessKeyId = "<AWS Access Key ID>" [Route53Helper.Authentication]::AwsSecretAccessKey = "<AWS Secret Access Key>"
Show-HostedZones
Remove-HostedZone -hostedZoneId "<hosted zone id>"
Show-ResourceRecords -hostedZoneId "<hosted zone id>"
New-ARecord -comment "Testing" -domainName "mail.cloudoman.com" -hostedZoneId "<hosted zone id>" -ttl 10 -type "A" -value "10.1.1.1"
Remove-ARecord -comment "Testing" -domainName "mail.cloudoman.com" -hostedZoneId "<hosted zone id>" -ttl 10 -type "A" -value "10.1.1.1"