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

Make CodeUri configurable #16

Open
tmclaugh opened this issue Jan 22, 2018 · 5 comments
Open

Make CodeUri configurable #16

tmclaugh opened this issue Jan 22, 2018 · 5 comments

Comments

@tmclaugh
Copy link

I'm trying to use serverless-sam to generate a SAM template for my projects, so people outside my organization can deploy with CloudFormation. I want to be able to control the CodeUri value so I can point the template to an S3 bucket path. I'm sure it's a trivial change but I have no clue what I'm doing with JavaScript.

@sapessi
Copy link
Owner

sapessi commented Jan 22, 2018

Hey @tmclaugh, the beauty of using SAM is that you don't have to package and upload the code yourself. You can keep CodeUri as a relative path to the local folder that contains your code. Then, run the aws cloudformation package --template-file you-sam.yaml --output-template-file output-sam.yaml to zip up the code, upload it to S3, and prepare a SAM template for deployment in one command.

@tmclaugh
Copy link
Author

I'm just figuring this out now as I read the docs closer. Seriously, this is super awesome and I think this solves an issue that's been bugging me for a bit!

@tmclaugh
Copy link
Author

Sorry to reopen this, partially because I'm blocked by #18 in confirming this, but I believe when releasing a version on AppRepo, the CodeURI needs to point to an S3 object. This makes making codeuri configurable useful.

@disbelief
Copy link

I too have need of a configurable CodeUri output to the template YAML file.

My use case is that I'm using the AWS SAM CLI to invoke & debug my functions locally (and I'm also using the new AWS Toolkit for VS Code, which wraps aws-sam-cli).

Currently, I have to manually edit the template file and change all the CodeUris to the relative local path to the source file for each lambda function.

Ideally I'd be able to specify different CodeUri depending on whether I'm deploying the function locally (use local relative path), or into the real AWS cloud (use .serverless/ zip file path).

@muchezz
Copy link

muchezz commented Feb 19, 2022

You guys found a work-around or a solution to this?

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

4 participants