-
Notifications
You must be signed in to change notification settings - Fork 89
Closed as not planned
Closed as not planned
Copy link
Labels
bugThis issue is a bug.This issue is a bug.module/cli-extp3This is a minor priority issueThis is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Description
Describe the bug
If you are not using a default profile set in ~/.aws/config and rely on setting the AWS_DEFAULT_PROFILE environment variable to select the required profile, the dotnet lambda delete-function command will fail unless a profile is specified inline.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
The function is deleted successfully.
Current Behavior
dotnet lambda delete-function --function-name <my_function_name> produces output indicating an error:
Amazon Lambda Tools for .NET Core applications (5.12.3)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet
Error deleting Lambda function: Unable to get IAM security credentials from EC2 Instance Metadata Service.
Reproduction Steps
- Ensure that there is not default credentials in
.aws/credentials. - Set
AWS_DEFAULT_PROFILEto<my_non_default_profile>. - Ensure
aws sts get-caller-identityworks, i.e., provides output like{ "UserId": "<my_user_id>", "Account": "<my_account_id>", "Arn": "arn:aws:iam::<my_account_id>:user/<my_non_default_profile>" } - Deploy a function using
dotnet lambda deploy-function. - Try to delete the function using
dotnet lambda delete-function --function-name <my_function_name>.
Possible Solution
The workaround is to specify the non-default profile inline:
dotnet lambda delete-function --function-name TunnelGPT --profile <my_non_default_profile>
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Amazon Lambda Tools for .NET Core applications (5.12.3)
Targeted .NET Platform
.NET 8
Operating System and version
Windows 11
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.module/cli-extp3This is a minor priority issueThis is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.