diff --git a/layers/Dockerfile b/layers/Dockerfile index e5fe428..d2ab947 100644 --- a/layers/Dockerfile +++ b/layers/Dockerfile @@ -1,4 +1,4 @@ -# Make sure to use the amazonlinux version appropriate to python version +# Make sure to use the amazonlinux version appropriate to python version # of the operating system documented here: # https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html FROM amazonlinux:2 @@ -7,7 +7,7 @@ ARG BUILT_LAYER_NAME ENV PYTHON_VERSION="3.11.8" -# note that openssl-devel since it is version openssl v3.x.x +# note that openssl-devel is version v3.x.x of openssl # is not compatiable with python 3.11.8 # The below installs openssl v1.x.x RUN yum install -y tar \ @@ -29,7 +29,7 @@ RUN cd /opt && \ rm Python-$PYTHON_VERSION.tgz #python install -RUN cd /opt/Python-$PYTHON_VERSION && \ +RUN cd /opt/Python-$PYTHON_VERSION && \ ./configure --enable-optimizations && make altinstall @@ -37,10 +37,10 @@ RUN /opt/Python-$PYTHON_VERSION/python -m venv avenv COPY requirements/ requirements/ -# #ask-sdk-core install +#ask-sdk-core install RUN source avenv/bin/activate && \ mkdir python && \ - pip install -r requirements/requirements-dev.txt --target ./python + pip install -r requirements/requirements-dev.txt --target ./python #bundle dependency for deployment as layer RUN zip -r $BUILT_LAYER_NAME python diff --git a/layers/ask_sdk_core_1_19_0.zip b/layers/ask_sdk_core_1_19_0.zip deleted file mode 100644 index 8528a59..0000000 Binary files a/layers/ask_sdk_core_1_19_0.zip and /dev/null differ diff --git a/scripts/cf_layer_orchestration.sh b/scripts/cf_layer_orchestration.sh index dd80a7e..b431bc1 100644 --- a/scripts/cf_layer_orchestration.sh +++ b/scripts/cf_layer_orchestration.sh @@ -1,13 +1,13 @@ aws s3api put-object --bucket lambda-deployment-bundles \ - --key layers/ask_sdk_core_most_recent.zip \ + --key layers/ask_sdk_core_1_19_0.zip \ --body layers/ask_sdk_core_1_19_0.zip aws cloudformation create-change-set \ --stack-name alexa-skills-kit-sdk-python-layer \ --change-set-name tvratings-new-layer-version \ - --template-body file://templates/ask_lambda_layer.template + --template-body file://templates/ask_lambda_layer.template aws cloudformation execute-change-set \ --stack-name alexa-skills-kit-sdk-python-layer \ - --change-set-name tvratings-new-layer-version + --change-set-name tvratings-new-layer-version diff --git a/templates/tvratings_alexa_skill.template b/templates/tvratings_alexa_skill.template index 8b60ba4..7d4e568 100644 --- a/templates/tvratings_alexa_skill.template +++ b/templates/tvratings_alexa_skill.template @@ -1,7 +1,7 @@ AWSTemplateFormatVersion: '2010-09-09' Description: | - Lambda function specification for a custom alexa skill and an s3 bucket for + Lambda function specification for a custom alexa skill and an s3 bucket for built aws lambda layers Parameters: @@ -12,7 +12,7 @@ Parameters: alexaSkillsKitLayerVersion: Type: String - Default: 1 + Default: 2 functionHandler: Type: String @@ -42,6 +42,10 @@ Parameters: Type: String Default: tvratings + pythonVersion: + Type: String + Default: python3.11 + Resources: @@ -58,7 +62,7 @@ Resources: lambdaPythonFunction: Type: AWS::Lambda::Function - Properties: + Properties: Code: S3Bucket: !Ref artifactBucket @@ -69,13 +73,13 @@ Resources: FunctionName: !Sub ${projectName}-alexa-skill Handler: !Ref functionHandler - Layers: + Layers: - !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:${alexaSkillsKitLayerName}:${alexaSkillsKitLayerVersion}' MemorySize: !Ref lambdaMemorySize PackageType: Zip Role: !Sub arn:aws:iam::${AWS::AccountId}:role/${lambdaExecutionRoleName} - Runtime: python3.9 + Runtime: !Ref pythonVersion Timeout: !Ref lambdaTimeout - TracingConfig: + TracingConfig: Mode: Active