Created
December 27, 2018 08:38
-
-
Save Mulperi/9cea322077d5e4a82a6d3cf9ff61ea80 to your computer and use it in GitHub Desktop.
Simple npm scripts for CloudFormation deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "MyProject", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"config": { | |
"AWSS3BUCKET": "MyBucket", | |
"AWSPROFILE": "personal", | |
"AWSREGION": "eu-north-1", | |
"AWSSTACK": "MyStack" | |
}, | |
"scripts": { | |
"list-buckets": "aws s3 ls --profile $npm_package_config_AWSPROFILE", | |
"make-bucket": "aws s3 mb s3://$npm_package_config_AWSS3BUCKET --profile $npm_package_config_AWSPROFILE --region $npm_package_config_AWSREGION", | |
"remove-bucket": "aws s3 rb s3://$npm_package_config_AWSS3BUCKET --profile $npm_package_config_AWSPROFILE --region $npm_package_config_AWSREGION", | |
"delete-stack": "aws cloudformation delete-stack --stack-name $npm_package_config_AWSSTACK --profile $npm_package_config_AWSPROFILE --region $npm_package_config_AWSREGION", | |
"build": "zip -r lambda.zip package.json *.js node_modules", | |
"postbuild": "aws s3 cp lambda.zip s3://$npm_package_config_AWSS3BUCKET --profile $npm_package_config_AWSPROFILE --region $npm_package_config_AWSREGION", | |
"package": "aws cloudformation package --template-file template.yaml --output-template-file packaged-template.yaml --s3-bucket $npm_package_config_AWSS3BUCKET --profile $npm_package_config_AWSPROFILE", | |
"deploy": "aws cloudformation deploy --template-file packaged-template.yaml --stack-name $npm_package_config_AWSSTACK --profile $npm_package_config_AWSPROFILE --region $npm_package_config_AWSREGION --capabilities CAPABILITY_IAM --parameter-overrides BucketName=$npm_package_config_AWSS3BUCKET StackName=$npm_package_config_AWSSTACK CodeKey=lambda.zip", | |
"build-package-deploy": "npm run build && npm run package && npm run deploy", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"aws-serverless-express": "^3.3.5", | |
"body-parser": "^1.18.3", | |
"cors": "^2.8.5", | |
"express": "^4.16.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO: