Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with deployment #73

Open
kittrCZ opened this issue Mar 22, 2016 · 8 comments
Open

Issue with deployment #73

kittrCZ opened this issue Mar 22, 2016 · 8 comments

Comments

@kittrCZ
Copy link

kittrCZ commented Mar 22, 2016

Hi,

I have problems with deployment. The grunt deploy task is keep getting 404 and shows:

Running "lambda_package:default" (lambda_package) task
[email protected] 
Created package at ./dist/css-processor_1-0-0_2016-2-21-22-58-51.zip

Running "lambda_deploy:default" (lambda_deploy) task
Warning: Unable to find lambda function arn:aws:lambda:us-west-2:XXX:function:XX-css-processor, verify the lambda function name and AWS region are correct. Use --force to continue.

Aborted due to warnings.

I'm able to invoke the same function with aws-cli:

aws lambda invoke --function-name XXX-css-processor test
{
    "StatusCode": 200
}

I'm running

$ aws --version
aws-cli/1.10.14 Python/2.7.10 Darwin/14.5.0 botocore/1.4.5

Package.json

"devDependencies": {
    "grunt": "^0.4.5",
    "grunt-aws-lambda": "^0.12.0"
  }

Gruntfile.js

var grunt = require('grunt');
grunt.loadNpmTasks('grunt-aws-lambda');

grunt.initConfig({
    lambda_invoke: {
        default: {
        }
    },
    lambda_deploy: {
        options: {
            enableVersioning: true
        },
        default: {
            arn: 'arn:aws:lambda:us-west-2:XXX:function:XXX-css-processor'
        }
    },
    lambda_package: {
        default: {
        }
    },
});

grunt.registerTask('deploy', ['lambda_package:default', 'lambda_deploy:default']);

Am I doing something wrong? I have used this library before and never head problems with this. Do you see there something wrong? I'm sure that the Lambda function is working and I'm able to test it.

@sonya
Copy link

sonya commented Mar 22, 2016

Could you see what happens if you change the lambda_deploy section to the following? (I was seeing this as well and just just opened a PR about it)

lambda_deploy: {
    default: {
        arn: 'arn:aws:lambda:us-west-2:XXX:function:XXX-css-processor',
        options: {
            enableVersioning: true,
            region: 'us-west-2'
        }
    }
}

@kittrCZ
Copy link
Author

kittrCZ commented Mar 22, 2016

@sonya I will check in couple of hours, I'm OOF now. Thanks for the reply!

@kittrCZ
Copy link
Author

kittrCZ commented Mar 23, 2016

OK @sonya, so this is working. I'm kind of baffled by that, I guess I need to review the code. But this is resolved. Anyway, it should be mentioned that the order of options matters. I'm considering review the code in order to fix that

@toshke
Copy link

toshke commented Oct 27, 2016

This maybe old thread, but It seems to me that default region is hardcoded to 'us-east-1'. What would be neet if region is picked up from used AWS profile, if not explicitly set in configuration.

@webdevotion
Copy link

@toshke specify the region in the task:

lambda_deploy: {
        default: {
            arn: 'arn:aws:lambda:eu-west-1:my-account-number:function:my-function',
            options: {
                region: 'eu-west-1'
            }
        }
    },

@toshke
Copy link

toshke commented Nov 16, 2016

@webdevotion this works for me, but I believe if I add

options: {
    profile : 'my-profile-name'
}

in Grunt configuration and I have

[profile my-profile-name]
region=ap-southeast-2

in ~/.aws/config - I'll still get 'us-east-1' as deployment region. Doing some work on my fork anyway, so will double check and fix if this is the case.

@Muenze
Copy link

Muenze commented Feb 9, 2017

It is a problem in 0.13.0, don't know why this is not being fixed...
You have to set the region to your region in the options.
My Problem was that there is misleading Information in the readme:

options.region

Type: String Default value: us-east-1

Specify the AWS region your functions will be uploaded to. Note that if an ARN is supplied this option is not required.

Please tag als bug and fix it

@pmvilaca
Copy link

I just had the same problem. I assume that there is a bug in the code and not a documentation issue, because it make sense to extract the region from the arn if it's available.

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

No branches or pull requests

6 participants