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

Lambda Function zipFile Error #2223

Open
urton opened this issue Dec 2, 2024 · 0 comments
Open

Lambda Function zipFile Error #2223

urton opened this issue Dec 2, 2024 · 0 comments
Labels
service/lambda Indicates issues or PRs that are related to lambda-controller.

Comments

@urton
Copy link

urton commented Dec 2, 2024

When trying to use Python code inline via zipFile, I get the following error:

The Function "myfunction" is invalid: spec.code.zipFile: Invalid value: "def lambda_handler(event, context):\n    print('hello world')\n": spec.code.zipFile in body must be of type byte: "def lambda_handler(event, context):\n    print('hello world')\n"

My Function YAML:

---
apiVersion: lambda.services.k8s.aws/v1alpha1
kind: Function
metadata:
  name: myfunction
  namespace: devops-automation
spec:
  code: 
    zipFile: |
      def lambda_handler(event, context):
          print('hello world')
  environment: 
    variables: {}
  fileSystemConfigs:
  - arn: "arn:aws:elasticfilesystem:us-west-1:*****:access-point/fsap-*****"
    localMountPath: "/mnt/efs"
  handler: "index.lambda_handler"
  memorySize: 256
  name: myfunction
  publish: false
  reservedConcurrentExecutions: 100
  role: "arn:aws:iam::*****:role/*****"
  runtime: python3.12
  tags: {}
  timeout: 30
  vpcConfig: 
    securityGroupIDs:
    - sg-*****
    subnetIDs:
    - subnet-*****
    - subnet-*****
@michaelhtm michaelhtm added the service/lambda Indicates issues or PRs that are related to lambda-controller. label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/lambda Indicates issues or PRs that are related to lambda-controller.
Projects
None yet
Development

No branches or pull requests

2 participants