Skip to content

Commit

Permalink
Version 5.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Leaverton committed Oct 21, 2020
1 parent 1f36556 commit a842d1f
Show file tree
Hide file tree
Showing 67 changed files with 5,182 additions and 1,409 deletions.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
**/.nyc_output
**/global-s3-assets
**/regional-s3-assets
**/npm-debug.log
**/npm-debug.log

#cdk related files
*cdk.out*
*.d.ts
source/bin/*.js
source/lib/*.js
source/test/*.js
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.3.3] - 2020-09-16
### Added
- Modified the solution to utilize cdk solution constructs.

### Fixed
- UUID Depenency changes

## [5.3.2] - 2020-01-21
### Fixed
- SQS KMS key
Expand Down
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWS Limit Monitor Solution

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License Version 2.0 (the "License"). You may not use this file except
in compliance with the License. A copy of the License is located at http://www.apache.org/licenses/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
Expand Down
112 changes: 48 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The AWS Limit Monitor Solution is a reference implementation that provides a foundation for monitoring AWS service limits. Customers can leverage the solution to monitor limits across services supported by Amazon Trusted Advisor; in multiple regions and multiple AWS accounts. The solution integrates with Amazon SNS and Slack to notify customers for service limits approaching thresholds.

## Getting Started
To get started with the AWS Limit Monitor Solution, please review the solution documentation. https://aws.amazon.com/answers/account-management/limit-monitor/
To get started with the AWS Limit Monitor Solution, please review the solution documentation. [Documentation](https://aws.amazon.com/solutions/implementations/limit-monitor/)

## Running unit tests for customization
* Clone the repository, then make the desired code changes
Expand All @@ -18,13 +18,15 @@ chmod +x ./run-unit-tests.sh \n
```
export TEMPLATE_OUTPUT_BUCKET=my-bucket-name # bucket where cfn template will reside
export DIST_OUTPUT_BUCKET=my-bucket-name # bucket where customized code will reside
export SOLUTION_NAME=aws-limit-monitor # Solution name
export SOLUTION_VERSION=v5.3.3 # Solution version
```
_Note:_ You would have to create 2 buckets, one with prefix 'my-bucket-name' and another regional bucket with prefix 'my-bucket-name-<aws_region>'; aws_region is where you are testing the customized solution. Also, the assets in bucket should be publicly accessible

* Now build the distributable:
```
chmod +x ./build-s3-dist.sh \n
./build-s3-dist.sh $DIST_OUTPUT_BUCKET $TEMPLATE_OUTPUT_BUCKET \n
./build-s3-dist.sh $DIST_OUTPUT_BUCKET $SOLUTION_NAME $SOLUTION_VERSION $TEMPLATE_OUTPUT_BUCKET \n
```

* Deploy the distributable to an Amazon S3 bucket in your account. _Note:_ you must have the AWS Command Line Interface installed.
Expand All @@ -42,73 +44,55 @@ The AWS Limit Monitor Solution project consists of 4 microservices which is depl

```
|-source/
|-services/
|-customhelper/ [ microservice for handling cloudformation custom resources ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-logger.js [logger module]
|-metrics-helper.js [ helper module for sending anonymous metrics ]
|-index.js [ injection point for microservice ]
|-package.json
|-limitreport/ [ microservice for summarizing service limits ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-limit-report.js [message handling module]
|-logger.js [logger module]
|-metrics-helper.js [ helper module for sending anonymous metrics ]
|-index.js [ injection point for microservice ]
|-package.json
|-slacknotify/ [ microservice for sending slack notifications ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-logger.js [logger module]
|-slack-notify.js [slack messaging module]
|-index.js [ injection point for microservice ]
|-package.json
|-tarefresh/ [ microservice for refreshing TA checks ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-logger.js [logger module]
|-ta-refresh.js [TA checks module]
|-index.js [ injection point for microservice ]
|-package.json
```
***

#### v5.0 changes

```bash
* Hub and Spoke model to support multiple accounts
* Service level granularity with Trusted Advisor service limit checks
* DynamoDB for storing current limit usage and details
* Slack workspace integration for notifications
```

#### v5.1.1 changes

```bash
* SlackHookURLKey and SlackChannelKey parameters added to primary template for slack workspace
* Slack ssm parameters will be created with the provided keys ONLY if they do not exist already
* Regex pattern matching for account id, allowing only 12 digit, coma separated and double quoted ids
* Fix in concurrent CW Event Bus put permission (PR #18)
```
#### v5.2 changes
```bash
* Added Trusted Advisor service limit checks for Route53 and DynamoDB
* Fixed mapping between DynamoDB attributes and TA keys
* Fixed incorrect attribute mappings
|-bin
|-lambda
|-services/
|-customhelper/ [ microservice for handling cloudformation custom resources ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-logger.js [logger module]
|-metrics-helper.js [ helper module for sending anonymous metrics ]
|-index.js [ injection point for microservice ]
|-package.json
|-limitreport/ [ microservice for summarizing service limits ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-limit-report.js [message handling module]
|-logger.js [logger module]
|-metrics-helper.js [ helper module for sending anonymous metrics ]
|-index.js [ injection point for microservice ]
|-package.json
|-slacknotify/ [ microservice for sending slack notifications ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-logger.js [logger module]
|-slack-notify.js [slack messaging module]
|-index.js [ injection point for microservice ]
|-package.json
|-tarefresh/ [ microservice for refreshing TA checks ]
|-lib/
|-[ service module unit tests ]
|-index.js [main module]
|-logger.js [logger module]
|-ta-refresh.js [TA checks module]
|-index.js [ injection point for microservice ]
|-package.json
|-test
|-lib
|-cdk.json
|-jest.config.js
|-package.json
|-README.md
|-tsconfig.json
```

***
***

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
Expand Down
136 changes: 136 additions & 0 deletions deployment/build-open-source-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/bin/bash
#
# This script packages your project into an open-source solution distributable
# that can be published to sites like GitHub.
#
# Important notes and prereq's:
# 1. The initialize-repo.sh script must have been run in order for this script to
# function properly.
# 2. This script should be run from the repo's /deployment folder.
#
# This script will perform the following tasks:
# 1. Remove any old dist files from previous runs.
# 2. Package the GitHub contribution and pull request templates (typically
# found in the /.github folder).
# 3. Package the /source folder along with the necessary root-level
# open-source artifacts (i.e. CHANGELOG, etc.).
# 4. Remove any unecessary artifacts from the /open-source folder (i.e.
# node_modules, package-lock.json, etc.).
# 5. Zip up the /open-source folder and create the distributable.
# 6. Remove any temporary files used for staging.
#
# Parameters:
# - solution-name: name of the solution for consistency

# Check to see if the required parameters have been provided:
if [ -z "$1" ]; then
echo "Please provide the trademark approved solution name for the open source package."
echo "For example: ./build-open-source-dist.sh trademarked-solution-name"
exit 1
fi

# Get reference for all important folders
source_template_dir="$PWD"
dist_dir="$source_template_dir/open-source"
source_dir="$source_template_dir/../source"
github_dir="$source_template_dir/../.github"
dist_deployment_dir="$dist_dir/deployment"

echo "------------------------------------------------------------------------------"
echo "[Init] Remove any old dist files from previous runs"
echo "------------------------------------------------------------------------------"

echo "rm -rf $dist_dir"
rm -rf $dist_dir
echo "mkdir -p $dist_dir"
mkdir -p $dist_dir

echo "------------------------------------------------------------------------------"
echo "Copying deployment folder"
echo "------------------------------------------------------------------------------"
echo "rm -rf $dist_deployment_dir"
rm -rf $dist_deployment_dir
echo "mkdir -p $dist_deployment_dir"
mkdir -p $dist_deployment_dir

cp $source_template_dir/build-s3-dist.sh $dist_deployment_dir/
cp $source_template_dir/build-open-source-dist.sh $dist_deployment_dir/
cp $source_template_dir/run-unit-tests.sh $dist_deployment_dir/

echo "------------------------------------------------------------------------------"
echo "[Packing] GitHub templates"
echo "------------------------------------------------------------------------------"

echo "cp -r $github_dir $dist_dir"
cp -r $github_dir $dist_dir

echo "------------------------------------------------------------------------------"
echo "[Packing] Source folder"
echo "------------------------------------------------------------------------------"

echo "cp -r $source_dir $dist_dir"
cp -r $source_dir $dist_dir

echo "------------------------------------------------------------------------------"
echo "[Packing] Files from the root level of the project"
echo "------------------------------------------------------------------------------"

echo "cp $source_template_dir/../LICENSE.txt $dist_dir"
cp $source_template_dir/../LICENSE.txt $dist_dir

echo "cp $source_template_dir/../NOTICE.txt $dist_dir"
cp $source_template_dir/../NOTICE.txt $dist_dir

echo "cp $source_template_dir/../README.md $dist_dir"
cp $source_template_dir/../README.md $dist_dir

echo "cp $source_template_dir/../CODE_OF_CONDUCT.md $dist_dir"
cp $source_template_dir/../CODE_OF_CONDUCT.md $dist_dir

echo "cp $source_template_dir/../CONTRIBUTING.md $dist_dir"
cp $source_template_dir/../CONTRIBUTING.md $dist_dir

echo "cp $source_template_dir/../CHANGELOG.md $dist_dir"
cp $source_template_dir/../CHANGELOG.md $dist_dir

echo "cp $source_template_dir/../.gitignore $dist_dir"
cp $source_template_dir/../.gitignore $dist_dir

echo "------------------------------------------------------------------------------"
echo "[Packing] Clean up the open-source distributable"
echo "------------------------------------------------------------------------------"
echo $dist_dir
# General cleanup of node_modules and package-lock.json files
echo "find $dist_dir -iname "node_modules" -type d -exec rm -rf "{}" \; 2> /dev/null"
find $dist_dir -iname "node_modules" -type d -exec rm -rf "{}" \; 2> /dev/null
echo "find $dist_dir -iname "package-lock.json" -type f -exec rm -f "{}" \; 2> /dev/null"
find $dist_dir -iname "package-lock.json" -type f -exec rm -f "{}" \; 2> /dev/null
echo "find $dist_dir -iname ".nyc_output" -type d -exec rm -rf "{}" \; 2> /dev/null"
find $dist_dir -iname ".nyc_output" -type d -exec rm -rf "{}" \; 2> /dev/null
echo "find $dist_dir -iname "cdk.out" -type d -exec rm -rf "{}" \; 2> /dev/null"
find $dist_dir -iname "cdk.out" -type d -exec rm -rf "{}" \; 2> /dev/null
echo "find $dist_dir -iname "dist" -type d -exec rm -rf "{}" \; 2> /dev/null"
find $dist_dir -iname "dist" -type d -exec rm -rf "{}" \; 2> /dev/null
echo "find $dist_dir -iname "coverage" -type d -exec rm -rf "{}" \; 2> /dev/null"
find $dist_dir -iname "coverage" -type d -exec rm -rf "{}" \; 2> /dev/null

echo "------------------------------------------------------------------------------"
echo "[Packing] Create GitHub (open-source) zip file"
echo "------------------------------------------------------------------------------"

# Create the zip file
echo "cd $dist_dir"
cd $dist_dir
echo "zip -q -r9 ../$1.zip ."
zip -q -r9 ../$1.zip .

# Cleanup any temporary/unnecessary files
echo "Clean up open-source folder"
echo "rm -rf * .*"
rm -rf * .*

# Place final zip file in $dist_dir
echo "mv ../$1.zip ."
mv ../$1.zip .

echo "Completed building $1.zip dist"
Loading

0 comments on commit a842d1f

Please sign in to comment.