Skip to content

Commit 5adecd0

Browse files
committed
Use subsitution for lambda layer version
Also fix it for code blocks
1 parent 28794e1 commit 5adecd0

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

docs/reference/lambda-support.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ applies_to:
1010
sub:
1111
apm-lambda-ext-v: ver-1-6-0
1212
apm-python-v: ver-6-24-0
13+
apm-python-layer-v: 3
1314
---
1415

1516
# Monitoring AWS Lambda Python Functions [lambda-support]
@@ -39,18 +40,16 @@ To add the layers to your Lambda function through the AWS Management Console:
3940
3. Choose the *Specify an ARN* radio button
4041
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:
4142
* APM Extension layer:
42-
```
43+
```subs=true
4344
arn:aws:lambda:{AWS_REGION}:267093732750:layer:elastic-apm-extension-{{apm-lambda-ext-v}}-{ARCHITECTURE}:1 <1>
4445
```
4546
1. Replace `{AWS_REGION}` with the AWS region of your Lambda function and `{ARCHITECTURE}` with its architecture.
4647
4748
* 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>
4851
```
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.
5453
5554
![image of choosing a layer in AWS Console](images/choose-a-layer.png "")
5655
5. Click the *Add* button
@@ -59,21 +58,19 @@ To add the layers to your Lambda function through the AWS Management Console:
5958
::::::{tab-item} AWS CLI
6059
To add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent through the AWS command line interface execute the following command:
6160
62-
```bash
61+
```bash subs=true
6362
aws lambda update-function-configuration --function-name yourLambdaFunctionName \
6463
--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>
6665
```
6766
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.
7168
::::::
7269

7370
::::::{tab-item} SAM
7471
In your SAM `template.yml` file add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent as follows:
7572

76-
```yaml
73+
```yaml subs=true
7774
...
7875
Resources:
7976
yourLambdaFunction:
@@ -82,48 +79,42 @@ Resources:
8279
...
8380
Layers:
8481
- 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>
8683
...
8784
```
8885
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.
9287
::::::
9388

9489
::::::{tab-item} Serverless
9590
In your `serverless.yml` file add the Layer ARNs of the {{apm-lambda-ext}} and the APM agent to your function as follows:
9691

97-
```yaml
92+
```yaml subs=true
9893
...
9994
functions:
10095
yourLambdaFunction:
10196
handler: ...
10297
layers:
10398
- 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>
105100
...
106101
```
107102
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.
111104
::::::
112105

113106
::::::{tab-item} Terraform
114107
To add the{{apm-lambda-ext}} and the APM agent to your function add the ARNs to the `layers` property in your Terraform file:
115108

116-
```yaml
109+
```yaml subs=true
117110
...
118111
resource "aws_lambda_function" "your_lambda_function" {
119112
...
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>
121114
}
122115
...
123116
```
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.
127118
::::::
128119

129120
::::::{tab-item} Container Image

0 commit comments

Comments
 (0)