-
Notifications
You must be signed in to change notification settings - Fork 13
Automatically install Amazon.Lambda.TestTool #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ffbb42b
1662376
21c6ad8
0de32d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"Projects": [ | ||
{ | ||
"Name": "Aspire.Hosting.AWS", | ||
"Type": "Patch", | ||
"ChangelogMessages": [ | ||
"Automatically install .NET Tool Amazon.Lambda.TestTool when running Lambda functions" | ||
] | ||
} | ||
] | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
using Aspire.Hosting.ApplicationModel; | ||
using k8s.KubeConfigModels; | ||
|
||
namespace Aspire.Hosting.AWS.Lambda; | ||
|
||
|
||
/// <summary> | ||
/// Resource representing the Amazon API Gateway emulator. | ||
/// </summary> | ||
/// <param name="name">Aspire resource name</param> | ||
public class APIGatewayEmulatorResource(string name, APIGatewayType apiGatewayType) : ExecutableResource(name, | ||
"dotnet", | ||
Environment.CurrentDirectory | ||
) | ||
{ | ||
internal void AddCommandLineArguments(IList<object> arguments) | ||
{ | ||
arguments.Add("lambda-test-tool"); | ||
arguments.Add("start"); | ||
arguments.Add("--no-launch-window"); | ||
|
||
arguments.Add("--api-gateway-emulator-mode"); | ||
arguments.Add(apiGatewayType.ToString()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
namespace Aspire.Hosting.AWS.Lambda; | ||
|
||
/// <summary> | ||
/// Options that can be added to the Lambda emulator resource. | ||
/// </summary> | ||
public class LambdaEmulatorOptions | ||
{ | ||
/// <summary> | ||
/// By default Amazon.Lambda.TestTool will be updated/installed during AppHost startup. Amazon.Lambda.TestTool is | ||
/// a .NET Tool that will be installed globally. | ||
/// | ||
/// When DisableAutoInstall is set to true the auto installation is disabled. | ||
/// </summary> | ||
public bool DisableAutoInstall { get; set; } | ||
|
||
/// <summary> | ||
/// Override the minimum version of Amazon.Lambda.TestTool that will be installed. If a newer version is already installed | ||
/// it will be used unless AllowDowngrade is set to true. | ||
/// </summary> | ||
public string? OverrideMinimumInstallVersion { get; set; } | ||
|
||
/// <summary> | ||
/// If set to true, and a newer version of Amazon.Lambda.TestTool is already installed then the requested version, the installed version | ||
/// will be downgraded to the request version. | ||
/// </summary> | ||
public bool AllowDowngrade { get; set; } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
using Aspire.Hosting.ApplicationModel; | ||
|
||
namespace Aspire.Hosting.AWS.Lambda; | ||
|
||
|
||
/// <summary> | ||
/// Resource representing the Lambda Runtime API service emulator. | ||
/// </summary> | ||
/// <param name="name">Aspire resource name</param> | ||
public class LambdaEmulatorResource(string name) : ExecutableResource(name, | ||
"dotnet", | ||
Environment.CurrentDirectory | ||
) | ||
{ | ||
internal void AddCommandLineArguments(IList<object> arguments) | ||
{ | ||
arguments.Add("lambda-test-tool"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question on tool name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also didn't we change the behavior so that you need to specify the port for the emulator to run? won't this error out as is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed in sync meeting. |
||
arguments.Add("start"); | ||
arguments.Add("--no-launch-window"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the name of our tool
dotnet-lambda-test-tool
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparently
dotnet lambda-test-tool
works and so doesdotnet-lambda-test-tool
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in sync meeting and we are on the same page now.