forked from awslabs/aws-api-gateway-developer-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
64 lines (62 loc) · 6.78 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
"name": "aws-serverless-dev-portal-example",
"version": "1.0.0",
"description": "Example application for running a Serverless Developer Portal with API Gateway and Lambda",
"main": "lambda.js",
"config": {
"artifactsS3Bucket": "YOUR_ARTIFACTS_BUCKET_NAME",
"siteS3Bucket": "YOUR_CLIENT_BUCKET_NAME",
"accountId": "YOUR_ACCOUNT_ID",
"primaryAwsRegion": "YOUR_PRIMARY_AWS_REGION",
"cloudFormationStackName": "YOUR_CLOUDFORMATION_STACK_NAME",
"apiGatewayApiName": "YOUR_API_GATEWAY_API_NAME",
"customersTableName": "DevPortalCustomers",
"identityPoolName": "DevPortal",
"apiGatewayApiId": "YOUR_API_GATEWAY_API_ID",
"cognitoRegion": "YOUR_COGNITO_REGION",
"cognitoUserPoolId": "YOUR_COGNITO_USER_POOL_ID",
"cognitoClientId": "YOUR_COGNITO_CLIENT_ID",
"cognitoIdentityPoolId": "YOUR_COGNITO_IDENTITY_POOL_ID",
"listenerLambdaFunctionName": "DevPortalSubscriptionListener",
"marketplaceSubscriptionTopic": "arn:aws:sns:us-east-1:287250355862:aws-mp-subscription-notification-PRODUCT_CODE"
},
"scripts": {
"pre-config": "node scripts/pre-configure.js",
"post-config": "node scripts/post-configure.js",
"deconfig": "node -e \"require('./scripts/deconfigure.js')()\"",
"package": "npm run lambdas-npm-install && aws cloudformation package --template cloudformation/base.yaml --s3-bucket $npm_package_config_artifactsS3Bucket --output-template packaged-sam.yaml --region $npm_package_config_primaryAwsRegion",
"deploy": "aws cloudformation deploy --template-file packaged-sam.yaml --stack-name $npm_package_config_cloudFormationStackName --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM --parameter-overrides ArtifactsS3Bucket=$npm_package_config_artifactsS3Bucket DevPortalSiteS3Bucket=$npm_package_config_siteS3Bucket MarketplaceSubscriptionTopic=$npm_package_config_marketplaceSubscriptionTopic CognitoIdentityPoolName=\"$npm_package_config_identityPoolName\" DevPortalCustomersTableName=$npm_package_config_customersTableName --region $npm_package_config_primaryAwsRegion",
"package-deploy": "npm run package && npm run deploy",
"create-artifacts-bucket": "aws s3api get-bucket-location --bucket $npm_package_config_artifactsS3Bucket --region $npm_package_config_primaryAwsRegion || aws s3 mb s3://$npm_package_config_artifactsS3Bucket --region $npm_package_config_primaryAwsRegion",
"delete-artifacts-bucket": "aws s3 rb s3://$npm_package_config_artifactsS3Bucket --region $npm_package_config_primaryAwsRegion --force",
"delete-app-bucket": "aws s3 rb s3://$npm_package_config_siteS3Bucket --region $npm_package_config_primaryAwsRegion --force",
"upload-site": "cd ./dev-portal && npm run build && aws s3 sync ./build s3://$npm_package_config_siteS3Bucket --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --region $npm_package_config_primaryAwsRegion && cd ..",
"delete-stack": "aws cloudformation delete-stack --stack-name $npm_package_config_cloudFormationStackName --region $npm_package_config_primaryAwsRegion",
"lambdas-npm-install": "cd lambdas/backend && npm uninstall common-lambda-assets && npm install && cd ../listener && npm uninstall common-lambda-assets && npm install && cd ../cognito-cloudformation-custom-resource && npm install && cd ../..",
"subscribe-listener": "aws sns subscribe --topic-arn $npm_package_config_marketplaceSubscriptionTopic --protocol lambda --notification-endpoint arn:aws:lambda:$npm_package_config_primaryAwsRegion:$npm_package_config_accountId:function:$npm_package_config_listenerLambdaFunctionName --region us-east-1",
"setup": "npm install && npm run pre-config && npm run create-artifacts-bucket && npm run lambdas-npm-install && npm run package-deploy && npm run post-setup",
"post-setup": "npm run post-config && cd dev-portal && npm install && npm run upload-site && npm home",
"win-pre-config": "node scripts/pre-configure.js",
"win-post-config": "node scripts/post-configure.js",
"win-deconfig": "node -e \"require('./scripts/deconfigure.js')()\"",
"win-package": "npm run win-lambdas-npm-install && aws cloudformation package --template cloudformation/base.yaml --s3-bucket %npm_package_config_artifactsS3Bucket% --output-template packaged-sam.yaml --region %npm_package_config_primaryAwsRegion%",
"win-deploy": "aws cloudformation deploy --template-file packaged-sam.yaml --stack-name %npm_package_config_cloudFormationStackName% --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM --parameter-overrides ArtifactsS3Bucket=%npm_package_config_artifactsS3Bucket% DevPortalSiteS3Bucket=%npm_package_config_siteS3Bucket% MarketplaceSubscriptionTopic=%npm_package_config_marketplaceSubscriptionTopic% CognitoIdentityPoolName=\"%npm_package_config_identityPoolName%\" DevPortalCustomersTableName=%npm_package_config_customersTableName% --region %npm_package_config_primaryAwsRegion%",
"win-package-deploy": "npm run win-package && npm run win-deploy",
"win-create-artifacts-bucket": "aws s3api get-bucket-location --bucket %npm_package_config_artifactsS3Bucket% --region %npm_package_config_primaryAwsRegion% || aws s3 mb s3://%npm_package_config_artifactsS3Bucket% --region %npm_package_config_primaryAwsRegion%",
"win-delete-artifacts-bucket": "aws s3 rb s3://%npm_package_config_artifactsS3Bucket% --region %npm_package_config_primaryAwsRegion% --force",
"win-delete-app-bucket": "aws s3 rb s3://%npm_package_config_siteS3Bucket% --region %npm_package_config_primaryAwsRegion% --force",
"win-upload-site": "cd ./dev-portal && npm run build && aws s3 sync ./build s3://%npm_package_config_siteS3Bucket% --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --region %npm_package_config_primaryAwsRegion% && cd ..",
"win-delete-stack": "aws cloudformation delete-stack --stack-name %npm_package_config_cloudFormationStackName% --region %npm_package_config_primaryAwsRegion%",
"win-lambdas-npm-install": "cd lambdas/backend && npm uninstall common-lambda-assets && npm install && cd ../listener && npm uninstall common-lambda-assets && npm install && cd ../cognito-cloudformation-custom-resource && npm install && cd ../..",
"win-subscribe-listener": "aws sns subscribe --topic-arn %npm_package_config_marketplaceSubscriptionTopic% --protocol lambda --notification-endpoint arn:aws:lambda:%npm_package_config_primaryAwsRegion%:%npm_package_config_accountId%:function:%npm_package_config_listenerLambdaFunctionName% --region us-east-1",
"win-setup": "npm install && npm run win-pre-config && npm run win-create-artifacts-bucket && npm run win-lambdas-npm-install && npm run win-package-deploy && npm run win-post-setup",
"win-post-setup": "npm run win-post-config && cd dev-portal && npm install && npm run win-upload-site && npm home"
},
"license": "Apache-2.0",
"dependencies": {
"aws-sdk": "^2.7.10"
},
"devDependencies": {
"inquirer": "^1.2.1"
}
}