├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── README.md ├── license ├── publish.sh ├── renovate.json └── tika-server.zip /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | aws-cli: circleci/aws-cli@3.1.1 5 | 6 | commands: 7 | publish: 8 | steps: 9 | - checkout 10 | - aws-cli/setup 11 | - run: 12 | name: Install Git LFS 13 | command: | 14 | wget -O lfs.deb https://packagecloud.io/github/git-lfs/packages/debian/stretch/git-lfs_2.7.2_amd64.deb/download 15 | sudo dpkg -i lfs.deb 16 | 17 | git lfs install 18 | git lfs pull 19 | - run: ./publish.sh 20 | 21 | jobs: 22 | ap_northeast_1: 23 | executor: aws-cli/default 24 | environment: 25 | TARGET_REGION: ap-northeast-1 26 | steps: 27 | - publish 28 | 29 | af_south_1: 30 | executor: aws-cli/default 31 | environment: 32 | TARGET_REGION: af-south-1 33 | steps: 34 | - publish 35 | 36 | ap_east_1: 37 | executor: aws-cli/default 38 | environment: 39 | TARGET_REGION: ap-east-1 40 | steps: 41 | - publish 42 | 43 | ap_northeast_2: 44 | executor: aws-cli/default 45 | environment: 46 | TARGET_REGION: ap-northeast-2 47 | steps: 48 | - publish 49 | 50 | ap_south_1: 51 | executor: aws-cli/default 52 | environment: 53 | TARGET_REGION: ap-south-1 54 | steps: 55 | - publish 56 | 57 | ap_southeast_1: 58 | executor: aws-cli/default 59 | environment: 60 | TARGET_REGION: ap-southeast-1 61 | steps: 62 | - publish 63 | 64 | ap_southeast_2: 65 | executor: aws-cli/default 66 | environment: 67 | TARGET_REGION: ap-southeast-2 68 | steps: 69 | - publish 70 | 71 | ca_central_1: 72 | executor: aws-cli/default 73 | environment: 74 | TARGET_REGION: ca-central-1 75 | steps: 76 | - publish 77 | 78 | eu_north_1: 79 | executor: aws-cli/default 80 | environment: 81 | TARGET_REGION: eu-north-1 82 | steps: 83 | - publish 84 | 85 | eu_south_1: 86 | executor: aws-cli/default 87 | environment: 88 | TARGET_REGION: eu-south-1 89 | steps: 90 | - publish 91 | 92 | eu_central_1: 93 | executor: aws-cli/default 94 | environment: 95 | TARGET_REGION: eu-central-1 96 | steps: 97 | - publish 98 | 99 | eu_west_1: 100 | executor: aws-cli/default 101 | environment: 102 | TARGET_REGION: eu-west-1 103 | steps: 104 | - publish 105 | 106 | eu_west_2: 107 | executor: aws-cli/default 108 | environment: 109 | TARGET_REGION: eu-west-2 110 | steps: 111 | - publish 112 | 113 | eu_west_3: 114 | executor: aws-cli/default 115 | environment: 116 | TARGET_REGION: eu-west-3 117 | steps: 118 | - publish 119 | 120 | me_south_1: 121 | executor: aws-cli/default 122 | environment: 123 | TARGET_REGION: me-south-1 124 | steps: 125 | - publish 126 | 127 | sa_east_1: 128 | executor: aws-cli/default 129 | environment: 130 | TARGET_REGION: sa-east-1 131 | steps: 132 | - publish 133 | 134 | us_east_1: 135 | executor: aws-cli/default 136 | environment: 137 | TARGET_REGION: us-east-1 138 | steps: 139 | - publish 140 | 141 | us_east_2: 142 | executor: aws-cli/default 143 | environment: 144 | TARGET_REGION: us-east-2 145 | steps: 146 | - publish 147 | 148 | us_west_1: 149 | executor: aws-cli/default 150 | environment: 151 | TARGET_REGION: us-west-1 152 | steps: 153 | - publish 154 | 155 | us_west_2: 156 | executor: aws-cli/default 157 | environment: 158 | TARGET_REGION: us-west-2 159 | steps: 160 | - publish 161 | 162 | workflows: 163 | version: 2 164 | publish: 165 | jobs: 166 | - ap_northeast_1: 167 | context: public-lambda-layers 168 | filters: 169 | branches: 170 | only: 171 | - master 172 | 173 | # - af_south_1: 174 | # context: public-lambda-layers 175 | # filters: 176 | # branches: 177 | # only: 178 | # - master 179 | 180 | # - ap_east_1: 181 | # context: public-lambda-layers 182 | # filters: 183 | # branches: 184 | # only: 185 | # - master 186 | 187 | - ap_northeast_2: 188 | context: public-lambda-layers 189 | filters: 190 | branches: 191 | only: 192 | - master 193 | 194 | - ap_south_1: 195 | context: public-lambda-layers 196 | filters: 197 | branches: 198 | only: 199 | - master 200 | 201 | - ap_southeast_1: 202 | context: public-lambda-layers 203 | filters: 204 | branches: 205 | only: 206 | - master 207 | 208 | - ap_southeast_2: 209 | context: public-lambda-layers 210 | filters: 211 | branches: 212 | only: 213 | - master 214 | 215 | - ca_central_1: 216 | context: public-lambda-layers 217 | filters: 218 | branches: 219 | only: 220 | - master 221 | 222 | - eu_north_1: 223 | context: public-lambda-layers 224 | filters: 225 | branches: 226 | only: 227 | - master 228 | 229 | # - eu_south_1: 230 | # context: public-lambda-layers 231 | # filters: 232 | # branches: 233 | # only: 234 | # - master 235 | 236 | - eu_central_1: 237 | context: public-lambda-layers 238 | filters: 239 | branches: 240 | only: 241 | - master 242 | 243 | - eu_west_1: 244 | context: public-lambda-layers 245 | filters: 246 | branches: 247 | only: 248 | - master 249 | 250 | - eu_west_2: 251 | context: public-lambda-layers 252 | filters: 253 | branches: 254 | only: 255 | - master 256 | 257 | - eu_west_3: 258 | context: public-lambda-layers 259 | filters: 260 | branches: 261 | only: 262 | - master 263 | 264 | # - me_south_1: 265 | # context: public-lambda-layers 266 | # filters: 267 | # branches: 268 | # only: 269 | # - master 270 | 271 | - sa_east_1: 272 | context: public-lambda-layers 273 | filters: 274 | branches: 275 | only: 276 | - master 277 | 278 | - us_east_1: 279 | context: public-lambda-layers 280 | filters: 281 | branches: 282 | only: 283 | - master 284 | 285 | - us_east_2: 286 | context: public-lambda-layers 287 | filters: 288 | branches: 289 | only: 290 | - master 291 | 292 | - us_west_1: 293 | context: public-lambda-layers 294 | filters: 295 | branches: 296 | only: 297 | - master 298 | 299 | - us_west_2: 300 | context: public-lambda-layers 301 | filters: 302 | branches: 303 | only: 304 | - master 305 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = space 9 | indent_size = 2 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.js text eol=lf 3 | *.zip filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | coverage/ 3 | node_modules/ 4 | temp 5 | yarn.lock 6 | *.log 7 | .DS_Store 8 | lib/ 9 | layer/ 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apache Tika for AWS Lambda as a layer 2 | 3 | > AWS Lambda layer containing the latest [Apache Tika Server](https://tika.apache.org/) 4 | 5 | ## Getting Started 6 | 7 | Click on Layers and choose "Add a layer", and "Provide a layer version 8 | ARN" and enter the following ARN. 9 | 10 | ``` 11 | arn:aws:lambda:us-east-1:764866452798:layer:apache-tika:7 12 | ``` 13 | 14 | Current version: [2.3.0](https://tika.apache.org/2.3.0/index.html) 15 | 16 | ## How can I use it with the Lambda runtime which doesn't have Java installed? 17 | 18 | The latest Apache Tika version requires Java 8 to be able to work. 19 | 20 | If your runtime doesn't have Java installed, you can use [Java 8 Lambda layer](https://github.com/shelfio/java-lambda-layer), which actually was designed to make Apache Tika work on Node.js 12.x runtime. 21 | 22 | ## Where can I find Apache Tika `.jar` file inside of Lambda when I attached the layer? 23 | 24 | You can find it at `/opt/tika-server.jar` (`/opt` is where Lambda unpacks layers). 25 | 26 | ## Available regions 27 | 28 | * ap-northeast-1: `arn:aws:lambda:ap-northeast-1:764866452798:layer:apache-tika:3` 29 | * ap-northeast-2: `arn:aws:lambda:ap-northeast-2:764866452798:layer:apache-tika:3` 30 | * ap-south-1: `arn:aws:lambda:ap-south-1:764866452798:layer:apache-tika:3` 31 | * ap-southeast-1: `arn:aws:lambda:ap-southeast-1:764866452798:layer:apache-tika:3` 32 | * ap-southeast-2: `arn:aws:lambda:ap-southeast-2:764866452798:layer:apache-tika:3` 33 | * ca-central-1: `arn:aws:lambda:ca-central-1:764866452798:layer:apache-tika:3` 34 | * eu-north-1: `arn:aws:lambda:eu-north-1:764866452798:layer:apache-tika:3` 35 | * eu-central-1: `arn:aws:lambda:eu-central-1:764866452798:layer:apache-tika:3` 36 | * eu-west-1: `arn:aws:lambda:eu-west-1:764866452798:layer:apache-tika:3` 37 | * eu-west-2: `arn:aws:lambda:eu-west-2:764866452798:layer:apache-tika:3` 38 | * eu-west-3: `arn:aws:lambda:eu-west-3:764866452798:layer:apache-tika:3` 39 | * sa-east-1: `arn:aws:lambda:sa-east-1:764866452798:layer:apache-tika:3` 40 | * us-east-1: `arn:aws:lambda:us-east-1:764866452798:layer:apache-tika:7` 41 | * us-east-2: `arn:aws:lambda:us-east-2:764866452798:layer:apache-tika:3` 42 | * us-west-1: `arn:aws:lambda:us-west-1:764866452798:layer:apache-tika:3` 43 | * us-west-2: `arn:aws:lambda:us-west-2:764866452798:layer:apache-tika:3` 44 | 45 | ## Update 46 | 47 | 1. Go to https://tika.apache.org/download.html, download Apache Tika server `runnable jar` 48 | 2. Rename the jar file from `tika-server-x.xx.jar` to `tika-server.jar` 49 | 3. Create zip archive of Apache Tika server with the filename `tika-server.zip` 50 | 4. Put zip archive into this repo 51 | 5. Put proper version inside of `publish.sh` & `README.md` 52 | 6. Increment layer versions in `README.md` 53 | 7. Commit & Create Pull Request 54 | 55 | ## License 56 | 57 | MIT © [Shelf](https://shelf.io) 58 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Gemshelf Inc. (shelf.io) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /publish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | aws configure set default.region "$TARGET_REGION" --profile default 4 | 5 | TIKA_VERSION=2.3.0 6 | LAYER_NAME='apache-tika' 7 | LAYER_DESCRIPTION="Apache Tika Server v${TIKA_VERSION}" 8 | S3_BUCKET_NAME=shelf-lambda-layers-"$TARGET_REGION" 9 | FILENAME="tika-server.zip" 10 | 11 | aws s3 cp ./"$FILENAME" s3://"$S3_BUCKET_NAME"/"$FILENAME" 12 | 13 | aws lambda add-layer-version-permission \ 14 | --region "$TARGET_REGION" \ 15 | --layer-name "$LAYER_NAME" \ 16 | --statement-id sid1 \ 17 | --action lambda:GetLayerVersion \ 18 | --principal '*' \ 19 | --version-number "$( 20 | aws lambda publish-layer-version \ 21 | --region "$TARGET_REGION" \ 22 | --layer-name "$LAYER_NAME" \ 23 | --description "$LAYER_DESCRIPTION" \ 24 | --query Version \ 25 | --output text \ 26 | --content S3Bucket="$S3_BUCKET_NAME",S3Key="$FILENAME" 27 | )" 28 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["github>shelfio/renovate-config-public"], 3 | "labels": ["backend"] 4 | } 5 | -------------------------------------------------------------------------------- /tika-server.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f6f6851e06f1af7a89edd1a418740757ad42fa292caf602506fa6b606738074c 3 | size 54665917 4 | --------------------------------------------------------------------------------