Skip to content

Commit

Permalink
Fixed DeploymentScript.ps1 for Serverless App integration test to cre…
Browse files Browse the repository at this point in the history
…ate deployment bucket in correct region.
  • Loading branch information
ashishdhingra committed Jul 30, 2024
1 parent b8f3ba9 commit eb7e990
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,22 @@ try
$content = Get-Content .\aws-lambda-tools-defaults.json
$content | ForEach-Object {$_ -replace $line, "`"function-architecture`" : `"$arch`""} | Set-Content .\aws-lambda-tools-defaults.json

# Extract region
$json = Get-Content .\aws-lambda-tools-defaults.json | Out-String | ConvertFrom-Json
$region = $json.region

dotnet tool install -g Amazon.Lambda.Tools
Write-Host "Creating S3 Bucket $identifier"
aws s3 mb s3://$identifier

if(![string]::IsNullOrEmpty($region))
{
aws s3 mb s3://$identifier --region $region
}
else
{
aws s3 mb s3://$identifier
}

if (!$?)
{
throw "Failed to create the following bucket: $identifier"
Expand Down

0 comments on commit eb7e990

Please sign in to comment.