Problem Statement:
I am trying to use a built docker container image and use that as the source for an AWS lambda function. However, whenever I build the lambda function and deploy it, I am getting this error every time.
The repository with name 'xxxxxxxxx' does not exist in the registry
with id '########'.
I did some sanity checks to make sure that my serverless.yml file was created correctly, with the correct spelling, and that this repository actually exists in ECR.
serverless.yml
provider:
name: aws
runtime: python3.8
stage: ${env:BRANCH_NAME}
region: us-west-2
role: arn:aws:iam::#########:role/current-role
vpc:
securityGroupIds:
- ${env:SG_ID}
subnetIds:
- ${env:SUBNET_ID}
tracing:
lambda: true
environment:
REGION_NAME: us-west-1
PYTHONPATH: '/var/task/packages:/var/runtime'
S5_QUEUE_URL: ${env:S5_QUEUE_URL}
SECRET_NAME: ${env:SECRET_NAME}
iamRoleStatements:
- Effect: Allow
Action:
- 'ecr:SetRepositoryPolicy'
- 'ecr:GetRepositoryPolicy'
Resource: 'arn:aws:ecr:us-west-2:########:xxxxxxxxx/directory/'
functions:
function1:
image: '#######.dkr.ecr.us-west-2.amazonaws.com/xxxxxxxxx/directory:tag'
However, for some reason, I still am unable to access this repository, no matter what changes
I have made it to my serverless.yml file. At first, I assumed, this might be a permissions issue, but I don't see any problem with my permissions declared...Can someone help?
question from:
https://stackoverflow.com/questions/66052001/unable-to-access-ecr-repository-in-my-registry-when-deploying-aws-lambda-functio 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…