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

aws-codebuild: CodeBuild lambda images/compute types missing from CDK #28418

Closed
2 tasks
colyoonamaz opened this issue Dec 18, 2023 · 2 comments · Fixed by #27934
Closed
2 tasks

aws-codebuild: CodeBuild lambda images/compute types missing from CDK #28418

colyoonamaz opened this issue Dec 18, 2023 · 2 comments · Fixed by #27934
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@colyoonamaz
Copy link

Describe the feature

Recently, CodeBuild released a new set of lambda images which can be found here under Lambda compute images. Along with these new images, CodeBuild released new lambda compute types listed here as the BUILD_LAMBDA_1GB-10GB compute types. The CodeBuild CDK code should be updated to reflect these new images/compute types.

Use Case

When trying to run lambda CodeBuild builds using CDK, the lambda project cannot be created as the relevant CDK values are missing.

Proposed Solution

Create new ARM/Linux image files with the new lambda images and compute types

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

Any

Environment details (OS name and version, etc.)

Any

@colyoonamaz colyoonamaz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 18, 2023
@github-actions github-actions bot added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Dec 18, 2023
@pahud
Copy link
Contributor

pahud commented Dec 19, 2023

Thank you for the feature request.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 19, 2023
@mergify mergify bot closed this as completed in #27934 Dec 23, 2023
mergify bot pushed a commit that referenced this issue Dec 23, 2023
CodeBuild has added support for Lambda compute.
CloudFormation can be deployed as follows.
```yaml
Resources:
  CodeBuildProject:
    Type: AWS::CodeBuild::Project
    Properties:
      Artifacts:
        Type: NO_ARTIFACTS
      ServiceRole: !GetAtt CodeBuildRole.Arn
      Source:
        # 
      Environment:
        Type: LINUX_LAMBDA_CONTAINER
        ComputeType: BUILD_LAMBDA_1GB
        Image: aws/codebuild/amazonlinux-x86_64-lambda-standard:go1.21
  CodeBuildRole:
    Type: AWS::IAM::Role
    Properties:
        # 
```
https://aws.amazon.com/about-aws/whats-new/2023/11/aws-codebuild-lambda-compute

This PR implements Lambda ComputeType by adding Classes (`LinuxArmLambdaBuildImage`, `LinuxLambdaBuildImage`) that extend the IBuildImage interface.

Supported Docker Images and ComputeTypes are listed below.
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types

Also, Lambda compute has some limitations and I have added validation for them.
https://docs.aws.amazon.com/codebuild/latest/userguide/lambda.html#lambda.limitations

closes #28418

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this issue Jan 5, 2024
CodeBuild has added support for Lambda compute.
CloudFormation can be deployed as follows.
```yaml
Resources:
  CodeBuildProject:
    Type: AWS::CodeBuild::Project
    Properties:
      Artifacts:
        Type: NO_ARTIFACTS
      ServiceRole: !GetAtt CodeBuildRole.Arn
      Source:
        # 
      Environment:
        Type: LINUX_LAMBDA_CONTAINER
        ComputeType: BUILD_LAMBDA_1GB
        Image: aws/codebuild/amazonlinux-x86_64-lambda-standard:go1.21
  CodeBuildRole:
    Type: AWS::IAM::Role
    Properties:
        # 
```
https://aws.amazon.com/about-aws/whats-new/2023/11/aws-codebuild-lambda-compute

This PR implements Lambda ComputeType by adding Classes (`LinuxArmLambdaBuildImage`, `LinuxLambdaBuildImage`) that extend the IBuildImage interface.

Supported Docker Images and ComputeTypes are listed below.
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types

Also, Lambda compute has some limitations and I have added validation for them.
https://docs.aws.amazon.com/codebuild/latest/userguide/lambda.html#lambda.limitations

closes aws#28418

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants