|
| 1 | +// tag::console-extension-only[] |
| 2 | + |
| 3 | +To add a layer to a Lambda function through the AWS Management Console: |
| 4 | + |
| 5 | +1. Navigate to your function in the AWS Management Console |
| 6 | +2. Scroll to the Layers section and click the _Add a layer_ button image:images/config-layer.png[image of layer configuration section in AWS Console] |
| 7 | +3. Choose the _Specify an ARN_ radio button |
| 8 | +4. Copy and paste the following ARN of the APM Lambda Extension layer in the _Specify an ARN_ text input: + |
| 9 | ++++<span style="font-size:10pt"><b>EXTENSION_ARN</b></span>+++ |
| 10 | +image:images/choose-a-layer.png[image of choosing a layer in AWS Console] |
| 11 | +5. Click the _Add_ button |
| 12 | +
|
| 13 | +// end::console-extension-only[] |
| 14 | + |
| 15 | +// tag::console-with-agent[] |
| 16 | + |
| 17 | +To add the layers to your Lambda function through the AWS Management Console: |
| 18 | + |
| 19 | +1. Navigate to your function in the AWS Management Console |
| 20 | +2. Scroll to the Layers section and click the _Add a layer_ button image:images/config-layer.png[image of layer configuration section in AWS Console] |
| 21 | +3. Choose the _Specify an ARN_ radio button |
| 22 | +4. Copy and paste the following ARNs of the APM Lambda Extension layer and the APM agent layer in the _Specify an ARN_ text input: + |
| 23 | +APM Extension layer: + |
| 24 | ++++<span style="font-size:10pt"><b>EXTENSION_ARN</b></span>+++ + |
| 25 | +APM Agent layer: + |
| 26 | ++++<span style="font-size:10pt"><b>AGENT_ARN</b></span>+++ |
| 27 | +image:images/choose-a-layer.png[image of choosing a layer in AWS Console] |
| 28 | +5. Click the _Add_ button |
| 29 | +
|
| 30 | +// end::console-with-agent[] |
| 31 | + |
| 32 | +// tag::cli-extension-only[] |
| 33 | + |
| 34 | +To add the APM Extension Layer ARN through the AWS command line interface execute the following command: |
| 35 | + |
| 36 | +[source,bash] |
| 37 | +---- |
| 38 | +aws lambda update-function-configuration --function-name yourLambdaFunctionName \ |
| 39 | +--layers EXTENSION_ARN |
| 40 | +---- |
| 41 | + |
| 42 | +// end::cli-extension-only[] |
| 43 | + |
| 44 | +// tag::cli-with-agent[] |
| 45 | + |
| 46 | +To add the Layer ARNs of the APM Extension and the APM Agent through the AWS command line interface execute the following command: |
| 47 | + |
| 48 | +[source,bash] |
| 49 | +---- |
| 50 | +aws lambda update-function-configuration --function-name yourLambdaFunctionName \ |
| 51 | +--layers EXTENSION_ARN \ |
| 52 | +AGENT_ARN |
| 53 | +---- |
| 54 | + |
| 55 | +// end::cli-with-agent[] |
| 56 | + |
| 57 | +// tag::sam-extension-only[] |
| 58 | + |
| 59 | +In your SAM `template.yml` file add the APM Extension Layer ARN as follows: |
| 60 | + |
| 61 | +[source,yml] |
| 62 | +---- |
| 63 | +... |
| 64 | +Resources: |
| 65 | + yourLambdaFunction: |
| 66 | + Type: AWS::Serverless::Function |
| 67 | + Properties: |
| 68 | + ... |
| 69 | + Layers: |
| 70 | + - EXTENSION_ARN |
| 71 | +... |
| 72 | +---- |
| 73 | + |
| 74 | +// end::sam-extension-only[] |
| 75 | + |
| 76 | +// tag::sam-with-agent[] |
| 77 | + |
| 78 | +In your SAM `template.yml` file add the Layer ARNs of the APM Extension and the APM Agent as follows: |
| 79 | + |
| 80 | +[source,yml] |
| 81 | +---- |
| 82 | +... |
| 83 | +Resources: |
| 84 | + yourLambdaFunction: |
| 85 | + Type: AWS::Serverless::Function |
| 86 | + Properties: |
| 87 | + ... |
| 88 | + Layers: |
| 89 | + - EXTENSION_ARN |
| 90 | + - AGENT_ARN |
| 91 | +... |
| 92 | +---- |
| 93 | + |
| 94 | +// end::sam-with-agent[] |
| 95 | + |
| 96 | +// tag::serverless-extension-only[] |
| 97 | + |
| 98 | +In your `serverless.yml` file add the APM Extension Layer ARN to your function as follows: |
| 99 | + |
| 100 | +[source,yml] |
| 101 | +---- |
| 102 | +... |
| 103 | +functions: |
| 104 | + yourLambdaFunction: |
| 105 | + handler: ... |
| 106 | + layers: |
| 107 | + - EXTENSION_ARN |
| 108 | +... |
| 109 | +---- |
| 110 | + |
| 111 | +// end::serverless-extension-only[] |
| 112 | + |
| 113 | +// tag::serverless-with-agent[] |
| 114 | + |
| 115 | +In your `serverless.yml` file add the Layer ARNs of the APM Extension and the APM Agent to your function as follows: |
| 116 | + |
| 117 | +[source,yml] |
| 118 | +---- |
| 119 | +... |
| 120 | +functions: |
| 121 | + yourLambdaFunction: |
| 122 | + handler: ... |
| 123 | + layers: |
| 124 | + - EXTENSION_ARN |
| 125 | + - AGENT_ARN |
| 126 | +... |
| 127 | +---- |
| 128 | + |
| 129 | +// end::serverless-with-agent[] |
| 130 | + |
| 131 | +// tag::terraform-extension-only[] |
| 132 | +To add the APM Extension Layer to your function add the ARN to the `layers` property in your Terraform file: |
| 133 | + |
| 134 | +[source,terraform] |
| 135 | +---- |
| 136 | +... |
| 137 | +resource "aws_lambda_function" "your_lambda_function" { |
| 138 | + ... |
| 139 | + layers = ["EXTENSION_ARN"] |
| 140 | +} |
| 141 | +... |
| 142 | +---- |
| 143 | + |
| 144 | +// end::terraform-extension-only[] |
| 145 | + |
| 146 | +// tag::terraform-with-agent[] |
| 147 | +To add the APM Extension and the APM Agent to your function add the ARNs to the `layers` property in your Terraform file: |
| 148 | + |
| 149 | +[source,terraform] |
| 150 | +---- |
| 151 | +... |
| 152 | +resource "aws_lambda_function" "your_lambda_function" { |
| 153 | + ... |
| 154 | + layers = ["EXTENSION_ARN", "AGENT_ARN"] |
| 155 | +} |
| 156 | +... |
| 157 | +---- |
| 158 | + |
| 159 | +// end::terraform-with-agent[] |
0 commit comments