-
Notifications
You must be signed in to change notification settings - Fork 327
Improved getting started guide for AWS Lambda #2556
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b36e15a
Improved Getting started guide for AWS Lambda
AlexanderWert 3534bfe
fix include attrs
bmorelli25 e5559da
Update docs/setup-aws-lambda.asciidoc
AlexanderWert fa0b488
Update docs/setup-aws-lambda.asciidoc
AlexanderWert e8b7d0f
Update docs/setup-aws-lambda.asciidoc
AlexanderWert edda5a4
Update docs/supported-technologies.asciidoc
AlexanderWert 3a34290
Fixed review comments
AlexanderWert c0f1c89
Added APM Server prerequisite
AlexanderWert af77c47
remove img and include from diff repo
bmorelli25 3ee7fd8
update prereq section
bmorelli25 8f6478b
update heading levels and nest prereqs
bmorelli25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| ++++ | ||
| <div class="tabs" data-tab-group="os"> | ||
| <div role="tablist" aria-label="dependency"> | ||
| <button role="tab" | ||
| aria-selected="true" | ||
| aria-controls="console-tab-lambda-java-config" | ||
| id="console-lambda-java-config"> | ||
| AWS Web Console | ||
| </button> | ||
| <button role="tab" | ||
| aria-selected="false" | ||
| aria-controls="cli-tab-lambda-java-config" | ||
| id="cli-lambda-java-config" | ||
| tabindex="-1"> | ||
| AWS CLI | ||
| </button> | ||
| <button role="tab" | ||
| aria-selected="false" | ||
| aria-controls="sam-tab-lambda-java-config" | ||
| id="sam-lambda-java-config" | ||
| tabindex="-1"> | ||
| SAM | ||
| </button> | ||
| <button role="tab" | ||
| aria-selected="false" | ||
| aria-controls="serverless-tab-lambda-java-config" | ||
| id="serverless-lambda-java-config" | ||
| tabindex="-1"> | ||
| Serverless | ||
| </button> | ||
| <button role="tab" | ||
| aria-selected="false" | ||
| aria-controls="terraform-tab-lambda-java-config" | ||
| id="terraform-lambda-java-config" | ||
| tabindex="-1"> | ||
| Terraform | ||
| </button> | ||
| </div> | ||
| <div tabindex="0" | ||
| role="tabpanel" | ||
| id="console-tab-lambda-java-config" | ||
| name="lambda-tabpanel" | ||
| aria-labelledby="console-lambda-java-config"> | ||
| ++++ | ||
|
|
||
| include::configure-lambda.asciidoc[tag=console-{layer-section-type}] | ||
|
|
||
| ++++ | ||
| </div> | ||
| <div tabindex="0" | ||
| role="tabpanel" | ||
| id="cli-tab-lambda-java-config" | ||
| name="lambda-tabpanel" | ||
| aria-labelledby="cli-lambda-java-config" | ||
| hidden=""> | ||
| ++++ | ||
|
|
||
| include::configure-lambda.asciidoc[tag=cli-{layer-section-type}] | ||
|
|
||
| ++++ | ||
| </div> | ||
| <div tabindex="0" | ||
| role="tabpanel" | ||
| id="sam-tab-lambda-java-config" | ||
| name="lambda-tabpanel" | ||
| aria-labelledby="sam-lambda-java-config" | ||
| hidden=""> | ||
| ++++ | ||
|
|
||
| include::configure-lambda.asciidoc[tag=sam-{layer-section-type}] | ||
|
|
||
| ++++ | ||
| </div> | ||
| <div tabindex="0" | ||
| role="tabpanel" | ||
| id="serverless-tab-lambda-java-config" | ||
| name="lambda-tabpanel" | ||
| aria-labelledby="serverless-lambda-java-config" | ||
| hidden=""> | ||
| ++++ | ||
|
|
||
| include::configure-lambda.asciidoc[tag=serverless-{layer-section-type}] | ||
|
|
||
| ++++ | ||
| </div> | ||
| <div tabindex="0" | ||
| role="tabpanel" | ||
| id="terraform-tab-lambda-java-config" | ||
| name="lambda-tabpanel" | ||
| aria-labelledby="terraform-lambda-java-config" | ||
| hidden=""> | ||
| ++++ | ||
|
|
||
| include::configure-lambda.asciidoc[tag=terraform-{layer-section-type}] | ||
|
|
||
| ++++ | ||
| </div> | ||
| </div> | ||
| ++++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| // tag::console-with-agent[] | ||
|
|
||
| To configure APM through the AWS Management Console: | ||
|
|
||
| 1. Navigate to your function in the AWS Management Console | ||
| 2. Click on the _Configuration_ tab | ||
| 3. Click on _Environment variables_ | ||
| 4. Add the following required variables: | ||
|
|
||
| [source,bash] | ||
| ---- | ||
| AWS_LAMBDA_EXEC_WRAPPER = /opt/elastic-apm-handler # use this exact fixed value | ||
| ELASTIC_APM_LAMBDA_APM_SERVER = <YOUR-APM-SERVER-URL> # this is your APM Server URL | ||
| ELASTIC_APM_SECRET_TOKEN = <YOUR-APM-SECRET-TOKEN> # this is your APM secret token | ||
| ---- | ||
|
|
||
| -- | ||
| include::{apm-aws-lambda-root}/docs/images/images.asciidoc[tag=java-env-vars] | ||
| -- | ||
|
|
||
| // end::console-with-agent[] | ||
|
|
||
| // tag::cli-with-agent[] | ||
|
|
||
| To configure APM through the AWS command line interface execute the following command: | ||
|
|
||
| [source,bash] | ||
| ---- | ||
| aws lambda update-function-configuration --function-name yourLambdaFunctionName \ | ||
| --environment "Variables={AWS_LAMBDA_EXEC_WRAPPER=/opt/elastic-apm-handler,ELASTIC_APM_LAMBDA_APM_SERVER=<YOUR-APM-SERVER-URL>,ELASTIC_APM_SECRET_TOKEN=<YOUR-APM-SECRET-TOKEN>}" | ||
| ---- | ||
|
|
||
| // end::cli-with-agent[] | ||
|
|
||
| // tag::sam-with-agent[] | ||
|
|
||
| In your SAM `template.yml` file add the Layer ARNs of the APM Extension and the APM Agent as follows: | ||
|
|
||
| [source,yml] | ||
| ---- | ||
| ... | ||
| Resources: | ||
| yourLambdaFunction: | ||
| Type: AWS::Serverless::Function | ||
| Properties: | ||
| ... | ||
| Environment: | ||
| Variables: | ||
| AWS_LAMBDA_EXEC_WRAPPER: /opt/elastic-apm-handler | ||
| ELASTIC_APM_LAMBDA_APM_SERVER: <YOUR-APM-SERVER-URL> | ||
| ELASTIC_APM_SECRET_TOKEN: <YOUR-APM-SECRET-TOKEN> | ||
| ... | ||
| ---- | ||
|
|
||
| // end::sam-with-agent[] | ||
|
|
||
| // tag::serverless-with-agent[] | ||
|
|
||
| In your `serverless.yml` file add the Layer ARNs of the APM Extension and the APM Agent to your function as follows: | ||
|
|
||
| [source,yml] | ||
| ---- | ||
| ... | ||
| functions: | ||
| yourLambdaFunction: | ||
| ... | ||
| environment: | ||
| AWS_LAMBDA_EXEC_WRAPPER: /opt/elastic-apm-handler | ||
| ELASTIC_APM_LAMBDA_APM_SERVER: <YOUR-APM-SERVER-URL> | ||
| ELASTIC_APM_SECRET_TOKEN: <YOUR-APM-SECRET-TOKEN> | ||
| ... | ||
| ---- | ||
|
|
||
| // end::serverless-with-agent[] | ||
|
|
||
| // tag::terraform-with-agent[] | ||
| To add the APM Extension and the APM Agent to your function add the ARNs to the `layers` property in your Terraform file: | ||
|
|
||
| [source,terraform] | ||
| ---- | ||
| ... | ||
| resource "aws_lambda_function" "your_lambda_function" { | ||
| ... | ||
| environment { | ||
| variables = { | ||
| AWS_LAMBDA_EXEC_WRAPPER = "/opt/elastic-apm-handler" | ||
| ELASTIC_APM_LAMBDA_APM_SERVER = "<YOUR-APM-SERVER-URL>" | ||
| ELASTIC_APM_SECRET_TOKEN = "<YOUR-APM-SECRET-TOKEN>" | ||
| } | ||
| } | ||
| } | ||
| ... | ||
| ---- | ||
|
|
||
| // end::terraform-with-agent[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ++++ | ||
| <script> | ||
| window.addEventListener("DOMContentLoaded", async () => { | ||
| addArnGenerator('agent', 'apm-agent-java', 'arn:aws:lambda:${region}:267093732750:layer:elastic-apm-java-${version}'); | ||
| }); | ||
| </script> | ||
| ++++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I like this. FYI I moved the table include into a block element. This allows us to nest it under the accompanying bullet point with a
+.