AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: OpenTelemetry Python Lambda layer for Python Parameters: LayerName: Type: String Description: Lambda layer name to be published Default: adot-opentelemetry-python Resources: OTelLayer: Type: AWS::Serverless::LayerVersion Properties: LayerName: !Ref LayerName Description: Opentelemetry Python layer ContentUri: ./otel CompatibleRuntimes: - python3.10 - python3.9 Metadata: BuildMethod: makefile api: Type: AWS::Serverless::Api Properties: StageName: api TracingEnabled: true OpenApiVersion: 3.0.2 function: Type: AWS::Serverless::Function Properties: Handler: lambda_function.lambda_handler Runtime: python3.9 CodeUri: ./function Description: Build ADOT Python Lambda layer and sample app from scratch MemorySize: 512 Timeout: 15 Policies: - AWSXrayWriteOnlyAccess - AmazonS3ReadOnlyAccess Environment: Variables: AWS_LAMBDA_EXEC_WRAPPER: /opt/python/otel-instrument OTEL_PROPAGATORS: xray Tracing: Active Layers: - !Ref OTelLayer Events: getEndpoint: Type: Api Properties: RestApiId: !Ref api Path: / Method: GET