Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drobinson-moj committed Feb 13, 2024
1 parent 1b6dcf4 commit 9b8743e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions powershell/Modules/ModPlatformAD/ModPlatformADCredential.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Get-ModPlatformADCredential {

$ErrorActionPreference = "Stop"

$AccountIdsRaw = aws ssm get-parameter --name $AccountIdsSSMParameterName --with-decryption --query Parameter.Value --region "eu-west-2" --output text
$AccountIdsRaw = aws ssm get-parameter --name $AccountIdsSSMParameterName --with-decryption --query Parameter.Value --output text
$AccountIds = "$AccountIdsRaw" | ConvertFrom-Json
$SecretAccountId = $AccountIds.[string]$ModPlatformADConfig.SecretAccountName
$SecretName = $ModPlatformADConfig.SecretName
Expand All @@ -50,12 +50,12 @@ function Get-ModPlatformADCredential {
$env:AWS_ACCESS_KEY_ID = $Creds.Credentials.AccessKeyId
$env:AWS_SECRET_ACCESS_KEY = $Creds.Credentials.SecretAccessKey
$env:AWS_SESSION_TOKEN = $Creds.Credentials.SessionToken
$SecretValueRaw = aws secretsmanager get-secret-value --secret-id "${SecretArn}" --query SecretString --region "eu-west-2" --output text
$SecretValueRaw = aws secretsmanager get-secret-value --secret-id "${SecretArn}" --query SecretString --output text
$env:AWS_ACCESS_KEY_ID = $Tmp_AWS_ACCESS_KEY_ID
$env:AWS_SECRET_ACCESS_KEY = $Tmp_AWS_SECRET_ACCESS_KEY
$env:AWS_SESSION_TOKEN = $Tmp_AWS_SESSION_TOKEN
} else {
$SecretValueRaw = aws secretsmanager get-secret-value --secret-id "${SecretArn}" --query SecretString --region "eu-west-2" --output text
$SecretValueRaw = aws secretsmanager get-secret-value --secret-id "${SecretArn}" --query SecretString --output text
}
$SecretValue = "$SecretValueRaw" | ConvertFrom-Json
$DomainJoinUsername = $ModPlatformADConfig.DomainJoinUsername
Expand Down

0 comments on commit 9b8743e

Please sign in to comment.