Skip to content

Commit

Permalink
Fixed an issue where CodeUri set in Globals section is ignored for AW…
Browse files Browse the repository at this point in the history
…S::Serverless::Function resource.
  • Loading branch information
ashishdhingra committed Jul 3, 2024
1 parent d9670b0 commit 6f68cd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Amazon.Lambda.Tools/Amazon.Lambda.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Copyright>Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
<Product>AWS Lambda Tools for .NET CLI</Product>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Version>5.10.6</Version>
<Version>5.10.7</Version>
</PropertyGroup>
<ItemGroup>
<Content Include="Resources\build-lambda-zip.exe">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static FieldDefinition CreateFieldDefinitionForLambda(bool isServerlessRe
string localPath;
var packageType = s.GetValue(LambdaConstants.CF_LAMBDA_PACKAGE_TYPE);

if(isServerlessResource)
if (isServerlessResource)
{
if (string.Equals(PackageType.Image.Value, packageType, StringComparison.OrdinalIgnoreCase))
{
Expand All @@ -134,6 +134,12 @@ public static FieldDefinition CreateFieldDefinitionForLambda(bool isServerlessRe
else
{
localPath = s.GetValue(LambdaConstants.CF_LAMBDA_CODEURI);

// Get value from Globals section for AWS::Serverless::Function
if (string.IsNullOrEmpty(localPath))
{
localPath = s.GetValueFromRoot("Globals", "Function", LambdaConstants.CF_LAMBDA_CODEURI);
}
}
}
else
Expand Down

0 comments on commit 6f68cd4

Please sign in to comment.