shelfio / libreoffice-lambda-layer

MIT License
112 stars 22 forks source link

publish.sh isn't working. InvalidParameterValueException is thrown. #15

Closed iamrahulroy closed 4 years ago

iamrahulroy commented 4 years ago

Background: Trying to integrate the layer with serverless framework based project using the method described in the docs as follows.

Using the ARN method throws the following error:

An error occurred: ConvertOfficeDocLambdaFunction - User: arn:aws:iam::XXXXXX:user/rahul is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:764866452798:layer:LibreOffice:8 (Service: AWSLambdaInternal; Status Code: 403; Error Code: AccessDeniedException; Request ID: 0cff4621-9504-43d4-90f1-27ee6be321af).

This is weird as others are able to integrate using the same ARN. Which makes me think, that it's a framework issue.

To test the hypothesis, I went ahead and tried to publish the layer using the publish.sh script. Running the script is throwing following error:

An error occurred (InvalidParameterValueException) when calling the PublishLayerVersion operation: Could not unzip uploaded file. Please check your file, then try to upload again.

The above issue is originated from the following command:

aws lambda publish-layer-version \
  --region "$TARGET_REGION" \
  --layer-name libreoffice \
  --description "LibreOffice ${LO_VERSION} binary" \
  --query Version \
  --output text \
  --content S3Bucket=my-bucket-name,S3Key=layer.zip
vladholubiev commented 4 years ago

As mentioned in the error message, looks like you're trying to publish to our AWS Account: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:764866452798:layer:LibreOffice:8

AWS Account ID 764866452798 belongs to Shelf, so it's expected you don't have access. Still not sure how did you get this message though...