AWS Tools for Visual Studio 2017



我正在使用AWS工具套件包含的模板为Visual Studio 2017创建一个无服务的ASP.NET Core 2 Web API服务,该Web 2 Web API服务代理AWS Lambda函数内部托管的S3桶。我能够使用dotnet cli

部署它
dotnet lambda deploy-serverless

sub命令的所有参数都存储在 AWS-LAMBDA-TOOLS-DEFAULTS.JSON 文件。除了为CloudFormation模板设置的参数

外,一切都可以预期。
{
"Information" : [
    "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
    "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",
    "dotnet lambda help",
    "All the command line options for the Lambda command can be specified in this file."
],
"profile"     : "Development",
"region"      : "ap-southeast-2",
"configuration" : "Release",
"framework"     : "netcoreapp2.0",
"s3-prefix"     : "s3-prefix/",
"s3-bucket"     : "s3-bucket-name",
"stack-name"    : "stack-name",
"template"      : "serverless.template",
"template-parameters" : ""ShouldCreateBucket"="true";"BucketName"="app-bucket-name"",
    "stack-wait"          : true
}

在创建堆栈之前,这些参数未传递到模板中。任何人都可以阐明这一点吗?我是否缺少某些内容,或者是AWS工具用于Visual Studio的错误?

感谢您的时间!

现在可以回答我自己的问题...这是人为错误。我在"条件"中做了一个错字,因此Bucketnamenotprovided总是是错误的。

"Conditions" : {
"CreateS3Bucket" : {"Fn::Equals" : [{"Ref" : "ShouldCreateBucket"}, "true"]},
"BucketNameNotProvided" : {"Fn::Equals" : [{"Ref" : "BucketName"}, ""]}}

因此,从"属性"中删除了模板" bucketname"中的进一步,导致带有自动生成名称的桶。

"Bucket" : {
    "Type" : "AWS::S3::Bucket",
    "Condition" : "CreateS3Bucket",
    "Properties" : {
        "BucketName" : { "Fn::If" : ["BucketNameNotProvided", {"Ref" : "AWS::NoValue" }, { "Ref" : "BucketName" } ] }
    }
}

相关内容

  • 没有找到相关文章

最新更新