Giter Club home page Giter Club logo

aws-lambda-golang-cdk's Introduction

Hi, I'm Rafal ๐Ÿ‘‹

๐Ÿฆพ AI Lead @ Vendr
๐Ÿ˜Ž Founder of Dynobase & ChatWithCloud - CLI that lets you speak to your AWS cloud using human language
๐Ÿ‡ต๐Ÿ‡ฑ Living in Poznan, Poland

Find me elsewhere ๐ŸŒ

๐Ÿก My blog
๐Ÿฆ Twitter
๐Ÿ“ธ Instagram
๐Ÿ‘” Linkedin

aws-lambda-golang-cdk's People

Contributors

dependabot[bot] avatar rafalwilinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aws-lambda-golang-cdk's Issues

Error when providing an entry property.

I expected these two lines of code to produce the same path to builder.js:

const handler = new golang.GolangFunction(this, 'funcs');

const handler = new golang.GolangFunction(this, 'HandlerFunk', {entry: 'lib/funcs/main.go'});

Using the later results in the following error:
Failed to compile Go function at lib/funcs/main.go

Further digging seems to indicate that findEntry returns a relative path for entry and an absolute path for the default behavior.

To reproduce this I logged const cwd = path.dirname(this.entry); from builder.js under both conditions.

Failed to compile Go function at ${this.entry}: ${err}

I am facing a problem while deploying

.....\node_modules\aws-lambda-golang\lib\builder.ts:71
throw new Error(Failed to compile Go function at ${this.entry}: ${err});
^
It appears that the problem is in line 28 in "builder.ts" file where you check the status of goBuild

if (goBuild.status !== 0) {
throw new Error(goBuild.stdout.toString().trim());
}

After logging goBuild, it has status 1

goBuild : {
status: 1,
signal: null,
output: [
null,
,
<Buffer 70 61 63 6b 61 67 65 20 42 61 68 6a 61 2f 44 6f 63 75 6d 65 6e 74 73 2f 57 4f 52 4b 2d 50 52 4f 4a 45 43 54 53 2f 78 63 68 61 6e 67 65 72 2d 62 61 63 ...
612 more bytes>
],
pid: 7848,
stdout: ,
stderr: <Buffer 70 61 63 6b 61 67 65 20 42 61 68 6a 61 2f 44 6f 63 75 6d 65 6e 74 73 2f 57 4f 52 4b 2d 50 52 4f 4a 45 43 54 53 2f 78 63 68 61 6e 67 65 72 2d 62 61 63 ... 612 more bytes>
}

GO is working fine on my Windows 10 PC, I tried removing and installing the latest version but the same error appears
Note: There is no error in compiling lambda function code, I have tried "go build main.go", and works fine, besides the same cdk code deployed success in mac OS

CDK V2 Integration

Hi @RafalWilinski,

I've been using the construct for a while now and it's great! However with CDK v2 coming out soon the current package won't install/work due to peer dependency issues and the new way the cdk has been structured.

I've taken the liberty of creating a version of your code that works with CDK v2. Link Here, I've also used the opportunity to base the project off projen the preferred way to make constructs now from what I can see.

Anyways I'd be keen to setup a PR into your project but it would be a breaking change to the version you already have. Might also be a good opportunity to see if we can get your code into the CDK as a first class construct.

Anyways let me know what you think, I'm also happy to keep it as a separate package if you don't have time to maintain.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.