Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add support for AWS Graviton2 powered functions #206

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

Merged
antonbabenko merged 2 commits into terraform-aws-modules:master from Infra-Red:arch-support
Oct 2, 2021

Conversation

@Infra-Red
Copy link
Contributor

@Infra-Red Infra-Red commented Sep 30, 2021
edited
Loading

Description

Allow to configure architectures property in aws_lambda_function and compatible_architectures property in aws_lambda_layer_version configuration.

Motivation and Context

Add missing parameter that is required to support AWS Lambda Functions Powered by AWS Graviton2 Processor.

https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/

Breaking Changes

None.

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

Closes #207

fabiomsouto reacted with thumbs up emoji
@Infra-Red Infra-Red marked this pull request as draft September 30, 2021 16:15
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! The draft looks great, there are couple of small things to do:

  1. Update minimum version requirements in versions.tf everywhere and rerun pre-commit run -a to fix documentation (when the updated provider is released)?
  2. Add support for the same feature in the Lambda Layer resource (compatible_architectures)?
  3. Update example code to have at least one function deploying using arm64 architecture.

If you can, please double-check whether we need to do anything in package.{tf,py} related to the way how the filename hash is computed to make sure that the same function (same runtime, same source) can be deployed in different architectures? If there are any changes required, please make an issue about it and we take it in a separate PR.

Copy link
Contributor Author

Hi @antonbabenko, I've updated this PR in accordance with your comments, please review when you get a chance.

For the package.{tf,py} I see that it is possible to update the Lambda architecture without changing the filename:

  1. Update a function to use different architecture:
    Terraform will perform the following actions:
     # module.lambda_function.aws_lambda_function.this[0] will be updated in-place
     ~ resource "aws_lambda_function" "this" {
     ~ architectures = [
     - "x86_64",
     + "arm64",
     ]
     id = "clear-earwig-lambda-async"
     ~ last_modified = "2021-10-02T13:04:47.276+0000" -> (known after apply)
     tags = {}
     # (18 unchanged attributes hidden)
     # (1 unchanged block hidden)
     }
    Plan: 0 to add, 1 to change, 0 to destroy.
    
  2. Apply the changes:
    > terraform apply .plan
    module.lambda_function.aws_lambda_function.this[0]: Modifying... [id=clear-earwig-lambda-async]
    module.lambda_function.aws_lambda_function.this[0]: Modifications complete after 7s [id=clear-earwig-lambda-async]
    Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
    

@Infra-Red Infra-Red marked this pull request as ready for review October 2, 2021 13:13
Copy link
Member

Can you also update a complete example to show compatible_architectures in Lambda Layer? Then this PR will be good to merge.

Signed-off-by: Andrei Krasnitski <a.krasnitski@outlook.com>
Signed-off-by: Andrei Krasnitski <a.krasnitski@outlook.com>
Copy link
Contributor Author

Thanks @antonbabenko, compete example has been updated to include compatible_architectures in Lambda layers.

@antonbabenko antonbabenko merged commit 3873c10 into terraform-aws-modules:master Oct 2, 2021
Copy link
Member

Thank you, @Infra-Red !

v2.20.0 has been just released.

Infra-Red reacted with thumbs up emoji

@Infra-Red Infra-Red deleted the arch-support branch October 2, 2021 19:37
Copy link

github-actions bot commented Nov 9, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@antonbabenko antonbabenko antonbabenko approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support selection of instruction set architecture

AltStyle によって変換されたページ (->オリジナル) /