Skip to content

Commit

Permalink
Fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pierskarsenbarg committed Jul 31, 2024
1 parent dbac2b3 commit 5062d02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 6 additions & 4 deletions aws-ts-multi-language-lambda/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2016-2024, Pulumi Corporation. All rights reserved.

import { Runtime } from "@pulumi/aws/lambda";

interface Config {
Expand All @@ -15,16 +17,16 @@ export const lambdaSetup: Config[] = [
{
language: "go",
handler: "bootstrap",
runtime: Runtime.CustomAL2023
runtime: Runtime.CustomAL2023,
},
{
language: "typescript",
handler: "index.handler",
runtime: Runtime.NodeJS20dX
runtime: Runtime.NodeJS20dX,
},
{
language: "python",
handler: "lambda.handler",
runtime: Runtime.Python3d12
}
runtime: Runtime.Python3d12,
},
];
13 changes: 7 additions & 6 deletions aws-ts-multi-language-lambda/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as pulumi from "@pulumi/pulumi";
// Copyright 2016-2024, Pulumi Corporation. All rights reserved.

import * as aws from "@pulumi/aws";
import * as dockerBuild from "@pulumi/docker-build";
import { lambdaSetup } from "./config";
import * as pulumi from "@pulumi/pulumi";

export = async () => {
const role = new aws.iam.Role("lambdarole", {
Expand All @@ -14,8 +16,7 @@ export = async () => {
});

const languages = ["dotnet", "go", "python", "typescript"];
let lambdaNames: {[key: string]: pulumi.Output<string>} = {};
// let lambdaNames: pulumi.Output<string>[] = [];
const lambdaNames: {[key: string]: pulumi.Output<string>} = {};

lambdaSetup.map((lambda) => {
const buildLambdaCode = new dockerBuild.Image(
Expand All @@ -38,7 +39,7 @@ export = async () => {
labels: {
created: new Date().getTime().toString(),
},
}
},
);

const fn = new aws.lambda.Function(
Expand All @@ -53,11 +54,11 @@ export = async () => {
runtime: lambda.runtime,
handler: lambda.handler,
},
{ dependsOn: [buildLambdaCode] }
{ dependsOn: [buildLambdaCode] },
);

lambdaNames[`lambdaNames.${lambda.language}`] = fn.name;
});

return lambdaNames
return lambdaNames;
};

0 comments on commit 5062d02

Please sign in to comment.