@@ -10,6 +10,7 @@ applies_to:
10
10
sub :
11
11
apm-lambda-ext-v : ver-1-6-0
12
12
apm-python-v : ver-6-24-0
13
+ apm-python-layer-v : 3
13
14
---
14
15
15
16
# Monitoring AWS Lambda Python Functions [ lambda-support]
@@ -39,18 +40,16 @@ To add the layers to your Lambda function through the AWS Management Console:
39
40
3 . Choose the * Specify an ARN* radio button
40
41
4 . Copy and paste the following ARNs of the {{apm-lambda-ext}} layer and the APM agent layer in the * Specify an ARN* text input:
41
42
* APM Extension layer:
42
- ```
43
+ ``` subs=true
43
44
arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1>
44
45
```
45
46
1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture.
46
47
47
48
* APM agent layer:
49
+ ```subs=true
50
+ arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v}} <1>
48
51
```
49
- arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION} <1>
50
- ```
51
- 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function. While the version of the layer `{LAYER_VERSION}`is
52
- usually `1`, refer to the ARNs listed in [Github releases](https://github.com/elastic/apm-agent-python/releases) to get
53
- the exact one.
52
+ 1. Replace `{AWS_REGION}` with the AWS region of your Lambda function.
54
53
55
54

56
55
5. Click the *Add* button
@@ -59,21 +58,19 @@ To add the layers to your Lambda function through the AWS Management Console:
59
58
::::::{tab-item} AWS CLI
60
59
To add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent through the AWS command line interface execute the following command:
61
60
62
- ```bash
61
+ ```bash subs=true
63
62
aws lambda update-function-configuration --function-name yourLambdaFunctionName \
64
63
--layers arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 \ <1>
65
- arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION } <2>
64
+ arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v} } <2>
66
65
```
67
66
1 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function and ` {ARCHITECTURE} ` with its architecture.
68
- 2 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function. While the version of the layer ` {LAYER_VERSION} ` is
69
- usually ` 1 ` , refer to the ARNs listed in [ Github releases] ( https://github.com/elastic/apm-agent-python/releases ) to get
70
- the exact one.
67
+ 2 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function.
71
68
::::::
72
69
73
70
::::::{tab-item} SAM
74
71
In your SAM ` template.yml ` file add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent as follows:
75
72
76
- ``` yaml
73
+ ``` yaml subs=true
77
74
...
78
75
Resources :
79
76
yourLambdaFunction :
@@ -82,48 +79,42 @@ Resources:
82
79
...
83
80
Layers :
84
81
- arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1>
85
- - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION } <2>
82
+ - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v} } <2>
86
83
...
87
84
```
88
85
1 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function and ` {ARCHITECTURE} ` with its architecture.
89
- 2 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function. While the version of the layer ` {LAYER_VERSION} ` is
90
- usually ` 1 ` , refer to the ARNs listed in [ Github releases] ( https://github.com/elastic/apm-agent-python/releases ) to get
91
- the exact one.
86
+ 2 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function.
92
87
::::::
93
88
94
89
::::::{tab-item} Serverless
95
90
In your ` serverless.yml ` file add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent to your function as follows:
96
91
97
- ``` yaml
92
+ ``` yaml subs=true
98
93
...
99
94
functions :
100
95
yourLambdaFunction :
101
96
handler : ...
102
97
layers :
103
98
- arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1>
104
- - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION } <2>
99
+ - arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v} } <2>
105
100
...
106
101
```
107
102
1 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function and ` {ARCHITECTURE} ` with its architecture.
108
- 2 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function. While the version of the layer ` {LAYER_VERSION} ` is
109
- usually ` 1 ` , refer to the ARNs listed in [ Github releases] ( https://github.com/elastic/apm-agent-python/releases ) to get
110
- the exact one.
103
+ 2 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function.
111
104
::::::
112
105
113
106
::::::{tab-item} Terraform
114
107
To add the{{apm-lambda-ext}} and the APM agent to your function add the ARNs to the ` layers ` property in your Terraform file:
115
108
116
- ``` yaml
109
+ ``` yaml subs=true
117
110
...
118
111
resource "aws_lambda_function" "your_lambda_function" {
119
112
...
120
- layers = ["arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1", "arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{LAYER_VERSION }"] <1>
113
+ layers = ["arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1", "arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-python-{{apm-python-v}}:{{apm-python-layer-v} }"] <1>
121
114
}
122
115
...
123
116
```
124
- 1 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function. While the version of the layer ` {LAYER_VERSION} ` is
125
- usually ` 1 ` , refer to the ARNs listed in [ Github releases] ( https://github.com/elastic/apm-agent-python/releases ) to get
126
- the exact one.
117
+ 1 . Replace ` {AWS_REGION} ` with the AWS region of your Lambda function and ` {ARCHITECTURE} ` with its architecture.
127
118
::::::
128
119
129
120
::::::{tab-item} Container Image
0 commit comments