diff --git a/aws-cs-lambda/.vscode/launch.json b/aws-cs-lambda/.vscode/launch.json deleted file mode 100644 index 0aff0b4f9..000000000 --- a/aws-cs-lambda/.vscode/launch.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/Infra.dll", - "args": [], - "cwd": "${workspaceFolder}", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} \ No newline at end of file diff --git a/aws-cs-lambda/.vscode/tasks.json b/aws-cs-lambda/.vscode/tasks.json deleted file mode 100644 index 328ec77b5..000000000 --- a/aws-cs-lambda/.vscode/tasks.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/Infra.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/Infra.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/Infra.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/aws-cs-lambda/Program.cs b/aws-cs-lambda/Program.cs deleted file mode 100644 index 5b1db8eed..000000000 --- a/aws-cs-lambda/Program.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Threading.Tasks; - -using Pulumi; -using Pulumi.Aws.Lambda; -using Pulumi.Aws.Iam; - -class LambdaUtil -{ - public static Pulumi.AssetArchive buildArchive(string lambdaArchivePath) - { - var immutableDictBuilder = System.Collections.Immutable.ImmutableDictionary.CreateBuilder(); - immutableDictBuilder.Add(".", new FileArchive(lambdaArchivePath)); - return new Pulumi.AssetArchive(immutableDictBuilder.ToImmutable()); - } - public static Role createLambdaRole() - { - var lambdaRole = new Role("lambdaRole", new RoleArgs - { - AssumeRolePolicy = @"{ - ""Version"": ""2012-10-17"", - ""Statement"": [ - { - ""Action"": ""sts:AssumeRole"", - ""Principal"": { - ""Service"": ""lambda.amazonaws.com"" - }, - ""Effect"": ""Allow"", - ""Sid"": """" - } - ] - }", - }); - - var logPolicy = new RolePolicy("lambdaLogPolicy", new RolePolicyArgs - { - Role = lambdaRole.Id, - Policy = @"{ - ""Version"": ""2012-10-17"", - ""Statement"": [{ - ""Effect"": ""Allow"", - ""Action"": [ - ""logs:CreateLogGroup"", - ""logs:CreateLogStream"", - ""logs:PutLogEvents"" - ], - ""Resource"": ""arn:aws:logs:*:*:*"" - }] - }" - }); - - return lambdaRole; - } -} - -class Program -{ - static Task Main() - { - return Deployment.RunAsync(() => - { - var hnLambda = new Function("HN-Lambda", new FunctionArgs - { - Runtime = "dotnetcore2.1", - Code = LambdaUtil.buildArchive("../dotnetLambda/src/dotnetLambda//bin/Debug/netcoreapp2.1/publish"), - Handler = "dotnetLambda::dotnetLambda.Function::FunctionHandler", - Role = LambdaUtil.createLambdaRole().Arn - }); - }); - } -} -