{"_id":"@amazon-codecatalyst/blueprints.serverless-tinyurl","_rev":"4-6b467413603f2aa2058556cb380b9d07","name":"@amazon-codecatalyst/blueprints.serverless-tinyurl","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.0":{"name":"@amazon-codecatalyst/blueprints.serverless-tinyurl","version":"0.0.0","_id":"@amazon-codecatalyst/blueprints.serverless-tinyurl@0.0.0","maintainers":[{"name":"codecatalyst-blueprints-npm-bot","email":"codecatalyst-blueprints-npm-bot@amazon.com"},{"name":"cindyzhao","email":"cindyzczhao@gmail.com"}],"dist":{"shasum":"fb69ebae2a91b9bb8b25ecfe7de8d44880e86f73","tarball":"https://registry.npmjs.org/@amazon-codecatalyst/blueprints.serverless-tinyurl/-/blueprints.serverless-tinyurl-0.0.0.tgz","fileCount":1,"integrity":"sha512-+35aWzqdJQwahZYb3rqs44RuyhdBtx+4C7f2xP2kbcfyUv5RBg82wNVDrHITtK2aXKiT+etpj++MARbEZQnc9w==","signatures":[{"sig":"MEYCIQDKkasUSJ50TbYYwhkjkD7puj7dH2wAS/1ipMdTWNQwtwIhAPYwCHnojaJrRg4DRZZjHUmdyBCNukWAiSxuMkr2kuuF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89},"_npmUser":{"name":"cindyzhao","email":"cindyzczhao@gmail.com"},"_npmVersion":"8.19.4","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/blueprints.serverless-tinyurl_0.0.0_1695699303883_0.5293595729723415","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"@amazon-codecatalyst/blueprints.serverless-tinyurl","version":"0.3.0","keywords":["api-gateway","cdk","cloudformation","cloudwatch-synthetics","dava","dynamodb","fullstack","lambda","s3","serverless","tiny-url application"],"author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@amazon-codecatalyst/blueprints.serverless-tinyurl@0.3.0","maintainers":[{"name":"alexfors","email":"alexfors@amazon.com"},{"name":"codecatalyst-blueprints-npm-bot","email":"codecatalyst-blueprints-npm-bot@amazon.com"},{"name":"cindyzhao","email":"cindyzczhao@gmail.com"}],"homepage":"","//":"~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".","dist":{"shasum":"120495ca4662a2e777ab9e004292d034eecd3cc9","tarball":"https://registry.npmjs.org/@amazon-codecatalyst/blueprints.serverless-tinyurl/-/blueprints.serverless-tinyurl-0.3.0.tgz","fileCount":516,"integrity":"sha512-t2Mz52BSRYnTn9feG74axcErldXT+qXOg+MiLXRBKBAKKEuUwMDU2q4XxXztPtrcEB1jHZq901v4D21jz7BQcQ==","signatures":[{"sig":"MEUCIDH2O8Csh2s0x4vOVZOs7ns7M3Ve7rltnEssmFCx5yRGAiEAj5gsvCOvykFDbj6up9FhYRNZ1lPh3eIbsrH8OnJeeU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28309335},"jest":{"preset":"ts-jest","globals":{"ts-jest":{"tsconfig":"tsconfig.dev.json"}},"reporters":["default",["jest-junit",{"outputDirectory":"test-reports"}]],"testMatch":["<rootDir>/src/**/__tests__/**/*.ts?(x)","<rootDir>/(test|src)/**/*(*.)@(spec|test).ts?(x)"],"clearMocks":true,"collectCoverage":true,"coverageDirectory":"coverage","coverageReporters":["json","lcov","clover","cobertura","text"],"testPathIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":["/node_modules/"],"modulePathIgnorePatterns":["/synth/"],"coveragePathIgnorePatterns":["/node_modules/"]},"main":"lib/index.js","_from":"file:dist/js/amazon-codecatalyst-blueprints.serverless-tinyurl-0.3.0.tgz","types":"lib/index.d.ts","scripts":{"bump":"npx projen bump","test":"npx projen test","build":"npx projen build","eject":"npx projen eject","watch":"npx projen watch","eslint":"npx projen eslint","projen":"npx projen --no-post","unbump":"npx projen unbump","clobber":"npx projen clobber","compile":"npx projen compile","default":"npx projen default","package":"rm -rf ./dist/js/ && npx projen package","upgrade":"npx projen upgrade","build:lib":"rm -rf ./lib/ && yarn build && yarn blueprint:build-ast && yarn blueprint:validate-options","test:watch":"npx projen test:watch","npm:publish":"npm publish dist/js/*.tgz","pre-compile":"npx projen pre-compile","test:update":"npx projen test:update","bump:preview":"npx projen bump:preview","post-compile":"npx projen post-compile","post-upgrade":"npx projen post-upgrade","blueprint:synth":"blueprint drive-synth --blueprint ./ --outdir ./synth --default-options ./src/defaults.json --additional-options ./src/wizard-configurations $*","blueprint:package":"yarn build:lib && yarn blueprint:synth --cache --clean-up false && yarn package","blueprint:preview":"yarn bump:preview && yarn blueprint:package && blueprint publish ./ --publisher blueprints $*","blueprint:resynth":"blueprint drive-resynth --blueprint ./ --outdir ./synth --default-options ./src/defaults.json --additional-options ./src/wizard-configurations $*","blueprint:build-ast":"blueprint build-ast ./lib/blueprint.d.ts --outdir ./lib/","blueprint:validate-options":"blueprint validate-options ./lib/ast.json ./lib/defaults.json","blueprint:generate-assessment":"yarn blueprint generate-assessment --wizard-option ./src/defaults.json $*","blueprint:validate-assessment":"yarn blueprint validate-assessment $*"},"_npmUser":{"name":"codecatalyst-blueprints-npm-bot","email":"codecatalyst-blueprints-npm-bot@amazon.com"},"_resolved":"","mediaUrls":["https://w7.pngwing.com/pngs/147/242/png-transparent-amazon-com-logo-amazon-web-services-amazon-elastic-compute-cloud-amazon-virtual-private-cloud-cloud-computing-text-orange-logo.png"],"_integrity":"","_npmVersion":"6.14.13","description":"This blueprint creates a serverless Tiny URL Java Web Application using AWS Lambda, Amazon S3, Amazon API Gateway and Amazon DynamoDB. This project also includes canary tests using Cloudwatch Synthetics.","directories":{},"displayName":"AWS Serverless Tiny URL Application in Java","resolutions":{"projen":"0.71.112"},"_nodeVersion":"18.18.0","dependencies":{"pino":"^6.13.4","projen":"0.71.112","globule":"*","@amazon-codecatalyst/blueprints.blueprint":"*","@amazon-codecatalyst/blueprint-component.workflows":"*","@amazon-codecatalyst/blueprint-component.environments":"*","@amazon-codecatalyst/blueprint-component.dev-environments":"*","@amazon-codecatalyst/blueprint-component.source-repositories":"*"},"_hasShrinkwrap":false,"devDependencies":{"jest":"*","eslint":"^8","projen":"0.71.112","ts-jest":"*","ts-node":"^10","jest-junit":"^15","typescript":"^4.x","@types/jest":"*","@types/node":"^18","@types/pino":"^6.3.12","pino-pretty":"^4.8.0","standard-version":"^9","npm-check-updates":"^16","eslint-plugin-import":"*","@typescript-eslint/parser":"^5","eslint-import-resolver-node":"*","@typescript-eslint/eslint-plugin":"^5","eslint-import-resolver-typescript":"*","@amazon-codecatalyst/blueprint-util.cli":"*","@amazon-codecatalyst/blueprint-util.projen-blueprint":"*"},"publishingSpace":"blueprints","peerDependencies":{"@amazon-codecatalyst/blueprint-util.cli":"*"},"_npmOperationalInternal":{"tmp":"tmp/blueprints.serverless-tinyurl_0.3.0_1696479222055_0.43202424954345253","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-09-26T03:35:03.769Z","modified":"2025-05-22T22:08:30.644Z","0.0.0":"2023-09-26T03:35:04.070Z","0.3.0":"2023-10-05T04:13:42.560Z"},"author":{"name":"Amazon Web Services"},"license":"Apache-2.0","keywords":["api-gateway","cdk","cloudformation","cloudwatch-synthetics","dava","dynamodb","fullstack","lambda","s3","serverless","tiny-url application"],"description":"This blueprint creates a serverless Tiny URL Java Web Application using AWS Lambda, Amazon S3, Amazon API Gateway and Amazon DynamoDB. This project also includes canary tests using Cloudwatch Synthetics.","maintainers":[{"email":"cindyzczhao@gmail.com","name":"cindyzhao"},{"email":"codecatalyst-blueprints-npm-bot@amazon.com","name":"codecatalyst-blueprints-npm-bot"}],"readme":"## About this blueprint:\n\nThis blueprint builds a functional tiny URL single-page application with a serverless backend and deploys it into a given AWS account. The repository\ngenerated by this blueprint will contain both projects and the CDK stacks that are used to deploy both the frontend and backend.\n\n## Architecture overview:\n\nThe application architecture uses Amazon CloudFront, AWS Lambda, Amazon API Gateway, Amazon DynamoDB, and Amazon S3.\n\n- [AWS API Gateway](https://aws.amazon.com/api-gateway) to provide the REST interface to the user\n- [Amazon DynamoDB](https://aws.amazon.com/dynamodb) for URL persistence\n- [AWS Lambda](https://aws.amazon.com/lambda) process the API gateway requests for create and retrieve the data from DynamoDB table\n- [Amazon CloudFront](https://aws.amazon.com/cloudfront/) to provide a unified endpoint with origins for both frontend and backend\n- [Amazon S3](https://aws.amazon.com/s3/) to store the frontend resources and served through CloudFront\n\nThe frontend application framework uses ReactJS with TypeScript and uses [CloudScape](https://cloudscape.design/) for the user interface.\n\nThe build pipeline runs unit and integration tests on the frontend and backend, and produces testing reports. Failed tests will stop the artifacts\nfrom publishing. The frontend code is compiled and optimized for production deployment.\n\nThe Amazon CloudFront CDN is used to pull both the frontend and backend together under a single logical internet-accessible domain under the AWS\naccount that is connected. Cloudfront provides HTTPS support for the domain as well as forward caching for the front-end.\n\n![Architecture Diagram](https://d2h15d5br6fxcw.cloudfront.net/aws-serverless-tinyurl-architecture.png)\n\n## Configuring the account connection\n\nAn AWS account connection is required before deploying this project. An IAM role with below policy statement is required for the blueprint to deploy\nsuccessfully.\n\nIn order to deploy the application successfully, the account should be CDK bootstrapped. Please refer\n[AWS doc on CDK bootstrap](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html) for bootstrapping the account. The account should be\nbootstrapped in the region where the application needs to be deployed.\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:PassRole\",\n                \"iam:DeleteRole\",\n                \"iam:GetRole\",\n                \"iam:TagRole\",\n                \"iam:CreateRole\",\n                \"iam:AttachRolePolicy\",\n                \"iam:DetachRolePolicy\",\n                \"iam:DeleteRolePolicy\",\n                \"iam:PutRolePolicy\",\n                \"s3:*\",\n                \"cloudformation:*\",\n                \"lambda:*\",\n                \"apigateway:*\",\n                \"ssm:*\",\n                \"ecr:SetRepositoryPolicy\",\n                \"ecr:GetLifecyclePolicy\",\n                \"ecr:PutImageScanningConfiguration\",\n                \"ecr:DescribeRepositories\",\n                \"ecr:PutImageTagMutability\",\n                \"ecr:ListTagsForResource\",\n                \"ecr:CreateRepository\",\n                \"ecr:DeleteRepository\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"sts:AssumeRole\"\n            ],\n            \"Resource\": [\n                \"arn:aws:iam::*:role/cdk-*\"\n            ]\n        }\n    ]\n}\n```\n\n_Note: If you add more resources, you will need to update the policy_\n\nIAM role also requires below trust policy.\n\n```\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n      {\n          \"Sid\": \"CodeCatalyst\",\n          \"Effect\": \"Allow\",\n          \"Principal\": {\n              \"Service\": [\n                  \"codecatalyst-runner.amazonaws.com\",\n                  \"codecatalyst.amazonaws.com\"\n              ]\n          },\n          \"Action\": \"sts:AssumeRole\"\n      }\n  ]\n}\n\n```\n\n## Project resources\n\nThis blueprint will create the Amazon CodeCatalyst Resources and along with a source code Repository for the project. The project contains below\nmodules / files\n\n- `.codecatalyst/workflows/build-and-release.yaml`: The template that defines the project's workflow\n\n- `backend`\n\n  - `cdk`: Java maven module for creating the Application.\n\n  - `lambda`: Java maven module for the Lambda function used by the Application to create tiny URL and retrieve long URL.\n\n  - `pom.xml`: Maven configuration for dependency management, plugin management, build and packaging\n\n  - `cdk.json`: To execute the CDK code\n\n- `frontend`\n\n  - `canary`: Canary test script\n\n  - `cdk` : Typescript package to code the frontend infrastructure\n\n  - `src`: React components using to power the frontend\n\n  - `public`: static html resources\n\n## Additional resources\n\nSee the Amazon CodeCatalyst user guide for additional information on using the features and resources of Amazon CodeCatalyst\n","readmeFilename":"README.md"}