问题
As of Dec 1, 2016, AWS Lambda now supports functions in C# that runs in the .NET Core 1.0 runtime. So I created the function using the VS AWS Lambda Template. I tried to publish the lambda function via the "Publish to AWS Lambda..." context menu in VS. So after configuring the function(selecting the S3 bucket, region, etc) in the dialog box, I click publish and at the end of the publish process, I am getting error:
Error creating CloudFormation change set: User: arn:aws:iam::***:user/demo_user is not authorized to perform: cloudformation:CreateChangeSet on resource: arn:aws:cloudformation:us-east-1:****:stack/****
I figured I can just attach/grant a policy to the group/user to cloudformation but I can only see this policy in the selection: AWSCloudFormationReadOnlyAccess
I was expecting to see some kind of ReadWrite or FullAccess.
Need help publishing the function to AWS lambda. Thanks!
回答1:
Provide full access to user profile for Lambda Deployment.Lambda Permission Image
回答2:
I believe this is related to the account profile to use; this one needs to be allowed to publish the lambda.
From within Visual Studio, when you right-click the AWS Lambda project -> Publish, you see the window to publish. At the top is the account profile to use and the Region where to publish to; default takes the aws_user account that you used when you installed the plugin
What you can try is to provide your own user the AWSLambdaFullAccess policy to be able to publish the lambda. You can do this within the IAM console of AWS.
Instead of using the context menu, you could also try publishing from the dotnet cli command line.
- in the console, go to the folder where your .net core project is
- here you can use the dotnet lambda console functions.
this is because from this folder, the dotnet cli is able to find and use the AWS packages located in the packages subfolder / or uses project.json to locate those.
Example:
dotnet lambda package
will build & package the to be published files.
dotnet lambda deploy-function
will publish your lambda function to AWS Cloud.
来源:https://stackoverflow.com/questions/41292599/error-in-publishing-an-aws-lambda-function-built-in-net-core