{"_id":"@litexa/deploy-aws","_rev":"84-2c8ca26b0f07bb40b2608ef287d1e0a2","name":"@litexa/deploy-aws","dist-tags":{"latest":"0.9.0","nightly":"0.6.2-nightly.187477873.11"},"versions":{"0.0.2":{"name":"@litexa/deploy-aws","version":"0.0.2","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-labs/litexa.git"},"bugs":{"url":"https://github.com/alexa-labs/litexa/issues"},"homepage":"https://litexa.github.io","gitHead":"795625ee8ecd349565f081808eca48cd9976d9ff","_id":"@litexa/deploy-aws@0.0.2","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-BvEEt9qkHbZ88r28N8MGS0OYMBWDldF0wmxaOOAn3pQeRF/xfE2X8x3lc8el+ZzrVn3sle5TaIkLuQ7nXyDSXg==","shasum":"d01294d37f5f2de2241359623c0f83315b41d1f3","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.0.2.tgz","fileCount":20,"unpackedSize":91981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczJZsCRA9TVsSAnZWagAAopkQAI806/fCo+45UFO5GViD\ntOV5pfLwAHGRkojDbwCEV8no/4T1RzHSeHiz7gABVVJEArM4fjfjIHDYPaJV\nNBE7S1tj/k5Hhu5Fu7Xumj0Ch/gSCN+b+Ziq1EgcAzUikVVxBCz17oh5WkBi\na1Cj5uy1TRaVW+jKXoX1+0KgX9xa+jVYlpeST3sxLDrHawHGw+HeTU+CPo2a\n5mjFOXxMBDrQFn4rFHDXDXncodXMsj8BN68OHayLTCifVvSpTtXPyh1RT6lq\nFRaizLIdJ5q5KvLBI5QX3qyc5x+v6vbApNqKKtcTwehOlLgD1r/IhZDGIFLv\nMZyGVIVjm3e0TcO3r7bhhB80IN7RiQTKAzJfxK0zUIx292CjZSTZrUJQqmWk\nqu1p5qmkKmNM9Nz5MNXg3AZb+tDLbSWHyuqnoDx3oN50j0FZMmhcg5F5pVoG\nRM/Na4vplbuZ//2uySbSZVpjOuIePhdXImjpBkYufcAN6C/Pl6ADB69S2YI+\nIPU/l/hV4jReN6O0rnXavm5MFIe0CmA6UVqoveGCcTT53WBmTHYI/C4e5AQf\nRqfQvxalDBLELNTao3obMFso0BWGpy+ZlEhZSnL3zMuR0ZdeTz4jhRmSw+VD\npuvpSkzRWtMHG2AAMnD3TjlAoltRe5rYQlsWYHnHOewBlcL7CZL03iwg2cbW\nyCoL\r\n=YaEY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHioSULXfVabmERtyPRTzw9I5USQAS4bwAMAkSuKP4rYAiEAllPhqLdR9pXPl1Ii1UdnrbFO4tlTgUWiMqLH64FGQ58="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.0.2_1556911723660_0.9018828069113121"},"_hasShrinkwrap":false,"deprecated":"Unstable package version, do not use."},"0.0.3":{"name":"@litexa/deploy-aws","version":"0.0.3","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-labs/litexa.git"},"bugs":{"url":"https://github.com/alexa-labs/litexa/issues"},"homepage":"https://litexa.github.io","gitHead":"f9d79982170f28b81e4037f52e3df6ea1f72abf7","_id":"@litexa/deploy-aws@0.0.3","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-TDt4hqt+2U+8wvfh0miSsIrN6yWMWksNp4Hf4itytL6Rn7JbsJmL0SCB0RoE4p9DMHfIdTmYYRJ93dqbmlP1Eg==","shasum":"128c8dfdce0f23382f4f21dcaa38346fe213e8dc","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.0.3.tgz","fileCount":20,"unpackedSize":92068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczLvqCRA9TVsSAnZWagAAN/EQAIDxtTzczb9C0jEh7ADq\np0Xb7AAMhvcPUnKR99igUJIqz+/Wu6LFFlvzuRRZd9yx/yX45EjIVUjub9a3\nvnCZRmA3okLPjOr89eqkHQ9M3vDRVPT51MXSS05UxOpcqZNA4Q6n9nW0v7uu\nkw4LBRK6W2GCuF8ter8H9kHh7Jvn3pBRH+k+00RwXK0U9R+FwYmis8ZZFaQt\nUP4lusoR6zOFjbTGG4HZMhwzKp86MBmboA6lwygc/wbBI0YOR7eIdFUaWXxV\nXHFfCr4ktqNlfs3AtRiE7Ck/DgqkJWknlbCmYsOJr0S+ZlznjtjyTCpzwzI9\nw9lK7/0libP4Wq4T7+uEkLtOHZocycanbJNc87o8QxJgQVW0KZRNe7KNXeCU\nQ5aPd0m2sB4Iwc8/kWVLU9kr8tOlkvN3w3k2lSiFlQQA1KR1XoLx2RmsmKJs\nZKi9SCm6VfuP49vTO+mP/ND+5DB8j0cPnAZZc66q8SwhZTPO1l9EQYMamKM7\n1EyjjwvhsIRDVow+oAmebgRtDtO0R1sGn5zuKfIKehkjU4K6d4hVKC40450e\nJdAZWEQpLvqGclZUiCx2lyAQdqQPYVCRGeuVkjQNkJiqynggkBIXsm3IW6dn\n3dFTD8ApVbcV57GAStun29V4NR4NJiKpJ6KOtBMsCGDpjbbELl8aNWdWdp+v\nc5fj\r\n=lYz9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSWX51S5itik/cLJjMUxy+KfoeaY+rzJT4hKX0Kjx2RAiEAkj7I2gdu98GxMUiV0SCZpQw/XGPNDyuOxNOUKY1kqAo="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.0.3_1556921321131_0.487620716176947"},"_hasShrinkwrap":false,"deprecated":"Unstable package version, do not use."},"0.1.1":{"name":"@litexa/deploy-aws","version":"0.1.1","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-labs/litexa.git"},"bugs":{"url":"https://github.com/alexa-labs/litexa/issues"},"homepage":"https://litexa.github.io","gitHead":"56523ebcc830e555c1e2b43f0027a03d1eefca1d","_id":"@litexa/deploy-aws@0.1.1","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-i4Laao4qZcL4lF5mrNVF84pNEtnltq1k1xWqJ7P5JMKfW3TTAuN3kUMSU3b3QUjv9vqcgjALrR4CK+W1DiUk5w==","shasum":"c71dd28e2fa7d13a79a70d007b45f2d0388ce55b","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.1.tgz","fileCount":20,"unpackedSize":102087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0IYwCRA9TVsSAnZWagAAtoUP/2f48o+dDQCx+YKXDWEX\nxSisoLmzMCGedmg4NevEUy86EKkvXn0ZL8oSAxQTyH4CqwWkMoU3G1FJX1Qd\nhIDcnIPRYjYJ7N9N/X+YLO5b3zhQwJeN0e3Ku53pgzZsX2JBzigEw8/IJIrv\nAkSKlPGs61pXXGDNc1TF12/IIm6ISOVQJVWpOZnGWiBY6rlQY2Z2SHW1NbRz\nWAmzuBUeLVoEfyu167x4QCpga4yp1bfA4+ZSjPa2WJ4E65cRVA/HZweu0+cq\nC41NB3YN7iAHJsOAc+aScQKFQIKggNu55RvstdHV73HHu6wvzvuSD3NaYUbY\nuaB0+jP/mSXsEv8xVlZAWLHi2Rs+2mRmr0zTiDjPxM8ZEl4g1DspzuJ/zocU\nIo0RvIQog78nCwA8s41Mcnsm+7rAm12LCq38FHy4C4kIzvxdNsiL5uZBPDjg\ndxVVwYFlZc+NQ965/yBOZK8vv8hZQdkDztVpjeF8eLeMv/LrnncFlu1K12hl\nB0psshr37SEt/b4SEUD0qUKhj7scR9a9eSvRP/Qe05TvsTGAJiAE1lgcbF/Q\nnirGZA195sIdVRaAXuFGI7cz3jqSOeIb5Dk0J4jKlO2xI8JXqyuyYEBsRpix\nNUoLHYKFEc6DC6o4G4E1vBixmslvrj7oyAhtSNEF1iz6Cvf8jyNUfeKXitMd\nVgiJ\r\n=FpcD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDIDn5aSm99C4iKpaxcAduhJ7pJsfjWYsXPjSASaSMEQAiBiCt4yT3fu1oQ6qZNVjTHHGOfvAh/8RPRbWgLPMBlKpA=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.1_1557169711768_0.7497198453587179"},"_hasShrinkwrap":false,"deprecated":"Unstable version. Upgrade to @latest"},"0.1.3":{"name":"@litexa/deploy-aws","version":"0.1.3","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-labs/litexa.git"},"bugs":{"url":"https://github.com/alexa-labs/litexa/issues"},"homepage":"https://litexa.github.io","gitHead":"e0af34aeee7e97b42f1b7ed152276ace7fbee96d","_id":"@litexa/deploy-aws@0.1.3","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-EUexzcxuvIB0Ex8tPYu5aPQwHcVP0AMoOx/rdjtV9etwNbCG5qOt6wWETsW3HH872zOMFfu/niGtfW57cpIUDw==","shasum":"27eeef3e36a93b35793bec90911dc1eb50f35bc5","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.3.tgz","fileCount":20,"unpackedSize":102281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0Kv/CRA9TVsSAnZWagAAmdoP/1IgMC8rB+q78x05osc4\nINN3tY8xASeS2ihJoib0JuHAUTZn36cFAyh5lAC37eO1qFN/IgrOrjdt9shq\nvVRGE3fTo6u9sp/r77cKMcHubhvYKnvgT02S2UY1VcRaXxHFeZ43rxZDM78A\n/CAV7d2baWGxOCVFsJKijTM4syb7nwPBoyOdQVYfbMPa68Ub6UJFJGJn3ezG\nKnk9y4B1onAB9UHit13VHzdffyIBQRKYQhQ7Es1ZCA72+zPsvITFMBCElIDT\nuJij+eCbTPi+6PBZ6+iODU3OpXejeN3FuR4cHLR/pGF4HxjsxU2B6ctIxxqa\nV9UJ535tOARTiuqBhN/5e/XpcYpjncpcKQY5SRHZJvVHtJ9UIGuZ84IrfxNk\nfEXwPbFLAhLcuI6ni0vXTfugXS6z74Qq321QFZrCO9IzGqoIU30Pg5Q2wsz0\ns/hImQwq3rRP99SMPBGHOmxytIu3U67+U9k0a0FZ1ttoOHkI65mRgEJ9cMBd\nlQ1FyGaoQO17bKnmSszakD+shqY0+S1kiolIeOrSCS6IyIJNoCh3+BMeZryM\nuOKQL6DPjzp/z6lPfFeyXU39RGZIvA9QVisC1QLe5WmDWomMiWR1VlRVg9eT\n2HTUw9upw4F6mvqcrJf3ESf27UhIMXs0HNC+htsDd8maQWqC5yhl7bCAe9oF\ntCKR\r\n=GqIV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnL0Cvv6UjSsRgSnqhc0rmzyvGE5J62EdusL97fQa94AiEAjvbkxoGMddCWpKPkbCerGOjxoUsgFMFli8qT116J++A="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.3_1557179390494_0.8622354992885639"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.4-nightly.110967595.1":{"name":"@litexa/deploy-aws","version":"0.1.4-nightly.110967595.1","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"http://litexa.games.alexa.a2z.com","gitHead":"495fc60175e42f13ec3103bd81f8d2a1bcb9126c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.4-nightly.110967595.1","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-PfVCK8Is+J8LdyrZSfWi7mNjWu/+uR7LqmI+obgKJFVcDPHrwT9vV3MiqRu972KYCDCggePDLvyPGQsLUWA5pQ==","shasum":"e8cd5a63623c047090e25f43d14b2cf6136d4a84","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.4-nightly.110967595.1.tgz","fileCount":20,"unpackedSize":102321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0gfSCRA9TVsSAnZWagAAn/8P/A6DurQYDT5qoAvS4veB\nnQ7vADnAK92WsYZjfmYHRHXeGD3E0MVHoVEYdwvI1nbpSRYEya5JxgIv6BVV\neJ+EIXaPMr2+RzJOC0j85meQa214cPsYMtowCXmsbHrWvRlHToTK56pp32C/\naDoeIOTG8B7E518JI77ajpfmheeT/FWyxW3SGNTWLWnZGUKnwGCcEcHDIvoV\nfRPXrma+bt/FO0NrHFO0uIwKU1U3guwRr+niiRD0gMKmDiYPcmv9PdHVyQbn\ntCmkwcMZmRcjl9C2iN6R0mRQhySRZ9e03Y7J5XkguKPg8Cn1aO9Isy2oBjDN\nz3s5XgosbfW1wat8tR++oCqWqwfTOFzgDgB7ic6WLxGSxolqHVFn4D78Z9kG\nhIGzN4ProC1M3zG3LNTU8+3I6DNt0ywPPcJ9mF1AMVOSzJ+6mb88Ctm3vd/V\npUvVw5Il+K4UcwrHns3K7QZrhHp3Zg+2eAnhVQOFPtM0bCCZG4CUk3v1IRsb\ncqhr9Bqm2Ixir1DWZbJJZ46Wk+I73nJAzhj0wnm2LIwHFRK4ocHanQCoLYKy\nqTWdEFmroC5KlmuY9LO2TqT7VTd9ECL490aXsDS7eCMTwmnAGJn6qNQPYVnh\n2E9PyO6soAAcrerHG1CWdZJaBsijTZ0KGnjhyL/pqtkGo80KfFQFiuqlAjY0\nNcup\r\n=gitl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXMnatZvklRRy0CHDEwQwtAgprP5IsJK5mo8doQ3+HuAiBSfZkrMapWoG3ESEHd9ipSGJnYrwmXNta7+mUopD+Eug=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.4-nightly.110967595.1_1557268433900_0.31234440133995056"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.4-nightly.111120854.1":{"name":"@litexa/deploy-aws","version":"0.1.4-nightly.111120854.1","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"http://litexa.games.alexa.a2z.com","gitHead":"495fc60175e42f13ec3103bd81f8d2a1bcb9126c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.4-nightly.111120854.1","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-q/cgTbe4LTleR1qLVydOPBD5WFHAhdUDeDtEeUsb2H/hpAzM+TKMPYPhtBVFkrmfQg/JzX9QJMmNiv2QnkdXRw==","shasum":"7023a44b810a1eb20ac52f691c6bfc087054e415","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.4-nightly.111120854.1.tgz","fileCount":20,"unpackedSize":102321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc01nLCRA9TVsSAnZWagAAsHwP/RhNSEfPUByfARF7Pd8X\nypqUwy1lvBn38h1Uim57l9eVyjchFRuekKaRW/4Fke2ejOZP3vpJigVhgtku\nl1IRAB7Pi/SU1xdBnLsXoD//Ctw8zYxcPrTqhTewikuQEP9PhjEGOkygfaeu\nekaNW7KEAwj0UtZX6AsrPSuc+1GbumMHILpdHyD+v2az6bhY9Dcha/QijTOR\n1n0j51eCJbCqJwFw7hBjbFYKlFw9MDcJK7i2dKnTrMKgwsuJm7pHyx1KO8MI\n+9u5WPVeEJhQQhrLhkdiXjvzuyMUolvNdCAbo42T8lQ1BDhxfyTv+batJUdr\nuwSAh4tOL5TCmDFKOh3i2tzpZBN4rfIDj1poM020AodVfERzR8Mz26fcf7Ie\n3e9zxRJHWgx0aiQQHOvQLETdHZ/z8MEb8HRh03K7NBtv8oy67Az7EQEsjQqd\nPlOA78MqbwoTC+K1lQMOZ1CvcgDVc6zNjdnqCjBYfvnqOTBH0DRWd8CYLK4e\nqT/46XoQ4ESxu3ZAXAX8g8XkvtdDhyLTvcqYMNC6y69bk9NnOrKnHV6hh/Mo\nhBjCyXTSO8I613zSrQF8QyiiIqoWRO4Rhfr3VwESMikaKYKPftba8blxddQO\nFuviBsKQTt31JHsN76McsvJtehg71mU8+kFH8A50J4o2ib06vR55eOT3zj4B\nsdt1\r\n=Aqev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCprQJ7eQ6ihhnlirKbPfJu+1UOmb+EBSBPSjO3c/QlBAIgPSL4IUHJuOVvGX5mLWFDEfSMxkoYjHBOpYgKRIOLdh0="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.4-nightly.111120854.1_1557354955198_0.8652650012120506"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.4-nightly.111132236.2":{"name":"@litexa/deploy-aws","version":"0.1.4-nightly.111132236.2","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"http://litexa.games.alexa.a2z.com","gitHead":"1c576668dd36dc3e2675332bf3a062056c83e02b","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.4-nightly.111132236.2","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-T6DNYx3DRidLDhWsEPlPoeCFSX4fyfBME22BXfwFCYAcz58ClTDr7+EY/xCMBl+G8bDFij4mdV4ukqZ32gfjzg==","shasum":"dce0087b3a34fc904bce0799e6d14e28f3ee53f7","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.4-nightly.111132236.2.tgz","fileCount":20,"unpackedSize":102321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc04GkCRA9TVsSAnZWagAAY4kP/3/JU3we4QR3TAcGtr8p\nHVEfIwRKjmPZip28frJNh+rlxog6mGjKRpDvJ5btV0eSVdUFzcMrl3elVDij\nK0Q1gJ60IIFraNitsTv1+fIXLNBxDz2MwCMH7UwmaOZklWay69paqYNMp9b4\nIvrbbtmMj9qvvVxSEq7ZtrxGDIak8XFviFq7icHMzg2xWGVx689ytsEGdQWY\nIyr4UKLgIh2XgQWeqLqszKrvt2PALs09dVuqseJ7nlvOR3Z0COeHpOv9g1hZ\npVjhrirpSddNp0+pyWGZ2FOBY9GqVy+dNY2pGXFDdHRgcSOdypUvp5NlTJY+\nNTnUWtwkeWTexSK/UFFyAVrui1E1fRlFQ+dvUkvwCUPg537AFLcIoRYZZZDu\npSHKlKNu7FJzVSywXzl/W4tGhZMVjAkeNTIa1dTZMfktTZzZfDu49Huwj2SN\nuNiS2kvljeMJpCW6oN6nsmvOaMFfu7TfaZByVhZ7k9f2Nlx2h8aBsN1VcnVV\ncde389aAJH9t1V6TYGgB1ikmJBnercFsmF+7qtW8o63TP36/ZW+Ha9fEBXXt\nSemDRSx9Qh2mqO46MPOS3Smt0o7qS5YsbidWq1c/J/wR5mR/2whJ77zRAVtt\nVxqozdIU5YHM7PQ4ttSTvXvIyPePBiKLjm/JqXZ4wgF44x662NA5OFQs/gXx\nEfWu\r\n=VVrC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuvavHBiGtquOjJciIl7lUFRgJHJikItAlxgO+ySS/qwIgUMMaln6QhWC0l5lfZ75133HHSVwvUf3wnUIzNYA/cEM="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.4-nightly.111132236.2_1557365155474_0.7712794075498068"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.4":{"name":"@litexa/deploy-aws","version":"0.1.4","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"http://litexa.games.alexa.a2z.com","gitHead":"d89330a299df060bcd10e05f17b8dc50d28cade2","_id":"@litexa/deploy-aws@0.1.4","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-Jptt6JrXEsx4O7hPO9+QnuU/HJm9642uKiQvm8ZlrmETozM6CfI8YCsO2NVamXB2dJxfurM/Gn/pMvCs4BBDdA==","shasum":"6dadad9bc88a48dcfdaccd0d5c8cc19797526e39","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.4.tgz","fileCount":20,"unpackedSize":102713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1KBdCRA9TVsSAnZWagAAWMIP/A8WbHYmPOpqREKV0K+a\n4RRNWwjE9LzdD1NYFGjwBS3IEpdBi+QRDsBGFP7XQoD1iOH+CnQWsuJNtlg6\nZVlWkDfcL8EBxrU2o69cY/6PNmkupYV6toHVoTgvhTCWWDM63w8ewiO1yP1w\nceqlxkJXHq7YselQXvDTY2vF+GEvwpF9E6C0ED3oRtLRq/OyFsOQUTKy2eyx\nSVrGcLpj73Hrr7SgcFwVn1/eHud9hV4TXzGBsD5iLn3fatj+HBOb9PUjkVOD\nWlpCQc35kahJEOTZjRwSCYpg5cCq0pqrz95yiAcaSxjik33QAMPF/cJqUSux\nieBXfgV+TG0E66f/rnVb5lEVZUrkQETSQ4f2VHP/Da0aoVEEhdq2AdfuoMkY\nU/9K+RzNdXe0dTTfEd0R5+xUL2x7kKpeUGhSN4wC0YYuZAVy0e5bp35DwizK\nNrsuV2LFNUygPdNSe6WebmVKt8H7X7jGpNYPjHLBqRRMSf0LLkCFnZOgGWUC\nWWD0XKssqaWE9fYtEw+zbFxn34bwBvSWaIHdkYg1aSvzpYW+enAoMAYmQ1Qs\nFyc9upDz0Vzh7tTXJonJKAGzkRlOJzzrRcKbJIshWogfiSlDHv0FszjfV5MF\nvi7b2fgybkwBXI000ZEPQ0kmrZwZPB+5Ru0UtZlcNcTPEdTEPMsjlOc8ySJl\nwPZ/\r\n=8YJt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLx9Loo2oC9W2n8OcheTyHYUprnYHuDRMqCBDGFO5iHQIhAIvIg2EqjqhB0Sv304uyoWDZ+kJ6b0SrgelCxNzTUKNH"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.4_1557438557016_0.44942123555079405"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5-nightly.112154138.0":{"name":"@litexa/deploy-aws","version":"0.1.5-nightly.112154138.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"7b9c6d5302d1e9da84f72a64e3975f5e7d86e830","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.5-nightly.112154138.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-gpvj94ROSAkVS4DSmPeWWdQgrxhX8D7YSdxf41TAdB4LY+68w0AmPMHe8ED/lrUdeuhiKU4xu5h5HPAKzX5Bqg==","shasum":"680b072025f5d88db3828623c51a4ca333a57c26","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5-nightly.112154138.0.tgz","fileCount":20,"unpackedSize":102742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3ezICRA9TVsSAnZWagAAA/IP/1H56BTtQACkWzNHmyIJ\nocx2RIbrh9sAIixBf5+MynewTCNXPsXv/EI3V2MMuccx/vESnM98KT8GbicZ\njCg2y8RegQjFvWIEi7ZoHgHsECi0ZrfysMP3/wt8/cm9DDp3iM66NnVw4zcy\n0jP/moTJdBI+BpInip5L8a/Q9yuzIXTSOGgKsubGk5FbQ6wKo0g4QzuLfRP8\nJJRqPJuzbVm21+BDe8pjdZERsxl7jxeogPFitsm2RwKFk8EjgRr4XWzyHAQn\nBP4q98Ls7vutaGhpUZLir7e8nJYQxXLC31kJ2ZqCuK8Gpl3r5RGvi+fpkEaB\ncVp3gb2cNHlcp12ftOKu1K4KYxvKQi1vEDwEBqXEWfFbJR6ztHi3MsgER9fy\nq9x4qca7pTk+f++rdfbsxT+9cm+jnVta8wfhV/3tRm0RKlm+LpspU00D2qBd\npe96k03AHJU4twSP3pEibmd9GYnJVRlvo+CtCxMrg1ZL54jtIv10fuReIu4W\nyHCBBdXyS5kZD0rW6sN/7s2bWTDX9NPMn434dXGEigXUYGLLrDUhgjzaMKNv\nMsHS3BrQXkH6g41auEEgR88c9uZNCUY+5ca39q/A17WYmc7jJ2jafURQAUel\nPQ1qjQOD8XFBGdkPy+Jqy/YdGnoLqzbP+IqIC2QNNP/PEJSnFqs6ZQe1k/nI\n8ncH\r\n=UkZ3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIACf5YEVU4tanjv+iFOmJuopMjA3byUcaZAwnz5Dx3SnAiAvJx9jbOwEVN89y/nP5LVrNr0M5WaWbvb/7G6zcTGjwA=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5-nightly.112154138.0_1558047943381_0.8627834748485905"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5-nightly.112295593.0":{"name":"@litexa/deploy-aws","version":"0.1.5-nightly.112295593.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"7b9c6d5302d1e9da84f72a64e3975f5e7d86e830","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.5-nightly.112295593.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-yZM1EMH+8oueEtZX04gr9pss7QDsyEA2rQi+zZ/UXPRRujm/umwB3szNyJ8p6yjpn1rc3Ta4RoowZAwhm0p6Ew==","shasum":"5304152d690194e193d7f91a10777f96bfbcb7d0","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5-nightly.112295593.0.tgz","fileCount":20,"unpackedSize":102742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3z6TCRA9TVsSAnZWagAALfIP+we+nY/R48BrAbjvViiL\nnliQT7UTJx3Wh7cE3UdblTi4epE/fICKpa/bvyj5XsJofrs31mWh+65XJtS3\nZVYCAgWCf/DToscDzFJxXh72K7//YcaoYllvFKQ2BEdrjFtOEemV4jU6Viso\ntyMmSHecUPQkPtPrgNsfqVPaOW8pb7SvhFZf39xMEL39s8GT8RX2yRf1jdPF\npiTHqtDbO+fDHIugwgstBZCA4mEc8qES2SsUitN0sqomTWSi/9KXIMcnNBqP\n7sA2sYiN+UWm9LN+3x/SR4qMcDRfIU3i19mRnRw0iGo5EtzzWEKsC9Ca6wuw\nbD3fS1ZJi91tuQ1QVboisoTTHl+CN94p29UFbH2fYVZHIQAq3gwZWgdpHYTo\nxU5NoXHYSrSSbQlW/C+8UOGCvDc4SiVxdtB974ydX4XMymSzGH8/HFZZWAh/\ndOEnIjh61grEVVV3Z64A6Wmq8oB+aZJ5RT0MnsvEw4nWCI8LZW19BHLlJLpz\nbBCgg36GaclOgIadxTfzea3qh/eJAEyoXtq5mT7lepgd+qK/SsDyNsg/cs1w\n9iqnjJDpQsgmh7kFHZFoVxm3sUN8TJNFuNSc6XgRNlC/L5MY/ZF8Mm5zNFvF\nGpVbB35aPoQlnT2Bz+repWuLMlxssMH4NiRhbbKEvU2vWZXegpaH3EEIHok7\n1GXr\r\n=p+GO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEe9B6IssBzB/p9OuypCyFZrHPsRy1h/Jk6vD+y/VnxRAiEAw7Tm8kchvcLlG9UPmYrmmxLxVWZ8al/JRxQnMoSmvMc="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5-nightly.112295593.0_1558134419133_0.26655446544899153"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5-nightly.112335225.0":{"name":"@litexa/deploy-aws","version":"0.1.5-nightly.112335225.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"7b9c6d5302d1e9da84f72a64e3975f5e7d86e830","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.5-nightly.112335225.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-4y6RLdjPNLVSDcwq79Q+kgtg09b8/P0RYhhg/ardww++XUyWG2IK4WkAqPlbdgHqbzAme7VCCM3ZBVaNJIjmrg==","shasum":"96dab1f2f8739674569cd6c570048d3cc69f3e25","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5-nightly.112335225.0.tgz","fileCount":20,"unpackedSize":102742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4I/CCRA9TVsSAnZWagAAoasP/i1YYUGk/qcSVbuuZHgu\n7mnat4PSIRmJJhswkUtxtOzF0C5U+xOr1F70/jEbSSExxGFcfGy908sPNhCu\niiydBh6T1fOhvzUK/ERGX3rMn47Zz4ebdcyN7mRObkOOvlIKjW7+8/kNHrDE\nqJvJATprA4yoPNHetTKqLg6mKFaB2YBqS0b9Vp7IUQeJyUUaDAG2auZ6B6oQ\n6PbbZlnS1k4PCLWvJAcg91ESiJtzdnekR1XxLhPJnYcYrjjTBsBvMORY9rHX\nLvTTzt3n0VMuAK380X796O9uqVDDWM93lYIKcD3UCTMccqiIZ5y4dm9tkC+g\nWFAb0XNrBkzNu53fWSV+H29Bnr4pPnDmFU81dd0qNf8v5rJkzpW93D5iRvJX\n0gek0dnQZepJDW+J96dOw/cz47QwmNaRbwj7CTm7q9bT30IRHLOkWAJ2e9rF\nuXbSN6F2qZojtA7pD5Qhw5sQlz3DK03CAXJm2XJUGnIUUSs9l3VivZlevJ4f\nwstZM6HuNbvwZm48AncFrRBcouDnv90dzDR0eVHqU7cIWwLSou6ThJVynoN1\nJihwQnp6Br1iqVRiEQFnymhymyrAEqErvSnhDN2JmEECT/LFdH5liYALYXyd\npDHvsmxN6Q2hSFG4fmHdDvOmyxJpPNBAbd1Ty5AJsLiLG2EkN0U9kMvqaNM1\n8OtA\r\n=dQrN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCehSPFOSywdNz6eSINuBX4xHDE/5Lmoz7NuABBNV7lVAIgc3A0akEaNu7D8DLhxBdG48z/wA5xWAr/7Y/M98yoBuA="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5-nightly.112335225.0_1558220737990_0.21797238301841282"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5-nightly.112374729.0":{"name":"@litexa/deploy-aws","version":"0.1.5-nightly.112374729.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"7b9c6d5302d1e9da84f72a64e3975f5e7d86e830","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.5-nightly.112374729.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-yz3VPkyUv459dn3urooXParYR9maqtATwPZVNsoMYmHLyq8iJpw2FycYhQ/OGxETCXPZ2lrpu30+MvOJieQu+Q==","shasum":"90c04a432b837307ee259d890de7f730b5e38f0b","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5-nightly.112374729.0.tgz","fileCount":20,"unpackedSize":102742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4eFSCRA9TVsSAnZWagAAaRUQAJ/rLg4uwj7oB/xc6N+E\nWp53h9ZmuCS1md6LKFxSlFCsyufOMpmaGuj1FKw7rgS5jHzr8Z77a07X5gCn\neypn+soCPD2rD56Rdj4Wx/hai9GMawtldNvNTvmPm/EhYZ+LN58Z+Fs3neUf\nui3YqXnhnMTOpQhkq/7vNjrc7mqkUT/2LZf6R+3DUswQyY85BzZsxAzqHAPp\nOUQVHgJbAw4jg5XBISrCgrJhzk+c8Ir/cXT4Os0Gg0RBT+xdRc7Sk/y66VLF\nF77fpaTS3hgnuIorgc8NrngrLH43f/dl6INkW8Xaw3JwI/kdxi3CUlxkuHkk\noF9DpSb6EY7AoVOQCxpCFXWFOZ+ZAJWxtV0cpcCD6OnV0ZA43KgqV/PH+hbU\n/FjwcXI1VR3xeFtSWjrTBVC5bHIUiW+czIPbQLQFGYGqA/Dx+lhRalj78Hoi\nlgEI7rXjlQFQhugm9uidmVlkv8EUvgcYIrGRLsf27obMIsa3Wtdxip5k9roh\np3TBzcO7zUhaWQ1zVka1yiZbE3E45mb3AvbytPZ9phsA8jDS0Xyp0Nh261mI\nr5HK6Jv7lWcERvFHBrJhTE8xZdOCAiay/O19i9FRYGMU0i0hW4eNqoESGtx8\n8CbM5Kg5B970xRyo6I4GH8vL014PIiHmcUH3xAl/dkS9pq0bYzrIe5uZsy1Q\nLjt2\r\n=Wisu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIqP99dXu1E+VdBbJBEoHI50Y77v7CKJdo1lsUd/nBeAIgKUjIJalPvDiaFvUBlAHoBE424GeFOxztg3eTJQeFruk="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5-nightly.112374729.0_1558307153878_0.11173288260280723"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5-nightly.112519784.0":{"name":"@litexa/deploy-aws","version":"0.1.5-nightly.112519784.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"7b9c6d5302d1e9da84f72a64e3975f5e7d86e830","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.5-nightly.112519784.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-yIOkKe6sGcqowC4ayz8DIYekBkGq6dBcRKuIUYng0mqK7WlJWU0Mz5nVuvWBkoK9w80bNw5GJgmyDFKmD839yg==","shasum":"507ebcea725b6aaa1a0cbeba21b63ab15dd8012f","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5-nightly.112519784.0.tgz","fileCount":20,"unpackedSize":102742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4zMjCRA9TVsSAnZWagAAkQ8P/1PfXnfYM2CBXPkMvvu2\nEhPw0n9yVRlDUfJi935JheHd50wHVOfDkqoyZ5yfjoH5JsT8bdm3pV5dPkZv\n7QFnRZ7qjrgLYr8d+lG6q2CVPaM1zuclu3kpu3iWNLvg1bICdMObgJnlUTFz\nOPoW0frYHhGRCNCG64k7x5mkWhTOdzHNFMPszpQbwSF3tbBMO+cMPlPxCW0V\npOp5XuC7GxHvs8MAAjKCSw3bGFeLjWLWtswEbKrrCtQvT3878wzESQTvqcv8\nIBsbeR/Q5lYlau8LFZGslVjG3SG7wIjg9QHLDFNDcd50ZjxMP+8JSWOQdylk\n1O05y8LRx6Rlq4vKe+NJP4xE5HSNh7I5wOuMzi/oNMNnKzvMLeHI2foZodHu\nJ5NM7HHvXz8PDNLwz0YhVwmtJPZVqfuVgK/of6TftunJnlY0Quv8oHXP4kYn\nDy5rBbvkmMoz1iG9wm1bhaOer+2NwldCGi7bvjcYuX+TqbAvfMcPEOnMmK3J\nMD5vGPLYxE5Qzv8E4pakeJqTgNkpLI/6m5mqWULORZ+F5hQFHQABIpCI+6N/\n/zpKf9RBc0dBXzSzxCaSjuksEGr6JCEJXTi4sOdFid50e0kv02/DlKNIMu7d\nU7jfJFeYWa0JkkoYUS3PbaqjGX90iF8ELPG0k2vYeeCTYMIEzEy7jDcDx4om\n6fjp\r\n=oKCF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCFmaX0vWJPgeMf5NnHhXdL17I4z4vbvUZJbiF1BnlBwIgLxHZMzHPGQ50O6lIR+JxnOEU2a6lnkWax23Jn2XQvn8="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5-nightly.112519784.0_1558393634710_0.16476443014933206"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5-nightly.112682969.0":{"name":"@litexa/deploy-aws","version":"0.1.5-nightly.112682969.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"7b9c6d5302d1e9da84f72a64e3975f5e7d86e830","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.5-nightly.112682969.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-164OcA2gNAnVstyUSkXq6a3/yEQrl1gvh7+F6QXDJ1VKQLVTxoknyyokEjULzj0Pq7jP3Uv/AmoRcFit65cRKg==","shasum":"fd670571152a5368c2dbfce20c52c47664fe817d","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5-nightly.112682969.0.tgz","fileCount":20,"unpackedSize":102742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5ITLCRA9TVsSAnZWagAAspUP/2hCDNnXeU1pLl6cLZFC\nEwLKBysVe/j17x0iDwLcZZNvndaCSQaEtvB8iRsJamkP0SbfRDTRDivQByXZ\nJMCuUg1m1S/NhDMFBvpjfh3C5zDsNwJ9XKKhIvAZ6HoD6dZIstjNUxr6rHyq\nVBHFiPCN3TrUnBJ6IbYWXPQeHrQHecvco0i0MRaEu9hmG/yqEAILek6e4+1j\nXacoQzhW/21SlA2Q4UmTzz749x8clrnKJOv7ZLRO3IHrVHMKSOQwSTA/d6o/\n2h1X3oWYzqgkonKIfalB9nJ6Cl75l2dSoLQNjFwGyTo7eprkqyOol+jm/sv2\nssz8lRP0s6WDLHmIXnRkdr3M82AZEzDSV+NtrYgnyK+PwsAOR4FCT4W/Sdly\no7u6b8uHyxB+TRTJdyR2AINRCTXNY4YDUWhh8Utue1Zd8Ehl/s8WWIxu7jdY\naoWZMQYy+Xb4QGezzAmzRb1TPKufAIUEI6kAXebzviywzVang0b00Gfdr8Wt\nKyMHZqvAB3YDBjaAZt6CE2qxB2tBMXV83myR2SE0K6OwF4JRqAMj7B+oM9FI\nR01b2oG30YxFByBD9zOwpLa9nxtCyYEm+wUEE1ME1uWewYxn3eBdsPSGAEwV\nnYJI3T8AvNDb24VV1LJ7GmK35hmiM9fN7p8/l+GyZe2S4a0RJloJegeFnJY/\najF6\r\n=/pC4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSIArHlEvHEifJtEiPwLAK4qdXX17WQIbDQD7Elytm5AiEA/iqqREVotKUv+5ZR9pcAMTUmrvqMe4dY5TI/9OcoEWM="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5-nightly.112682969.0_1558480074891_0.939751221236323"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5":{"name":"@litexa/deploy-aws","version":"0.1.5","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"51341595db365ab7874cfff3faf5ffd314cd1075","_id":"@litexa/deploy-aws@0.1.5","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-xyBpv+z+HYS8z0EzV+oyDE6ztErrOdFbyWbIifzsu0xqd9ksMcu4G41n4mAIXCktJ0BwqYL4oTdq8zWRZVcUwg==","shasum":"93596a27d1805239b3771694993e8ef802db8a99","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.5.tgz","fileCount":20,"unpackedSize":102866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5b9UCRA9TVsSAnZWagAAUw4QAJaS24kViSv0A7wTSKFG\nr/CJRILzWEz6SZFJ/FudqBCvi8XHjh++D1PaUNEIYmrCDxGL1Bb5sKTA8StP\ncVIY6Tt3f7CRdeOOASbmgsrpKlT3F+mBGvQr+S5og2hJPXZt5HnTzF0338Sq\nwMMRsFWlGEEE1lkeiLndJlW4OrA2v+E4yNQIrtbuSLXKoisclPqPoXN89ktE\nhfQbFXe0DwC+59c6IQOGJXCNqgnnqicPW0F95V+GlMUQaAdCD7pO0wpzOMrh\nv95HcFVMdNXCHq+7ukKGRJ2/3T5El2CKuDW0zkEM2WRl13weJZ009V/Vu89a\nDDj+bbwUT+AvTSFn/gRTv2PoyA6heM58qPyr5c/vcRedhimv7LN5Z5l/N25Z\nH57rYTO6/UlAESL5AEkFyKgAO9J8BGWLnDOsQydetpFm8BPKOKpJhwyQ0Yw7\nTgpYSSMKW99QKY91PIaXOXRn10SNHUyXZ2q9acN9ZhkdYXiOaSNW7FOB1jW0\nOSaRkrp1Rn3CcccI68nKL01ZvRuONOVQQqjGdOPueI3F14kKXe/cQVWl+iN3\n4sYkJAX92Bl0fxLANOAA/3e0bp7/ztKVA+W5zoLZSVcEPwx6im/4aIXJtM4I\nV17CQ2iOu0YzZsP13/0sZ+hyuiRVx3lcLaLmXtzdUcvY/B6PIeAdPiE2iH4b\nTrht\r\n=ceOC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCucjkV7Wmr73+vj+hETbot/MIfxRB+4g0JPMHcVLZOxgIgU0ekfahXY8ARwwG3N/Tcu7KD1IADRYl6IqGshnlN0gI="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.5_1558560595715_0.25592181233137623"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6-nightly.116497869.0":{"name":"@litexa/deploy-aws","version":"0.1.6-nightly.116497869.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46bdf16d5718eb0f5dc816579359366e080fc236","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.6-nightly.116497869.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-MBs1AaxeiDDGxaMzHvM182so7hp9Gd5xqCHOW2vX4GQU4kNPhpbd+HmZMikQ0iBmlIxSgmsu9ZyttsW2J6GH2Q==","shasum":"7e8b1d0af1177711f15abeede12b55aafa56159e","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6-nightly.116497869.0.tgz","fileCount":20,"unpackedSize":102775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDWueCRA9TVsSAnZWagAApXgP/3OhG2JrD1SiEUItBiNh\nCz1OVMaSGzkvDY9Cgm5oplcAV5sqsXPqw17OtsPq1d+xzbTeTaYqBCuh8bvA\nA30P/Rqi/lJ5wpbb+uS6+CE7Yf4FkwTje1I8daLeATmYqPy9fI0bhP5vg1ay\nbV9PzS56BUiKyycpkUYLCwlFYqQCh5JR8h2IP1LSwWgJQZmxPrOGd2N3gkJY\nFbmNTbbSstow7nR5pCDPLMnpNzNsl+sbckyfw9b8qT2GOyBQ4gzHu1N+iSni\njYevvZjCE6zm2I5KND18Gfgw8t42jWJ7sVFomgq+rQMALxy7CvdO37nKZlsc\nnPvBNqx9hfTPAqbNMZcuoL/NGLWXmOQ0vS+toW+thzIcHpql0evjfxoljJYS\nDTcJIp9b8FUhyaK0XFcyAhar6OsS54RWz46H3TVeYvSfp8N80lbC/P0LqDi/\nVLL+NbYtpxYB8hM0igzO5HQUxcx4qMJT5r0I/68JTNauZvkStuZ//igY9wSI\nLyIu86iPa9pAMrgnRwdPzse3Zs1F8NDMWY5Yxuzg5yYH9DddGV01EBYiiKkd\nigBs3e9ktfFKGjUJymtOponbcUtZWL/J2+lYs265mi3YYj3zrsG/mRX4WSIa\ntKEDj9mfJEwjaaGPG4SpP8eVCqKFytG8NY9rk+OzpL5UA/s1NhC2vK2LIgaW\nuKlq\r\n=0Jzc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCJjXjVaiLRsYDDQQO1OKVXyjea4q+Wexs5v+Vll8NXgIgBtVccpSJebFUKz9wCgYDfvLwK8XxGNJZQOSZj/lP2CU="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6-nightly.116497869.0_1561160605714_0.0283256117521673"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6-nightly.116537503.0":{"name":"@litexa/deploy-aws","version":"0.1.6-nightly.116537503.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46bdf16d5718eb0f5dc816579359366e080fc236","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.6-nightly.116537503.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-DiAg9uOemJ4lcRPXVfRqIBr4rb5ydG2zEVuqFwiSo+vJzlAqIYmn6eJdeLEFMyHSD1FXRjrzWxX1ZhlNM0+9qg==","shasum":"bccdaa4bc9428cf882b4d73cf4b5a367896546fc","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6-nightly.116537503.0.tgz","fileCount":20,"unpackedSize":102775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDrgWCRA9TVsSAnZWagAAsokQAJaoHHDSAwIjPCwdgI7w\nwSFovzckfeyDEY2SxPFs+Rf1zD60y+aGuCtDRZbwa0pfIszbT+VBxvcaKw/D\n03S1/VFP3x8AUClk7kiDWvlr58aSyMGmcckPa0FNmqonLTuFEfgCeDUFRXX5\nEC3VsHbhFGCLxlezdAozDbY+xMNlJv9oMhMs7+6s1rtys0sNA4iUYIlUEr3Y\nxhAL7cn3aCGnsGofafw5PZBqgqgTUQ4HoVRNysmVNkPSDzcyGVrbOD95yebI\n7m1sWp7kUMgULRr1rp5PjxrnVb3j9+Br5+oom5UlHF5GgjF4nVsyo+T/+Wdr\nzcviX/SF7J+h9mX2oKjCcvA3ZBf2dpS3C5dv7p7LNwbhC6zytt8THpHAPzgX\nNrruuPvtSHg49Cw6ejnvRCBY96H3SzfGf7iS2uporrGchnD3ZaecA/RY+Efx\nNoz0JF/yMBcE2hCtYXi57iMhBpc1EjAClqX92KQ8dWL3fcM7FeVPnLWRORKp\nadOHQlsLCj8frvqzi44JbbK4CITQ4IcVdoItrOimIa3GrNRyw0/wewtfw4vJ\nPCVfOdsVOLtaNOxR/iLHA04wNPC1ewgjcaXOjrVsDGXFjPaht/tAlQm/RPhF\nJsYxK8aktWgJQLdNnxeF9QJz0e7gz6qkzx8x0NmGJDS53FeNDDjjGyfZDitt\nc6yx\r\n=kuLX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSp2RLXVeEvm0NIe+3DzADbH6GDc41xGTv02wdYVWigAiAWJCYKFiPi2X2kIw8G1Or/MWKGFT9DCQBuLvAkcetocw=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6-nightly.116537503.0_1561245718072_0.7745634409726236"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6-nightly.116575979.0":{"name":"@litexa/deploy-aws","version":"0.1.6-nightly.116575979.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46bdf16d5718eb0f5dc816579359366e080fc236","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.6-nightly.116575979.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-d9SjtJ1VCLZqIEEHueVBgagZZDxTDd6nlRyq018GSMWmSONSFdWZHCXWtjFYGzq79lT3GwvEGfEvvzbFjg7UfA==","shasum":"a135b1db8f54e597f9f47f1a66db71c5a5cc33b4","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6-nightly.116575979.0.tgz","fileCount":20,"unpackedSize":102775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEAoECRA9TVsSAnZWagAAN4cP/2CUNUi9xwWhSc79kqxE\nvSYAF3s9HPTIhvVyqW8bP0IflSjnu0r/VfwH0AtwPRDmI6eMK/U7sGxOMGfO\nW06hpUvRltHf3G84b/xFqIVuUnlEYCtVe33cDI6CCQfnmF/rw1ZYU0/pSZA0\nsljs0an+PfUeJlQsZdyZz/gdYTxwSMFCzpa2dpU49Nq+FiwNW/FR8ODNwMwo\nXAS8R8dMbezxK2SBQKDRyXOXBbUa+1GBhIpwSCPlU8aRio3qnCDTsO3DaYff\nT3ux1gdIe4yKY5uoF2v/XDh0o60UyrEOSVTXHreLbrIfzJQjxlFID3fleKnL\nr5rSA4gVQv4irF/Yo6IcdUSmhTPRwtEmndGEuyyUK7PjEjW/I8S5XGo4EBLO\nP2RWLkQJPNNcSssX+wXlzzBA70KwfgGss4fb2fNMQWOsTPabN3XMlUiU+FmI\n6dzntgZW9pqAxqkuoszs9GVNGqDhk7gAzDEuO4GwLaGiFoFhx8Q4N0bbyyrt\n4XvmikcRhNWPGNL3C2axRsnuj7Ooe/nbH/iNzK7wzKLg97nwy7pXkNzzIi6P\nCWV9U1mQajR0oS+Hy7pmZEFa+rKewu2YM4mhheXveAcV0RohHp7B4s0/qBMw\nwj3TOJZTAmxvGFy8Zx1MtjSqKPmzjn4X4jy3werQBk0sr4FsD4/NVjUKuktb\nIJiO\r\n=fA/k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH1AHylB4H1EMlCzmYdq0Cl9nEqiyKLaU1AnJYU0T9YfAiAPConuO52aod0UXpRu8Y/mVo8UeGq9kAUN4ShVMM9lTA=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6-nightly.116575979.0_1561332226942_0.27974900098292266"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6-nightly.116725281.0":{"name":"@litexa/deploy-aws","version":"0.1.6-nightly.116725281.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46bdf16d5718eb0f5dc816579359366e080fc236","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.6-nightly.116725281.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-V/n2ZHeDgFtVUDBpBO4Os4vlvfRaFdDEcb2n2KX1eOP+8zPXAEvzPpiubdMDwg6H1l0J6PxLEVTex87S53gmOg==","shasum":"cd486a4f1dbe4d9e62603f98994ecddfe552ce76","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6-nightly.116725281.0.tgz","fileCount":20,"unpackedSize":102775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEVvJCRA9TVsSAnZWagAAACEQAJFy0cHFS8Aw3ClqDvQc\n1xTBgiWW9E7jWgyMPDskWCbrrdiTDjU8FUMx3+SzlhMREZk7NDXFH4V+qPJT\n4HdE9zKXVOiUxbqj3nDVHl8d+6eoDDvLe6dnKJxvxk/xmevBV2WsflbZWJ9Q\nRo/jQgVzRfHnrzJfvBIuO1Tp3VHc7BJa5hgperloV5pMFXdKXC/ImVvXh9oN\nNSCy4bC0MZrsmmWk03riZUbDb+ES8VsbVwilP5JkjBuoEKfcRTNvUwUVQ2K4\ny6Vxhz/y0TcbgYEYZlHHgqDX/pGXpaU5YJr2v9bmyE1soQsKm5M4MV9RnI2L\nIMafbf4LfwJgTia0an/LGJPrwz0iGqwu91Iom7h2MafcHaUANxO70/1FWE61\ndQzjPo7bgAlcxpzmMEF24GQHXgjx/kL99b44LH1NEwqkDDGYtIht17B+DoRI\n4vKnQCkGc2RftO9JqdRshSXvYwqlqaUSKJLu0ZdQvCRlCIJ7C8JKRmVCCrgZ\nJrNq2bJgqQ8uNVznXv4i8aKAXDHpYFRC5VUkDgEfWatZyiCfTlYCEhzhlZC1\npH7D7pqTWdW6GGLfIbQbCWXSn6Ezpy6a5lciFmdzGLbxYhRwXVfLlVdVkQHe\nZ7NVU7NcPw5X9t7eBrt0xJOoULwsHtWvNPQBP//HDnZV1GRMhXSZoXuZekLM\nJUTp\r\n=Stqz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCebcNZj74cVaK39o5OrB2GwApzNeVLMUNJwaDZKd42XAIgOREpJJkQKSkfse5q1MVB+/enLv9FgEOXsqMV0hXIuCw="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6-nightly.116725281.0_1561418696909_0.38969607628984737"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6-nightly.116894862.0":{"name":"@litexa/deploy-aws","version":"0.1.6-nightly.116894862.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46bdf16d5718eb0f5dc816579359366e080fc236","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.6-nightly.116894862.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-8YbpWHh8VGxHZnq1u8Cbv3L2WkuMXVqM7PWCJqz34xwr0QTl4Rnx4fVtWa3cQr7OSi6jXSqBEddQqKiMGqQEbw==","shasum":"5fa6d7c90eb472b239c339d5818ad4cf8710aca5","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6-nightly.116894862.0.tgz","fileCount":20,"unpackedSize":102775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEq1TCRA9TVsSAnZWagAAW+4QAJOuFNnMSuOK0yJ7jiCo\nDknQ7Y10vGR2Lp/bRcZdmRd2TM6QSuuPubI2ST2VzIcsWapgZP1yiIHYUL4U\nK94L8Y4d5uamCu5lRw+zwr4Mk5Ie4yWP1ZWvjLa/QjGcOO55TO6I9d8k+c6x\nSboq6CgoRejyBrBUr3WMWywHniQBtWjLpnanmD2IS2QtzHE3oNQVG9riOrQF\n4FunuvM8+SV9pzputnxVoUL5bJKdQ4+CURZv+0vbtR5S+eG1vcDtIKmeKYb9\n770/1AB6VF0QCr7Jd+2etze6PB/Qm0M4802j6k8snZH51TmBSgz4Dv5EdnJ7\nclAtzrPjT0jGyOnPW1a7i6jlpoeOGNKJdhIftbtC3mywikJ4bxZI8HMRgTS+\nW+rpBE0LUqcVLPjNtUg6k4FCtxBKPBJJTvD3YdbiQO24pVzU1wmL/5nhrTpI\nT8JMI1QgpRWMj7ZxWEqkAzHJWwQIIlDQ9XYsAgs11pM0KdX5ZIljG2dUlrdm\nsBQsnNahBwE5VxESupRCe9JyCfzxUjS9hX/eCYWWMwS+YCPucYsqViYbAbJ9\nLeSNAF/Kudxf4y1u/vX/y9wWzEUcQbZbJkxQmU9+72CjgQQbnwPhRUBKmT8C\nrPPwL2Q/449A97Frqdh9UuDWO+4P+zRm/01Ft1mR9J9J/ceFRdLcMtkZgr4K\nbYCb\r\n=5BD2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+Is5rK+0RRhPQtEXZCAVcRT6FPJ8uTtprRwxZFq9gIQIgYnMtdpVehCg8GLT/CHkOIr4ZXuJ3QXuslh4qwLKkhNI="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6-nightly.116894862.0_1561505105846_0.12349242893191814"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6-nightly.117061114.0":{"name":"@litexa/deploy-aws","version":"0.1.6-nightly.117061114.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46bdf16d5718eb0f5dc816579359366e080fc236","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.6-nightly.117061114.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-XMROXqXdmFlS3XjUMmRFC9uGwTHO9Qs2kEXb8Q76OFLHR4TOI5+uISPR+OJPMj1j5RbhFUNZNwdOiHBdcceIww==","shasum":"4f9d748b0c2028ae675b17d6d4e61597785d2efa","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6-nightly.117061114.0.tgz","fileCount":20,"unpackedSize":102775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE/66CRA9TVsSAnZWagAAvn8P/29f6Ilm7UicwUzOSKNX\nnyyIvYV9ADh/mvAgfds4CK5Pn/M4ANl8Lk91/A2oMCB1/RZGlstFgxtl68Q1\nUV0XkjXTwOZRu8XwMSF0PygWooEiu4YtvEkfoLPZq+Ju1ef/KTo7TgzBFIrl\n1JrZRjEvXCG9+URh3SWhR2woBkUIs3c1yMiZC1v+pZYWysdoLl25u9VEVuRL\nBQf6EMCLNW3NDdMBUk6FiZTldJ71TdSlCigUT+95+hMTRje+bnmo3brjTDu1\nEmOdLP1OinaxcO6Slt9XtNvS1eWBO6Hm3lsvnm4obgkUwF5eK6EUlhMWrOG/\n4ydqS8D2Y4eaJmr43T7fPEAteGV6P0NQiZL8DzlfrUlBrCC77kHm4ZYOrrNO\nNIMCm0MlwBsTDDKVvaUD2lQzIrDrQSrL+t2TQSoo9tuME+7kMm9ORGUDOvK7\nAIvBi5JsJsLulw0hDYZMqiRuYwpEm1OOTMQduN2guaiWD4gHnDDwsK8A34ml\nV0nUZLr71D39nCfstWk4fghgJe09tEBOFa+rsm88KEQ+VyGkh9SrZXxG4Vy+\nj+h0aLLv1OM9WnllYIWjJNbmhAG/nRA3eX1j/Z9spG1QAeXVWkmFXQLx+tVf\nWXlWk7nnq3tKUEtdRwI3b75XqyLWOVWT+WGhZN8CYC3me6j5qRgDrHdWqcMO\nKZRV\r\n=kP9c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtfTN6sEHbZLxaxYkdBGLuoYqGUR3Y2ubJ9gXz/WXCGAiEA8evwV9vF5qOkeDnz7Ym9LDTzyblK98HHXIDV8ytWaT4="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6-nightly.117061114.0_1561591481387_0.2132098345297122"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6":{"name":"@litexa/deploy-aws","version":"0.1.6","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"1c3a75c51ff0ca99e5aec086ff6f9c26fa225874","_id":"@litexa/deploy-aws@0.1.6","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.13.1/node@v10.16.0+x64 (linux)","dist":{"integrity":"sha512-uc/s/ePqvHzwY3fZtEhz7tA+t6ku+TOovDUoOct6VOqjiUu7gMmyHHAdf5iuVXXK1nTTb+vGwP8rTtVfotyFxw==","shasum":"3eef9014ce7e8839b7b14002b3d6691e1bfb2ce1","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.6.tgz","fileCount":20,"unpackedSize":102990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHUMcCRA9TVsSAnZWagAAg3IP/0Uf1xHDklzb7u/sg2MZ\njlPtl+jQW9ytlNwqURXlp38u+ik5m3kotDrInK6o4E1veVrLPXR7KJyJpmZM\n88QJ43BZkUimQ2eNtaQC0yQNrG5P7azDO5xVML+hSfUCbKgfc4mYp/PU5dTF\nRJo8szKVdjTPH0MIFCAVamTBkWi8GNZOp66BjyQkU6wBJEAeEsb9In6p9gkV\nLs5XFGZUB8Y0wHm6dZendJYDFvlclN42RSsptySuahdEuqHVQXhskntTBd3Q\nhlqhhP0oJrVNAW2STSxmllfv0CJ6f4gfgsVU1xgjVV3IpCRegKSAEX2yae8n\nf28IyZwSzmRuQwnT/3ObAHCOBegTodUycf6eR6wzqSs2gqW5X0rO/CHJnfDf\nNDgQfN4Jz10yUhzr4ro6NldEOuqhAc0Tl8l2YDVW773IPNI+7X6HPU2mJwYJ\n2o2N2SmjNne0ohDnTgN2VSW38qNi3XWlfeF8fFuZUSz8WZ9jrzXi3DmSBnpz\nrE48lEfWT6oQHH8ePcWABoEozJhMLgUuRHVtip+iq1E5y5Xk7mrdVk5OIV6f\nVPG58k282D0p3UWVTkw+hTYROgzc2lqMu77V4+OR+CrRt8+H16IaGo/0paGD\nUmof+dO3zhUdQj6pNfNvCfMy/rc+dyqO6gyuXaDGxR0j6uYe2AzjLNDEB5PX\nPuWm\r\n=3voY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+B9Yq0G+Gex35UdH85UUciPy/UQVAMDYOQqlE65g4kgIgeDK1YCLVmoxPtBqVlvhYjNiJvvKCC3Unkaa2PppLupo="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.6_1562198811520_0.27325040785964005"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.7-nightly.122204651.5":{"name":"@litexa/deploy-aws","version":"0.1.7-nightly.122204651.5","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46c0a97929dae67572cf314952af7718cd4574cc","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.7-nightly.122204651.5","_nodeVersion":"10.16.2","_npmVersion":"lerna/3.13.1/node@v10.16.2+x64 (linux)","dist":{"integrity":"sha512-N//5+fmqqjwpxdb69v9jb55tog9doyg9cawndmrmfv/FnbGi6IKnJe0JO94q+SuELeIYMhYVyUNtE4my9JzW7Q==","shasum":"890df2078082ecf94fdc9999cd689dd71f4cfaab","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.7-nightly.122204651.5.tgz","fileCount":21,"unpackedSize":109105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSi9hCRA9TVsSAnZWagAAZIMQAIpOEVfbjZLCf7mjzFqv\nKQF/MfrC1Zf6XfYx/jb9hha6h7A1m3W51VAEj4cxF2lGXkBo6VgUSHDDEwaJ\nCFxk8wieEOBWv7CfxYOfMDhUucINmLyEXY4Xu9TJm4JdBSz7EmSRrw3ibUo1\nW6mRokaKPBCw/TQPotbLTh0x/S4EI8bdW3PgmADllMEesAHCLjPdFrho9N1m\n9joGO43ZC2QxBQ80TTlLupc6PECzGieLHw9oeOzZ7ooaef8oHfOcf3QsTjd/\nEbcC8/fPKVQhXmjBZnB/TP6LkxkO3ddgxRpsfPTB59LM3yVdkZVK1rpcxhPz\nN7McjclLoDYuWiBvGwMeYoInUR8KtRRLr274igv/KkghJhHzFst5T058g8ZU\nrrzhZ/pfL281wYPMOsn5przJbn9MyJ67Jh1/EhfgRn1EzD65uwjr4zWio/53\nCIwIf9WjymwrhVZOvSy7eiiPRnUkuM9ujFEF6ZAcDDAVSKphqG6qH6mGYktZ\naRbh/Y2uiJFTNIiTSnONrNZtmJLpPDdZburZFt+gCzLRa9rJeCVNtxKhjbzK\nBfXC359mvzlBUMUWlcszI7zQYoSnFl2RQmLVk0aYI4a/detBrThlDcDJEcww\nUzQeVUO0pqL7NHlhOppRfjp0kjv+EMmExEupdP8+gRH2bA9agwjWD0DAqi7e\nlMRI\r\n=IxlB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQdPgfqtrTGBtrg6N0sY9QvzZf18HWXkXj2B/TcIW/5AiEAt9WOi5a0DPTz1hgPfM6pC9aLrorBtVEdZKJD5s7XX1o="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.7-nightly.122204651.5_1565142880077_0.24333991044770498"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.7-nightly.122204663.5":{"name":"@litexa/deploy-aws","version":"0.1.7-nightly.122204663.5","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46c0a97929dae67572cf314952af7718cd4574cc","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.7-nightly.122204663.5","_nodeVersion":"10.16.2","_npmVersion":"lerna/3.13.1/node@v10.16.2+x64 (linux)","dist":{"integrity":"sha512-UpchEhAefQMVXtvNuS4/3myo5+PKXObGQpeZsIy2AUxu8UVMP8Yz60eUJyp1vHmF+bWEjx+2sdiveDL8B6IBRw==","shasum":"13f65fa4f2b4f9b404be6f228f0a58502e9fccc1","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.7-nightly.122204663.5.tgz","fileCount":21,"unpackedSize":109105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSjQCCRA9TVsSAnZWagAA4KoQAJuLrS3N8DtPWGcJDcck\n1sF/vXnfdaqNfYTeh1iYv1slNPOYYdiVGXqdnfiy7K55lZWdKboGXZKsiiiz\nSN/ei1IuWzKYuJHnLB4iCmUwfZ6VwwvBNAUL3nePor8XhWUDbgMcYQzzeakg\nPez+O1OBL9oTmVSGA0m1b5XVc/JcOxr477PlPdP/x90f3EcBf605rIMyLvkw\n8nKsOICPONt4rr7dCPXSVFLEwMOwhCIJ3UE5Z1uA5aMGGhSCWSv5Lt1g7iki\n2DIDL1yYvV383EfvbUy++1kQU6Zg7mT9ShaBQl+WIZgw1IjTs+4El0NxHoGT\n1RbFVwI/uXbcp4Ie9PB70UZUNYOrzZsVNSEacpb+JkuVOg5X/67A3vZFICS5\nzXMu+81dMRxbeURUO8Kfw09Ov45MPWfnBQ7YLNSNlHXH3mySAHqgG9vn3p+j\n4zh9rtXsUGFF4tJ1y+cbKD5VVlPxfulRhP1h+dgdBV31eQlXMyui9IUgcwg1\nBnqtIIFH59+2+89YH+EccDDKi2QtX47LUIdB8v9DxRaON/o/CSbnb9IyHU0l\nhs2+f1xxy0solxljq/SgUSspEZcI/8Yul5QUf6v+V8r1LWgvlVqEttmigwOh\ngAOzmZQzkn8NybLvocnFnSMnrbuUGlaBW4ovZIpQH8dNI3D0MW5A9vGnO+Jm\nimSz\r\n=sK75\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMItxVaPCogMSlHgl9D14UaT5XKrMhIWAGekrZ0RKfiwIgeMczO034zCRgyQooLhZhtIgePCSoOD8GFZb0lMZ1v+c="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.7-nightly.122204663.5_1565144065482_0.7281230679734736"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.7-nightly.122327531.5":{"name":"@litexa/deploy-aws","version":"0.1.7-nightly.122327531.5","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"46c0a97929dae67572cf314952af7718cd4574cc","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `S3BucketName`. There are also some optional `LambdaConfiguration` parameters\nyou can put into your configuration for further project customization.\n\n### S3BucketName\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `S3BucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"S3BucketName\": \"suncoast-assets\",\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `S3BucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.1.7-nightly.122327531.5","_nodeVersion":"10.16.2","_npmVersion":"lerna/3.13.1/node@v10.16.2+x64 (linux)","dist":{"integrity":"sha512-wfDzxq83UaF35OQgsQ5avu7/PCRrdkqH+J9NNr4O6g9smNs1lBAx5OpaDu+DfVsFqTSsCEPYXDhWP0EZwgNg9A==","shasum":"bb06dd0d35133e844b88fcecb6dd37251a11d049","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.1.7-nightly.122327531.5.tgz","fileCount":21,"unpackedSize":109105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSx9CCRA9TVsSAnZWagAAiFoQAIcWGD7TLiKZmLjm5MBQ\nOdZAG4fTauUvwdl2x+kGhtZX5T8uxX69+qF2SK52SFaDVbX/quHzo5kd7QkP\nGJCUAVBVbmVIfTUVOuNsCXaEmpjKD5yjkGTzdTjLKyddeiFctvAN2aJVbYSr\n7XfDkFOiEOrqGoDre2BCRvQuo+1toEFqtabD8b0WvxM2L5TMTqhHwW1Vlib3\nqg3FsHXM6LQFtHZoOASl8368GRQ5KRX6F120bDBcpKnd6c+dxWRaGA7fDDT6\nqlbAI79qd877RtyqJuwXeqe7GdSL5wXSXU9qqBenvk+dZ7z6Oq4VDxqpjgDN\nhu6qRKcqVD6Eas7RlFt5XoKQvN/AtFqr2l//y8zvNmKH4163Swn5VoVzjSS1\ntIovVrdit+W/CVRomfZsIGoykTEOIQrMs0K3pxh5RO5ZiMu3om39f5iVJxnc\nEzVaqgnNKVlxpiVC/BXdMUQ1F4GG1YlwA4AHBHg2M5mrC16jmj9s/GqB+Hra\n3YYZlDwuXjmWwvavPLyj4/++vzUE08xw1mL8rn1yQyQ39iIzjW2kzmRFzZew\nLEFE1ddy8L+TyC+a65FIUXVAR+csVLBwhHqIaAhSBXoObeCxB5pnmw8O6dI0\nksoI1DjKQJm0PiAOeC3mdPURNPtsvn9gUbtWpCI1nLRJJeJEAGzB+IBIWmcI\nhXr/\r\n=lE0L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpFSuh+BNFyCe4QG4WICRS9t23F3DKFku7cG1yIMPZRgIhAJCyScJqJtwJMPiUR0wJWy+ckSUO5dH3KWdmqb5sHmrH"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.1.7-nightly.122327531.5_1565204289616_0.8074899592408382"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"@litexa/deploy-aws","version":"0.2.0","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"3adf414d624551190f210b80f940c9c0fcbb89bc","_id":"@litexa/deploy-aws@0.2.0","_nodeVersion":"10.16.3","_npmVersion":"lerna/3.13.1/node@v10.16.3+x64 (linux)","dist":{"integrity":"sha512-88jc790siflBtyR7zFq4SxRMscFZxcFa0xQ/dQZKle1leSxkKYa2tbTq8F0T6djAWHfpV6E8FywEGBV8I8ED5w==","shasum":"0ecae1e4b54b112ffaf2cdfa91dad0332e0a105d","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.2.0.tgz","fileCount":21,"unpackedSize":109614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgtaDCRA9TVsSAnZWagAAJZEQAJ0aNoDsaDlAkKe4EbTT\n0R97zz7TyaLMrxQkYTSzH0pTSsAAbpWXgPlW+cypSEZu17QzN7OJEcdVrCzR\njKiHNCiB/408XOfa0V+Ekfj4kiA7ZUS9GdOrllAyL3og9YozbNWGKNUuWRWY\njsR27nUn1mhV37w7XkYWe3LS1q2Xwbv2MYpSecMhD/1Tr8XxVBlDyCO1btz+\nVbSVgR2SwZfZptlQiSCZNUsJZRsuvFDMDtcm1Zo7a4cEsqVeq2QplxUW2mTb\nWAqnoglrn4ayjXFrPeu1I8C/cbEJxfVFZTf7Y979pJq3u9oemYAMiIlbISok\nfv/J9JWgQ0CX4iFTtc2PQeQWFNC/xmJNYY/QWUI9rdSMF3UtXj3fBC3Pe0o5\nfpXX9XR8NRtdnXdOW6p9c3ejrtmgSykrDy/kBgtYg3doO2x007V/mbw4d/Az\nVf5HeR0VVq1LAx6d4E4DKXN6Twq00EeH2MmHh0+21EU5F+G2ix2MjVpq4rDo\nphlr+oq+OPrK248Q1+IcABc1PAe9ygzIDk16fdzWYefLQXoiwPHlOAaXhLxS\nowQlUxQzPV4v1ieyncDmIHXKQZV3fc6fmTqtyZJGZLgfN0Wws63vmZ2p6caQ\nBqwrikdQgmKpSk1muu/19lb6stxDQjwmhylTRH8toBvERptA3c6CW7UDW8s5\nxG9K\r\n=klGo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoUxlrNfHB3MK6ESvEoetIAC3YS+c26TbhrTwX0XqFiAIhAPWmpBsI5PnrP14bjW4SNHizGjChOfenDGAxJcNx7RKr"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.2.0_1568855682333_0.9878298626207866"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.1":{"name":"@litexa/deploy-aws","version":"0.2.1","description":"Implements deployment for litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon.com"},"license":"SEE LICENSE IN LICENSE.TXT","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.games.alexa.a2z.com","gitHead":"a2a6da10b990957d2bc7137906d951c1ca3d962a","_id":"@litexa/deploy-aws@0.2.1","_nodeVersion":"10.16.3","_npmVersion":"lerna/3.13.1/node@v10.16.3+x64 (linux)","dist":{"integrity":"sha512-PSOV458RZEGyVIkw8HscEugTBZUUFFA4s6CrFhzt5AKJyAoa31U0XHlfJTbOD883PueQVeB6EZ8cbQVe2k89RQ==","shasum":"2e3dd8686fa0f21e1cec7bf2b1ba17b2446ff0c1","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.2.1.tgz","fileCount":21,"unpackedSize":109762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnVzNCRA9TVsSAnZWagAAqV4QAJOTY+UTsnlfhs49NZW3\n4jd8GzTeZ9T+lxeVSV9tRuc11lkUcmN6MUUrqxCvSEFaPz3mT2RsSXxf0Mvn\nIHhpIe3an0tdars9FrP81DS4JRNJevW77IzIfF4MvS2T0rs9NWJjjHwDe/Nl\nue0oO5Y7J3V5s8Sq6rkkKRcm91W8sWa4Rc61unoU7uho+4aJR4jqLjaZQIGu\nSJU4kDRIO7Iu/5Q4FdJ+Kd2bRgmkp6pH4joh6Ko72v9nmJIwssgs3wTVuAqb\nRdR6+OvIj+dg+3Dm1Is6m3x8EYRnVc20Bl0C86H4LC38huv6SNcSKmBZHeRE\nuGqQ4g12ogzVigNA+s9KYRI2SQXev87gZEcGEuFbF0B/yyQXeiDGIa/DfO2X\nisQEx5WSvozGiusW2gtmWZsL06Y2MiE25j3d4ieKwe0MMKZZDc76ihdHpAYr\nQnLTL2p5jsXyMsO3vVtrr3PzKs2qZ8nAgYpvJRJIy/WghfOB1R+770j6t4FJ\nBnmeGvcje+VKLeRminKriO1qctUX6fXmsVDndTcBuLeRhDMrwReRrhSpKRJI\nhsAeoNkhhzXx6ZZMuR4pDVLzRtU8EKIQzYifMBSxxiK8jOCrIn2YxXRzjQrG\nfUvAyNgk0WS+4NN5hbQzENL32yubNZjLK/St8afCnBMpExyh8flvAVDFElg3\nvMuf\r\n=NyrA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDt5rbWssjszG3ek93Bxb1a5ZEc61nGKO4FgjwPLdlbugIhAJbjJoXJg8tZmgTskX7zMYcqeYRyb0xtumvZgmaxlgnY"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.2.1_1570593996490_0.3316016892205478"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.0":{"name":"@litexa/deploy-aws","version":"0.3.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"8292531c50c47a90cb264603155b867d07759311","_id":"@litexa/deploy-aws@0.3.0","_nodeVersion":"10.16.3","_npmVersion":"lerna/3.13.1/node@v10.16.3+x64 (linux)","dist":{"integrity":"sha512-XNd3+lR6P5vEU+ZnMph87BmEUqyoZPyRKfY1rIWx1oKjzdcs24PceE9lr8fOHsp2VOSobqF5ERKnGLorQQsWKg==","shasum":"c5bf8f4cf3edac9537ac8b9d5ac38009876435d2","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.0.tgz","fileCount":21,"unpackedSize":114412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoRyQCRA9TVsSAnZWagAAIRAQAJcgmYkhmDRDSqKYsEPD\nhty4NZ45ksBVVyyYkIwY8fc7sgpk8tcpzWC61e+jXlfd7WCX9nBzKO/nNoiN\nn7Sj4357v3p1zIpQ3rLjvG/lQmliDJId2EJ2QhdWmLJ5a4yXUgRz8sHrU40m\n6v1iurV8YIbwJIJj7KQ0dZl8SkCdzTgmgFx/gDJo6tvTh0Fmr1nNDjXzjLWY\nv8TeCd0P0CGqfTKlWqlgC6Sww2DBc14sovIhd7OFj/89OZF3YqYL0WNYT4ND\nqRlyD6R12+YrqgVP8E6TTf00SnQp8Q1OrHnHOatss+N3IP4EGQjgF+Po18WJ\nzHUR4sJRmxpBfpXjWImYslMkXZvIzPJzZDkfTOrZged0C5/8tG4c0bm1zsjn\nlfw1YPeX8O9G58eSOs5ilRRwnTFDqsMETBKteXoIiX2muMK2SR1K6Kkj/Wcx\nfecn3tqu6/b/H2JxIOicR+pydN1R3ZywoCy10nkcw0R6u46SpDXwvOZStekA\nPr7rQGqIgggETwhFPQDV3TLFzq3sZMct6iOyu/FUy3YFwx9fV2Pb+/big6xg\n+IO8aZyhrDlQsIGCYl9D2ROR79kWaUidvUOaBMPj4Ipn0H4wu672G9zAOomp\nYUEjWUMfN0xKl0pnqhPcDBLK40fb5zJRdpr+9TMIK29shjrOjEJxPwmz7AJh\n2rR7\r\n=0Lp8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+DpEClUyTb5OYCk/uOvx4PpYhyVdG7IwfPf7HUe/N1wIhAMWwxad18pkOFhKsd3tfhbc9eYY9fgQzBgnDhN4/fa38"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.0_1570839695981_0.0893304967091264"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.1":{"name":"@litexa/deploy-aws","version":"0.3.1","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"0a9b12eed2e37a861122c71cb3f3ac26ea9fe4bd","_id":"@litexa/deploy-aws@0.3.1","_nodeVersion":"10.16.3","_npmVersion":"lerna/3.13.1/node@v10.16.3+x64 (linux)","dist":{"integrity":"sha512-Nf7nhmwKPGmqt/kasP4HUSUz5rvjuQy9LSLSNY0Z5TWQt6LWZX/jHn4kk9Gib8AZKbfJBEeSAaS5wwTGpjaVEg==","shasum":"ae845d20ab8c2fc9029596aab8fe113cfd48e4a4","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.1.tgz","fileCount":21,"unpackedSize":114731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpP1MCRA9TVsSAnZWagAAatwP/35Ljrq8e+cPA0zZ3Cf8\nz1PUwMGBGRMcP9i8l43FeWt20US3bbyaav6pgOykrZiTiPmqSkHgfRmp2IlK\nc2wpVfY6NVyTU2IMMhjKvIZD7lpF89trZTyVv6WOOz2tnVyYSta1WH+6DE5Q\nEeFSTmndrQTJkdH8iTo+FNh/9Dwa4p+J6ZrhKMkSt59ztj/qA7aDsu8AJJjI\noFAK7lfreSRarkQpoR1m+SgdTPMxCW7fuSjtyjn+RFoCobkJ/dDeXkPDi8N6\n6serSIFPZM+lQ6zFAWqTZ/eS5ziHaFO9GtR00Yih3jmvjEMIolvHTMoUj7cr\nN51zz4tFIUuQaThtmEh4aBg2DOeV7ZZi7U9x+/Ro9XO41wxzgoZ5tTw0MdlL\nQIOFNnUl5+EroowVJgiRx4zV1ojDmtWaeAn4ukUJspI63nLLPvXD4BNt1e4n\nzfCCeP84wGvyGxykvs1wHk3/IV2YT2quTy5mtvRUZyP3PUUXGam/0gDdBe/m\naxwcABTGW7skAVD8rNjDa+xtaoKQB4q/d8N7PJD/zLNj6bfWKoH4Yy479iQJ\nPHfafFbY6qj2tPTPwgFgOmmaQIT1kBh5gUCBrLhAJKdoZlze7vtzXt5Ilhhr\nuKr+xmqmqsVYlx5e26NN5/aIixkSs7TAxb16FQgEHEQCk7B1sTqdBCc03JLH\nla1P\r\n=zYzU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCITu43/P1zq/cgEuEFFRFZgxSFkYo32LHAnfk+noZnTgIhAPn2+Z0w44mPAyiFcxsxV5vcwywmsXzz1uEF4JRqcXCD"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.1_1571093835911_0.3043514920920287"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.143043099.9":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.143043099.9","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"8a1546df3dcd6e29094b8308c964d32e52b1a96a","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.143043099.9","_nodeVersion":"10.18.0","_npmVersion":"lerna/3.13.1/node@v10.18.0+x64 (linux)","dist":{"integrity":"sha512-6hoaAAxneVz6712+wEU+3d+tEoxWgpXWXSNiSKQKkjuQ4n+i9HrPk2Ci7S+364i6/t1fd8Q5ht2k1u22blgKhw==","shasum":"132a9afd71e805c75c456f7ec6adf949fdd8ce55","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.143043099.9.tgz","fileCount":23,"unpackedSize":135082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD6ECCRA9TVsSAnZWagAA4GwP/3TsKyCZ7pTHS14/2xop\n+GrhClehy15R6+Tn0b4k+P9WVWRyeh+9vodFC/4sTBC1FaxShbo8R06gmfE1\nmkZgPE3BXaJmj9uD8MsiCkG8400Yw9MCe/M4VECTZdsUX9t5+L+pb5QGrr+b\nOkvS6FTho9rQO9iYnH+gQAlAzS8/cpbloF8MupnNFXCs+t4fjcX44X4WC1Bq\nT+5JE5az8hdsIc3S8Npje2TSYtIJdmhFsItzBjkxOWN7X8Y/ObVoo8XBJlqG\nVsHPgIvD7b+RcjgRiPowZPvg6GDHam072YqXNxfQIHosHS4WgPvMM2zOT5GG\nNRzOpEBhP+P40Fqf41Bh2MYLH7eh3/H6ZVJ1nasRL4fI5PfNQHO72qMM04QQ\n4hZJjk76nU+bCmECUKLsQ1tlUdaBTbD23JTWbm/tFvrBpZk+Xj7ppabWu8tK\ntdTaTyiKXyJKISo5qbbznaIfZqxgYuj4BzM9pZ4/bctQ2Vxn9JJVtn7BClbW\nkfXp1dqLDGrnQCDiLlOYEqi40oR4uy3ER/oOfp5H0xdUbztJ3SFXJ4HT6Y8H\njSCMmTdW0oa2QI1oidBi9YFPXx+RtpZEXZvRzQd+jnVkVZvLPTjgYdVgtwlb\nUHdxbw6QVJO6qKd4CAcRdkStb6Gr2RqMQ8Z96tYQrzxs5e3+qQb3wA/lVFzL\nSYQf\r\n=CIR7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaE0WaOu1D8jbp215avHSHD3ay0mSD6T0fuEsDSIhWsAiBYmk6oWcyYXgBymCbj7BnmGVxl+l8Oe1B1qpl3b9FbUQ=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.143043099.9_1578082561363_0.71934973101679"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.143113172.9":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.143113172.9","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"8a1546df3dcd6e29094b8308c964d32e52b1a96a","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.143113172.9","_nodeVersion":"10.18.0","_npmVersion":"lerna/3.13.1/node@v10.18.0+x64 (linux)","dist":{"integrity":"sha512-+nPw3kHTkSsZSuPHh7SGcQD+hfqFEy1QwH3D08+Z70PIhGLubnWCoEieTJuBroGK0DFXSu2jEEfmnPiKd7wSiw==","shasum":"14c964a7887f3c9c677e9abff230e9a0203df117","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.143113172.9.tgz","fileCount":23,"unpackedSize":135082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeEPK8CRA9TVsSAnZWagAAA5kP/Akt9bSqAdiHtnzTBdrw\nYR2J/UlDaY6c/MwHRJltaRqEGCiwUTY5q++MvFEoZD7NzylRyXR8Pdx19Svz\nhXgRHhptw8xNb9fK5NY03q47Hxo11OaBrWSXT2ON8PAr+yxGuK1kD+TMvs1k\nxFaYhHJH7P8SY9SF3Y73v/3fxmP4Xk9gjOs8MFtoJ9KDY4Au54Dx4JhevjQw\noyGxR7wYMJpBgjHG2To9DRPY7oeYqkmtg3r712qfDHAgkh5Gth1Pw72twzmB\nON9yrC+D/daPYJXNmG0oZtWCFXbH0N9LoSkK5BSWidSNb/R4rJJQ2ExOklhk\nvKPchONvIftEBdGzyE7AybyF1IFMrsvWr1E6gKNTNEl39Ro/G2fnb1oN7VYS\n3SCBiZEFDuEFIEtluWVVZEuGLAgGdwoXkOCLTRiCuC8Hda3NK7ybNkFcv2Gu\nUbve/WUAqD1TjaRjAqDySTTNFaVDkAEjLsS+taPeiL5PKEZdJ9yLAElELkQY\nZmAD+l3H2hAgPwvJftVFOa4YtZo8UxGX21uR20q6zofA0tQPZWfNbE0hMQsr\ntEvOl/vLZiaLJikNGCei7w8AbyqgdtrO8q/chmuM2mIDq5Pa9DkU6HpYpYfc\nEYLiP85aRbSMaSsSLsBGRnaC69RxsG84T3fQOgIn5HSx0wlyTTWRjjZMsiDm\n2z/X\r\n=deCw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoE69cEhbGXynb1Ve6qPKVqy09mP/ZVo1575CL+7BhuAiBarbh0cLMMFJncoXFvHEXIGtnWtw9SVpX6xTI5X1SFYw=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.143113172.9_1578169019560_0.09157221823205974"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.143155414.9":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.143155414.9","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"8a1546df3dcd6e29094b8308c964d32e52b1a96a","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.143155414.9","_nodeVersion":"10.18.0","_npmVersion":"lerna/3.13.1/node@v10.18.0+x64 (linux)","dist":{"integrity":"sha512-/lrzayR/XWQNjtXAHkP5G+aklh6UMmTWpoCQ9n67+nFrVB8LP2UpIfdOzEwuU+fm/H+wdh94HDtLzwrhuBPnUw==","shasum":"2e8c85f39617835734eb1dd2d2bd5af2b5b9d512","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.143155414.9.tgz","fileCount":23,"unpackedSize":135082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeEkSYCRA9TVsSAnZWagAAsSMP/1SqMG5gn/L+lz6zjBcr\n5l8TV9Yag+S38rQnpdtoPctFYU6bf5vDbcndc57T5T3m5VsXKKMl69IMdAtI\ndeJejKF+qTQ9tuHvNYYPYgjWt1TRbmG696vQt672CAm2UCN2AeaJFCDbpGap\nXd2UNBnWOM7+l08V2l9s7QU5tOA4FwXtAQRIma5rG8OS5F6IYy+gWO6c91fI\nhJF0CBYegctrCg9LY+ynGqKsNyb7uebxatdyjDwOWAZ0946vQ7nYi0Mwqq3P\nPWgLs5G1SrKDAuG6JcrRU+M2w66ee5wK5MgSMPYI+AtcbJDDaQZ0guqpZW/b\n/QR9DSRrABjQ7Om2ds9VTCOQmlN7Q7yuRWza7Szx6E9mKzGPbmB5NdBXZoR6\nt3hinW4jIiqUa2KXO2yv1BWbyNto6GXnEJ0pJ1dahAhKCxFlTg22c4Anqw7M\nzXAO8NWTltCDyHkbX/k37AhW0hqMHHF2lN8YHsbshVl+dr6hOzHGmmqCNYWp\nATdh88uahSTm+J24aboEiGKfiomTwie751L1scsjbGyvs/hbWF7RverYIBfE\n46oB6ws8GxBVBC5lg/TeXR0gbY1FVDiK8zcarA19oZIXeJzjp3lKOA8NoThv\n51QT7CEcDnadlXMnMMA4eRYWYcMGPVRpBeC/YuPr1+6BoHv68gSTzvRknZzl\nlPVM\r\n=KQTv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXvvyNO5v4CYeBnzvlsryY4w/+PMwd8MQNfBEauh+AuQIgEVRyduxmgVenJQ2Kbtpxg7EMDKbO9EeRvTM7oiIpC1A="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.143155414.9_1578255512494_0.2758387604350274"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.143294186.9":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.143294186.9","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"8a1546df3dcd6e29094b8308c964d32e52b1a96a","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.143294186.9","_nodeVersion":"10.18.0","_npmVersion":"lerna/3.13.1/node@v10.18.0+x64 (linux)","dist":{"integrity":"sha512-10RTNo9Vkr+hIT0gARzGOxm+FocIJflueG6ZLgUforIzEuG5JEwXC2eA2M+IgPP+r+mjJNNJyJfI7vru4jXu2w==","shasum":"4eff923b67953330448b8f3d97b57cbea9f4ffa4","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.143294186.9.tgz","fileCount":23,"unpackedSize":135082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeE5ZPCRA9TVsSAnZWagAAXf4P/jwWNrCq/sceRx6Ac1Ia\nFLNad7f1g3cgkeyqstgOvMbRym5nKKw34n3cpbVVeIpQ9p2DaIT2fDZ1hZSP\n/DvzzuWQzXXFjr46sWEfH0BycZEkyi9a26oasJrkICA4uufUdmFrfiGqNnSO\niODC7wtKr2syVL6TQfqiubLQ7NpiM5Vw/fKBicjx9V8ecYgMWACYKxe5tWMw\n/LqYgP4x25Z+nlLD99h3+OY2aSRXDuE4VPIZeFFaCPdRYTgVffWHMxaFautU\nTIvOBCsjfc0//EQcu1qvB6WqwWCyodrIqUozCTNdODM5HRMVbkT50I4ZVACq\nYVP7ARE4W5DxiJsvBRuTtVms9RSaq+loXcUCVuTZizdhf1ONVhbtMGPYYVfO\nlfNld6V3cxYyvEpzJQMEde/GOWqu6FlN87l/jL23f3t8KPoSHTlwm7ELtzVh\nVMmFTf+mda1edWPduoL0vGOULu8PgZOR2p9MjjZ0fhr+MACHqzNKLjn8Y1A0\nqtq3l6smYzu5/essQuXZbWsvof9r60B6xtA4EJv+8iwYzRb7ZZcIpczp+TH+\n/5LEco8kkvtlqpMV2z9dhLKXDwm9xQYrbCSixmRplGjMkj6WNlE+QVv1qTn6\nSxvtw42OnNTVRKEJPJuMo5DYCXoRc+SXA1KRIeOL7f7N1NG3GnFs0nz6vbAW\n61lG\r\n=daB9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCp1EPbNuD1kvVPDkxgem7Egjy6nYUQ1lrODgJliYx6rQIgLiMbQVJPhZU1ry3tekyb25+CJ2NVG5P/ry7ZwJNIkqc="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.143294186.9_1578341967228_0.41480816773718665"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.143460678.10":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.143460678.10","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84d2ba7851387deed6fff571ba072018eff9a4f0","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.143460678.10","_nodeVersion":"10.18.0","_npmVersion":"lerna/3.13.1/node@v10.18.0+x64 (linux)","dist":{"integrity":"sha512-yNwtxDLe1du0u/mi0tCClpOcXH80AHQpJ2P7V4//VOufeOo7hvad79/qa/uaUtf+hZOTQ1Gt5hDvVVjONMq8aA==","shasum":"16b4897b63e36411781ae928dfbc0421bffd21fb","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.143460678.10.tgz","fileCount":23,"unpackedSize":135117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFOfiCRA9TVsSAnZWagAAlnAQAIjUc+sXt/0KniWHfP/J\ngfFIUUOZhklNlLzhGc0x1FKLKVvbCJrfsxUzwFt3UEdUsiv4gji1KDVCgqz+\nzuoMdQ8ApSI0bL5E9vG830B1NYptaCNUwyTp0IbM0JlmUSaRV9IMBfRf6vEI\nXk0cU98r6YSdsF8lGdZ6QA9dOXwtL8sC4bi2K2W5fMg7+240Wp2ezypRBh94\nSfDPwRdTluGembmDE4CsMIK1+bZ4HDSvMBBHJd+zzDuAUc1J/WDzukf38MIe\n8fNkT+F7fx4WnKLFRFbByrl7ssWzZeMpZHKnC8nVdx+ps+TDh5qL6vEaEejW\njvydrZTJZzpvMfkHXDCI/uTJUpATuE8ld0o7mXzhAQVCWwiVexag3WlHfPJ2\nslrm/atyyt3G554PvCRpM26jC2bhoMWWma86dSYS1lVSpbWIF/4SGkGzvFLi\ndfMV8WvT7n6rgY6u6/VqVBrB1F1RP+AFrVnzml5QIeDwSrDHvezTu1BDvWFT\nGhQlY6vyRwKhA6XOKzrkxEFZW8Ud30yelU87OVJ+AWH5LzSoWAtAmzpAhHg5\nyfiujSFO5n7qQK5VU17dpSlY0chZjSUGDEoV9/qITsgnYYSznkA7HenkWJDe\nRj0ZyXaM+e9sw04PYkDU6C7LZ4GgmI7iupS+PLb98UutKry7eV3FPEoNbrkz\nCJzJ\r\n=XEOA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwHSPv5eX06xZug9kMcr77szWpYAfX3taYV8vyWvK4sAiEAlEW/hUqp/hPVUfbHago0nuwngpak0WJn3njcBgRd2+w="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.143460678.10_1578428385728_0.594428774223114"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.143626239.10":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.143626239.10","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha \"./test/**/*.spec.coffee\"","test:debug":"npx mocha debug \"./test/**/**.spec.coffee\"","test:file":"npx mocha","test:file:debug":"npx mocha debug"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84d2ba7851387deed6fff571ba072018eff9a4f0","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.143626239.10","_nodeVersion":"10.18.0","_npmVersion":"lerna/3.13.1/node@v10.18.0+x64 (linux)","dist":{"integrity":"sha512-cW+eI5t8tRL1v5q69NtG/i47B+zzQwDO679Q4Ktpgfn2ZH2fy1Eau3lKfpzJpXtkp8effH3SF36qmlZrcFHJGA==","shasum":"b4800e5658da11716483f1937ef88561c188aadd","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.143626239.10.tgz","fileCount":23,"unpackedSize":135117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFjlaCRA9TVsSAnZWagAAbhgP/3n7Y4cqQ8QeEZazx7AN\n5Iz5BJ6yt/geo8Bv4r+c9gDD5LTfvLXPYL80zz2GeaRJWhq2Sc0HP24QfVZh\nt+tNJDOHJ/rQHJpy83he+Qp5XT+p0LRWhR47wn7TOZI81JSmdIGLhejmjgjD\nqnulpcfyTs6N860hnwF9+RalvuUC+RG0rkqxoKuQDnHy97+MdGEn/+/DS92+\nzOMabZGFy6u0Kc9a3b5vyXBJ769B17eC2dTk8+b7tyIfplWuqkuQLfzbyeAi\nx8/zt6eqwNvrn8B9hVaIaBPDvEBSvwwnP22s4py7LiAJJMzvWDGF8qI7LkI1\nnbPV2gGvch2VPtHvxUwdLo/PWaxBxWYd7ZiCWqyyQ9/Qj3cDy8l+VSeOwWjh\nDOzxsacE904dK/3xROkit8BKHxqNSraNxhO61A5C5Mit7GyE99VvJ4U8M8bP\nZr/TuT8Xxn8NkPU86BEvcqFB04Q8KPjGZJvMPD24M/RNirm8Ytry44ZF26tO\nxAxAGKydvy/lTWSWCBYqMnzHpQYmdkZ7m7G83p5a13YqTKZ7uX6rQVarospC\n/spQ5bcIA4ICbO1y+nRh4N1of/l2F2RAdWaAe23/wAl8g85vGlpmOGbtZhcI\n1g9YTVkiFAyeA8xh7t79daEGXtOymVOw2Ch/aVax5hXPGyPn2m05Xvmm3f1X\nyBqc\r\n=JaFY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzNQVKb8FOSlFh4ZMj3q+LGoS7+J4/CuB+ePCL4f27cAiEA/XsukH0Ab7j+k4plVoVsV+iRFCDfEr+mokKaAzbODxY="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.143626239.10_1578514778156_0.41606475769857565"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.146005597.29":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.146005597.29","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"a97b3f396bc7d05e75847b86d2685b288cd8d8a6","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.146005597.29","_nodeVersion":"10.18.1","_npmVersion":"lerna/3.13.1/node@v10.18.1+x64 (linux)","dist":{"integrity":"sha512-+2fyZiTCq2/ynTVe7n/JB9TSp8kXCrrKdtoLkNfD+ntrkXEGk+vjMpjM1TE8gBYskHaD44bp2PgiXmj4Li6REw==","shasum":"4dc812014fe909eb1490414c7d266bd86fff6c3b","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.146005597.29.tgz","fileCount":24,"unpackedSize":137924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeK1IzCRA9TVsSAnZWagAAd8AP/R1as07ch6HwQvGON8J1\nqA8FjnUxKtBUymQHY4zwQ02sDeWAWpxg7S2pfuj+WNOzrwbZ0Whsxbmq46WV\nNiEtAklicDfjM2L2Homdo0DcsALaD3Xj1JeBxCZS3wFq8fEpT1sMHQxxJcGe\nSrj5DtTucJcCsVBQInCrJFERpOlY4S4HyYr7qgACs5Z2NoW/jJP0T8q5quIR\n16AJnmARXInYufEk9QPAaxkDdH1XhNRn+BKaQH6nqtVeqqRR4fyMcSDhXNM6\nUk6fv8AXo4O+UIu3P9Lq7emxa8DUYcr/Ffu6AQ3ZehkF2JW2T2F0ESxejDJ1\ndSUGu+406FgDmlUV08wRAwzEhBImVO8dJAh7Rx1hi8YTqcYv2HaNgo1k43NR\n+Vev3w24RZJl1wr2CBeD39hqCAPCCZVjuvDiSLEQJXsPI+ll400cslSfHNVE\nc+8HHWDqytsiRRX1T+uxftCRwl8Ft60zciPdmT9vlJJM+Q7f5OcPh/pffrdf\nqYkd/T0KynJzj7F1PqX3ovwqThrFle5wBvqWXZ8S7fBq9U7y8gj1pUeJ7dRm\ngHdZV1tzj0JzL3wuTdg6bWbD9aKZ+14KBx8Pkw7sS9IMcV70zvlQ0oAVCsLZ\nqm60ClVl2cXDPSYLY1SJZieE9vxJTNlqCemKbQQk1/P+XnP4vhbm1M+3iI/D\nByly\r\n=TTYQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV5scEhxa0MHF36A8/3L6McDpePNUiFOXYLSgXgqfWqgIhAOzGQxjw5s1asvQAv1mO0cI0tSOL7252IPLzd2tI6ueS"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.146005597.29_1579897395467_0.7692644270540598"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.146073429.29":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.146073429.29","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"a97b3f396bc7d05e75847b86d2685b288cd8d8a6","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.146073429.29","_nodeVersion":"10.18.1","_npmVersion":"lerna/3.13.1/node@v10.18.1+x64 (linux)","dist":{"integrity":"sha512-uLGTofYhDJ7lcoRibpcRMC2dVG3DW4dvDJEUs3eLBALHck1c9vOXdJhQvekffl3f63ahhTWypI5PhymA6v+iPQ==","shasum":"9fe11bb96abd85b4ae1ab124330c166c39b2ddbe","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.146073429.29.tgz","fileCount":24,"unpackedSize":137924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLKOMCRA9TVsSAnZWagAAEkMP/jWN1AT/fmayxsXMGGGf\nqNayL6H1DC26VsmHXGipN96h06gCU/gvEGIwf0881pz8xajz2BHoZeAWa4b5\nQA5PdXkL7pGa2c1nNiehTmREFBSjCz0RPI3kv+UHS+5yvgUa9Bt/w5ZhFnua\nydbhpO30HSKvwvkt78BZz8wiERFLS1rh5DlCQPH5LtT0rrRY/kdj0cyTBkMS\nyz8mrrGrDpT9AYdeN4kRN/pLnoPovAAIwZEXzp3w5BkNeOVpzrVQQz14xFpl\nU5UFeVgKgkJVHwiF9RVModapMFi4AgYL28mMV368gZq5NPGSNvymkcUXOVrm\nLrrim850SXo0VCrFpmjz7vATZT0wS4WPiKIJsksdScvXUz85hawlpzQ/l5mX\nlrEBxH/ABvOC6q6MfvTwaJj/XjMkUT6GuwiRrnBhKWrrPpEbd1EPATcxwCq3\nFgrhO4pSPy25DLpqQ2kUZWewAzYLymYB4hv1K2Ecg/ZrfXh+GEdnr3gPLv6z\nz/3jVN4dvyK4e8vMHzq+uefsFrPRK8fCA3XxhDFriDq035Y3L3JRHNdlnWgz\nxaRVekDkGAQlZnYTHYSixToKdui9Y3gZQpuzBNqMrP+MNlawQGzbJKTgXWe3\nDYYd3qXXb/lUZt2yh8n8NNZSA9LPiHMaVuWUH/owXgDNocFa3fW/b2OV/k/G\nyMzL\r\n=WYls\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDK2tE0yH4HxQfMGWrOFoH43t/BQrqJCiEdq4Lq8wQjvAIgYXbfXnwZgFLmhzRCaG7k0rdIIjt/XvCptrWdH3IpWJc="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.146073429.29_1579983755749_0.48363618651027784"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2-nightly.146126959.29":{"name":"@litexa/deploy-aws","version":"0.3.2-nightly.146126959.29","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"a97b3f396bc7d05e75847b86d2685b288cd8d8a6","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.3.2-nightly.146126959.29","_nodeVersion":"10.18.1","_npmVersion":"lerna/3.13.1/node@v10.18.1+x64 (linux)","dist":{"integrity":"sha512-r48jgEUT+aXWOuu+Hp25vRjCkh7krMgiq0GpRNwspqVboPkZaxRbzQxNndntT8xkyxAUNAiJrWJ+7ySwvI5R4A==","shasum":"d7c209aded5bd72fc5e4b58d49f0b1f7246a779f","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.3.2-nightly.146126959.29.tgz","fileCount":24,"unpackedSize":137924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLfVcCRA9TVsSAnZWagAAPdcP/29aftzfs3Lf2E/IwTN+\nUCaa6lqE4F7nt1OcP84WSEDrlxasnzOcuvhdHXdesJineqmcHdc9Hj8bwaWN\nHx7drLGzw1hZZGFu6lqcvEWaZQPxDEpla+fsDLTakIPzX+az+9vQxj/87gh/\nMCytjPFWXHesbP5KWj6enoq7oDjHPG0gqrQdpMX5E0C2v+IK0iQu0iD7Aec9\nBSFftzxOAk3ppL6DWqkQySDHyp3oUa54YD7wz5TX1FGO+v31TRlneGLLyphl\nLKv8NSZ66m2DujBW7wB/+ChjwKhLf0xwNk2zH4WKmVRGMVNQtq7bzMrSR04D\nkEIhNKkoDuKBxlMuLLuOErQIIc58OQaPxt7qrzjRT+JS77j/LyzhJhCcvV8r\n84xV3p44D6WXalyIVe3nMSr6Dn48mh+zuOveHn8Js/Y8DvEkJaC/GooJ68Jc\nUOil5Mjz0Mt5CQ7biy9XOEIhSbKY/ATWxzWjNk6cZdM7XbtNmp9BvKoI7naq\nJgSNBoSUxCef2jaxblp/wWrDAuLbqj519QkKqlsIF2FGN65iMTUSUssfBaB5\nMkMogNijDl0Dz9j69gO3q2HxXPJjlIyyIKOEYQLirsqzT0Bbkp5WbVDsXKHF\n0giYsaA/ZSTtL30UwepB5gdPuanHL2SiZ2Uy/an3aGp68q2bi3T2Egt1MpBX\nzIiD\r\n=Q0QR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCANXWc7n59ndCjFK6KYUfs0FrXi7KaljY7B8I7VNo20gIhAIKxrikhOAjY43EiHaYzxCQFw0PpW8QAjSYzTk1Ahb0p"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.3.2-nightly.146126959.29_1580070235561_0.033158590564946966"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.4.0":{"name":"@litexa/deploy-aws","version":"0.4.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"0.5.1","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"5f203822eb5ecfad5590d02d8d3c8b1a39a44b81","_id":"@litexa/deploy-aws@0.4.0","_nodeVersion":"10.18.1","_npmVersion":"lerna/3.13.1/node@v10.18.1+x64 (linux)","dist":{"integrity":"sha512-gO2VIBpfMm3CrwGro8wtm6vnxCyGFn/NzfBRXL/iuGkHIV9i2e4IGs5INuX9QCluxzrfjFZJpBXUEzLNUTIZtQ==","shasum":"f17f773dd0d1eb9586a8bac6a24cc234361a737c","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.4.0.tgz","fileCount":24,"unpackedSize":139025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMiTLCRA9TVsSAnZWagAAYgYP/1XED0RdiSVS5mF5+QnG\n/kWhpd5HoXfNUXVcEhQx4ouR8+UPZ4m5f8aBvVF/S6/lTntAlopv4e020Z9/\nno3KVHQ/t1SGZaOXJNfcC8liHGhUXlxDfzI14YlNODWNclvee5QRL0x7RSi3\niumy+qCKdYGZXdqPTdeYzq8ap2owitTodMyhc2L+HCrhFhqWJig8tUJvgqsQ\nkNUcJ8SSe6UjaHoVDQv9myiMp3xucz2MOlbVNjnjt+ulhIn/0ZuRKlnMiwoF\nZ+veKY6E0gkFmuP36hWlE8qemfiGc/+zlrtKQgS9B8FJhIj97K9B6NH9ngKB\nxBt/n4GzcYYMNpjz0lUlnzeKO9rIBL1vqlCp3Gjy2nvKRUWQ5s8nU69g2UlM\nlYqfhPKO62duGMED7StMCmbCjpi7mWSSSKk5wVZ8tziC8ntywPzHnwK3aWMz\nq59CdEJpgdVM2z5/09txpR1GFXJgKf7XSb1s4oDqdAGwR4TXelOYQQnIZHH/\nNmWWr4bwFnOqdvj3fGVTw3CvJH5+XyPerThGytMMTVqy3/UNbJM8i3zgvKMi\nmf+fKJD3Iy11SlmO4Xg2rKCSWiU/mvK6YR1VrD2pPN1fCG3QwUcbAkFA98MZ\nAheUbksuYTg2PNNlK6d2uZsH26k86fYiDbRqYMn3In4vXWHIZUBFScp7qytr\nL+h6\r\n=B1Oh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDIUGLgMG/nnFQdpKx3J7XymIfyEYogce3cMTXYjiZgAiEA8M52zzIZBXur6n62ar5GxYjbQyJ9Hn9cdw0XsmUaBHE="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.4.0_1580344523169_0.05480330206597861"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.4.2-nightly.157326457.1":{"name":"@litexa/deploy-aws","version":"0.4.2-nightly.157326457.1","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"f3cc7de046f0d8f633c991aeefe33e032a6f1bd3","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.4.2-nightly.157326457.1","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-okOcCigmJDQotFPAwEg3+VdypBiYGZANXmAnVWQXKLYm0YiVAqOqMidaoxpTGWrKPWS9qJQygWvoCsJxwGsziw==","shasum":"2b554f84f4f59d244b5266a0ee1b0e6b1142edc9","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.4.2-nightly.157326457.1.tgz","fileCount":24,"unpackedSize":139053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg6/YCRA9TVsSAnZWagAAzO0P/ROBkJ7QizeqphYvEwcO\nu5pR93VWRBqquDhUC7WTJo1X6F7jXe9UQzA9jI/sdSOH3LjXh9rLymeqAVsb\n5WszHR7qI4POe3ZUr6xPBBmeoeBOyPR3hzW4dV53122E8hJJFEkmLnnPXz9T\n7fUXzVDOTjeILFgDaQty0KU3QeUyc7ABg317tOwYfzA/PqPzJYMNesik8o9y\n45yIzhz5Q5Gdknnkal01wQsbpl08uMnJ7vAylDt5EO3MudIqJ7r3lDJ0uRq6\nFONJcEe/3kH5TTRvzeK034Qp9kMCof5yheawpTL4K2emajAHhvaHMUnzuZw6\nFBmWuxKhygRZdT5qGEVTOptxUjmLougzfDC6Wlpsr45DOf14FecIhJwLnJIp\nJnUoGt/nUZ5yMTNaXn/WtAnd45RBYAhh6uH5f/AX2qZ29h2htvqU47S52Ya4\nR6cW8PTzn4Ga7SZZvWHhz4ZrKZHG9wFSQoy9kf2cfSZMJVVRnV4IbE/wt/ia\nqogf6SL8j0t2jt3Wyz7UZIrmBeEwQP5hTDqOsiZ2yXrYLfJDNGrYdCAH6gn8\nOroQQ7UKQUffzd20Zq+y86sAT/cefXsTbNyvjDEKCzWjuMB1hAIroGe2+Bb1\nTpPsOovC/qGgTPS6UKbUFtpDkoVJzRNYp0/9gJ4D5oDazYp4ZzO9lyncvTmu\nQ6+j\r\n=oveb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOa7TS9O8Rb/7zmk9AdkUm3O8kpVLJWPj99DqeSjsLaAiA4JczmJfe/r1MtGdAN24fCvqPO0dT0+k+wim38PH/SIA=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.4.2-nightly.157326457.1_1585688536168_0.6182388385767281"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.5.0":{"name":"@litexa/deploy-aws","version":"0.5.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"2.4.1","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"89b994293c4b99a342b9306ed4d90528fee81d3d","_id":"@litexa/deploy-aws@0.5.0","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.20.2/node@v10.19.0+x64 (linux)","dist":{"integrity":"sha512-dPqGe6VwDkdPtSJ1IJqlx06YsUgj7OKRn1Gb65Ny6xhbU66QfHTXe2VZZ0Qyi0e7Nrq4KR8QMc9qf6b5EXkb3w==","shasum":"f67e14a0ef5ec91de68accb0aedb20a70ab31585","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.5.0.tgz","fileCount":24,"unpackedSize":139176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehQyvCRA9TVsSAnZWagAAc0EP/2uboTbT2fvpAij00Po4\nwJe4Y4NfjLldeU/y2otoyVrc9U+JGvuP69HepSwS/KwAAwiwBePczIM4dPEf\n09VrZKDGEEEyq9gYpAgtw9GcCGeuRrfYH4EyyORoplOMYFTrj/IZh7typUYe\nQjXJ3TvwqwkTm+wuneUxokfRTA6BaCZfKony0Upxb16cfe0epoPosubltpV5\n4zLfH9STEtM7XAPZJTdcn0c1LTdp4HKoXJLT3rQJYpuWlgdoy1OZ0vNlv2iC\nSbHPo+YWegni+jBwI5Q9DlF7JODXf/wT2+br4TPavxox3Q5vjbC/FGFyDerg\nNysMxu1TvLiC92Cu59f5sH4zUJZT93Bf8xfrbz94+7r1ZdjmReoCDew8SSPA\nFgItlCLXd9hzA8QNg9+ParMUDsIK8/8UMe9X/lflnF2i9DcT7HYaztSrXCEf\nSAnZhuAVxBvkt1aaiYqrhLfBt3Xh+gYsIZhZmuRA2TxipdrjP9SXuSV+IbXg\nyC3OPcrjiL8USeR+IotLGm1y9ZqlT4uhz9gi1sY83czaGUJ264W5t/Xn2gpv\nvEG2fPOJOVznEb1/312yxKSrGz1dDS9SjlfAQosb7OYOgeryifdTsLNwVpNU\nIxRzw6HTFNjz6UkN/e1GfZsp0Ee+wpRjvIBhcf7hZQ8UiqW19rOh429y2kmb\n5uG9\r\n=bvlm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCodLcEyYVSwrWZGvUEC0Yb1JtQmtbB/2eIHQPXD0u2IgIgIMxg+yFHDnhetY3eBSSGorWDicVF1ShPa2cDX/dPY60="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.5.0_1585777838750_0.43786837906619347"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.5.1":{"name":"@litexa/deploy-aws","version":"0.5.1","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"12aed72dbe659ee9d246eda215be4e7c94a15ee6","_id":"@litexa/deploy-aws@0.5.1","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.22.0/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-R5t/S/zwSRCGYAjL4ZkKMK3A3VK23OUHV/wGHTVZ106NqGDnlVep2phTTQLrvpEZQHxMCi1ib4R4OF5DmHG/sw==","shasum":"e063fe7e910dd892ffbdee1cb008c19c1b2fc133","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.5.1.tgz","fileCount":24,"unpackedSize":139329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4/4ECRA9TVsSAnZWagAAhzUP/Ao9VnXlru0nrn8sfKrP\nsx6xAWjP0QZAwfBVu8jjOqdT2r4QNxZwr9FgWI8jSGmEniTkD30Vt6y6nSNp\nUdnncteVSR9cLa/Oa4na5ztxa47EO+oRsbLgOjCTUx722m9MfAD2AmEx4M9e\n26x+OYx3IDMsdAkZ4gpN2f7QSeRBXoDJ2ss2dN0LsJOpLmV2JnJmIlBd4UZl\n742RACyF0tmjsoG8ZTgFxdDoU5tZRQbNm0dwXLgs3JF+vm2Tjit0TWk9EcQ9\nIM1g1TJifwNVVcBNwmuurfvTfglfPBJB1GGkfdKrwi6nFVXNko56a7G1QZRS\nlWYwN1BS/9sZQlgar6ZqRFsD1U5TaBSqbGZLgH83omtSO7n42Ryovpj16U+I\n92ryxssTYo+8jpuMvrQk9ptzv9gNqZKPZ7S3k/SpHOXH3WVkiBSlXqyxVdzO\nWPuu3ct7rQILF01teGaUImezhPymdaX2REW2is1PMR52vyTsDXfJ6JIBDHZB\n+QJcUJ0TlYdNxHEaOWuLOYyZBZbwyTvkC+0hcnHZbtqDMpjC6+PgCyV0fvhx\nNVK0ITdcrLFG80nd+Ss60G+CdodIdOFQFXY1x2NXXvJG4ZzCZdUdTHgGJPkr\nTTQAsKHeKBKLuYZ/tn7/sH4C7azd/DM2Pb8w+rbZf6Lux7NEwzoAUFhsUm9w\nO8vs\r\n=Cz0m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHNc4NmUOQ6yexOqz1XHvJacnxp1FgZ/WFfn146ezm3IAiEApKjv2uVpUfhysCZnItz8w/PApauNg0Z+NGuA9EFI2aQ="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.5.1_1592000003694_0.5158512102504358"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.0":{"name":"@litexa/deploy-aws","version":"0.6.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"7652d56addc4fbc53b4fba8de27bc7f307109cb3","_id":"@litexa/deploy-aws@0.6.0","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.22.0/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-Su51l9GRZKu9ipJY4TiuYz8Pw9TeAhve8t0MFKUVpflb/Pmn+vObtJT1MiIzblwBKtZqT/YOLN268VDvq51t7g==","shasum":"1ab79bff216db699bf64a66c4f9db9b3121b6c07","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.0.tgz","fileCount":24,"unpackedSize":140002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6Cq2CRA9TVsSAnZWagAAQvgP/3SZP2Htm/1f8QTRUVTh\nT32X3L8Of96Iq9N2gV+1rb/pPUGf9vSQ+ECax0IbZrBylpHL7eM/ZE9ZASBb\nvJF4U4hTVmlse95kOZCd0F+LXyaGqngrFE4TZlr+rTGB4fE2EcbWVRquRzwo\nAgjFYrGhu43iFsHNiyzW6yf1ae3OeW4A/frNmZlbYOJg/Pgd4/GfYXYFsaNd\n9sJHyTi5EVydAl7uidgOYaaW3tM7tU4dLzc76wEyxy6GXMlSuR8FrXs/XOEW\nixsy4iNOJ84ytj+vhr3J0t2dovxgTn7J6o6AJwu21uk1hfpwZPET/BLRNpRT\n8ETAMlWZ1tpBWHdCsPr6QWodzY7qyyHROT37689STsbMbdH9wo7ptgqgXrYp\nSuQ1k7kvG+cWGINGoDSngu58Tm96W+ACJRQ96k9bhdsMVPykkgjNmQetDuo3\neEaQnnYsWmBnwvzhIb8XPjXTTCVwoGQYecz2r6vqA3+lvOtF7/Fu4GF2cGdp\n0uVih/6gaElZ5D5Lok6RUVgKd+elAZC8hpyXs4ozEgeruR5+Aj9FbDVIWL+a\nQNTYPjDAK8MESFamcM6LB7INk/IqnGgElKN/gfGa7tJUYNEXYY+IParfiujj\nf6wCTx6L+S8+dpv/YDNz32fuqlYEUVcoXMg245IcsPyj9nENks0UzBXEjeND\nPEfk\r\n=WQe4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2MdbFZh9ubSh69fsvrqyJ/z/0NHpioVrCjray09a/ZgIhAPVB4GenzKpLD1i16IkcKrFk4k7q63FEwYjg2URNG4f0"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.0_1592273590033_0.9503120459397991"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.174863890.1":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.174863890.1","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"012a993762b8d9bfd8db4f6b94d2ad1d2dbcc6eb","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.174863890.1","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.22.0/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-jU+UraiPorEjrjBJY4I2kIW9HAXyEUuNM35vKB3EtggvaOJtN58GbOEoQNGqD4XT1Iv4P3iySaW6xU2CepZFng==","shasum":"672e5a6e702fd1b4923efe11c1889a6e345556fb","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.174863890.1.tgz","fileCount":24,"unpackedSize":140035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBh8VCRA9TVsSAnZWagAANJAQAII7NoZ3G3gQmb3uYbmz\nHnqNJAbUMicd6Ae3eMaUOPivqXXzFre2NSOMwdoegyZXEEEL4JfJfmZsXX/E\nvhKmFgfF/QyeLmpziz4OOSou82WQSoyM+D65aBt3HvVVEFw0lrrl12VdqPQU\n1/NaW1g0SPdPmKjT7OYh9fu2ditpvFYM2u7HsuawtlevV53wYxQ938fIRVLM\nsu5eFJUcICD2vFgqhPmZGBtzjlJXMzJ9/JCgmugOcJkETjMGAfwJa6a2Ntag\n/7+ZNDCMb7AIhDD4YcpszHjG0LofFrrbulg5M59zH0oBaYEtA8JJhZGE51GG\nprsq3GMPcVvhvhkWGvx8Uos/+NmxZVVKB5deDSCx1t5o37L7EI0uSQSN6HxN\nO8jekdYNyhim96//4OL+oVvE/GMBl0eA+bldASCia7OXLNbCkUMLUhdd9kPl\nb6/TGnSn6NHYfYgvdJ9sAxSeuiIsSCzkPKYpbrJYgUYUggge599aoTnyYpQk\n1nF9Lr7uxLRGLEXa6uS8pEgYvWQfD1aMQe8H8wjSgzmfCEg9WOQ5uwMuUiTc\nHIWHtY/9b3C3+yZGs8A0P+bzjG2zZhYpd/uHBfgFX9Dy/Sm+yn6pBMJ41ByL\nAxV20LrFRV+k86fDDAi/8r2hLAe8+Tlt5YZl2duiK4ZBJotnk5AznfS+OW9z\n4Hqs\r\n=04vO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPOC3nfD2+sNddAtffN9ZMFZEkwY8HSbBLCcfTrQz4swIhALXd9XJYyu1QBAd5RoDTy4HnAGW+X7t93R897N/NL7Db"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.174863890.1_1594236692568_0.24943593796281882"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.175043642.3":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.175043642.3","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"05459c4f2c5dd0ab911d3313d0daca7c2e9fe25c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.175043642.3","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.22.0/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-Avn/PjJxMBr2GJi/2AroxX7eG8DrxZ1VqnoXpbRS0DdIPL87CZDPrPTR1PQY5amb37aREUece7C6iyTgLv+G+A==","shasum":"adda13972971b6ad2ab5f11aa9c9da506b34ece7","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.175043642.3.tgz","fileCount":24,"unpackedSize":141121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB3DlCRA9TVsSAnZWagAAlusP/Ail8+tnaLMhSKguDVEA\nGLCJJmr1hcp6eldRSV6HZAi74I1aQK8kBNS+DLKyxGwwmXOATUMGDrWHPlS5\n3c6inzQEf3/Uc4b/lrGhhb3bVYIrjsdPjrjLpSeEtKojkJ883G/2ek0unJjs\nOOqNnWRVFO8o2NUETstmpxVuBLEMokNsFSij1Rbh8vtAFFA4VRMZE1GfQ3CI\nip7hz5NorHGFFdph81LszJphaTudkpnB8dYCHsE6VvSR93X21UWFFv1Vue5S\npkfZWO92vmKGo3f6hhInxPwXrXJ6eouhdDXCoHKYU5t4kteX3IHAodZlCt4x\nvQNSa1qeI2p3FXMHQFNOSC7BM0FToEl2E11tyXSt1cLXWagTgDh+aKB2kpY7\nZuEJPdNeZsf+FvfR9ZjEzme4pI9Re1TV2lna2DI0we6jMwL5DWlE4KyYyFRi\neKcay7EqV6AfZqAYOY69+5ovxEBdLoIFmvMppZL7VcRUQvRNeMco5++VhgVe\nmtCzpV4QxEGzKDhYoN97uZnaLl3tZ+FVATT+affslaTMUkOJeWU2saQmVUHj\nFGZruyt8psDPzOHiYSCbBQygPlEw7ObZk/Hg9VgSvjaU7hvF2LohiObuYLQs\n+giN46JWiBFteZEb8/8HLDGhGnBK+EUBN2EmMW7q1dHdAVDoBg9t0ergr1Nr\nmDTZ\r\n=BcjN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBZLclqnf3Q1y6hAk7OIUOwosvt1+Jt6YdwLg04Pa3yVAiEAqpS/xMCH88zjQzGad9w5anVm3MdbwdeaFqqouzMLQrU="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.175043642.3_1594323172817_0.26430366883411716"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.175213831.3":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.175213831.3","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"05459c4f2c5dd0ab911d3313d0daca7c2e9fe25c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.175213831.3","_nodeVersion":"10.21.0","_npmVersion":"lerna/3.22.0/node@v10.21.0+x64 (linux)","dist":{"integrity":"sha512-N0zABl7hWZVhns3AP7l6qLuj2zCc4okUDW8N80iAbaFz4EVCuECxiXYrptlwW3xCZSKpDCpmGKc08z/HOJ+v9w==","shasum":"9b399f0351024b65f12709777be5ad64b3f873ba","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.175213831.3.tgz","fileCount":24,"unpackedSize":141121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCMJvCRA9TVsSAnZWagAAnJIP/jysqLt+d4JgQfmN86vg\nGJT6+2wolkBTxP1y15dO7ulbZGCY61ZhkeJWdaMgNYmhXwhbNZvlD6Oiw+EL\nu9Mtd1vBPTW/Yq9p/ze0KORVM6Xz2rgb9scADQkrO6eiUy+9rVrbM7oFn+n9\nWn4kzVG9vl2F18jG510OVWklqNIllVtCm48yqXF65lyzTySP2u40TwE7JCos\nKTX5MrSRehAxBBtJZoXaho6Rc9uID/eKxZEKDS8/ku5BvJIfSSNM30e7ub2v\ngJPCOpSET3WsZEfHO5Aq9vdV5ne/IZm/ZFWzFvdorc3Ymc/9cm0+guTNC9VJ\nih3WbCQ64Azre+m6xLY2XUN8DK6XKUb+pvHw7WVpdlU3Sw+MsOvCIt/67djq\nETS9C/bRd3tAM+90wS5JjpiOGe+Xsu3mRYDFe8dr+ld6I5M1IGJYZ+EMuhWg\npdL72K5YZ49N45rGmyquHyVRM4W0MsTX5FyeDDdIPmmfu0WDYSbsjjDM2VDJ\nr81rDjKuo+OpuydOPXO6HbG+1mOIhZYAVhejLarGxr1lLVkSOALas1SaRaru\nMQ554UT1YrSdIyh4DnGjrZZoE3YcnIWFpcgsjBdHg9T/P3AfRgDdGBfUvx7e\nBQ/mON9w9KTl4xoOP9ZlNBugtiZ5KfPXWkBCWKBLvG+RMN/yQ90UfhMbfIEf\nMSs9\r\n=4E+j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAi6R3uQ0GR4Qh+PeeCd7kzYVjekOnW+0up5IoQoREqCAiEAkU88HvwHk4+FGZirlMJ0nsosIGxqZigOxaY7EyfM1Uk="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.175213831.3_1594409582722_0.7206186326957158"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.182315671.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.182315671.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.182315671.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-facAwd4xW5A3royFY9nMCxBQ4MPdIFv2oPrDeUOZ3+gv4Zm4XlPkmYD26EB9p0958wA3S9s4vYFhQsB6NEI3pw==","shasum":"d258a38a18027a12256b6c8a66d75ecda863c61c","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.182315671.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTqgECRA9TVsSAnZWagAA49IP/R5MQoCZFrEYIE1p3N+4\nqezo88B+73Lx+dWZJkZdyHD1etZlsdrFGRZhVGl89TstiZPQCsKjSgMHD51b\nTTVXuTUkSy4H1zIm92VGxS+18/v/Bh5BvBBGvGTLsPgQFzSYyW/XWonmED0b\nT70VEC+Hum9sKCSFw1nDCwEAKb2ykDlSa/xCAAPweh/f+2G4pnBZEs3Plebz\nQZlNhjU2WF4NbtuR8dU1WFffp0xZEJ7WiNgf5b6Xiwh9RBvAuA7xIKh45N31\nHZ3VeLUd3tkwKF69FmNzc+gOiSrdePM2I366EvFkf3W419n0JvqtFXfCoeOX\nNpqAYlFcWLqCylbs2JvADbY/UGi16qDu5GtBj3B78G6cLgTt0l27LkRxl2BO\nUEAJBp519qaNFkE/4QZOroAf79s4aJk3USiG2hIdWkUoAFQ8eaPu5euSF8YI\nit4ca7XJ7iDNLfyDrqj/vHi2cYgzPa3agdVPSweJAnML5INq93o37yw9zh2l\ntz57A6QlCYpIaWvS1LlSGKxqKMmjQl8D1IRyZU8/T/Wwk6ayfAFmJ50zRb39\nTDmEB4OYikLmLuXD4/l/0XvRhL/MmLWDZDQdoKywBr/WQ2hpzOs70VL9T0DI\n7elj8OAn68+TAQolFqJZ+TviFH4vUx5GUukypTlVPF9GLQsHFefmYmNWBi5l\nYP4F\r\n=cLor\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4TNAP4iHtiMv+KuF9erB2iYL9kUtxKHEbKMLarKbvgAiAWc45Y5oPp3yL9ptW5smyQFm6M4Uktai9aOlUKPxFxhw=="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.182315671.11_1598990339665_0.7801306109432842"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.182486205.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.182486205.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.182486205.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-d1FleDybRDYfcCNx8Uy7rptII26CKfnUDyHN3T6N9+cGBeiWtefFDzxR7b52IMyt7ZjC/+yJ2UvNXxq0nu/zMw==","shasum":"d96194ac1eed0163812918ff908cfa59951f8a93","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.182486205.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT/mDCRA9TVsSAnZWagAAPWYP/ih5/WmX0kGmT43r+tc3\n9mONcfXrCD39YHCaxz0NW6sXrHJN/LpyF9ijZcWXyLspn/gMQGXBE4KJcyEB\n64DR7ntDMc5KBwiM+4PbM7WIQX7w6H2H8W565ht4oRhYEnXJyCKVJT3xKjm3\nlCKsexjW1mgES4t2MwlOqEufVhgr0z9XSlIRoKlkIetFTqAPOxr5o/FCS+p1\nfS/cWw9F/ngBf4k1eKXsA0k3Xf+tzZQEd8MeqKV9BViuEqYEci4w2w7Dga+F\ncy4idGHNARg7208HlN9kJhLT9S+w9xtQHTlxZFpgOeqn8PNijpOdDs1kvZG0\n3xpftxglf4C5N+ffhY3jD8XXi+yVm8Kaju8EjWfpp34KKo83yn2ghEjU6Q2y\nbbdau61YJY/9IGfHpMt3dvXBgeuQoGoH44XFCy0Xbzb6UnWPiGqwNRHxGX/I\npTY+yS6xtlw/VpZL2BgJVMtsN8tIH5ikkai4Ro2V17keU53+Kpeco8JlBMzb\nqEQudnKKHC1cbOJNMo76cfxzPtt7LnBQ0rEwJOREu1XJHQNZp8K5EBqI2UMr\n+nLyTpYnBKsGnnMXylAD/iuuGlfbg27XewXpuSwrPjEGgy1bSHmYv3iJkOm2\nQ3Yzb8e49CDaVZozVKThN1Wpo5Ey5GhNXDWzvEch6FZiKNX8mex7uEj1KcuY\n09ap\r\n=bQVa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvpJ+4T9Foj6aclTe96fz/CaZfdc71F8mVnxPag7mFbAiEAu6j8DKbeEcVtesC9D8+99BDz1ER+pp4bLcVIxlKCK4w="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.182486205.11_1599076738407_0.11827012957131444"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.182657892.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.182657892.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.182657892.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-l53EcjqhgR6uyQ+2CbStTc2ONzw8bRf9A6GGdONoHsyHGCLSdLvw170NIyf/OK0oVbSqFMC2cbzGEGgd3HiVtw==","shasum":"240fd2ca77cc14bfd798a225af08a09639e3305a","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.182657892.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUUuICRA9TVsSAnZWagAA3hsP/3r1neGCYPGouL6YaOpr\nQvBiQFD62muhyimDC33Xe5mv5n/Pm2i3ayV0/qdakBMRotSFf3NfkbsAcmgs\nqH19y6eZNUfZpTxQYd/RrlGES5maBlpMchwEo1lFZhU/w+CEIaUqWWJCPgwp\nvzEgFKGmXSa+0uL34XcvV5xqRMAeK+as4qVK0wcJqUakgvcQjIY3oGsOL4bf\nw7Gt3lD+Tgdmje4qc93VSj7032exDqt4P8ABDJ8MvIYw7JM04PA44iEsj/ZO\nfZK6+jWLkAm92tqlMpOYuWzZ2TAJGVZL5OEasbS9zpLoNuOeK98DRNEYOp4J\nTUteE0n3aC+tMy8VjNaMzKsvRJk380Ne5fgCh61CnxSJpmq1FwtyeHuuHmCq\nZVhazdVzFyUs/QfYVQh6czXRYdps7vUbdodSiesU4IU9ahiHvM7aEIxbyftf\nSta6qtNYAGV4qgzs7uInux3MUj99FjuEr29LF3twyeQ+9Rlpw8XKELsam5cF\no+snVcvYvQ7EB/q2aB+PX1Wwl0ptrNxoFeJFpa7VWiSEiiwU9RxwFKzhqNhG\ndohszU2IYPGFyVSQakR1qkq/pmLOAdXHKeNg+RsYsGSX4Y1idgPmWYM4unst\nUUB1uodYoghhV0l1klqjR2lSoIuGDjxo4+o3hNUAdnZxxdTZeqDYfdpjE5pk\nSPaU\r\n=HZPZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf5HGmsirYgK3Lmf9gNfa8rlFWkJci4wqYTA34SrXhzAIhALva/4AMws9N1z2CVk0iCBkkfxv/XM3+poIrIbqZKa8E"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.182657892.11_1599163271896_0.08807668510177846"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.182830167.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.182830167.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.182830167.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-4Woz5meVKtrykQWX09XUT5zjkplp9G9xzFmAvkHwbDapzDWPdXqWDlzhppdMyAQteRHfVFU+2gb9m4+w7CBR5A==","shasum":"bb8936f747e5c1fd410e4d3158f5859aafce29c0","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.182830167.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUpy3CRA9TVsSAnZWagAA+ZwP/R1SD1C/bGYRSmInmG8q\ntXZxD00okBUr3M7BWJX6Xeil5bdd2F6VZmdhiJR9G1lqGuWat18Lloqq7oP6\nhTv/tnOYtvzMwcbYzqyKQUsguhzfAnD+RUrAcHkFnn0HCd7eBSuqcVHW1ZHz\nRdvbfOJB6h9F5GWJhnKpuYr9Ke5S9UAbuxTQy0GkoHUsijLWD/0b3+K/PohC\nZjKMrHASoJdI3RXXISsCk/AKc86l9WhSSQKAiHWK2KLYtQXAoBH65iffZc6R\n+t8VSoB0JtFS7n0DPcPo9qH3PXtkMRsmtfy5NxZf8kw8rDpl9hMi+3lANvEZ\nS4tKBkRFlp5DNSUA9e50xSiFmcWff2+P3hM7CbAVq5GLpSY1heGZ1J8z6IOr\nfbS8ke5G5vzNFjNKC2jIMGHYd31rCLChtIvdJkGmJQ2RUrsJdmBW6LzTMnuR\nyhehrUtm3/rv7g8s6ygHX0oHoXwTnQoGc0oklwKSAYMVhVXBVnxzYffo9RYf\nwiDNQ17XMqgckfhgKEiCp4etXreCUnHQFC2qgq6j/1b7WeKh1Yb2AsL7Pn20\nr7JPiURVrEyAmAQ6G989Npr3smLE5vdSINTuMvqAUlVqU/QDBB+PIwDJvRMf\nX1RoTrn5xB1dpg3ZpQU7bjDfrBjEEEe+V4QFicBx2FT4R/abbQhCqeACNuoy\noJVY\r\n=yaVn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaAOg+4UWPvbsfyzCFyXTtUITgowPsMilhq47qALozMQIhAPqxFTKmQAck7DnSRxlEO0k5Yq2p94offPcBQshpvYbM"}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.182830167.11_1599249591156_0.8756457769111878"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.182925034.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.182925034.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.182925034.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-ClyqZ4Idb1Ir73+vqD90h24k2aax80W2tNXNE+M6ix9uvQRB3Qxi2KalpaJ3RelchTbTef7uUMmTi/0up7YGyg==","shasum":"fb29ebeb2a92e5b316a3fea97e346ba9c696c87d","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.182925034.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfU+4xCRA9TVsSAnZWagAAO1gQAIfZbh9t0CNgkd//UJqA\nlfIDr1TyQ4Kb3rMB1akxkE8Gv9EB6poLTF7nokoFTJZa9+mCUS63VwLJQowy\nKRTd81OKtOe15BQXHUqUkWom5S9iOdxNgqk5gVD9Yyt90VGdgjugurdgdVKr\n5BcU9Q0GA1/QKPLBwE2aXhARTvfISE1UZElux8oRgQEUtNgRGH5djSG4rEyv\nypjiUlAT22TqPxQLMtfp2haLDjYvW+au0Rv9kAe009hRif11MgpO/biUvH4S\nFfWeuZDw+mxOYerPqRKHbepwoxbtS7UY6eaF0EUJYxPdjxyokGtQqqPjXZWy\n0WGKvK6Wx8NpX5rpy+zqPAyOeDjQ0Dn33BCyoACRvhrTMcgqLmbC7x9iTXdd\nYhVDbnrA2HFnwsH6S0TlHqHiYUpK+MRROSxRZDdrQgRaQzc3hdskSt3YQzmQ\nFyZ3PyR8ZqsryKdWqlOdLcceMx9ucIzqvehyHvD0QJtiV2JahrEoSMFfUadM\ngxop8Sec5kcdWB0OPKhm+MVj2C8rQGj8Q9LxnjWhE2UUNytFUJV3uJ16KGxl\nclueaEa+AohbQUBx0/ciD/IpilCCUi0PL5Jfh9hDfYl0zm8RKp3TK3EUbxJN\n3wpxpvsgeYL1Kqpoi3S3QKJE1iXJFy12RftR3ogB4uiTUWWMmKlil0+/9poR\nCJIM\r\n=AdcL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHt1gie7P19Wcvx92N/+Xixcxbw8TD9G3olCDIx1eNi7AiEA4fBxJ1f7HnzNCHi71QgeLDxVsgL6+2c/5ZYljDrOQDQ="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.182925034.11_1599335984873_0.9008368827100519"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.182972073.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.182972073.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.182972073.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-YluYnLFGpb8WnfU5AX3sSHSzNKGNHZNAiGx/iGEXwperiThQXNvyfqgRskH+EuO9krlrSYT9x5B2sRqhhmJHPg==","shasum":"64cb30e5d78e54555f1cfaf315640f164a719e74","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.182972073.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVT+dCRA9TVsSAnZWagAA1wMQAJa+K/tHI+vB0khm8NLp\ndkCK0J6KLpfTIR78qGTvHb/YdygKnWW90Cx4ytbJMPsN1Gyv7CpalcP1q6jr\nmYc7o5H40pDO/540ow5np3J6ofJ6e+C63JC+TOhigI1b38QgzXb/VfBosK8R\nOUOVRfdCoMWpIopjugtx5VKJkA6qVtQ4Qvd+cxcDcX1JEsuarF6VtZ6N4VvT\n5TxG5V4ILZTU1J8osvmbkCDj2yUO4vNnEkMgpOXjA68P2QGbaE+psD0Em+Sv\n6nU0kkPf4sNJTA2E05b7wY6JWpfkoxW89oh7bDaPBGpsVwf2evrP5tiFItqw\n8SCIpFpUtZW3ETyBRfKm9TXCJqDkt2E7nEurQlmrXbSvzrTlkG9sE8S51LRM\nR8ASuKm+HXgsFB/PfGi2vROkSK8/yqKJXk4ldnQ1zGNMRlQYant9SuZ5tfBO\nmGspsLBT7SOQEs5vb6JB/aqqfpjTKB/EtfXzPWE/eaKjfEvfTeWs9HhBw7O/\nHjRzfsU2N0wcGxlyfQh5rLElc3V++/k1vH8JJhoFbpATegGrukCNK/B88JjQ\nS6BGb2Kxm/5Hxg3F49rqfVA9UvcMRLHg6C6bPTEernETmKtzHv474mLXzDn3\nc7Rnv9MAqC/m8u3tQEzyEbAusSvec9f8FVOyEru5IEcwfHJLvT311AG/fq3D\n0SoX\r\n=Ol8G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDub1/5lmrB5Yv1UyIBDNbDZwSd2u6dmm0yZQl7pa6MFwIgTGHXkXARUhKKDCu44ZR+cZhLGRR7a10ReZdIhcf4jVE="}]},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.182972073.11_1599422364533_0.651410656341483"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.183213242.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.183213242.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.183213242.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-RFFB6GchKN201SZTwbXyAATQ/cezF7GBGGALcWmMBGQ4BLPRx63OHV0J8F/twfYAhnbFzubLUgpV5PTpQ6vbWg==","shasum":"54294f64c39065f01b4e4704bc3539948c703189","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.183213242.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVpFYCRA9TVsSAnZWagAAbPQP/j7Poabp4mDauiuPigIQ\nuvl1oOzAEM6y4EQzoPNdtUHe9RH6C9+P6+NQbLz161JilsGWYvr9s+AG0tB/\nrJq7dknqCvIIWVp3R8oY2u6wG4OCuiubwKzjGf6qq+/0TvXVB3BPeT0lUhhF\nRH6/fpWiWWCq9swf1Yn5XWVzqyyDc85GoErs2pqcRBPBoujbMdFuYoH16VGG\nhp0VJcz61JX5Y05zJpYnFbx70+yU8kFK2R+T+oP87v8Jkm8yqeu3Zglnd1rh\no5vhTVOgyCiPJ0Cpfe1ckNgYNxrculH3gybeGS+UovzhOzRElw2lbimAXgdL\n6i2Cs9Vcv9PcwOcM7dBMW5olUH4Kf2yBjK1zQ4DQDu7vo8IurDXcQE/GSLBh\ne6QnJWEiMF60YsNWpJLH80IewljtWP3ZvsIlZBu8NmO6y6HNXWjTdQxZrvA2\nALv+dDOvIHQO9R4z91kBDxrqsCgpyhVGWhohyN4bqSdNc3ZcC7GA0rHwMxQf\n6KOhRzKgrtkIswweo+ALm/fJdJZMt/MUjujIyMtyzzvoTSg7opak1nHho3Sz\nv9Vk/nCYPjXWKw07gH7XMTkX8tq1xxAyu6yoUP/HPvNmuTR7WuXE9SRUb0xb\nRaq+Skv6p4QWv2ud87ZZATBPB23kJhql+zBhTg9THhbuM/mdLVei5qUj7HDU\n/9rz\r\n=Pu4m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzOul1H+vtsFVVzONCCir8px0f9V5kTWs5rpKuVw03PgIhAIiiWn+D1gjCYzQ3jHb97PD1ZkFBs8FYahRpHtyAxFTX"}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.183213242.11_1599508823416_0.26977385928338204"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.183432939.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.183432939.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.183432939.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-YUyHVi0C+cj2D9/tx8Niy1aPPuDEq9UOVaB4cR2sL3bnALAi3QwdjthRwGegmzuOCS78LfezB2nN7kKQSrBHsQ==","shasum":"77c3bf2c6c78353099303a82e54fa6febbdc95e8","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.183432939.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV+MwCRA9TVsSAnZWagAA5FAP/2wgRJ6Cromcs6GvQX/g\n3nDedqIxgBoifDlTClSDKDHNd/I7SbPdpGcGI79KJXkfs/t2wROWyoZjmVu9\ndVS8qgsJW3ZoyKyxPSCJeuR55urPVR3yUBvJo1mWy/WS9vCpx+gxci0uQZR/\noom9eUH+wiIAQE64A+ABybCCBOvvyRceEAgqwl3jvEd5QVYG4rXVnf2Y/IfY\n1x79cDy+aiNql89tY7RbXTNVndeuChbO5vjKCIr9H4ekEonxHTzqMh/SS2kE\nNgxG6vs5tlBTBxfc3g0epMJeVWpLqq2L/gwC/5BwUqpS5t9IMl/fSwljh5Y9\nCg5DxTqhylMJA9Qo91lBkmqSgg6d1rufXllKSQE/0kSmEYJhebjVkXubMMmG\nmdOgCEcY+BOhV31Zu6OAKAK7pZeTWqT9FhElNW/XNxzX+F14xvf/jo7CKrss\ng0Fv6xFKshvapJnOM9J8oIA0rsmdXYXhCzUdtFenKVUxJWvXOmUzakWHq5qM\nxGojnhNHmPefcGRoW2DAzXYGpAb9fAT2t0zYIUhQ0rH3epaFKD8RtPMsWXcm\nayfK17BoSrGvCV3QKZV7z/aSVYzQN1UoDHMo9gIPN+JbKegAr9A0iehGwAY6\nLXJxWyV5zUk9iHgWMcxTZY083ivrWWwaoG4yfs06KpCzBkz0P9y6Kf1MIDlB\nhXt8\r\n=/f5x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGcvTGwWaUi+gSTB1stsTRx/U99TaPtmNPoiu5raAHnNAiEA9ApuBewt/EwihyXn8JbyINLr6DJ5agh1D/UGEksDtck="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.183432939.11_1599595311619_0.4338702055785646"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.183615521.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.183615521.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.183615521.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-wU3Tm5mJCUGQiT1a+FGanksZOa//Ph/FdqlbM3zWwBuW38loS4niNGeJq8pyfjYtWQywKCbu+jpGTwUuLjBd0Q==","shasum":"8fc6f3084fa637ea799cd77dc0f866d7dd763d82","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.183615521.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWTSvCRA9TVsSAnZWagAAphIP/RIsYMoJ0k/+nGZLFf8W\nchesnjrXcc+iEuL9brvDPGSzp/W/p3pBd4FMlYx+ViKLw55BBz7TO5FUBCTb\njKyJsiW8yH8JQlZS+jveOzNL9jgOZmbYCeRgQ689a3D5xnWEUE2z5voeIbcX\nE1E8BUXI++qbr1W9NSUkBTvew0Lt1aQS67jUjQ5ezt8awGxU+eVqV0VgvXaV\n/9LODFT+omVVQyh/7ivf5whGaOx06LqMEZhvjyYwZKgIJ3+U1DdtdTK6q1ph\n6cuhW/Q93SgZo6cXCIPuX4Jkcj9Jb5GTkjHfrFEf39g6xkqNguQW7mJlIKeZ\nGHS5H1pUOf/Y9tR3pVZLFgb8F3diayxdmZoQ2iHGiZMZ+mriJ4ISN5PyjZlD\noPw3QSyhHDaD6fjBg8qiy5ZGPN6OvxZ3hZ1b2YgfCqf3A35WCwFSh1ieZS3/\ngsnArvk0SY7rQshwIi/+Y/yQTN/XZkfeoUhIIekXqJ97ecy/WIj4Qvoz/lT8\nT1GMYgJorrmQRR/HBP7vdsrV9XBD7WFyeazoCX7HWIcGLDdl+0a6MQeV1sMn\ndd9qx89EbVEuX9yM3JzrJEnwqbxmkbUx2c9dQjxHh/LZEr82HIyMToplEzLL\nDH5jousFBn1avJsl463mBmT9RbA/Iv4cAd2WiBaUba0ree/IXWDek4zVv9Sd\nKzuR\r\n=r3PR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5c+TMB9LjWQwnjf2obPtUNUmx0amJ3weavBgD/gfu9AiApl6OzMjg/wRql6SC8rFM1CexcekFkbOP4ZRvx4Tl1UA=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.183615521.11_1599681711261_0.9977292159245426"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.183790684.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.183790684.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.183790684.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-zLkuxjG8nJJRknbBpPP7N6r0SZNePr0cuBwY4dUGSDK6/GVRIi2LMMSNaUro7m7hkhtgcyVzOlirhY5AbugNeg==","shasum":"4474a942f06cee04c256b3a83b2ede553d1883b5","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.183790684.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWoY+CRA9TVsSAnZWagAA/GMP/i9+FaaOTyXLBDaZfi1h\nqEQ0de6J8vbWpBIEDG8D1lREFDO0P3pVECfQatmC1fKrSsajJiQAB4kefaAg\nk2iiCzS9GTdZxPHy9RtTieXWzBYBfUKkdUFLj5owtRH4Zdv6Qp1UGfYzw07C\nJVtglIj1tvOO1wPDeCWM7xgr0Ay40hap7awFpfI4gYpyhrvzuJJ1AVAxeYh7\nGR2XAR+h3UNJIhdbIVygqUQ92sHUc9Wx2CcdHQuiev77fvS7NBSVSTrNGiKP\nyvAFNKBbVkOZKLCRK+/1lzwwDoV3PSUgq3bo/Zssz90g2/mzjo4n92sP1i0u\n0GHEkC/sxo5JAEZ39Ia99BNwRaR5V3YPpR9pPGCBYkOOa1uiP2U7/fumFMbM\nHbAY7Zm7yAhbdEJ2v2LkzbYkBzrijEMsIBhxqY0cIv6GPSx3CMJzhIECEIQu\n+dSUJfNunNpLfPEXZbv0e8ioTq6kcPMlhWN59dGhwkT/6VD2OlZe8wFvdkOs\nWSuNPnIhGuK/jOTcvjDud+oZ+zzV+gsavEFg2ude7PrJkfb/g1cHZSTJVJCZ\nFsN2PEpzlE0RQHoERgXf5/cwxlflCZAB7/VxCS7sbr0NTHV5EbDjQhIytRZZ\nNSKvHyx8CF796HhSh8yExc5PyBZ7kS+gy5DFCfK4mFQpj1QjT+sBhfebHcVU\nj1fT\r\n=91r0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUxg6nXncemEvOBcH+nprbKrb/9mIjHRKBx+pZownP5QIgRthVC0jolGB7lnJhwZOI0sAZxsWG549EeKm255AtLqY="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.183790684.11_1599768125519_0.39297009226780033"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.183973871.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.183973871.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.183973871.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-MvZC9f5Y2KDhGE98oXIv81d1B/C/Blg9FENfQTW0zDSTkKPE0qLTHNTl/+ZEjt0NF2OXbcNjxN9MYsJeDbAI1A==","shasum":"2dd6088169ae0f918868cd808e02330b0ab6c216","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.183973871.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW9gDCRA9TVsSAnZWagAAHlsP/2YmoyBqXAUi4oqRvRTI\n4TwPKQxvt31KLHSibjYcmoItPgIm7eI3mEQoBNxUWqNPwRD5HS3e7t7/FV+/\nhKGpa11Fq1tOSBBEDKeILGbWutJ1ubTyk5ZNevqz8tgHzmQ1+HtZwT4fJ22r\nP+JZsFtbJfRsRGtexklXTxttUDG52flDUBnOuiRw/cph9rpbWWU+7vcfukkJ\nQ9iuLq7oTpd8vHbNs9iLgsb7InXbgvoVcBcjDgBr+3eKrHPs75qjnW+foG9E\njqURpg1GFipXIZCPbOD2zxfx4MR8K/LvzSMSxq/P6ADr09cbsJ/OhHl2PcIf\ng3jz0dDQtXfTzWBtJzZvkcxj/vxZk7AmyeFLko1jyn/1EpZqs+ZNEEkRVMdo\nY04Q81Q5Fd8A0egxk6GhJXJJgD481+kNwdnfgNUVWH1z+QwN9OSJlOdsPc9r\nM43mIkX4Ibf6ynSsfAzfYFoszlTfs0Kq4HC2/H3DTxEFzq4OtXdSI6y955RA\nunNasUp3s6Hw/LuLjd3sCkNHlkrwR9JTM3A9ckE4qtC6CQtRyDVtx9uLUZ+7\nf7F0DBdmNl7namO+rH1ifj0oGIuD+eBHISS3sXAl5+QfGw594GY1wxJSjwqE\n9ktIJLxvjXplX6Se/lGe+KP2owIglY7ShgP1xB2ZEsUBMC+nPS/rpIZhH9xS\nku5c\r\n=CkjC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIASVP0EKgUXMaC/XWso0nwLQghuYl/v4v2njHa5qGT4zAiAKZHwSQbu15oLgifJEfO8RCOi/WaHupVxhO8OEp31IZg=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.183973871.11_1599854594899_0.2760618044364507"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.184054526.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.184054526.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.184054526.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-skzB78pQjb+t5N+Ra2Lw+upSv6Ni+tbfnUMPlpOySlQHy2WQzV1mQ7RSt+dLr809kz3udcu6XyMSjarfjTFqiQ==","shasum":"6def993397aeafef8ae719bc53682e97db49fbdf","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.184054526.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXSmECRA9TVsSAnZWagAA5o4P/3Qm800DTBVHNxUYZKCH\nbCrCsl0hnI7BYHlTOpgL/oIJHuNvAKAvDGyBzqLZEv1Upo57S5Nvbi3BNQQC\nSdh5wuvqzqtOlSV5QHh9PDX1UGhxIT2Tf5lzlY3ra/QEdCMs1ZYbthMYe9w8\n73Lpzf4721RSm9fc4DV7ze/3hyPrSpc1IuTJ7gGpbMAt7pCcaLjt3MZp4i6f\ndgY3ACbLYeel6bRr/axPbee5LfXmfKG3EU5r4bil1TQwIXg7QDhL1CMJFQha\nTtlHEdH117FbXr1bj8k7t+t+hKvJ6W9V3zDqTHYcV21aaGY5L9G370exkmHE\nhKgegmRPmrhN1y3rOhUAfgsqB7M12akN2oXJQRmZdNOr/BR8m1JicS+Cbrel\nHXbR/fSwFjl+oy5yIAyZuh+QYS4mE4gG3WlagAidnPV/MrA2sBo7eCsrZJpo\njhMjImVsZoKS30sYCe2vYMxaEo13LD2zCLkEbEo/a1dFdTaJMY+IXDG4SWHC\nOAIVp1vYbC1M4g/U350ml54WQMyaYkH9JeHiroqJylqIVtRriCTpJjNqkya7\nC/XPCJdGtq01VgLrWc8nMbSMJeWyphPZYfZzrsPVN8L6cTcrkH5rQBeNsPjB\ntDNPRYusmFdfUI3qi0fZMZh1vWkLn2Y7UOT/EFLqfBy/0es5Wjz391sBW1nH\nsSi1\r\n=kcwK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChWpBFkTZhVU1JY4FFYPwtubbu9RhPKZWxOZ3rWWpaTwIgJe9Qzft/u0gVY5g1SbtDpws04rCaOJyTCloFvjtIHoQ="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.184054526.11_1599940995752_0.29277049086273976"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.184116303.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.184116303.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.184116303.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-0gvo77YAmiwN3WdMK+g1KbFE1fYAx3wNUQPgIn4LJStwxQauj1BrMSouAFCTC2Y/upHyAxlistsl3at8Bj+JmQ==","shasum":"8e64285a71d8094471b95552a34ac6da2f53f7a4","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.184116303.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXntDCRA9TVsSAnZWagAAMYkQAJAfuv6xQ14DtzxgMZ3x\nCxO21mXbo82RZ/Z7d35CN/KqAmvPICzSG1px3ecPPE2I7/qafQry4DP5fJ9r\nXMWmVW3sgi9x6OLJodY+CMaCrqOhGSxpr8gxgThooAsq6JGA9E7qZ55NKyjj\nUKaF6rcT99n20+ylhjgPzenH3IpIKICUlyn0fHizLR6v1Y+Lc/KyN7A6MW6q\njB8VBUl/8G4PUQsE8oS7u45d+SgiYmgxKvYuKIFpy8z5jmWWzaBy8QdgbUJS\nx/aznW6KBOAud2fUCLM/VDGOyrREq0tLdaMsRStvTR8bx1n8gqwM1O5SEbed\nQ+1dJ23PKTBQ16AhxBohTB4hANgPIoaeGEhIDS57iHyBiw/8VMUrWzg431ed\ndKxBWgBzBe02JJ6XQkfzQUTK8kCEkD/uAuj8m2CRHtQSXqtIdMFXGxHgjC02\nmhr6EJFAlSzrPpynxf8LPVZhvhe/eRzD2Wcyo/SgFOx6r60CB494naTvXuGp\niXJSkdO0hmkaRIN5Mj+IHILYf1jksWln+ypeXRrCvKidOBHyGsQsdY7LpGb3\nfw+QsMb9lMYuoVwag0pewc5SIKuQdHgAtECapcPvebiwsZkv7jgEhpiCeHF4\nYG9Txdbqyf50vRddqOgXbSzoMrWOurHD0PzRX2KY1HMxNiKCu3RG2RFtX8kI\nykQB\r\n=EAJ/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFmrAl8uHajgT1C3mVSN1vRw+uZe3KROqaCPfG7e7wpPAiEA/4WvQ4HZ66yLqq6KQiASH2z7SG8DpPILXXJYKti1ulQ="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.184116303.11_1600027458400_0.7058357393563781"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.184273663.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.184273663.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.184273663.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-CPlhuT9lMxNIpdJ53mo/D2S7L/RwA1G2Oyc5ydiS2NByLUr3iP1PA3u8RvIjFZ8MNSbuMnuMdoErUao/giEx6g==","shasum":"6ac118b97a20356a84cafa8fb6da5195300e7b32","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.184273663.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX8zACRA9TVsSAnZWagAAs9YP/3K9WkAbE+wmE9jT9tcG\nEOPQAfYRlvMtVMzrSKEG4PFXUNKujlXOZYaMlwZK1F4odt92kmdJKjXmAaKa\nA2nUtkVE8iOCquLSAu47PB6p2tbNEhyikswQSEQykzIykIr99C5xT2wjUs8v\nt5069//Vnpz9lJmF4Bi9hiL9vlv3Ycei+E70wTUInFxbl0Z0wAPOxU+T4Bzh\nmJWBHFAugc7ZLtsjcOL7FUT4+tw563AtnhJ5om5XqkPs8V/MiaLCuwGcX6vK\nKHSXo6nnH2vrMhbpqOU9bJKTq1oFVqOvzhLj/WqwBT0zpkP5r6qhzJCD/52c\nSAyUgzNZ5EzOi6rTGrIQOh/IK+jtx7vR2QiduqavkAgB1oXtD7E9P2Eqrk/o\nBq0fXKwxzjBH38j4VHWo8YtrmKDDUhpL/FRWLfvkVBBhSuxC3UhjNXAgszSx\nc761LC5o+OQIcls5eHkCFAY1avRm/UTrlBMkaOaGsbqaNuzhJy+oWdJImAMB\nUCf3nrLtIu2JrhGtjRB/2AVs8upWe/n6B+yYZXw2hv2981oxiYlNVUaUb2tf\n+W8PRLnypYKL6BR+OryZNOOfqB/Q38gFakJCr9mTH2pIK546aM+HXHzalNI7\naRAACeyDjoFMmrrkjUn/mP5wzOBcXGXbCotwTKYaA2bevvB8zu+LdmFV+5FW\npmgm\r\n=eUZI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrDUR1G0B4xSL29cwHAzTx7oKVhqkz76fep+Ic9/Qy6gIgHwjEswRAY+ecd7Q6BEl2nJdSUjZ1UvN1c2ymuZvXTFc="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.184273663.11_1600113855809_0.060369594592355025"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.184454255.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.184454255.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.184454255.11","_nodeVersion":"10.22.0","_npmVersion":"lerna/3.22.0/node@v10.22.0+x64 (linux)","dist":{"integrity":"sha512-QZv1pveusGpEFAQDK7pXeTufJgViVr63a+bKd6Wwf4d60gAHj9EAty+cuKQKMrMg8n1Bn1ISz8Uqd7Ci2cpHFA==","shasum":"e5e3d38f02b95e955ee8a6c7bcaa223624be5b14","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.184454255.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYR5oCRA9TVsSAnZWagAANv0P+wbeeDhtYzsZBb7vy702\nQwi5/ZnuGm8dKBsqBwg3b4iHYgO+H3R+GS8adx6ZZAq8996vQbSwfyV7bVc7\n4UA4ui+u+QQOmjoAD21D3abG459dFG2EPNuY5NHw2ZbrXEOMtBd+mdCJfoBj\nbsYxvGhJEL7v7AGz8NwtmEj7VFqfAO7G3xJVyNuwuzr+gGZ1Em8WyfECY/HG\ncGpmbjB1LYA7i/noF9Yk7nE08p/IuG9dD0kGpq3+KWAHN2z6T1umol9mQ8+H\nsSchxjRtXsSxw48bb93SOjQJMwv6oQMko2o1zKeCvIhG1LLs9Bpqp/YFMVxV\nqGaiGH4iCmT0qJqrEDfa6yheG5Qs4dSchYgxnbuyzz1Itz4gFQ0cmdQ1I73b\nEtMpVVzN/67Hr0KzKJxm1LaHaDxejTaB82emhWJkMhys9tauJ6PBElqEH6H+\nlPT95O5wAlFbiWFc6yVDJ95J1LzlVfxQZp4SLNTvNLmrV14k+JZuL627kHSH\n8jMS91J1leQWadULyFJNRcZMj+b75ykyZN+SIdT2h8ca0E59TYYU+JRhC/f2\n2+uMPpqAXiwi49k4ysmTaVZ8eYAhG7D4+3PPwXD9LBXmWh2GS2OME81/N1GW\n5Q95rpZLJsCgxhazDhleIQkTnCVBEg3GzmO+zNTwFAEn9g1yviLaQMxkT5sD\n1Kvt\r\n=GqB7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDDErovlPYI3KiBpQKsvc6NV/4ztosGL5hC/T+PQGCDuAiBPSu4pmChsK1dFPCpBMUbuY3jIwfrQdeJwfMwY/V7hHg=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.184454255.11_1600200296280_0.11841070250797459"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.185047658.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.185047658.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.185047658.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-l6OGvJ29zxyvbC6VR1N4YYTib2aApD75MZLBg6evKh+OkrA++gr3yPJvT9p69foVoMF5O4dp2/zZB1iBLFgA9g==","shasum":"703b7189057e0879a3a81ced8b4e128adedd510d","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.185047658.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8GaCRA9TVsSAnZWagAAEtcQAKMB4NHJd+D5k/XhZM9B\nNh2opJ2B/8axE1QWilVKAz1eE6lpEJ+GBtDNy3br7x0RLkVt73v4yajdFcJr\npoz98kxCf8JUMc0XPuIw9/LyZjaKfnYB2O2LX6/EMqeWwK2gudlIcnAOovGS\nuJrL3ozg2YbRSLoRXLZmuEe9J/6TbJHZdKPU9ZtK6cgcT/odzcDdWlADA7/i\nQm3S8BHRCN8h8p2Y87+JB6QEZ8ZplXvshgcipM21hOwttQatc7hc1hUsTWWs\n+1PAqSXNcR0dF4qHkHXnI0Z9jHw55cxouQpzbwPfqH6ipAO37Et8SHydEp/2\nc1ngfKenh55RFTeDBxgXYge7sREqL91ryEZU9rt8/8jSSkwWRQG9TcGuFid7\n9xcmSgRpKWNy8XyFicVOzUXN5zMW4rRRriSldhqB/MeNkBVrXJGUriNm5LAk\nsqY9cYh/473gkyxo2nyhTv6Kvv69jgtPpkgb5jIMBmbS+WNNwm/CkW7SKF0y\n25eEhuFdY38ZL0ZURekEDIrv2WsOMbutVLojtSHdvKyCW3i5gaIBFSNJCFsF\nqqqg7Hbj9O3VMPibnQV2RpIRxbacLF5e8jIYLipYLB7kwoVd4dCAsPBBYImk\nfD++c2Kyekf5MHTptvQ/4CWm7IXLC5Jm2Zge+uO4lW+OWjOW1kGKD3wFYjiY\nzuUA\r\n=Nkkz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4AHApGxNWXrgPuJARauhT82oeVDWd3XvDE+16pqeiMAiA4j8eaN8XXF0anZPJDZAlRmPbxHDs+GtWyT2cCieBdow=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.185047658.11_1600373145725_0.41868340180168184"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.185263572.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.185263572.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.185263572.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-QHQ4kz1IOjaYgwEbv/drE7w/WGd5+8hHtweuramnEE/aYe3WlSck3hGO3tyHWrUzOSKWV8IDgkW9lZNNHowkcg==","shasum":"1bcfc13f635ca3527c27ed6aae64567e460f1304","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.185263572.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZRJ4CRA9TVsSAnZWagAAKb8P/0jOIKi5npTt/R9LfiIU\nGpqaFunuvjkbE91gvV126E6IDGmhAaCLj12gG+vJCAo9tPdx2TpUjgqOn1CI\nuJevuCbQ61XBGbyR6Dml6OHadhIQEaXksAXntmmVxofaGvZ36TUuo/8xBDg2\nxa+vvGE5xIhu822Y4CQr0TlelkNNcIqq8BPl9BwuZYUIcrF0Mh2aUYCXuPwD\n6g49rDJ+dQ/VajySbWOmvxg37hmOAtpUU+nHveE6+2racmCFbZyDyxrVUrrT\ndaE8ZRiN3wRa1MTOepKXJgeuwI1vulXbnfvnxLjVqFWTr12r6l7bYZOD30Jg\nThxM1jzCPDrXjKTOHzwtvOrT+Au6bCrNUmu6oOryqX2EycbiPCzG1DPC/Idz\nFXhA7Iq99/xhjoRdAxkte5+Pt3Ts/vRMWfKm840ahk0r71Cwd1tHpXLbWngr\nFizxreW5kMkLu+WNLCFDPX+ipvT3stqK7kWa9Xcfev/Tc8lznmwFq2NC7Zde\nc8K/neC+WC4zEKNJFMP1Bqu60AMLb6NZIbJjXJ2FHezoO0eTBbRdStudralU\nKvxRCyLdeIIj9y5qvlxaknT+oV5nwlhLoi3sIyfqe7zPoVbFQXjkyH/Vgkh0\n+95Gs0WZchRJJOY/jrmtNpbyjFKpJPJr12DkbVpXSu+3uT0N8y0achI4qzro\nOEwv\r\n=Tvdm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXmCRAwHBP0kxc5eNyDFx3UPF+Ns2eOMeLtA3rbdfG8AIhAMCPLmzDGib65mqP1V7aYzm/gZdRBnkZssajg8tcsr5Y"}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.185263572.11_1600459383464_0.3781475680388884"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.185370434.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.185370434.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.185370434.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-FRL9QT3My+VHtx7UQdFGseRydI50Ue2iu2Ls04VK4eKxPk7Wwc/j9JZQlzwHnh8WvVxgGH9D03PNHBRjEUU7yQ==","shasum":"93c7aa0bdd6d0127a99bc7bafbb7a2f3206820e6","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.185370434.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZmPyCRA9TVsSAnZWagAA4QAP/jjeD0ZTzoUMqjweiCvN\n5ELBJPDq5xvg7cokqpkDLZwZwlP89pmmnNKb5bttdToDg9ecZG99/79Hx1PK\nP/RTiW/2qvmJEpcwVezCi4fQgAPtBerp0WPcWtw3NUUkifCF08VMwJUGFes5\nIHqhlbNGB2VCJCQY7OaUinuHJHYnwRtMX/mjwQZiOwfZCIufFdlgqUdd0bR6\nVmW6RB25ybeMFf9QRbyEEbTSv7VWDjmcNh7CNsutlFZsOzID9UoOUCdky0si\nELE7cJwAG0Y6uZxlh6TsUp4/jhuXOH3QbT9s9eGQHZ7rBWxmOReDbJUd2QlH\nqUq+FKMrv79GYoHQltMpVw5NMM3xZDmiNN2aR3CXrzVxh8WWERFZWnoyWfJa\nuFS3mRCdd1Yb/4dL5H7nx0cMQqPGVTMq2PqK1tHS+YvJjfpLhnwSr3WVaMee\n9WwsXBWQZVsZx7qjYj0pq2wxmtWfjFHV9br47daLE5Vasb3EE87cQz5xwbeA\nksiYpjy4oq57C0AOR/AhCItNDxrb0oGFUBT9mB4C3LxBUX1mJUZMf/Y09TWv\nRso+mXnauuWGkYqHlz+2tKcSqFIpdA6ieaQ7uUDgjPhDuVtb25j3bApm+IAu\ndmFKyqu1Xy98zDjLYikzTFJluYwXnypuL4/l7WCLNz16iRXEm/F/RPDkoPTk\nYqsE\r\n=pwIt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJP12X8fpGOAldLbY1oGIIVd7gplOseHjVeVi7yFHipgIgfdIb5TyBDbO//ShwyxdXWXVNWp50BYgR01kF0TolfBQ="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.185370434.11_1600545778336_0.03724553253840335"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.185479620.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.185479620.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.185479620.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-NckbjuTrIgvvMkCmSA+FwZwfbwkZfd/wxF7522zQm6yG6g85lLB7QdltWQ7mq2Mzg3Gi2QjFwINcQh5F8pgEWw==","shasum":"7eaa7f13cc0a9500e1fb1de9669378f06c73cbd0","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.185479620.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZ7WyCRA9TVsSAnZWagAAEIoQAIyqwX1mdH9hnsrNRqCo\ncFEM9j6hIsmr4KV2XHq2FNGb0bN80TMqDD0Y8G/NKxN0+fcHTm8A+m8/Tbvn\n0p7iZZ+btVSmtFOB3jKbHEsq5Dd+Iqw9C5Ge4Xmhx3NxJ2wB93L8KaM1/m7R\nR2dvWlpaXeDi068MrExfVeYof7IwveLvD8XHpSzatYQ57NjjuNzaKpv0axIN\nIHKqGHxynWkFabBT/sCOgc+LPEtJdPPY1H+Xhhxd8Ho1BcLhgq9uQqzA0TzV\n5sIxShOoo+I3lmD+m+uMRv3Ht90MgfkODkbW3DFh1g527NsFfVcT3BwwbhAd\nxtoavXDe4IP6areFlALYY4BTfhb6vHyDmQWEX1Mk+aK63zyw9I4SgrCnzDot\ngI/KawuD7Uwo+hO3lb6DUXligCRvvep8/3Qvj5k94galrsEJ2lJA/MXZkA8G\ny7FNACoBaVG5/cSXMEdEuJvyxgeqVdtyEb/VNwjeHE8+y5tMjYRAdJZ/opQt\nfOCrfRh8UIizYQPIFZHSqqT95kxj7yXH6nCFqJvX4El1GCimqpXA6dxP13iW\n/x70A18wmEDQp7DU6OEJADNTEaYBHIsvAZ7xhPSyuPnX4ZAHEoVbMjWuiB5d\ny7VncCYimP/75bSORFKUjYkLPA+h2G6O/1JBjsmzrGSfvgmJOWqTojO7F/5U\naala\r\n=bQ3y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfMtWexkS4HA3qM1A5HFA0g5v5g1VkYv9ky5kA89WuFAiBt5ipoAPWAtKVKSB9QD5GjHolhLuf/HuLUADl+vk+C/Q=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.185479620.11_1600632242077_0.3498607324910976"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.185840251.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.185840251.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.185840251.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-SQvQY7zvLkycnmPwuWIaRY/qLcRE8iElncYHh/zNPZ0IQ/EcjLnr/xvPECXKR2PJgw/MedckyzJ2HkMgRMSNEQ==","shasum":"2caeae5d66b15b52d83cb361a0d5eafd2211bf4c","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.185840251.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaQhlCRA9TVsSAnZWagAA+HgP/3Hv4+XZsFsNmu7touRo\nvG2mvOuvw2LTb8/v1uFRGexPXztq3O5ItnrBVIVX4/97nCQ8ixjjPOULeMKt\nFTaUgSRCRzlGB7xz0tKmbBFyz5rWVhkKtCv7iXI0Cym5xm6Ip/xmB9TGjObS\nfaadiLoXxDw+MbrisDY/A6oVLpaRAV05Z7zJLPdU8jUVGpQDca5DkKczsqvf\nnHERyAtapKkv22t9JdGqQBLVi/hvLxPMCvMjFK9CSavY39TQKU0uh73dje7S\nZmghUy4tDVfw1WYqh0GPGsFMsXZah6nzFf7+ujyEoRG9Ib0WVK4qQ9UEc2/d\nWFdEdUXMIMhz85R/rCTjASb8jHVthgNH+Mf2rIjxDYATwOtKmASov+0AVVOi\nk7yHP50TFBAW7M5NrUnr5sVzXhfSNyFWC1bbqQTsVAI4ha9w2UKvu1rPeL7C\nW0+xA8Xth7NMSxPjzAMEWgsJ9ZvmRZ+jZAadPAnfSYOy6eNWLWnp2yJkQPjr\n/2de71lIsSrQ8XYvP3y9cXAHcwgdZHjiC6oKP35TnPbcABOxEemEUFTUYYct\nUEtN/2gXe4k2+9W+jXokNBhgzRIqqaRgAjs2BE7ClxFU+36FBjhkuclnoQ9I\nSSho8UbcMKS9nOZy6AHEKhR+ymOWyNB5tmY8Oo/FHAIBz1HVjUI8mSRTkJlM\neMS4\r\n=iJkr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHaOlOEBUvx5ek0BooDONPd5omyhVI442oFLvvHTQIZTAiEA392XfuqlRjAmduRoN4fc28dlvy9h+65YROexN0x5LaA="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.185840251.11_1600718948868_0.4241001359017025"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.186071352.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.186071352.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.186071352.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-dmuYxlpoNKsiSxzvHZviQ5be4xluUXB6iieATijejk7ckVZQTmPPuUcnpb+yshaqoK1m6FgtX1vF+C/l/57hUA==","shasum":"6a10d80cababf2be1607c47650cd8c42202d45df","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.186071352.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfalm0CRA9TVsSAnZWagAAf/kP/1RrQ4GvtwuJrU8LhAZF\n3pN4eAmjY5E/TPtyvSfKVPlkwImLoluO1QiBvjjvCUzfa/Ooc4oAzSyt8uoR\nJrk95xtsPo20h5P5FaQFTSUGD/BkE3YBNkN8DLpzYe7ZXKTepRZZel56Y+5t\n+Hp0m5yRqChZdIjrLo/8MpofcpprU/pArMXQDI7mp+DARXkB9bsDNE5HOJZd\noaD5s7IfWl5y6u3uRM5UHyyr422YV9QD2uPA2YAMOJ2e7Y5kzq9cPSz6oSR5\naZxIceajPW1D+1cCY6yIPZ80jTd2R1ZwDsD3Mci75PHKWZjxkuNI4dX78CYJ\n8mEgo4mUCrw0/Lx/erxdB0HGKKCCFwZrWae3NWQc7nr9KD8trDI1mq0sokIF\nOHMDD4GfY1XU6uHlk8LCQaMHgiFxHEcCssE6ojW4YBeoS4f2FS8JFC9isOIE\nEg0Rt+uHYUXkzqvEkn+u1pBWtsV3pewKyoxRnFCAhSW6J7rnLPxQ5mVCXFX0\ntHnrfLxe/AesIzVp5iDvqd/qTw1dAQEqoBBvCbn619wGzOCaMZ85Xz0SNuSJ\nwSUNlWUXN14SKmCB+uBf9bgNb2ua2+w+EDXmM/h/iVNYOkJwsCoet9oEpOmY\n7puPrcE/ZlaX3fMFkI4Wcwk4gy7AQKCkxWrZJ2b8xw7IwnGMD7jUmIN5tZ48\nGdLD\r\n=57MD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJ3dUbIjhsl1Vnt6a2oHt2fvR1GyAY8B5NPYxmc2PVAAiAuSXtMKw6YUMfkiH/IaNpXqq95uoq7zO5KlCg4KniQyA=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.186071352.11_1600805299489_0.3967247321333083"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.186285978.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.186285978.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.186285978.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-f8SGk4x+3Oj+7n74CEPg5cmA/srblqQfuMV2h/9QkDoGFh3H0ps0F2dkFG0qnjHOecnv9QDTrmmRX1Hn2RFmyQ==","shasum":"75dcc73261737c9b927e7feb989fbe6989e297d2","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.186285978.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa6rTCRA9TVsSAnZWagAAly0P/jl99QOmVSap8hO6pLIF\n6XR5eTTpKXhXmgwk0rRKVLRncCFfBehQiIuLrRHQneKoASa6M3A6Aw77ho99\nHzZ4zp5TZ72JaUctoHXQEfONleOvoklSafW7IRL63YD+GBWjOJ+WDSh9d6y/\nDfAYqpE67nWMnOv/gzIZFOsL/m+RVP724HZiQYe72s8cv/eE1p030CH8z/+f\np6r0txO7LtioniLOcWo9/+jGDxvqqQoUq81tTZlPsm5LSviFaQ5yzQOdD9TV\nv2rxVOh6G9SRVpwBTJRg2EDxf+x5fjsZDk8TI6YV7lddIH4VnX93FU0x0rR9\nS8XLO5a9lvsT8OO0zeU9WR50j3QCAZMU9GIKZtilIOeB+mXU9Vw8845uEkLa\nrCib3JoWdpsvxH0onXFD5xsFecRUunW0iaAo3TT4qMILuJeqUL5a0IM9BulF\ng+uARSiCYFxPA+lC33aVpNm1mwu4Ru96Hv9Og99Hsq8xIayPWvDvWIBi+QD3\nTDvNkm1cf24HE4V72M5HON0ZAZG0USS+IJhdpX/tN9KR2JCIh+dwaRjV67z+\nwObt5wV5axFqM0b1zIJXnw57ewqXahxjVsAvOqTJluE2O+h7pPhJlM76Qvhc\nTyDtDp57CSWfA7n6AMNNfCijbeZXJATlbttVXEmKP/7Fjsm7ZEHmVfkg0K8x\nIQUi\r\n=XRhH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTxYl1MERwbEeHmgDro8PaxGx/LIpjUTQg3MbIdhc68AiAKXLz88u/UQ4E90wcPhdbz9LYfxnr6KRTtjenYKSTD4A=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.186285978.11_1600891602700_0.868900245555728"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.186544736.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.186544736.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.186544736.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-nOb7jwM0ZLkjtd8HzErOaGRgrSnfRfTjGXvywfSx4OtCBbgzcglDgVwZqo2O+/4/VJlAM2oMKypxtpxhGDrTqg==","shasum":"7eae7bf6d2db4166261022fb519594c80e659e0f","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.186544736.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbPyWCRA9TVsSAnZWagAA/C8P/087FNWAaqmf5hP636De\nGVyifoIQ9t6XYLHXU5Fphs9kZ4DyS58XTLcrv3Cg6LxvQAzL5AoDMpwCZAhE\nP569Sosmmp1/zVKqGi42qkW1ctBVXsymedvUBiNSX+w1R1JYZUU9gel+AV0Y\npifq9UJQ6gNaxDk+ZFFB1G+z66zfC9IafI+f197na1vJiXNuK4OGSzkPXoBG\nBusj6IUpPxyXORZUyVJLs00eclHFYPLI0gLW21nL9JcqeXU1qrIDJdpE9J0T\n9dFDRSMiNmWORV6wCKzlBxk/3VYaINwA1NKy+NyG919vdmaiX+2pnQRkS7vx\nB4Fe7k+/n3RlvEC7kySTQaxdkj7BOdyqjxB98+pkNPnkwOHcXpIpU5pDu7Sh\nCLzAOxntbH8G2QTNw0acijUtc+Nv6icAXPxem14elN3SucoUmN67nqs04Tou\ns5ZfPqPGsk31QqkCC7ti12ljr7XEfNRduDQzc7K6+DwYZar5EW46taQzJXEt\nOjN+UOR3dnZzUnjvYh73xyMeyNXtkgJSBNrUDbglYOtRz2PkP5xIHsbkeXY2\nKFbCdmIo0UTRf9zjcAbECOQHdFfdBw7VjkaDsMceEQ0Np/uBxS+1JemQpGuN\nOd9rluyxoicEzBvtTFYGENlzlVBtZIoWOiKLAqOfaZnoLG25nOYiDlY7C+7I\nqNMg\r\n=+Rjm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH3DNh5Hm46wZuewI7d2c5aM8uQ9H43J+XC+mTXyEPwQIhAOcCeZ9yQpTLaC9EDAcPD6zTpYykjwxuktt3iT0tLrPz"}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.186544736.11_1600978069587_0.4013104325085306"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.186742410.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.186742410.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.186742410.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-DofV6xK+IkfQwdnKZxln4E8rNlOitd65UbtWUQWTzofoYIJF1ZO6xB6piWfrJ6yvn/GOlqzz/dOlZbvseL2A9w==","shasum":"5d054acc10ca536b50e1e3a3f8cc334df6747199","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.186742410.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbk4zCRA9TVsSAnZWagAAYEMQAJkzHz930usdlVCd/SG/\nEQoPhpTldN+1tzjFGB8A87jjqp3px8F43d1s4iV2UjOfuBOfAPiYn1IoLKuF\nPthYsB4eh5zYIP29KzsqgMoAPVINPvYWcXQBw8P0eBfQwR8s5WmykCK/2T1o\nfGAygmM35N/OkyQxXfUiJzl7P/YJr0P1KQ9ZTh8681XnfPX20GcxBqAWu4qc\nygE/DNoab+ejyLjJq0VR8q3Y+sMjwY9FFKmUOr+EXTSVhZfSnb8xpgDvvwNl\nLZ/nIyTPT/juMYzwe8f6d6sO8cSvMPFk+6cMEjo+DdPnHkrBux+1kiqT0pqy\nsTctk0wooYTqVBDkhcUj7d/4+gmLuPven80VhaiMZUEvIYwWHcaNopSqn1Pf\ncbNmGykYgRbewhJfLuojFERjzwtEM7kMpdlRbCGeMTAi/oksuYjW48dVpWfN\nHZwaTXpr1PGqRnwAdFqL18zwEbaS+VxyDkkEZKRwIfUJctA2oQQ5siMMYhTo\nbg0NFGCGNg38PiMiDmOsr6Ozpq9jvaS90et0m2jShhVdlE6ofLAEhuH+TfyH\n770Oge0xH1z4xmvLPFXdegLKXU8zBby1Fsq3PiYGigeKQtvuEp0RIcwdVKfR\nhCRmiqjX6g1yKmUSTQL7r/+upWjNE1QRtivoITftlQ8DRsdv+JFDGr8Dq4JE\n1tmv\r\n=egni\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUgJy8QoSD0WNo7HPJvErs5+m/Ir1eDAhEBM/5kjK0ZAiEAwWA1VQhH+Lyps6YPFoTV3zdzkp4pJlziNQXzEProtmo="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.186742410.11_1601064499023_0.5966093109935096"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.186839486.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.186839486.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.186839486.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-JKozKbQx4ladYLAE0SGh+MLgm3RElP+OGjlhrPkzCcXHH8x0WsJ/Nqqq9XUmxLUH0j0GBs/L5/r15hR0BuK+zQ==","shasum":"32352791b3fad43498d5a8e807b454f057278fc5","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.186839486.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfb6BhCRA9TVsSAnZWagAAdKEP/iHWaD26wCGSZmSsuisz\nFjQF9Iq/cE7j6fXd/nISgFMEf7HaodE0uvvhbzn+gieBLJeH6ZOrOsScxXWu\nmGf23ebz6lCPspUlOGqt1yxMX8rBsZYQeQTY3OqGY2b3XkaWhbvcrKJxgs/f\nAkRGdzJmHEEG7NnyVHhGpCqdQPeMAWHlxoD/Jhv87dkG8Xy1D8zz+fLIAxlz\nurV8aaZlWXwmsRrl1cwGARnViy5IoX14QVGk6IiH3dF0XWTL68IJebIPIHMt\n7rqCLdD2E9+JwWqkfDckyUGNlOYk345wgiRxpDzeCP9KwpIF0Gf0U3PBxv0d\nF+obIacVrTpc7ya55oD1GfhOKaWmCCn4UogGGcvgYrGpLLoWqeNf74IcAFmb\n9LlTog64V2VlbU8zaplyGTyRlekW4nH5TLTwnvMOHWVtDK/Yc3XZeo0dyhPS\nt0ScVdZVeB4tUyjTDnlunQcePFViU/UJSV2s0qh2WwLIXCRr5pcs2VFLNU7v\notFXIDZOO0a3+WLDZ/7jYr01fFieJRIfXMuFZIOSy4vaXi/LPk6d4tV8Wytu\n++ADhPKO0i80Ejf/FyqKXAWKh6ZyoVDdPU83dwcDtEFfML7lkfJjaO3VCgE/\nO5EWBG5XZBY3gUU4ibkxQFbRJTLrDDCe5VFuyhs1o+gRFwURTnZnAA+zGewL\ngVf3\r\n=bOWh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNGP7EBuBXhIRUAyYWkMs38lTD5Z9IH6wSntHUzKV1eQIgB9Y3v4bJ5t+IRjvsaza0g6EHsziNf0UpVhK4VQ3STQU="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.186839486.11_1601151072400_0.9458897339888845"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.186901232.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.186901232.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.186901232.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-pyYhQ4glYgzsGXx+oyjugS8d41UUptLTW6eUa9DXCioNseZTQ6MRUvf22oaKaG9Rb23D2oP/7MxFh1ImvCFs5A==","shasum":"f5a6c79e5eb295d7974a8e08bbfece9393d521d1","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.186901232.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcPFMCRA9TVsSAnZWagAAmTAP/iWhyJMHm2aGwsR9OIE4\nHpzTyVT83eY9BEYsHpnL1DyCNKzxKsXKjNNpPM0YOiMXBl/ZkivKtpaodeW9\npaRJyeWLJQoZ0zyGL8XhMa2qGDjQdXSH2gqFzqilCYv2MFylIv1n55awFA17\npsQbpQzFs07bYssmfY/cvhZ3QqaR1HKef3udJ8ct+wjmrDdMYTaP4vaYqaec\nosLxOTEFtjxwy5T4DPIUvtKUjvu+lEICNWoV5u5ewRq8f2TuVDo31MtFw/mq\nrVkOc73ZZe72TZ7RWGkx4dN71dKDrsiq/dMWbvwDNNcxBg8sw6PfKjYcbKKC\nPxY7N3SoiixXzwsJrY4VANdS7S4tje8/yIkxmcdloC9B+QAsH6aTgYzny9fC\n1C3jQ2MjQ0Q5GvNPIsWcDUiReQcj7xSwHpVtz23LQuGhbQ/ZhNVDhj5T5nWb\n6xkyOjT61PM8OsCk2Xa/+tpK48WDgjQ8DU5beRmoXmZlggOstR3nH6TMpRa8\nv9JsgpChy04SMm+Tmvkq5euxraSZumrQPYV6dWRNFkpufA/xI/4Bzkhj7eYZ\nDcr41rjxdcr2EzHEmAcDvoEyV+hSchF6eELAyUJzdRF4uNDhSctGheTekPCJ\nO/H0LUXa7FTObMDRfXQaBbtgEhpELElF8fLcJKiJkbicpEndbaZiR3mrUZZZ\nYYdK\r\n=KkbN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPooaeeXNgKqgkv/erpJ9TpHdz43kqvIR/AH/YqAa44AiBqXXC4rkrYUI8n6v4Ssb+lAwLfbvMuEG8lvGw32EpVzQ=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.186901232.11_1601237324232_0.004813131148555083"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.187077581.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.187077581.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.187077581.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-mvqlPmVOP5FnLdJdlCqBySHCWWXIYVAZjN3fJtFiGpMLZWvX580AMU6ElNpxzYwAFLpJ15pQoZ5my7OJ8QS5gQ==","shasum":"cd6932d37ef2ae86457bb82b187cbfb145081514","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.187077581.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfckL/CRA9TVsSAnZWagAARXoQAKBvqJRseTCfSwpwf8kc\ndQH13NN7wU8OKsiVvyLr1IkSHBnjq5bMs5IyAmhTntDOS417/OKT0FpmkFdU\nV/hQStA2dyvwmcAvdPu0ALA72GShY5rTD/O65Oq1B/QsrAZZMla5t9rwpcb+\nsG9mHem3s7TQKUDgHGWHcqAiBumPU+dscRfoOpF0NfGLGrCwWkNXwfRba2ZO\nQhrlV1BtifSB8seDb0tk54NbI9y9hOxHcphXnYYa/IYsho++rV4Rs6c/pYNI\n80VE348G7CmKgiRKzPUpTWFxcrW6o32MH+PKeVntWjWOlB9iPkIg02/WJ3ZJ\nKpRUt6pSlCnuE3BbHYpujPkq48ACvcTz5yQrrJzUQoYWBQUIxqVIkLNdYRG2\nC3IZWfTbaNbZ/JiQYysvUTUTNRkXwCL6jY4QURwczlSg76d0HLuPvcTfRdGi\noBXm/m7nUf5If9JltMIBGfyigDNVyZ4UP+Y+0fdHY1GNanrYoyOfTssXv4Y0\nQRZYfC94BUTmN3xkNJfL9zQqNKkIRdyIdq7tfESwQx8NdivijXIMwTl4GmbY\nI7o/zKoKSNY+CLEMSvfhZhG2SPcSc3b4a3JO3q6lJjI1ozs4Gzwj7bGmjhlK\nIZFVUGCtUnYTje+GcePhZGB4jXRYffT7Y3q53ekwvwY0k58XKHBkou7xPDIw\ni3FY\r\n=67nQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFynZKkOTE5JaSFokh7ekP0SRgMLxfDN3bVrPzZv39XgIgQjr984sy/y1yI72yrH3JHmVsrV+N5BL1YZqzeCJwChw="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.187077581.11_1601323774613_0.5793788097681927"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.187282836.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.187282836.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.187282836.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-Vd7mccetMQHnexdGOcVK4bVK1wUrGkJWDVavF8sh/2HhKFEFfU6/AdfJsjTa6gwfGzPKuNPHNgMOWQfMdqQdTA==","shasum":"ff409fd30308d6266fe8edcc1333fc7948484783","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.187282836.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc5RGCRA9TVsSAnZWagAAv9kP/Rh6NKVCp4QuE+QVvJK/\ntGy0VlRzw0gimgKFQYdlJ9MoKQD32sizSSt8HFwHFWVc8EgtV5XsNJjv9ZAw\np1CteXO9rlfzig2H0iYxg4JYfRnMkxUlT9fvCDBobf1VPmOjW5+V7k0GFRrf\n1MaPil5hgB+KnWcwg8J4vEfki1jZDLVSed4Q3GNzgS7m+rScBrGXE+ebPjth\n70GCwHuRkp1zyGsBVx3d4r8lPJdYKSdcmmXLg0UEaFNdUaIyl1wMYTPRDTVQ\nGLZGErxFH2wtU328Uifb2V4WiRsmubf5insoJunIv2K1wAxDqXueYOMmn+/g\nhbfS2JgBd1gfGgUKGtLPAzLkqrLK7Y57pZ6v1RmlM8OoqBbk+Gfn4dh7MMnh\n61TrlAe5KIwvpkGGlgBp7LJ4oiZysMeoXnD8FxL+/NsQiUZZcTN9ZcELrTDv\n3IAUFLJRYwSJoXVTI52Uofo5oouTR17bTZAclKGKL79O44bjkrqUjNr/7Bj6\nVNzgygWQ7XawGv+LYiMZ6T5gWwqVGLzk3Qb9Ox8YQwcL4yT1pwk4A3Dz32Av\n6abqodpWr8f327+Cupkxrn+GeSEovFY4u8nsNKBXk6Ww+mo5ivqvdA+9Zqmv\nSXOzL45XMW50X1obZEntW8fJeNIsKxJXS3UpJ4Sj0fZZa26hZlDGMgEL8+ho\n0lJP\r\n=+Sqt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1MMlIU8BG9UHpXti894bt+6Wayumz02g4XtJUU816+AiB9KHDmVTtCifTGbNBUR0Q+6pVtUyApznTmdmBtv7afVg=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.187282836.11_1601410118120_0.7665274753039102"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.6.2-nightly.187477873.11":{"name":"@litexa/deploy-aws","version":"0.6.2-nightly.187477873.11","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"84b779229d1e10eccae2e217b6ee63c9899d9c7c","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md","_id":"@litexa/deploy-aws@0.6.2-nightly.187477873.11","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.0/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-ihUACYftgEvR0s/y3QGFVXBrkWWzTM7TnkmhAnFIpc7eXrPX5g4cs+H6vfZ+VIPGwDBwjsRv45+9XhQqH2HLLg==","shasum":"55625115d15428e89821b6002e3e663e7310a630","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.6.2-nightly.187477873.11.tgz","fileCount":24,"unpackedSize":141947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdOXYCRA9TVsSAnZWagAA5m4P/iB+xs3ua6GcqrkKPfgA\nOCAk8HOF3vJy+nUWc8yZNdb6F/q5QU0HzroeeBEx1zJEajTu3+Qwvo3fVJL3\nYSFlIeKQIsEm1hRLivuejNHESf19Yg0/JsjU3/4kkr6rN7nyXGLncFlewGSc\nD7yBRbedeJ7t6mF3sbOjQYiZfsvj4r3T1Vl123YM2TKpuo+H3qG9d7i/o19B\nyzOl3/1FgDfONcPXFsOdQQccUAB9Divk1pxI+5HgqYIAWVv++NbpqBaKyGFS\n8llEs1/tNehGfwKhvvNOtAG02zRd3Tx9lH3VAvB3VjOr7Ymo/SoNpG+RMohr\nYtadVpPnvybXWIdQVPuATFCC60SmGZDxGO1gfrj+l5VjiASOziwxcIC14KrK\n/GFv/9E5ogFjw0QM7p7cYnF0/mOXEuVIunsul9vHy5Yxgb7ZiTCuCWFusy7I\nL32L+LCjdeUQNXP5myq1uqJa8o/OYx5J2Q5BG6xiWc7U2blQWHwe8AKgXS0y\nujvSRdKnzXglO31v3EqXMv4RfYZAIrbXUrpqMTmAgqIIhGxMe1cIzRFJqFvM\n3ZXLM3m9gIAMAB5cYH4YKW6LAJn7NoqGRZL3enkN3ARfYg7XfcTT6fygP3vu\n4XrOXbEKYRJjmH+bWW4jLp0DL2JKRE7HUcUvJBs9vEECET6NO2R2YaRuau4Y\n/uW+\r\n=NeOx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6it4jtR5H2shZ3YLpfKA2wa+Su/9GNKBP/NprDoUgAAiBsEd5M4cJ3nmysWUGrQt7U8SdA9YehtblMeqOqDPgfNw=="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.6.2-nightly.187477873.11_1601496536313_0.4502358604327301"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.7.0":{"name":"@litexa/deploy-aws","version":"0.7.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"bfb1e3d6cd40f3fbe3491a1f4512539cdcf7b9c2","_id":"@litexa/deploy-aws@0.7.0","_nodeVersion":"10.22.1","_npmVersion":"lerna/3.22.1/node@v10.22.1+x64 (linux)","dist":{"integrity":"sha512-B4g3aKZHqt/mxotrLMot8YCC6RuC5SHdZ+dDo4R5/YHtRjAciTFYtqVxHeYz8vqZfUTwyDKPvoqyWp2R2IzjsA==","shasum":"3e06b00d1d1bfec06e1e644334e6be724142413e","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.7.0.tgz","fileCount":24,"unpackedSize":142949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd6sQCRA9TVsSAnZWagAAh1sP/iOvC4Fqix7TL5XZKBiO\nggE1WR0/KQjtUI/MuaG9eBnB/lXe5pRUovSS3v9EFjels3oVwr95+USBQ5Pl\ny0kUGILKzeqTqJnO5HeFCAn8e5LDs+lAva55cxg4zI3icKBbbhV68PpAuNNQ\no43I7Yrj7pJRAcnDho/V3ryT6H1hecKWJ8+AOO2OMRptgjYvd5WdcWOgcfju\nLnI+Ggl6JhP9HUyijAJHrgA/H4OhR7CsGxVN+fl/SJNRkW8JX7aF1di8SlL+\n8xrC4m3j0p1yhRl/uHklWF9Y2Gone6XfI4eO+QoY58V0oD5ZYqZIHoL02+lQ\nxEbLWzfcmDvCf52IctUVyzMUM/VBpV45yQYFKAHPNQe/j5w5dACBHxsMFRFO\ninE0jIS/qVZPMx/fn/HxGhze9EV+tJvB2Ok5glHiNkqRMryz+//JgMeWhkzm\npSJtNFRJhb0EKAOItfWiV31wPHHvUszv+njbbPGeFKOmByXFIVNEL6TrBJD8\n/t76/9/zW2RbQ/mdJyX+ctMq3Sj0DZ64AHL3o0BE97mZ7pq+nlfuLtimqAKO\nczOVxnBVBCfVx4+R8tymulbSbtBT4+KFbbINjv/nBmrXeOEAhjJJN3nbGnKi\nt6ljdISvHw866rKoGcbGVmqurs5iYFMMNG/zTIvOXmCw7UPoEtlu4aogVSEe\nE3YE\r\n=U0oS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOJJyFaZ5MCB+6+YWUNJEtK1Qa8UWu4biaFIKim+WsPgIgQA0NIJNoeKl+sBZb+prEUJ5ZgjoUjQlTMrRVEqBdJ50="}]},"maintainers":[{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"}],"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builder@amazon.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.7.0_1601678095706_0.2322575988378568"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.7.2":{"name":"@litexa/deploy-aws","version":"0.7.2","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"4e9de1b4d975db48ade88264c869be8ebc30401c","_id":"@litexa/deploy-aws@0.7.2","_nodeVersion":"10.23.0","_npmVersion":"lerna/3.22.1/node@v10.23.0+x64 (linux)","dist":{"integrity":"sha512-dncErVCuw3OpWpAPulYe2xIfr7/1y0B8hgU7KZARfTnoL/yKNW7KctJ2uXu53qvXWFVhg+BZ4aZUR4qRQEK4Qw==","shasum":"03d902d882234a31273667d788fb099bd19dbf66","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.7.2.tgz","fileCount":24,"unpackedSize":143101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf67vnCRA9TVsSAnZWagAAvwMP/i3EjH7yNIGSMOmcA6In\nhOghCsnx73SxV1gdqP70ng1WaAYhL1d4qLlB8UNKiO9ozUXZsWTRO7kkYAuL\nttL2MCrOHDP3LyGND72GdGMP4x2ppLqDVqAIO+6P58acTVpfZsSz2lov2TX7\nfKt6ijR7NFPhVWgL4IdxbWW7XLoW+r3k0wzbqkbPn1cUbcT51QurczOpQ/5O\n1FtkgIJ01VmV6bPxAxDxdLRVmK0vGTstTWAiJLhjAk0m4YjnQp9XgUQiON7e\nWHIL0LsO5NYVvf/HxE3AceO3BW5T42y2VBfl7m7XIl6gwabIvJVrtBSwS3Lw\n16gso1VDCLE9GMEGr/aAlbnFUJdOZhxWkeFEd/mOoG7LjNrpYvIvgUWw7Dn9\nYQSEGibtoRcD2YkwlmkbUL/bCPEXXoJ7El7KLEAjk6qcwFzi/Iza/RD+Wxw2\n4DWhtHTpkTYRBlPpjvBPR9jEzNsW9G/3uB7PKzO60JWtbRc8oW0pY9OMvlwI\n/7A5ntENurUbSHWfqC392OLv74tLg62nESPilGuY0+SHI43nGHmOooHzKOHG\nLvH1LeTKb+7K/+Qq+RT7RQFjC6nafYKxqde9wba5CtBIk+EzyViphOcyu6KR\nGYNh2D+kmZxsmRZGgrBAf4R2wn4yNuRptW+LMF6JqIFh4UFcQCiPcL8DBxRV\nKOP8\r\n=34MJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHOOjTlBkPWhVwVD2d0f1Ik0lMnQKHzUoyJVBCkU5xLdAiBm6kWiu39cgEAJaoLvVT+ufYuijL6gdrQEyncubhlJcQ=="}]},"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"},"directories":{},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.7.2_1609284582485_0.08743011734569195"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.7.4":{"name":"@litexa/deploy-aws","version":"0.7.4","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"2.395.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"07d9b71b11ddc82617163896eb9561dc9036a68e","_id":"@litexa/deploy-aws@0.7.4","_nodeVersion":"10.24.0","_npmVersion":"lerna/3.22.1/node@v10.24.0+x64 (linux)","dist":{"integrity":"sha512-7JOEt/wM7EMtHAdBnapNKpUn3cGYPzNdE8igTe0AxwmJTxjLT8/ghHak+pUd/4k0zBq3HDFby8JQVuiBVzNETw==","shasum":"2e25f8737a932f41a93cd688f7d1736268177e26","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.7.4.tgz","fileCount":24,"unpackedSize":143254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQEWTCRA9TVsSAnZWagAAMpYQAJstroHoCxrMLQWXoYaF\nC088m+e1z2ITG2ODrSZEa7LVqvoVfe860ueph1kimgBhmjeF7JOa7XwC3Xey\nWnDyY7bsv62iEJTNGHAMAX/v9PovtySynSQ6me9aaYrVKdQ0htlKB2Triw3d\nft1Ju379h2RpvvllZTmif8n09Vb8h5O+6Su0EKe6qFSeP+9rbBsJpIP3jZO0\nJj0OCfKe8EvWFd2xbIf+wFdLVhT8rWIB+KDLfUNGzfKjlffCW1sbvcAdXv5z\nWqrU/2pADQwkt8ASCDGk4XViMVeQDnXVXfNY5EXUna/JWCOaW1AQqKGpt1oX\ncXKYSTKW3/Fg3ITIs1WggaR581ZLWW+TTeO82f4B9onQTCIB2Q3EmnmLzMCd\naQLijIVrhRnna9jV+fuSSeM8vt+pL8gAO38/1lywRJGtoaes4sjImuVicoZH\nvxtT8bnP1Rd0YzY75L043O3fl5ckwPymG57Nl48WcB+6e9JPBQUoIMgkV/Jh\nrypzVKeOSEw7PJ+ugNuyBzojjxXC7CqzTLnKAaN0iHpFeXPN/xzzVtEcQUJ8\nJyPt5gAyj+PYT+rIDOy+GTRUNR0SsW6v9ndxYRPmlo+R9b75CVmauGsVukCc\nt95DU3PJ2QWEtJsrSAss/qfwtleVGWrx2WHhzn3azav16VToLeYAd0i1MO83\nTkyJ\r\n=fBcB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCpc8uXuhwiU75F6U7bw2tTYUCXlEzWvXjy9PGBFoVqAiEAuDaC+KkKDoejiq0W2ZPOqezUKhx0zmy2kaeAcR2tfow="}]},"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"},"directories":{},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.7.4_1614824850585_0.35674360560455165"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.8.0":{"name":"@litexa/deploy-aws","version":"0.8.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"^2.1060.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.0.4","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"1433954be45b5d6dabe3a3282775c30830858395","_id":"@litexa/deploy-aws@0.8.0","_nodeVersion":"10.24.1","_npmVersion":"lerna/4.0.0/node@v10.24.1+x64 (darwin)","dist":{"integrity":"sha512-Sx4KT7vYn2M9EX+TrOxpUXJXn/ZyzKhe/cAqNB82OiVWta020069lLKGoA1x4W5XIPIISBYOiN08HfYQbPJwMg==","shasum":"596468da3e5baae8a0a0386c9b974f6778b124dd","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.8.0.tgz","fileCount":25,"unpackedSize":145484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7xGACRA9TVsSAnZWagAA6CoP/1NddLsg1yzAkpmELqU3\nIxx9kbdkYGySii+VCHCyILpLHYesAbzldF9yMai2ByTJjfnLs7yvH7wKcZ89\nfnID/lqK+nyf5qVobbspl3QymGLx8GhUsrsTuqc0DVKC3zOcHHPRuOcrI7KB\nx3fBQITM/lqQ81qUq0xQAJAVFz2Mh4BwlFv/FasJK9uB/9tae0t10O4DDABA\n11hczRbiKhCLfU6Zvrw586fg1JVnYoXnLKHuedDkcnejN1tCdBqcp/jYfbuS\nDDxIRoC8lhGVDl42kRszFxUjUqcx+2SRYB25h4DoSx/IUsQQQ+SOowcQM0C6\nGZ+IWYOnRL9SjhjjgtAegJyDPK2swIMEEYt70rKhQiDX1dVWL9CslGr1iWIE\nyy6yOklbagpPBv+PnrMw01AB5mukc2otoTHbxxLuFOxOvSvjapPvDBG2RE7H\nWyiDlAR2+BKS3A84PmraCWSDWaN7ecXMzBdG5GuZiusrIIs2cpS7cr7tlHht\nKrjUj0kVhR0IsHSkhjKf2VTDvZ3+VRWYhD3avIJMZIAXPZyiYXtud3/u+j3i\n/ksrgnztrF4S8539rRDkWf4goJV8VH9o9lS7RgvfxxSrASrvHEtlx7H+zldK\nxd9IhdU8q8tlkOXHZVTcRB6fLYEJuqurftLqlqfRpo+EOCbsVyPFzL5LBBlb\n7rSq\r\n=eOnF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF8WDNMWo/s6AtrX+tyjnW9mnsKaLvFS4qnCJssg27dSAiEAmAo/fu1Gua+xjfXiwQ0XrztsGZBJQZBCN2HhFm7azEU="}]},"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"},"directories":{},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.8.0_1643057536361_0.40803949411714124"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.9.0":{"name":"@litexa/deploy-aws","version":"0.9.0","description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","main":"index.js","scripts":{"audit:fix":"npm audit fix","build":"npm run clean && npm install","clean":"npx rimraf node_modules","coverage":"npx nyc npm test && node ../../cacheCoverage.js","test":"npx mocha './test/**/*.spec.coffee'","test:file":"npx mocha"},"author":{"name":"Amazon"},"license":"Apache-2.0","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"dependencies":{"adm-zip":"0.4.13","aws-sdk":"^2.1060.0","coffeescript":"^2.5.0","debug":"3.2.6","md5-file":"4.0.0","mime":"2.4.0","minimatch":"3.1.2","mkdirp":"1.0.3","rimraf":"2.6.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"homepage":"https://litexa.com","gitHead":"1433954be45b5d6dabe3a3282775c30830858395","_id":"@litexa/deploy-aws@0.9.0","_nodeVersion":"14.18.3","_npmVersion":"8.15.0","dist":{"integrity":"sha512-4wkDvgzLi4/GKcj0JIWjYXuR2T/YRsKgyOHwHfEbWGYNFYi86O/8H022KPKqH64JZ7eMt/xhKRXcw2PzqNjCww==","shasum":"236a3214c010d27979b042931ea2a420308fb5f8","tarball":"https://registry.npmjs.org/@litexa/deploy-aws/-/deploy-aws-0.9.0.tgz","fileCount":25,"unpackedSize":145484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNQ9x0/ts9RdtkvTaHkIKqTY7S2Y0/ieTSHKsgYE6CygIgP5WzdxR13JNtS4bCPBODvsMXftqkGgJA+M9UVtgX7bM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQwCFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFAw//dCuvqd1AFvo9iSzYOYrBTFIcbnJNV7lQCJWLiYty6BGM+mas\r\nfT2ifNgz7X3pkVN+hv18UXdc7FCP4gO1dW9LMszXuPRDxqIuYGeYz9nYB9WE\r\n+2j5SofRA/dN+yVu4bYF3yarw60mF/iJGyaD2oTunfQHysDKXI+u3efYRJIh\r\nCkxe4Pux3BkwTEFj9v2eLmnLPfZgV6RiXg/i9UDYvzWQOTqFZ/9xuLNGkIFp\r\n5HmMJ57SiG2N2eOBty2ZVFnNZ5dc5sjIFcC0sScVQRXvHNt/LUmUm1nwtLyg\r\nEWbFEGUbSyX9aoEVHP1SbafdAHJzBcuPFfooYVResmTvusLi/VwQ23MoIHbx\r\n5mGbw8zm8nbJ6QAUe1UMWhIP8rRsXlHpCw64+FEm/OEnkcYpZ9WCsMgql8Dj\r\nC1HHmXVYjGbO+ZqI3a4EhBy+KpnAVx7ITEt7cWF6XkR5oCV+d5Pi2G7EnFBh\r\nwZsS5eF1Kdxc4UvPpIkLqpdi1xnJ6AU4KPkBiTTBdUkSjhW4jIKIhgWs35Vm\r\n8PZwh0543x4h5Q7IYH71WvZn65cZ4vy73nY0G7cfoz1wSg0smmXBhsqNHY2v\r\nurLPmCISWxaKo5zMFFk0uYqMo9hAm/FLtq+PXZAjC2f0OQe8kPOwOP989lWI\r\nbEiVEf7O75cjD2now61psfhlkR32XI2ImAU=\r\n=KIh/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"},"directories":{},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy-aws_0.9.0_1682112644986_0.41357623112625164"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2019-05-03T19:28:43.659Z","0.0.2":"2019-05-03T19:28:43.826Z","modified":"2023-04-21T21:35:17.430Z","0.0.3":"2019-05-03T22:08:41.342Z","0.1.1":"2019-05-06T19:08:32.100Z","0.1.3":"2019-05-06T21:49:50.626Z","0.1.4-nightly.110967595.1":"2019-05-07T22:33:54.068Z","0.1.4-nightly.111120854.1":"2019-05-08T22:35:55.338Z","0.1.4-nightly.111132236.2":"2019-05-09T01:25:55.640Z","0.1.4":"2019-05-09T21:49:17.149Z","0.1.5-nightly.112154138.0":"2019-05-16T23:05:43.539Z","0.1.5-nightly.112295593.0":"2019-05-17T23:06:59.279Z","0.1.5-nightly.112335225.0":"2019-05-18T23:05:38.127Z","0.1.5-nightly.112374729.0":"2019-05-19T23:05:53.977Z","0.1.5-nightly.112519784.0":"2019-05-20T23:07:14.814Z","0.1.5-nightly.112682969.0":"2019-05-21T23:07:55.005Z","0.1.5":"2019-05-22T21:29:55.906Z","0.1.6-nightly.116497869.0":"2019-06-21T23:43:25.849Z","0.1.6-nightly.116537503.0":"2019-06-22T23:21:58.206Z","0.1.6-nightly.116575979.0":"2019-06-23T23:23:47.117Z","0.1.6-nightly.116725281.0":"2019-06-24T23:24:57.051Z","0.1.6-nightly.116894862.0":"2019-06-25T23:25:06.035Z","0.1.6-nightly.117061114.0":"2019-06-26T23:24:41.502Z","0.1.6":"2019-07-04T00:06:51.636Z","0.1.7-nightly.122204651.5":"2019-08-07T01:54:40.338Z","0.1.7-nightly.122204663.5":"2019-08-07T02:14:25.600Z","0.1.7-nightly.122327531.5":"2019-08-07T18:58:09.733Z","0.2.0":"2019-09-19T01:14:42.455Z","0.2.1":"2019-10-09T04:06:36.651Z","0.3.0":"2019-10-12T00:21:36.116Z","0.3.1":"2019-10-14T22:57:16.085Z","0.3.2-nightly.143043099.9":"2020-01-03T20:16:01.545Z","0.3.2-nightly.143113172.9":"2020-01-04T20:16:59.729Z","0.3.2-nightly.143155414.9":"2020-01-05T20:18:32.608Z","0.3.2-nightly.143294186.9":"2020-01-06T20:19:27.414Z","0.3.2-nightly.143460678.10":"2020-01-07T20:19:45.890Z","0.3.2-nightly.143626239.10":"2020-01-08T20:19:38.319Z","0.3.2-nightly.146005597.29":"2020-01-24T20:23:15.611Z","0.3.2-nightly.146073429.29":"2020-01-25T20:22:35.943Z","0.3.2-nightly.146126959.29":"2020-01-26T20:23:55.672Z","0.4.0":"2020-01-30T00:35:23.333Z","0.4.2-nightly.157326457.1":"2020-03-31T21:02:16.297Z","0.5.0":"2020-04-01T21:50:38.983Z","0.5.1":"2020-06-12T22:13:23.853Z","0.6.0":"2020-06-16T02:13:10.197Z","0.6.2-nightly.174863890.1":"2020-07-08T19:31:32.711Z","0.6.2-nightly.175043642.3":"2020-07-09T19:32:52.907Z","0.6.2-nightly.175213831.3":"2020-07-10T19:33:02.958Z","0.6.2-nightly.182315671.11":"2020-09-01T19:58:59.870Z","0.6.2-nightly.182486205.11":"2020-09-02T19:58:58.526Z","0.6.2-nightly.182657892.11":"2020-09-03T20:01:12.051Z","0.6.2-nightly.182830167.11":"2020-09-04T19:59:51.293Z","0.6.2-nightly.182925034.11":"2020-09-05T19:59:44.965Z","0.6.2-nightly.182972073.11":"2020-09-06T19:59:24.759Z","0.6.2-nightly.183213242.11":"2020-09-07T20:00:23.565Z","0.6.2-nightly.183432939.11":"2020-09-08T20:01:51.776Z","0.6.2-nightly.183615521.11":"2020-09-09T20:01:51.411Z","0.6.2-nightly.183790684.11":"2020-09-10T20:02:05.643Z","0.6.2-nightly.183973871.11":"2020-09-11T20:03:15.012Z","0.6.2-nightly.184054526.11":"2020-09-12T20:03:15.922Z","0.6.2-nightly.184116303.11":"2020-09-13T20:04:18.545Z","0.6.2-nightly.184273663.11":"2020-09-14T20:04:15.968Z","0.6.2-nightly.184454255.11":"2020-09-15T20:04:56.420Z","0.6.2-nightly.185047658.11":"2020-09-17T20:05:46.100Z","0.6.2-nightly.185263572.11":"2020-09-18T20:03:03.628Z","0.6.2-nightly.185370434.11":"2020-09-19T20:02:58.431Z","0.6.2-nightly.185479620.11":"2020-09-20T20:04:02.210Z","0.6.2-nightly.185840251.11":"2020-09-21T20:09:09.001Z","0.6.2-nightly.186071352.11":"2020-09-22T20:08:19.712Z","0.6.2-nightly.186285978.11":"2020-09-23T20:06:42.954Z","0.6.2-nightly.186544736.11":"2020-09-24T20:07:49.753Z","0.6.2-nightly.186742410.11":"2020-09-25T20:08:19.201Z","0.6.2-nightly.186839486.11":"2020-09-26T20:11:12.597Z","0.6.2-nightly.186901232.11":"2020-09-27T20:08:44.358Z","0.6.2-nightly.187077581.11":"2020-09-28T20:09:34.744Z","0.6.2-nightly.187282836.11":"2020-09-29T20:08:38.223Z","0.6.2-nightly.187477873.11":"2020-09-30T20:08:56.444Z","0.7.0":"2020-10-02T22:34:55.825Z","0.7.2":"2020-12-29T23:29:42.672Z","0.7.4":"2021-03-04T02:27:30.813Z","0.8.0":"2022-01-24T20:52:16.496Z","0.9.0":"2023-04-21T21:30:45.239Z"},"maintainers":[{"name":"alexa-games-admin","email":"alexa-games-npm-admins@amazon.com"},{"name":"alexa-games-builder","email":"alexa-games-npm-builders@amazon.com"}],"description":"Implements deployment for Litexa to AWS Lambda, DynamoDB and S3.","homepage":"https://litexa.com","keywords":["Alexa","Skill","deploy","AWS","SDK","Litexa"],"repository":{"type":"git","url":"git+https://github.com/alexa-games/litexa.git"},"author":{"name":"Amazon"},"bugs":{"url":"https://github.com/alexa-games/litexa/issues"},"license":"Apache-2.0","readme":"# Litexa Deploy AWS\n\n*NOTE: For full documentation on deployment, please see the book.\nFor information on the command line interface, please run\n`litexa deploy --help`.*\n\nThis module implements Litexa deployment to Amazon Web\nServices, with the following structure:\n\n* Assets are copied into a new or existing S3 bucket of your choice\n* Permanent data store is written to a new DynamoDB table\n* Skill endpoint is hosted in a Lambda\n* Logging is directed to Cloudwatch\n\n## Before You Start\n\nLet's take a closer look at your Litexa config (the `litexa.config.js/ts/json/coffee` in your project\nroot). It probably looks something like this:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\"\n    }\n  }\n}\n```\n\nYou will see that there is a key called `development` under the `deployments` key. This is called a\ndeployment target. A deployment target is a named configuration for the deployment of your skill.\nIt determines where, how, and with what settings a skill will be deployed.\n\nYou can name your deployment targets whatever you want and have as many as you want. The `development`\ntarget is just the one `litexa generate` creates for you to get started.\n\nAlexa skill deployment is comprised of 2 parts. The first part is deployment of your skill logic,\nor backend deployment. This is what a deploy module takes care of for you, and what this README will be\nabout. For the second part, read the `litexa` module's README or the Book's chapter on ASK deployment.\n\nIn your Litexa config, you'll notice that within a deployment target, there is a `module` field.\nThis field indicates the name of the node module your Litexa skill will use for its backend\ndeployment. The module implements what sort of hosting, persistent data storage, and logging your\nskill code will use during execution. At this time, there is one official deployment module called\n`@litexa/deploy-aws` (this one!), which is already set in the Litexa config for your convenience.\n\n## Installation\n\nRun\n\n```bash\nnpm install -g @litexa/deploy-aws\n```\n\nto install this package side by side with\nyour litexa package. This will then let you specify\n`@litexa/deploy-aws` as a deployment module in any\nof your projects.\n\n## Authorization\n\nAWS access is piped through the aws-sdk module (installed as a `@litexa/deploy-aws`\nnode_module dependency), so all of its configuration mechanisms are supported\n, e.g. setting environment variables.\n\nThe simplest way to authorize AWS is to complete the aws-cli\ninstallation, and then use the profile name you set up\nin the `awsProfile` field in your Litexa config.\n\nSee: [Installing the AWS CLI](\n  https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) for\nmore information.\n\nYou can alternatively provide credentials local to a particular project\nby creating a `aws-config.json` file in your project root containing\nthe following credentials:\n\n```json\n{\n  \"development\": {\n    \"accessKeyId\": \"someAccessKeyId\",\n    \"secretAccessKey\": \"theSecretAccessKeyForThatAccessKeyId\",\n    \"region\": \"us-east-1\"\n  }\n}\n```\n\nwhere `development` is the name of the deployment target you want this configuration\nfor.\n\n*Implementation detail: If you have neither an `awsProfile` field in your Litexa config\nnor a local `aws-config.json` file, `@litexa/deploy-aws` will attempt to use the\naws-cli profile named `default`.*\n\nBear in mind you want to *keep your aws-config file local* though,\nyou don't want to be sharing that with other people! We've generated a `.gitignore`\nfor you that includes it, but if you use a different source code sharing\nsolution, you may want to configure prevention on uploading this file.\n\nThere is one more thing you need to set up for authorization, and that is permissions.\nAWS permissions are bundled together in what's called a policy. A policy is then attached\nto your IAM user, which is the credentials that get used for deployment. To get that set up,\ngo to the [AWS Permissions section](#aws-permissions).\n\n### Diving Deeper on AWS Security\n\nIn the long run, it will be beneficial to follow secure credential management\nguidelines. For a starting point on what AWS security credentials are, you can begin\n[here](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).\nFor secure AWS credential management, you may consider reading\n[Best Practices for Managing AWS Access Keys](\n  https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html)\nand [IAM User-specific Credential Management](\n  https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).\n\n## AWS Configuration\n\nThis deploy module requires you to fill out one more field in your litexa\nconfig called `s3Configuration.bucketName`. There are also some optional `LambdaConfiguration`\nparameters you can put into your configuration for further project customization.\n\n### S3 Configuration\n\nThe deploy module uses S3 to host your skill's assets, which can be sounds and images.\nAssets are deployed to the [S3 bucket](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html) with the name you\nput in the `s3Configuration.bucketName` field in your Litexa config.\n\nIf this bucket doesn't exist yet, the module will automatically create it for you. If\nyou create your own bucket:\n\n* The bucket itself does not need to be marked public. Individual\nfiles will be marked public on upload.\n\n* The bucket does need to have default CORS correctly configured.\nSee: [Cross-Origin Resource Sharing (CORS)](\n  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html)\n\n#### Upload Parameters\n\nYou can specify S3 upload parameters to groups of your assets by utilizing the\noptional `s3Configuration.uploadParams` object list.\n\nA Litexa config that utilizes `s3Configuration.uploadParams` might look like:\n\n```javascript\nconst deploymentConfiguration = {\n  name: 'my-skill',\n  deployments: {\n    production: {\n      module: '@litexa/deploy-aws',\n      s3Configuration: {\n        bucketName: 'my-skill-bucket',\n        uploadParams: [\n          {\n            filter: ['*.mp3'],\n            params: {\n              // check for file change every 10 minutes\n              // (useful for content files that are regularly updated)\n              CacheControl: 'max-age=600'\n            }\n          },\n          {\n            filter: ['*.jpg', '*.png'],\n            params: {\n              // always check for file change\n              // (useful during development)\n              CacheControl: 'no-cache'\n            }\n          },\n          {\n            params: {\n              // no file filter -> applies 1 hour age\n              // to all files that aren't caught by the\n              // above 2 filters\n              CacheControl: 'max-age=3600'\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### S3 Configuration Schema\n\nThe schema for the `s3Configuration` object is as follows:\n\n* `bucketName` - (String)\n  * The name of the bucket that your assets are deployed to.\n* `uploadParams` - (Array\\<Object\\>) - Optional\n  * `filter` - (Array\\<String\\>) - Optional\n    * A list of glob patterns that, when matched to your assets,\n      the upload params are applied to. Litexa uses the\n      [minimatch NPM package](https://www.npmjs.com/package/minimatch)\n      to implement the file pattern matching.\n  * `params` - (Object)\n    * An object that is passed into Litexa's call on\n      the AWS SDK S3 Client's `#upload()` function.\n      * To understand what keys are acceptable in the\n      `params` object, read more about the AWS SDK S3 Client's\n      `#upload()` function in the\n      [AWS SDK docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).\n\n**Tip:** You can define default upload params.\nAn `uploadParams` object that either has no `filter` specified, or includes a\n`'*'` filter, will be treated as a default set of upload parameters. All\nassets that do not match any other filters will use these `params`.\n\n**Tip:** The order of upload params matters.\nAny `uploadParams` objects that are not default upload parameters (see above)\nare applied in order. This means that individual assets will be set to use the first,\nand only the first, matching filter's `params`.\n\n**Warning:** You may not use the Key, Body, ContentType, and ACL keys.\nThese keys are reserved by Litexa, so you may not use them as part of an\n`uploadParams` object. If you attempt to use them, the Litexa deployment\nprocess will fail.\n\n#### Asset Deployment Location\n\nAssets will be deployed to subdirectories of your bucket, isolating\nspecific deployments of specific projects from each other, copying\nthe contents of your `litexa/assets` folder to the following location:\n\n    https://s3.{REGION}.amazonaws.com/{BUCKETNAME}/{SKILLNAME}/{DEPLOYMENTTARGET}/\n\n**Note: Use one S3 bucket across your Litexa projects.**\n\nS3 bucket names are *globally unique*. This means that any AWS account cannot\ncreate a bucket of the same name as an existing bucket until it is deleted.\nYour AWS account also has a limit on the number of buckets you can create.\nSee [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)\nfor bucket restrictions and limitations.\n\nWithin this location, your assets will be organized by the locales in that folder,\nwith the assets in the top level going into the `default` folder. So if you have a\nLitexa project named `CatsVsCucumbers` and you're deploying the `development` target,\nyour project folder will look like this locally:\n\n    .\n    ├── litexa\n    |   └── assets\n    |       ├── intro.mp3\n    |       ├── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nAnd your S3 bucket would look like this:\n\n    .\n    ├── CatsVsCucumbers\n    |   └── development\n    |       ├── default\n    |       |   ├── intro.mp3\n    |       |   └── introScreen.jpg\n    |       └── en-GB\n    |           ├── intro.mp3\n    |           └── resultScreen.jpg\n\nBy default, Litexa will upload Alexa-usable files from your assets directory and\nignore any file types it does not recognize. These files must have the file extensions:\n`.png`, `.jpeg`, `.jpg`, `.mp3`, `.json`, or`.txt`. Litexa extensions may add to that list.\n\n### Lambda Configuration (optional)\n\nThe `@litexa/deploy-aws` module deploys your skill to AWS Lambda. It sets a few defaults,\nbut you are welcome to override these settings with your own in the Litexa config. Here\nis an example with all the supported Lambda configuration options:\n\n```json\n{\n  \"deployments\": {\n    \"development\": {\n      \"module\": \"@litexa/deploy-aws\",\n      \"s3Configuration\": {\n        \"bucketName\": \"suncoast-assets\"\n      },\n      \"askProfile\": \"suncoast\",\n      \"awsProfile\": \"prototyping\",\n      \"lambdaConfiguration\": {\n        \"MemorySize\": 128,\n        \"Timeout\": 240,\n        \"Environment\": {\n          \"Variables\": {\n            \"mySpecialVariable\": 13\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThe `lambdaConfiguration` object gets merged into the generated configuration\nthat will be used to call Lambda's [updateFunctionConfiguration](\n  https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property).\nYou can use this to modify the Lambda's timeout, change the memory size, or\nadd your own environment variables. All sub keys are optional.\n\n## CloudWatch Logging\n\nLitexa uses an environment variable called `loggingLevel` to determine what to log. In\nthis deploy module, logs are recorded in CloudWatch Logs. There are 3 possible values\nyou can set for this variable:\n\n* `terse`: This is the default setting. Will log the relevant part of the skill request and the full skill response.\n* `verbose`: Will log the full skill request and the full skill response.\n* (empty string): Will not log skill requests and responses.\n\nSee the [Lambda Configuration](#lambda-configuration-optional) section above for how to set this variable.\n\nIf you have any logging output in your litexa project though, those will still be logged to CloudWatch\nindependently of this setting.\n\nYou can retrieve your logs via the `litexa logs` command for a specified deployment target. This will retrieve\nlogs after the timestamp of the command itself. The deploy module\nwill download your skill's CloudWatch Logs and format them as skill requests and responses. The downloaded\nlogs will be available in the project's `.logs/{DEPLOYMENTTARGET}` directory.\n\n### Use the log command in development, not production\n\nIf your skill becomes popular, running `litexa logs` may produce very large log files of requests and responses\nhappening in parallel. That may make it difficult to trace a single skill interaction. It may also cause a\nsignificant performance hit while it is running. We recommend using the command for when you are testing\nyour skill on a device or the simulator instead.\n\nIt is safe (won't cause Litexa project issues) to delete the `.logs` directory and any files within.\n\nFor more information on the log command line interface, please run `litexa logs --help`.\n\n## Local Caching of Deployment Artifacts\n\nA deployment will use a directory named after that deployment target\ninside the project's ephemeral `.deploy` directory to cache intermediate\nfiles before uploading, as well as additional files to aid in debugging\ndeployed artifacts.\n\nFor speed, the local cache usually doesn't validate the contents of\nthe `.deploy` directory, and builds incremental changes on top of it.\nIf you have modified this directory in any way, deploy results\nare *undefined*.\n\nConversely, you can safely delete each deployment target directory inside\nthe `.deploy` directory at any time; this module will detect the cache as\nempty and rebuild it as necessary. If you'd like to delete all deployment caches,\nyou can also just delete the `.deploy` directory.\n\nIf you modify the contents of your Litexa config during\ndevelopment, Litexa will automatically wipe the `.deploy` and\n`.test` temporary directories to perform a clean deployment.\n\n## Extra Note: The `production` Deployment Target Name\n\nThere is a special deployment target name called `production`.\nFor deployment targets that are *not* this, a `\\ (development)` will be\nautomatically appended to the name of your skill, with `development`\nspecified as your named deployment target. We recommend creating and\nusing this deployment target for your live skill.\n\n**Also:**\n\nWe recommend changing the DynamoDB settings for your live skill to ensure that it does not\nthrottle your skill's persistent storage read and writes, which would have an impact of added\nlatency for your customers. Increasing the provisioned capacity units, enabling Auto Scaling,\nor switching the table to On-Demand capacity are all ways you can make your skill's experience\nmore robust.\n\nSee [DynamoDB Capacity Modes](\n  https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html\n) for more information.\n\n## Default AWS Settings\n\nThis module configures the following settings:\n\n## IAM\n\n* Creates an IAM role called *litexa_handler_lambda* for your Lambda to use.\nIt has the policies: **CloudWatchFullAccess**, **AmazonDynamoDBFullAccess**, and **AWSLambdaBasicExecutionRole**.\n\n## DynamoDB\n\n* Provisioned read capacity units: 10 (Auto Scaling Disabled)\n* Provisioned write capacity units: 10 (Auto Scaling Disabled)\n* Primary key is a String called `userId` - the `litexa` module\ngives this the skill requests's `context.System.device.deviceId` field, by default.\n\n## Lambda\n\n* Creates/uses an alias, which is included as part of the skill endpoint\n* The deployment target's alias is set to point to `$LATEST` on every deployment\n* Memory size of 256 MB\n* 10 second timeout (maximum runtime)\n* Some environment variables related to your skill configuration\n* * loggingLevel = `terse`\n\n## S3\n\n* If the `litexa deploy` command generates a bucket for you, it does so with all default settings.\n* Objects in the bucket will be marked public on upload.\n\n## CloudWatch Logs\n\n* If the Lambda's log group doesn't exist yet (will be the case for a newly-generated Lambda),\nit will create it and then apply a 30 day retention policy to it.\n\n## AWS Permissions\n\nYour IAM user will require the following [minimum permissions](#minimum-permissions). You can [create a\ncustom policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to define\nthese permissions and attach it to your user. There is a [sample policy](#sample-policy-document) at\nthe end you can use and modify for your own account.\n\n### IAM\n\nThe following permissions all apply to the role `litexa_handler_lambda`.\n\n* AttachRolePolicy\n* CreateRole\n* GetRole\n* ListAttachedRolePolicies\n* PassRole\n\n### Lambda\n\nThe following permissions all apply to the Lambda function name structure\n`*_*_litexa_handler`, where `*` is a wildcard.\n\n* AddPermission\n* CreateAlias\n* CreateFunction\n* GetAlias\n* GetFunctionConfiguration\n* GetPolicy\n* ListAliases\n* RemovePermission\n* UpdateFunctionCode\n* UpdateFunctionConfiguration\n\n### DynamoDB\n\nThe following permissions all apply to the DynamoDB table name structure\n`*_*_litexa_handler_state`, where `*` is a wildcard.\n\n* CreateTable\n* DescribeTable\n\n### S3\n\nThis permission automatically applies to all resources.\n\n* ListAllMyBuckets\n\nThe following permissions apply to the S3 bucket defined in the\n`s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* CreateBucket\n* ListBucket\n\nThe following permissions apply to all objects in the S3 bucket defined\nin the `s3Configuration.bucketName` field in your litexa.config.coffee/js/ts/json file.\n\n* PutObject\n* PutObjectAcl\n\n### CloudWatch Logs\n\nThis permission applies to all Cloudwatch log groups.\n\n* DescribeLogGroups\n\nThis permission automatically applies to all resources.\n\n* CreateLogGroup\n\nThese permissions apply to CloudWatch log streams with the\nlog group name structure `*_*_litexa_handler,` where `*` is a wildcard.\n\n* DescribeLogStreams\n* PutRetentionPolicy\n\nThis permission requires the above resource plus wildcards for the log stream\nand log stream name sections.\n\n* GetLogEvents\n\n### Minimum Permissions\n\nAny resources with wildcards `*` can be replaced by the specific ARN,\nbut the wildcards are practical for creating multiple Litexa projects\nin the same AWS account.\n\n## Sample Policy Document\n\nRemember to replace `myAccountId` and `myBucketName` with your AWS\naccount ID number and S3 bucket, respectively.\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"IAMRole\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:AttachRolePolicy\",\n                \"iam:CreateRole\",\n                \"iam:GetRole\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"arn:aws:iam::myAccountId:role/litexa_handler_lambda\"\n        },\n        {\n            \"Sid\": \"Lambda\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"lambda:AddPermission\",\n                \"lambda:CreateAlias\",\n                \"lambda:CreateFunction\",\n                \"lambda:GetAlias\",\n                \"lambda:GetFunctionConfiguration\",\n                \"lambda:GetPolicy\",\n                \"lambda:ListAliases\",\n                \"lambda:RemovePermission\",\n                \"lambda:UpdateFunctionConfiguration\",\n                \"lambda:UpdateFunctionCode\"\n            ],\n            \"Resource\": \"arn:aws:lambda:*:myAccountId:function:*_*_litexa_handler\"\n        },\n        {\n            \"Sid\": \"DynamoDB\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"dynamodb:CreateTable\",\n                \"dynamodb:DescribeTable\"\n            ],\n            \"Resource\": \"arn:aws:dynamodb:*:myAccountId:table/*_*_litexa_handler_state\"\n        },\n        {\n            \"Sid\": \"CreateLogGroupListS3Buckets\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogGroup\",\n                \"s3:ListAllMyBuckets\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3BucketActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:CreateBucket\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName\"\n        },\n        {\n            \"Sid\": \"S3BucketObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::myBucketName/*\"\n        },\n        {\n            \"Sid\": \"DescribeLogGroups\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:DescribeLogGroups\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:*\"\n        },\n        {\n            \"Sid\": \"LogStreamActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n              \"logs:DescribeLogStreams\",\n              \"logs:PutRetentionPolicy\"\n            ],\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:log-stream:\"\n        },\n        {\n            \"Sid\": \"GetLogEvents\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"logs:GetLogEvents\",\n            \"Resource\": \"arn:aws:logs:*:myAccountId:log-group:/aws/lambda/*_*_litexa_handler:*:*\"\n        }\n    ]\n}\n```\n","readmeFilename":"README.md"}