sparse-intern-71089
09/26/2019, 5:27 PMacceptable-army-69872
09/26/2019, 5:49 PMearly-musician-41645
09/26/2019, 6:01 PMWrite-Host "Signaling CloudFormation that the instance is up and running"
cfn-signal.exe --success true --region ${config.region} --stack ${stackName} --resource Instances
Write-Host "Updating DNS addresses to match the Directory Service"
Set-DnsClientServerAddress -InterfaceIndex (Get-NetAdapter).ifIndex -ServerAddresses (${directoryDnsIpAddresses})
Write-Host "Joining the domain directory: ${directoryName}. This will force restart the instance."
$securePassword = ConvertTo-SecureString "${directoryPassword}" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential("Admin", $securePassword)
Add-Computer -Domain ${directoryName} -Credential $credential -Verbose -PassThru -Restart -Force
I've spent a couple days on this and found that UserData was the only way I could make progress. Was just wondering if this is already supported via Pulumi, e.g. through some launchconfiguration args for domain joining that would flow through as needed.early-musician-41645
09/26/2019, 6:03 PMclever-sunset-76585
09/26/2019, 6:05 PMclever-sunset-76585
09/26/2019, 6:07 PMearly-musician-41645
09/26/2019, 6:07 PMearly-musician-41645
09/26/2019, 6:07 PMclever-sunset-76585
09/26/2019, 6:07 PMearly-musician-41645
09/26/2019, 6:09 PMclever-sunset-76585
09/26/2019, 6:09 PMAlso, isn’t the whole point of UserData to run commands after provisioning?I am not too familiar with UserData myself to be honest.
early-musician-41645
09/26/2019, 6:09 PMearly-musician-41645
09/26/2019, 6:09 PMearly-musician-41645
09/26/2019, 6:10 PMclever-sunset-76585
09/26/2019, 6:14 PMUserData is just a script you set in AWS launch configurations to run commands after an instance comes upAh I see. Yeah perhaps the difference with the link I provided would be that it wouldn’t run the remote script every time the instance is restarted (in my case I didn’t need that) unless the script is installed to do so vs. having a script that runs every time the instance comes up? I am assuming using UserData does the latter automatically?
early-musician-41645
09/26/2019, 6:18 PMclever-sunset-76585
09/26/2019, 6:19 PM