From eb7e990a136ee69cfbfec50e4b14b3b892ae5fdb Mon Sep 17 00:00:00 2001 From: Ashish Dhingra <67916761+ashishdhingra@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:16:40 -0700 Subject: [PATCH] Fixed DeploymentScript.ps1 for Serverless App integration test to create deployment bucket in correct region. --- .../DeploymentScript.ps1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Libraries/test/TestServerlessApp.IntegrationTests/DeploymentScript.ps1 b/Libraries/test/TestServerlessApp.IntegrationTests/DeploymentScript.ps1 index d6b8e3d84..38a358d22 100644 --- a/Libraries/test/TestServerlessApp.IntegrationTests/DeploymentScript.ps1 +++ b/Libraries/test/TestServerlessApp.IntegrationTests/DeploymentScript.ps1 @@ -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"