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

fill ImageConfig on init #307

Merged
merged 2 commits into from
Aug 10, 2023
Merged

Conversation

chaya2z
Copy link
Contributor

@chaya2z chaya2z commented Aug 10, 2023

function.json created by lambda init is missing ImageConfig field. This patch fills it.
I referred to documentation of AWS Lambda GetFunction Response Syntax.

I test this patch can deploy successfully in my development environment.
ImageConfig field in function.json is like this.

{
...
  "ImageConfig": {
    "Command": [
      "cmd"
    ],
    "EntryPoint": [
      "/app"
    ],
    "WorkingDirectory": "/var/task"
  },
...
}

When WorkingDirectory is not configured, GetFunction returns an empty string.

{
...
   "ImageConfig": {
     "Command": [
       "cmd"
     ],
     "EntryPoint": [
       "/app"
     ],
     "WorkingDirectory": ""
   },
...
}

Even in that case, lambroll deploy can deploy Lambda functions without problems.

Image_Configuration_AWS_Lambda_empty_workdir


Ref PR: #101

Thank you!

@chaya2z
Copy link
Contributor Author

chaya2z commented Aug 10, 2023

Sorry, I fixed test error.

@fujiwara
Copy link
Owner

@chaya2z Thank you! Great!

I found a small problem in this PR.

If I want to reset the ImageConfig already set, I'll remove the ImageConfig element in a function.json simply.

But lambroll cannot reset the ImageConfig because ImageConfig of UpdateFunctionConfiguration API becomes nil.

I'll fix the problem.

@fujiwara fujiwara merged commit 25267e8 into fujiwara:main Aug 10, 2023
fujiwara added a commit that referenced this pull request Aug 10, 2023
Co-authored-by: chaya2z <[email protected]>
@fujiwara
Copy link
Owner

@chaya2z
Copy link
Contributor Author

chaya2z commented Aug 14, 2023

@fujiwara Thank you for fixing the problem!

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