generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Csr/dsos 2171/fix ad connectivity (#3356)
* add domain controller sg to asg * add ec2 instance for testing in dev * fix casing and name * add kerberos ports to domain-controller sg * increase domain-controller range to all of fixngo * add port 389 to ports list * add test linux asg * allow ldap global catalog * add tcp ldap secure port 636 * add TCP and UDP netbios sg rules * add second test instance without any local hacks * add turn off schedule for asg's in dev * tidy up
- Loading branch information
1 parent
3aeb5ae
commit a8c2a50
Showing
6 changed files
with
234 additions
and
27 deletions.
There are no files selected for viewing
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
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
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
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
43 changes: 43 additions & 0 deletions
43
terraform/environments/corporate-staff-rostering/ssm-documents/windows-domain-join.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
schemaVersion: "2.2" | ||
description: "SSM Document for creating local configs on Windows Server" | ||
parameters: | ||
domainJoinUsername: | ||
type: "String" | ||
description: "username for the domain join credentials" | ||
domainJoinPassword: | ||
type: "String" | ||
description: "password for the domain join credentials" | ||
hostname: | ||
type: "String" | ||
description: "hostname for the new instance" | ||
domain: | ||
type: "String" | ||
description: "domain to join" | ||
mainSteps: | ||
- name: JoinDomain | ||
action: aws:runPowerShellScript | ||
inputs: | ||
runCommand: | ||
- | | ||
$ErrorActionPreference = "Stop" # all errors will terminate the script | ||
$domainUsername = "{{domainJoinUsername}}" | ||
$domainPassword = "{{domainJoinPassword}}" | ||
$hostname = "{{hostname}}" | ||
$domain = "{{domain}}" | ||
# TODO: set up the domain join pre-requisites here | ||
# TODO: check if the proposed hostname is already in use | ||
# TODO: check if the instance is part of an ASG and terminate if it is since reboot may just result in another instance being spawned which won't be joined to the domain | ||
$secpasswd = ConvertTo-SecureString $domainPassword -AsPlainText -Force | ||
$mycreds = New-Object System.Management.Automation.PSCredential ($domainUsername, $secpasswd) | ||
# TODO: check this next command is in a fit state to be run before the domain join | ||
# TODO: check to what extent we need to rename the instance and add it to the domain | ||
Add-Computer -DomainName $domain -Credential $mycreds -NewName $hostname -Restart |
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