Skip to content

Conversation

@toshke
Copy link

@toshke toshke commented Nov 15, 2016

Support for uploading code via S3, rather than directly

@toshke
Copy link
Author

toshke commented Nov 15, 2016

Will check the tests in upcoming days, and comply with coding conventions.

@toshke toshke closed this Nov 15, 2016
@piercus
Copy link

piercus commented Feb 27, 2017

@toshke what do you think of #103 ?

Thanks for your help

@toshke
Copy link
Author

toshke commented Feb 27, 2017

@piercus i've already opened #102, including mocks tests and code that passes linter with success.
As for #103 - looking at https://github.com/Tim-B/grunt-aws-lambda/pull/103/files, I can't find place where s3 upload actually takes place.

@piercus
Copy link

piercus commented Mar 1, 2017

@toshke

I'm not sure s3 upload should be done on grunt-aws-lambda, i'm suggesting to use grunt-aws-s3 for the upload.

On my point of view, to keep things granular, lambda_deploy should just be able to :

  • Deploy a AWS lambda from an already uploaded zip file
  • Use the package's name from lambda_package as filename to find the s3 file

With this we can connect with grunt-aws-s3

see my example in

grunt.initConfig({
    lambda_deploy: { 
        env: {
            arn: 'arn:aws:lambda:us-east-1:123456781234:function:my-function',
            s3_bucket: 'my-lambda-code-bucket',
            s3_key_prefix: 'folderName'
        }
    },
    lambda_package: {
        env: {
            options: {}
        }
    },
    aws_s3: { 
        env: {
            options: {
                bucket: 'my-lambda-code-bucket'
            },
            files: [
                {action: 'upload', expand: true, src: ['dist/**'], differential: true, dest: 'folderName'}
            ]
        }
    }
});
grunt.loadNpmTasks('grunt-aws-s3');
grunt.loadNpmTasks('grunt-aws-lambda');    
grunt.registerTask('deploy', ['lambda_package', 'aws_s3', 'lambda_deploy']);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants