-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from aws/master
updating master
- Loading branch information
Showing
166 changed files
with
12,149 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ild-NETCore_2_1/AspNetCoreWebAPI-FSharp/template/src/BlueprintBaseName.1/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Warning" | ||
"Default": "Information" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...ns/Msbuild-NETCore_2_1/AspNetCoreWebAPI/template/src/BlueprintBaseName.1/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
193 changes: 121 additions & 72 deletions
193
...Msbuild-NETCore_2_1/AspNetCoreWebAPI/template/src/BlueprintBaseName.1/serverless.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,127 @@ | ||
{ | ||
"AWSTemplateFormatVersion" : "2010-09-09", | ||
"Transform" : "AWS::Serverless-2016-10-31", | ||
"Description" : "An AWS Serverless Application that uses the ASP.NET Core framework running in Amazon Lambda.", | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Transform": "AWS::Serverless-2016-10-31", | ||
"Description": "An AWS Serverless Application that uses the ASP.NET Core framework running in Amazon Lambda.", | ||
|
||
"Parameters" : { | ||
"ShouldCreateBucket" : { | ||
"Type" : "String", | ||
"AllowedValues" : ["true", "false"], | ||
"Description" : "If true then the S3 bucket that will be proxied will be created with the CloudFormation stack." | ||
}, | ||
"BucketName" : { | ||
"Type" : "String", | ||
"Description" : "Name of S3 bucket that will be proxied. If left blank a name will be generated.", | ||
"MinLength" : "0" | ||
} | ||
}, | ||
"Parameters": { | ||
"ShouldCreateBucket": { | ||
"Type": "String", | ||
"AllowedValues": [ | ||
"true", | ||
"false" | ||
], | ||
"Description": "If true then the S3 bucket that will be proxied will be created with the CloudFormation stack." | ||
}, | ||
"BucketName": { | ||
"Type": "String", | ||
"Description": "Name of S3 bucket that will be proxied. If left blank a name will be generated.", | ||
"MinLength": "0" | ||
} | ||
}, | ||
"Conditions": { | ||
"CreateS3Bucket": { | ||
"Fn::Equals": [ | ||
{ | ||
"Ref": "ShouldCreateBucket" | ||
}, | ||
"true" | ||
] | ||
}, | ||
"BucketNameGenerated": { | ||
"Fn::Equals": [ | ||
{ | ||
"Ref": "BucketName" | ||
}, | ||
"" | ||
] | ||
} | ||
}, | ||
|
||
"Conditions" : { | ||
"CreateS3Bucket" : {"Fn::Equals" : [{"Ref" : "ShouldCreateBucket"}, "true"]}, | ||
"BucketNameGenerated" : {"Fn::Equals" : [{"Ref" : "BucketName"}, ""]} | ||
}, | ||
"Resources": { | ||
"AspNetCoreFunction": { | ||
"Type": "AWS::Serverless::Function", | ||
"Properties": { | ||
"Handler": "BlueprintBaseName.1::BlueprintBaseName._1.LambdaEntryPoint::FunctionHandlerAsync", | ||
"Runtime": "dotnetcore2.1", | ||
"CodeUri": "", | ||
"MemorySize": 256, | ||
"Timeout": 30, | ||
"Role": null, | ||
"Policies": [ | ||
"AWSLambdaFullAccess" | ||
], | ||
"Environment": { | ||
"Variables": { | ||
"AppS3Bucket": { | ||
"Fn::If": [ | ||
"CreateS3Bucket", | ||
{ | ||
"Ref": "Bucket" | ||
}, | ||
{ | ||
"Ref": "BucketName" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"Events": { | ||
"ProxyResource": { | ||
"Type": "Api", | ||
"Properties": { | ||
"Path": "/{proxy+}", | ||
"Method": "ANY" | ||
} | ||
}, | ||
"RootResource": { | ||
"Type": "Api", | ||
"Properties": { | ||
"Path": "/", | ||
"Method": "ANY" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"Resources" : { | ||
"Bucket": { | ||
"Type": "AWS::S3::Bucket", | ||
"Condition": "CreateS3Bucket", | ||
"Properties": { | ||
"BucketName": { | ||
"Fn::If": [ | ||
"BucketNameGenerated", | ||
{ | ||
"Ref": "AWS::NoValue" | ||
}, | ||
{ | ||
"Ref": "BucketName" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"AspNetCoreFunction" : { | ||
"Type" : "AWS::Serverless::Function", | ||
"Properties": { | ||
"Handler": "BlueprintBaseName.1::BlueprintBaseName._1.LambdaEntryPoint::FunctionHandlerAsync", | ||
"Runtime": "dotnetcore2.1", | ||
"CodeUri": "", | ||
"MemorySize": 256, | ||
"Timeout": 30, | ||
"Role": null, | ||
"Policies": [ "AWSLambdaFullAccess" ], | ||
"Environment" : { | ||
"Variables" : { | ||
"AppS3Bucket" : { "Fn::If" : ["CreateS3Bucket", {"Ref":"Bucket"}, { "Ref" : "BucketName" } ] } | ||
} | ||
}, | ||
"Events": { | ||
"ProxyResource": { | ||
"Type": "Api", | ||
"Properties": { | ||
"Path": "/{proxy+}", | ||
"Method": "ANY" | ||
} | ||
}, | ||
"RootResource": { | ||
"Type": "Api", | ||
"Properties": { | ||
"Path": "/", | ||
"Method": "ANY" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"Bucket" : { | ||
"Type" : "AWS::S3::Bucket", | ||
"Condition" : "CreateS3Bucket", | ||
"Properties" : { | ||
"BucketName" : { "Fn::If" : ["BucketNameGenerated", {"Ref" : "AWS::NoValue" }, { "Ref" : "BucketName" } ] } | ||
} | ||
} | ||
}, | ||
|
||
"Outputs" : { | ||
"ApiURL" : { | ||
"Description" : "API endpoint URL for Prod environment", | ||
"Value" : { "Fn::Sub" : "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" } | ||
}, | ||
"S3ProxyBucket" : { | ||
"Value" : { "Fn::If" : ["CreateS3Bucket", {"Ref":"Bucket"}, { "Ref" : "BucketName" } ] } | ||
} | ||
} | ||
"Outputs": { | ||
"ApiURL": { | ||
"Description": "API endpoint URL for Prod environment", | ||
"Value": { | ||
"Fn::Sub": "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" | ||
} | ||
}, | ||
"S3ProxyBucket": { | ||
"Value": { | ||
"Fn::If": [ | ||
"CreateS3Bucket", | ||
{ | ||
"Ref": "Bucket" | ||
}, | ||
{ | ||
"Ref": "BucketName" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"Logging": { | ||
"IncludeScopes": false, | ||
"LogLevel": { | ||
"Default": "Warning" | ||
"Default": "Information" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...printDefinitions/Msbuild-NETCore_2_1/CustomRuntimeFunction-FSharp/blueprint-manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"display-name":"Custom Runtime Function", | ||
"system-name":"CustomRuntimeFunction", | ||
"description": "Use Lambda Custom Runtime feature to build Lambda functions using .NET Core 2.2 or 3.0.", | ||
"sort-order" : 101, | ||
"hidden-tags" : ["F#","LambdaProject"], | ||
"tags":["Custom"] | ||
} |
40 changes: 40 additions & 0 deletions
40
.../Msbuild-NETCore_2_1/CustomRuntimeFunction-FSharp/template/.template.config/template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"author": "AWS", | ||
"classifications": ["AWS", "Lambda", "Function"], | ||
"name": "Lambda Custom Runtime Function", | ||
"identity": "AWS.Lambda.Function.CustomRuntimeFunction.FSharp", | ||
"groupIdentity": "AWS.Lambda.Function.CustomRuntimFunction", | ||
"shortName": "lambda.CustomRuntimeFunction", | ||
"tags": { | ||
"language": "F#", | ||
"type": "project" | ||
}, | ||
"sourceName": "BlueprintBaseName.1", | ||
"preferNameDirectory": true, | ||
"symbols": { | ||
"profile": { | ||
"type": "parameter", | ||
"description" : "The AWS credentials profile set in aws-lambda-tools-defaults.json and used as the default profile when interacting with AWS.", | ||
"datatype": "string", | ||
"replaces" : "DefaultProfile", | ||
"defaultValue": "" | ||
}, | ||
"region": { | ||
"type": "parameter", | ||
"description" : "The AWS region set in aws-lambda-tools-defaults.json and used as the default region when interacting with AWS.", | ||
"datatype": "string", | ||
"replaces" : "DefaultRegion", | ||
"defaultValue": "" | ||
}, | ||
"safe-sourcename": { | ||
"type": "generated", | ||
"generator": "coalesce", | ||
"parameters": { | ||
"sourceVariableName": "safe_namespace", | ||
"fallbackVariableName": "safe_name" | ||
}, | ||
"replaces": "BlueprintBaseName._1" | ||
} | ||
}, | ||
"primaryOutputs": [ { "path": "./src/BlueprintBaseName.1/BlueprintBaseName.1.csproj" } ] | ||
} |
27 changes: 27 additions & 0 deletions
27
.../CustomRuntimeFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<AWSProjectType>Lambda</AWSProjectType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Content Include="bootstrap"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Function.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="aws-lambda-tools-defaults.json" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" /> | ||
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.0.0" /> | ||
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.5.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="aws-lambda-tools-defaults.json" /> | ||
<None Include="Readme.md" /> | ||
</ItemGroup> | ||
</Project> |
36 changes: 36 additions & 0 deletions
36
...ild-NETCore_2_1/CustomRuntimeFunction-FSharp/template/src/BlueprintBaseName.1/Function.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
namespace BlueprintBaseName._1 | ||
|
||
open Amazon.Lambda.Core | ||
open Amazon.Lambda.RuntimeSupport | ||
open Amazon.Lambda.Serialization.Json | ||
|
||
open System | ||
|
||
module Function = | ||
|
||
|
||
/// <summary> | ||
/// A simple function that takes a string and does a ToUpper | ||
/// | ||
/// To use this handler to respond to an AWS event, reference the appropriate package from | ||
/// https://github.com/aws/aws-lambda-dotnet#events | ||
/// and change the string input parameter to the desired event type. | ||
/// </summary> | ||
/// <param name="input"></param> | ||
/// <param name="context"></param> | ||
/// <returns></returns> | ||
let functionHandler (input: string) (_: ILambdaContext) = | ||
match input with | ||
| null -> String.Empty | ||
| _ -> input.ToUpper() | ||
|
||
|
||
[<EntryPoint>] | ||
let main _args = | ||
|
||
let handler = Func<string, ILambdaContext, string>(functionHandler) | ||
use handlerWrapper = HandlerWrapper.GetHandlerWrapper(handler, new JsonSerializer()) | ||
use bootstrap = new LambdaBootstrap(handlerWrapper) | ||
|
||
bootstrap.RunAsync().GetAwaiter().GetResult() | ||
0 |
Oops, something went wrong.