Skip to content

Commit eb7e990

Browse files
committed
Fixed DeploymentScript.ps1 for Serverless App integration test to create deployment bucket in correct region.
1 parent b8f3ba9 commit eb7e990

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Libraries/test/TestServerlessApp.IntegrationTests/DeploymentScript.ps1

+14-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,22 @@ try
3838
$content = Get-Content .\aws-lambda-tools-defaults.json
3939
$content | ForEach-Object {$_ -replace $line, "`"function-architecture`" : `"$arch`""} | Set-Content .\aws-lambda-tools-defaults.json
4040

41+
# Extract region
42+
$json = Get-Content .\aws-lambda-tools-defaults.json | Out-String | ConvertFrom-Json
43+
$region = $json.region
44+
4145
dotnet tool install -g Amazon.Lambda.Tools
4246
Write-Host "Creating S3 Bucket $identifier"
43-
aws s3 mb s3://$identifier
47+
48+
if(![string]::IsNullOrEmpty($region))
49+
{
50+
aws s3 mb s3://$identifier --region $region
51+
}
52+
else
53+
{
54+
aws s3 mb s3://$identifier
55+
}
56+
4457
if (!$?)
4558
{
4659
throw "Failed to create the following bucket: $identifier"

0 commit comments

Comments
 (0)