Skip to content

Commit

Permalink
add insights to replication job
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpearce-digital committed Oct 30, 2023
1 parent 0235f9b commit 143c2b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lambda/create_s3_replication_job/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ RUN python -m pip install \
--target ${FUNCTION_DIR} \
--requirement requirements.txt

FROM public.ecr.aws/lambda/provided:al2 AS production

RUN curl -O https://lambda-insights-extension.s3-ap-northeast-1.amazonaws.com/amazon_linux/lambda-insights-extension.rpm && \
rpm -U lambda-insights-extension.rpm && \
rm -f lambda-insights-extension.rpm

# RUN curl -O https://lambda-insights-extension-arm64.s3-ap-northeast-1.amazonaws.com/amazon_linux/lambda-insights-extension-arm64.rpm && \
# rpm -U lambda-insights-extension-arm64.rpm && \
# rm -f lambda-insights-extension-arm64.rpm

# Multi-stage build: grab a fresh copy of the base image
FROM python-alpine
# FROM python-alpine

# Include global arg in this stage of the build
ARG FUNCTION_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ data "aws_iam_policy_document" "scheduler_invoke_lambda" {
}
provider = aws.region
}

resource "aws_iam_role_policy_attachment" "cloudwatch_lambda_insights" {
role = module.s3_create_batch_replication_jobs.lambda_role.id
policy_arn = "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy"
provider = aws.region
}

0 comments on commit 143c2b7

Please sign in to comment.