├── MWAA ├── tests │ └── __init__.py ├── verify_env │ ├── __init__.py │ └── aws_clients.py ├── .gitignore └── LICENSE ├── EC2 ├── README.md ├── EnableIPv6 │ ├── .gitignore │ └── README.md ├── QuickInstanceEC2 │ └── DeployScripts │ │ ├── README.md │ │ └── tomcat7_ubuntu14.04_install.sh ├── NitroInstanceChecks │ └── Readme.md ├── AutomateDnsmasq │ ├── README.md │ └── AutomateDnsmasq.sh └── EC2EBSThroughput │ ├── Readme.md │ └── ebs-stats.sh ├── IoT └── README.md ├── S3 ├── README.md └── S3_Transfer_Acceleration │ ├── README.md │ └── Bash-script │ └── README.md ├── SES ├── README.md ├── SESReports │ ├── sesreport.zip │ ├── lambda-dep-package │ │ ├── template │ │ │ └── end_new.html │ │ └── node_modules │ │ │ └── https │ │ │ └── package.json │ └── LICENSE ├── CheckSESQuota │ ├── README.md │ └── check_ses_quota.py └── SESMailer │ └── README.md ├── SNS ├── README.md ├── SNSReflect │ ├── README.md │ ├── sns_event.json │ └── sns_reflect.py └── SNSFastPublish │ └── README.md ├── SQS └── README.md ├── .gitignore ├── EMR ├── README.md ├── Get_EMR_CLI_Export │ ├── aws-cli-export.png │ └── README.md └── Assign_Private_IP │ ├── README.md │ └── assign_private_ip.py ├── Cognito ├── README.md └── identity-pool-integrator-onelogin │ ├── LICENSE │ └── README.md ├── Glacier └── README.md ├── Snowball └── README.md ├── CloudFront └── README.md ├── CloudSearch └── README.md ├── DeviceFarm ├── README.md └── TestOutputDownloader │ ├── NOTICE.txt │ └── README.md ├── MobileHub └── README.md ├── MobileAnalytics └── README.md ├── StorageGateway └── README.md ├── EC2 Auto Scaling ├── README.md └── Multiple ENI Auto Scaling group │ └── README.md ├── ElasticTranscoder └── README.md ├── WAF └── WAF-Enhanced-Replicator │ ├── requirements.txt │ └── wafer ├── .vs └── ProjectSettings.json ├── Elasticsearch Service ├── README.md └── DeleteIndices │ ├── LICENSE │ └── README.md ├── Lambda ├── BuildLambdaLayers │ ├── python │ │ ├── requirements.txt │ │ ├── LICENSE.txt │ │ └── README.md │ ├── nodejs │ │ ├── requirements.txt │ │ ├── LICENSE.txt │ │ └── README.md │ ├── NOTICE │ ├── LICENSE.txt │ └── README.md ├── Functions │ ├── TagEC2Dependencies │ │ └── README.md │ ├── echo │ │ ├── README.md │ │ └── lambda_function.py │ ├── echo-api-lambda-proxy │ │ ├── README.md │ │ └── lambda_function.py │ ├── README.md │ └── AutoShutEC2 │ │ ├── README.md │ │ └── auto_shut_ec2.py ├── README.md ├── FindEniMappings │ ├── README.md │ └── LICENCE ├── CheckFunctionConcurrency │ └── README.md └── DeploymentPackages │ ├── lambda-user-data.txt │ └── global-lambda-amis.sh ├── OpsWorks └── sample-cookbooks │ └── cpulimit-ruby │ ├── files │ └── default │ │ └── cpulimit-master │ │ ├── tests │ │ ├── run_tests.sh │ │ ├── Makefile │ │ └── busy.c │ │ ├── Makefile │ │ └── src │ │ ├── memrchr.c │ │ ├── process_iterator.c │ │ ├── Makefile │ │ ├── process_group.h │ │ └── process_iterator.h │ ├── attributes │ └── default.rb │ ├── metadata.rb │ ├── templates │ └── default │ │ ├── cpulimit.sh.erb │ │ └── cpulimit.erb │ ├── chefignore │ ├── README.md │ └── recipes │ └── default.rb ├── README.md ├── DataPipeline ├── Readme.md ├── WriteToAnySchemaInRedshiftFromRds │ └── Readme.md ├── PostgresqlRdsToRedshift │ └── Readme.md └── MySqlRdsToPostgreSqlRds │ └── Readme.md ├── CloudFormation ├── README.md └── CloudFormer │ └── README.md ├── Systems Manager ├── SSMAgent-Toolkit-Windows │ ├── NOTICE │ ├── SSMAgent-Toolkit.zip │ ├── SSMAgent-Toolkit_EC2Output.png │ ├── SSMAgent-Toolkit_Flowchart.png │ ├── SSMAgent-Toolkit_HybridOutput.png │ └── SSMAgent-Toolkit │ │ ├── Private │ │ ├── New-PSObjectResponse.ps1 │ │ ├── Write-Log.ps1 │ │ ├── Test-RegistryValue.ps1 │ │ ├── New-ProxyOutput.ps1 │ │ ├── Get-AppVersionNumber.ps1 │ │ └── Invoke-CustomHTTPRequest.ps1 │ │ ├── Tests │ │ ├── New-MetadataToken.tests.ps1 │ │ ├── Get-InstanceID.tests.ps1 │ │ ├── README.md │ │ ├── Get-ServiceAvailability.tests.ps1 │ │ ├── Get-Region.tests.ps1 │ │ ├── Get-ServiceStatus.tests.ps1 │ │ ├── Get-WindowsImageState.tests.ps1 │ │ ├── Test-HybridRegistration.tests.ps1 │ │ ├── Get-MetadataAccess.tests.ps1 │ │ ├── Get-ServiceStartupMode.tests.ps1 │ │ ├── Get-AgentProxySettings.tests.ps1 │ │ ├── Get-ServiceAccount.tests.ps1 │ │ ├── Test-EndpointsNetworkAccess.tests.ps1 │ │ ├── Get-SystemWideProxy.tests.ps1 │ │ └── Test-IAMInstanceProfile.tests.ps1 │ │ ├── SSMAgent-Toolkit.psm1 │ │ └── Public │ │ ├── Get-ServiceStatus.ps1 │ │ ├── Get-ServiceAvailability.ps1 │ │ ├── Get-Region.ps1 │ │ ├── Get-InstanceID.ps1 │ │ ├── New-MetadataToken.ps1 │ │ ├── Get-ServiceAccount.ps1 │ │ ├── Get-AgentProxySettings.ps1 │ │ ├── Get-ServiceStartupMode.ps1 │ │ ├── Get-MetadataAccess.ps1 │ │ ├── Get-WindowsImageState.ps1 │ │ ├── Test-HybridRegistration.ps1 │ │ └── Get-SystemWideProxy.ps1 └── SSMAGENT-TOOLKIT-LINUX │ ├── NOTICE │ └── Readme.md ├── APIGateway ├── README.md └── Tools │ ├── README.md │ ├── curl_for_latency │ └── README.md │ └── vpc_link_lister │ └── README.md ├── DRS └── DRS-Settings-Tool │ ├── utils │ ├── str2bool.py │ ├── clients.py │ ├── obj_to_dict.py │ ├── logger.py │ └── delete_none.py │ ├── classes │ ├── source_server_info.py │ └── basic_launch_settings.py │ └── object_builders │ ├── source_server_info_obj_builder.py │ ├── drs_launch_settings_obj_builder.py │ ├── replication_settings_obj_builder.py │ └── launch_template_obj_builder.py ├── MGN └── Windows │ ├── Private │ ├── Set-PSObjectResponse.ps1 │ ├── Write-Log.ps1 │ ├── Set-ProxyOutput.ps1 │ ├── Test-RegistryValue.ps1 │ └── Test-TcpConnection.ps1 │ ├── MGN-Toolkit.psm1 │ ├── Public │ ├── Get-WMIServiceStatus.ps1 │ ├── Get-FreeRAM.ps1 │ ├── Get-Authenticationmethod.ps1 │ ├── Get-SCandNET.ps1 │ ├── Get-RootDiskSpace.ps1 │ ├── Get-BitLockerStatus.ps1 │ └── Get-ProxySetting.ps1 │ └── Tests │ ├── Test-EndpointsNetworkAccess.tests.ps1 │ └── Get-SystemWideProxy.tests.ps1 └── EBS └── VolumeLimitCalculator └── Readme.md /MWAA/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MWAA/verify_env/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /EC2/README.md: -------------------------------------------------------------------------------- 1 | # EC2 Support Tools -------------------------------------------------------------------------------- /IoT/README.md: -------------------------------------------------------------------------------- 1 | # IoT Support Tools -------------------------------------------------------------------------------- /S3/README.md: -------------------------------------------------------------------------------- 1 | # S3 Support Tools -------------------------------------------------------------------------------- /SES/README.md: -------------------------------------------------------------------------------- 1 | # SES Support Tools -------------------------------------------------------------------------------- /SNS/README.md: -------------------------------------------------------------------------------- 1 | # SNS Support Tools -------------------------------------------------------------------------------- /SQS/README.md: -------------------------------------------------------------------------------- 1 | # SQS Support Tools -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | -------------------------------------------------------------------------------- /EMR/README.md: -------------------------------------------------------------------------------- 1 | # EMR Support Tools 2 | -------------------------------------------------------------------------------- /Cognito/README.md: -------------------------------------------------------------------------------- 1 | # Cognito Support Tools -------------------------------------------------------------------------------- /Glacier/README.md: -------------------------------------------------------------------------------- 1 | # Glacier Support Tools -------------------------------------------------------------------------------- /Snowball/README.md: -------------------------------------------------------------------------------- 1 | # Snowball Support Tools -------------------------------------------------------------------------------- /CloudFront/README.md: -------------------------------------------------------------------------------- 1 | # CloudFront Support Tools -------------------------------------------------------------------------------- /CloudSearch/README.md: -------------------------------------------------------------------------------- 1 | # CloudSearch Support Tools -------------------------------------------------------------------------------- /DeviceFarm/README.md: -------------------------------------------------------------------------------- 1 | # Device Farm Support Tools -------------------------------------------------------------------------------- /EC2/EnableIPv6/.gitignore: -------------------------------------------------------------------------------- 1 | log-enableIPv6.log 2 | -------------------------------------------------------------------------------- /MobileHub/README.md: -------------------------------------------------------------------------------- 1 | # Mobile Hub Support Tools -------------------------------------------------------------------------------- /MobileAnalytics/README.md: -------------------------------------------------------------------------------- 1 | # Mobile Analytics Support Tools -------------------------------------------------------------------------------- /StorageGateway/README.md: -------------------------------------------------------------------------------- 1 | # Storage Gateway Support Tools -------------------------------------------------------------------------------- /EC2 Auto Scaling/README.md: -------------------------------------------------------------------------------- 1 | # EC2 Auto Scaling Support Tools 2 | -------------------------------------------------------------------------------- /ElasticTranscoder/README.md: -------------------------------------------------------------------------------- 1 | # Elastic Transcoder Support Tools -------------------------------------------------------------------------------- /WAF/WAF-Enhanced-Replicator/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3>=1.9.133 2 | -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /Elasticsearch Service/README.md: -------------------------------------------------------------------------------- 1 | Elasticssearch Support Tools 2 | -------------------------------------------------------------------------------- /Lambda/BuildLambdaLayers/python/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | boto3 -------------------------------------------------------------------------------- /Lambda/BuildLambdaLayers/nodejs/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3 2 | aws-xray-sdk 3 | -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/tests/run_tests.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aws-support-tools 2 | Tools and sample code provided by AWS Premium Support. 3 | -------------------------------------------------------------------------------- /DataPipeline/Readme.md: -------------------------------------------------------------------------------- 1 | Scripts and data pipeline definition examples for non-default templates. 2 | -------------------------------------------------------------------------------- /SES/SESReports/sesreport.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-support-tools/HEAD/SES/SESReports/sesreport.zip -------------------------------------------------------------------------------- /CloudFormation/README.md: -------------------------------------------------------------------------------- 1 | # CloudFormation 2 | 3 | See also https://github.com/awslabs/aws-cloudformation-templates/ 4 | -------------------------------------------------------------------------------- /Lambda/BuildLambdaLayers/NOTICE: -------------------------------------------------------------------------------- 1 | BuildLambdaLayers 2 | Copyright [2019]-[2019] Amazon.com, Inc. or its affiliates. All Rights Reserved. -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/NOTICE: -------------------------------------------------------------------------------- 1 | [SSMAGENT-TOOLKIT] 2 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -------------------------------------------------------------------------------- /EMR/Get_EMR_CLI_Export/aws-cli-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-support-tools/HEAD/EMR/Get_EMR_CLI_Export/aws-cli-export.png -------------------------------------------------------------------------------- /Systems Manager/SSMAGENT-TOOLKIT-LINUX/NOTICE: -------------------------------------------------------------------------------- 1 | [SSMAGENT-TOOLKIT-LINUX] 2 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -------------------------------------------------------------------------------- /MWAA/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | __pycache__ 3 | *.swp 4 | .DS_Store 5 | launch.json 6 | .idea 7 | .classpath 8 | .project 9 | .settings 10 | .pyc -------------------------------------------------------------------------------- /DeviceFarm/TestOutputDownloader/NOTICE.txt: -------------------------------------------------------------------------------- 1 | AWS Device Farm test output downloader tool/script 2 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /EC2/QuickInstanceEC2/DeployScripts/README.md: -------------------------------------------------------------------------------- 1 | Deployment Scripts 2 | ================== 3 | Various scripts for use with QuickInstanceEC2 tool to deploy applications. 4 | -------------------------------------------------------------------------------- /SES/SESReports/lambda-dep-package/template/end_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-support-tools/HEAD/Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit.zip -------------------------------------------------------------------------------- /Lambda/Functions/TagEC2Dependencies/README.md: -------------------------------------------------------------------------------- 1 | # Tag EC2 Dependencies 2 | 3 | A Lambda function to propagate the tags applied to an EC2 instance to the attached EBS volumes and ENIs when they are updated. -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit_EC2Output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-support-tools/HEAD/Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit_EC2Output.png -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit_Flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-support-tools/HEAD/Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit_Flowchart.png -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit_HybridOutput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-support-tools/HEAD/Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit_HybridOutput.png -------------------------------------------------------------------------------- /Lambda/README.md: -------------------------------------------------------------------------------- 1 | # Lambda 2 | 3 | *Support related content for AWS Lambda.* 4 | 5 | --- 6 | 7 | ## Directories 8 | 9 | | Name | Description | 10 | | :---: | --- | 11 | | **Functions** | *Functions for AWS Lambda.* | 12 | -------------------------------------------------------------------------------- /APIGateway/README.md: -------------------------------------------------------------------------------- 1 | # API Gateway 2 | 3 | *Support related content for AWS API Gateway.* 4 | 5 | --- 6 | 7 | ## Directories 8 | 9 | | Name | Description | 10 | | :---: | --- | 11 | | **Tools** | *Tools for AWS API Gateway.* | 12 | -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/utils/str2bool.py: -------------------------------------------------------------------------------- 1 | #Convert string of "true" or "false" to boolean 2 | def str2bool(string): 3 | if string.lower() in ('true'): 4 | return True 5 | elif string.lower() in ('false'): 6 | return False 7 | -------------------------------------------------------------------------------- /Lambda/Functions/echo/README.md: -------------------------------------------------------------------------------- 1 | # echo 2 | 3 | *Respond with the ingested event to echo back what is received.* 4 | 5 | --- 6 | 7 | This Function is perfect for debugging the request payload sent to Lambda. The Lambda event is returned as the response. -------------------------------------------------------------------------------- /SNS/SNSReflect/README.md: -------------------------------------------------------------------------------- 1 | SNS Reflect 2 | ----------- 3 | This lambda function will reflect back a SNS notification by publishing to another topic. This is useful if you'd like to receive SMS notification on cloudwatch alarms created in AWS regions that don't support SMS yet. -------------------------------------------------------------------------------- /SES/CheckSESQuota/README.md: -------------------------------------------------------------------------------- 1 | Check SES Quota 2 | =============== 3 | Checks AWS SES daily sending quota usage and notifies using AWS SNS if threshold of 80% has been reached. 4 | 5 | Make sure to configure Lambda environment variables e.g `REGION=us-east-1`, `ALERT_THRESHOLD=80`, `TOPIC=arn:aws:sns:us-east-1:1111122222:MyTopic` -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/classes/source_server_info.py: -------------------------------------------------------------------------------- 1 | class SourceServer(object): 2 | def __init__(self, sourceProperties=None, sourceServerID=None, stagingArea=None, **kwargs): 3 | self.sourceProperties = sourceProperties 4 | self.sourceServerID = sourceServerID 5 | self.stagingArea = stagingArea 6 | 7 | 8 | -------------------------------------------------------------------------------- /APIGateway/Tools/README.md: -------------------------------------------------------------------------------- 1 | # Tools 2 | 3 | *Tools for AWS API Gateway.* 4 | 5 | --- 6 | 7 | | Name | Description | 8 | | :---: | --- | 9 | | **curl_for_latency** | *Bash script for checking latency when communicating with API Gateway through CloudFront.* | 10 | | **vpc_link_lister** | *Python Lambda function to identify resources associated with VPCLink for REST API.* | 11 | -------------------------------------------------------------------------------- /S3/S3_Transfer_Acceleration/README.md: -------------------------------------------------------------------------------- 1 | # S3 Transfer Acceleration 2 | 3 | *Support related content for AWS S3 Transfer Acceleration.* 4 | 5 | --- 6 | 7 | ## Directories 8 | 9 | | Name | Description | 10 | | :---: | --- | 11 | | **Bash Script** | *It contains the Bash Script test-upload.sh and test-upload-macosx.sh to test upload speed to S3 Buckets via direct upload and via Transfer Acceleration.* | 12 | -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/object_builders/source_server_info_obj_builder.py: -------------------------------------------------------------------------------- 1 | from classes.source_server_info import SourceServer 2 | 3 | def source_server_info_obj_builder_for_csv(server): 4 | source_server_info_obj = SourceServer(**server) 5 | return source_server_info_obj 6 | 7 | def source_server_info_obj_builder(row): 8 | source_server_info_obj = SourceServer() 9 | source_server_info_obj.sourceServerID = row[1] 10 | return source_server_info_obj 11 | 12 | -------------------------------------------------------------------------------- /Lambda/Functions/echo-api-lambda-proxy/README.md: -------------------------------------------------------------------------------- 1 | # echo-api-lambda-proxy 2 | 3 | *Respond with the ingested event to echo back what is received. The response is formatted for Lambda Proxy Integration in API Gateway.* 4 | 5 | --- 6 | 7 | This Function is an example of how to respond back to a Lambda Proxy Integration request from API Gateway. By default, it will echo back the request payload (Lambda event object), but you can easily modify it to respond with a base64 encoded binary payload as well. -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/utils/clients.py: -------------------------------------------------------------------------------- 1 | import botocore 2 | import boto3 3 | 4 | class boto_client(object): 5 | client: botocore.client.BaseClient 6 | service: str 7 | region: str 8 | def __init__(self): 9 | self.client = boto3.client(self.service) 10 | 11 | class drs_client(boto_client): 12 | service = 'drs' 13 | 14 | class ec2_client(boto_client): 15 | service = 'ec2' 16 | 17 | class iam_client(boto_client): 18 | service = 'iam' 19 | 20 | class kms_client(boto_client): 21 | service = 'kms' 22 | -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/utils/obj_to_dict.py: -------------------------------------------------------------------------------- 1 | #Convert object to dict 2 | def obj_to_dict(obj): 3 | if not hasattr(obj,"__dict__"): 4 | return obj 5 | result = {} 6 | for key, val in obj.__dict__.items(): 7 | if key.startswith("_"): 8 | continue 9 | element = [] 10 | if isinstance(val, list): 11 | for item in val: 12 | element.append(obj_to_dict(item)) 13 | else: 14 | element = obj_to_dict(val) 15 | result[key] = element 16 | return result 17 | 18 | -------------------------------------------------------------------------------- /MGN/Windows/Private/Set-PSObjectResponse.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Create a standard object 4 | .Description 5 | This is a helper function to create a standard object for each check 6 | .Example 7 | Set-PSObjectResponse -Check "$check" -Status "$value" -Action "$Action" 8 | #> 9 | Function Set-PSObjectResponse { 10 | [CmdletBinding()] 11 | param ( 12 | [String]$Check, 13 | [String]$Status, 14 | [String]$Action 15 | ) 16 | return [PSCustomObject]@{ 17 | "Check" = $Check; 18 | "Value" = $Status; 19 | "Action" = $Action 20 | } 21 | } -------------------------------------------------------------------------------- /WAF/WAF-Enhanced-Replicator/wafer: -------------------------------------------------------------------------------- 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | #!/usr/bin/env python3 5 | 6 | # Modules Importing 7 | from __future__ import print_function 8 | import sys 9 | import waffun as function 10 | import wafget as get 11 | 12 | if __name__ == '__main__': 13 | 14 | function.header() 15 | 16 | returnValidation = function.validateArguments() 17 | 18 | if returnValidation[0] < 0: 19 | sys.exit(returnValidation[0]) 20 | else: 21 | get.getWaf(returnValidation) -------------------------------------------------------------------------------- /Lambda/BuildLambdaLayers/LICENSE.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # This file is licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. A copy of the 5 | # License is located at 6 | # 7 | # http://aws.amazon.com/apache2.0/ 8 | # 9 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 10 | # OF ANY KIND, either express or implied. See the License for the specific 11 | # language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /Lambda/Functions/README.md: -------------------------------------------------------------------------------- 1 | # Functions 2 | 3 | *Functions for AWS Lambda.* 4 | 5 | --- 6 | 7 | | Name | Runtime | Description | 8 | | :---: | :---: | --- | 9 | | **AutoShutEC2** | Python 2.7 | *This script will automatically shutdown running AWS EC2 instances if they are not tagged with the* `noshut` *keyword.* | 10 | | **echo** | Python 2.7 | *Respond with the ingested event to echo back what is received.* | 11 | | **echo-api-lambda-proxy** | Python 2.7 | *Respond with the ingested event to echo back what is received. The response is formatted for Lambda Proxy Integration in API Gateway.* | 12 | -------------------------------------------------------------------------------- /Lambda/BuildLambdaLayers/nodejs/LICENSE.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # This file is licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. A copy of the 5 | # License is located at 6 | # 7 | # http://aws.amazon.com/apache2.0/ 8 | # 9 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 10 | # OF ANY KIND, either express or implied. See the License for the specific 11 | # language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /Lambda/BuildLambdaLayers/python/LICENSE.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # This file is licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. A copy of the 5 | # License is located at 6 | # 7 | # http://aws.amazon.com/apache2.0/ 8 | # 9 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 10 | # OF ANY KIND, either express or implied. See the License for the specific 11 | # language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Private/New-PSObjectResponse.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Create a standard object 4 | .Description 5 | This is a helper function to create a standard object for each check 6 | .Example 7 | New-PSObjectResponse -Check "$check" -Status "$value" -Note "$note" 8 | #> 9 | Function New-PSObjectResponse { 10 | [CmdletBinding()] 11 | param ( 12 | [String]$Check, 13 | [String]$Status, 14 | [String]$Note 15 | ) 16 | return [PSCustomObject]@{ 17 | "Check" = $Check; 18 | "Value" = $Status; 19 | "Note" = $Note 20 | } 21 | } -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/utils/logger.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import sys 3 | import os 4 | 5 | path = os.path.dirname(__file__).replace('\\utils', '') 6 | 7 | 8 | def get_logger(name): 9 | log_format = '%(asctime)s %(name)8s %(levelname)5s %(message)s' 10 | logging.basicConfig(level=logging.NOTSET, 11 | format=log_format, 12 | filename=path + '\\DRS-Update-Tool.log', 13 | filemode='a') 14 | console = logging.StreamHandler(sys.stdout) 15 | console.setFormatter(logging.Formatter(log_format)) 16 | logging.getLogger(name).addHandler(console) 17 | return logging.getLogger(name) 18 | 19 | -------------------------------------------------------------------------------- /DRS/DRS-Settings-Tool/utils/delete_none.py: -------------------------------------------------------------------------------- 1 | ##Delete None values recursively from all of the dictionaries, tuples, lists, sets 2 | def delete_none(object): 3 | true = 'true' 4 | fales = 'false' 5 | null = None 6 | if isinstance(object, dict): 7 | for key, value in list(object.items()): 8 | if isinstance(value, (list, dict, tuple, set)): 9 | object[key] = delete_none(value) 10 | elif value in (None, '') or key in (None, ''): 11 | del object[key] 12 | 13 | elif isinstance(object, (list, set, tuple)): 14 | object = type(object)(delete_none(item) for item in object if item is not None) 15 | 16 | return object 17 | -------------------------------------------------------------------------------- /Lambda/FindEniMappings/README.md: -------------------------------------------------------------------------------- 1 | # Lambda ENI Finder 2 | 3 | This is a simple bash script that when given an ENI identifier and an AWS region will find if there are any Lambda functions currently using the specified ENI. 4 | 5 | Requirements: 6 | - The [jq library](https://stedolan.github.io/jq/) 7 | - The [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) 8 | - An IAM role configured with the AWS CLI that has permissions to query Lambda and EC2/VPC/ENIs 9 | 10 | Arguments: 11 | - `--eni` the id of the ENI to check, __required__ 12 | - `--region` the region to search lambda for, __required__ 13 | 14 | Usage: 15 | ```./findEniAssociations --eni eni-0123456789abcef01 --region us-east-1``` 16 | -------------------------------------------------------------------------------- /MGN/Windows/MGN-Toolkit.psm1: -------------------------------------------------------------------------------- 1 | # Get public and private function definition files. 2 | $Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue ) 3 | $Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue ) 4 | 5 | # Dot source the files 6 | Foreach ($import in @($Public + $Private )) { 7 | Try { 8 | . $import.FullName 9 | # Write-host "Importing $($import.FullName)" -ForegroundColor [YELLOW] 10 | Export-ModuleMember -Function $Public.Basename 11 | #Export-ModuleMember -Variable "script:defaultfilepath", "script:loglocation" 12 | } 13 | Catch { 14 | Write-Error -Message "Failed to import function $($import.fullname): $_" 15 | } 16 | } -------------------------------------------------------------------------------- /EBS/VolumeLimitCalculator/Readme.md: -------------------------------------------------------------------------------- 1 | You can use this script to calculate the maximum available IOPS and throughput for a given volume. 2 | 3 | ## General Requirements: 4 | 5 | - You need to install bc (an arbitrary precision calculator language) on your Linux machine. 6 | - You may use the following commands to install bc 7 | 8 | Ubuntu / Debian based machine: 9 | 10 | `apt-get install bc` 11 | 12 | Amazon Linux/ CentOS/ RHEL/ Fedora based machine: 13 | 14 | `yum install bc` 15 | 16 | 17 | ## Running the script 18 | 19 | - Place the script on your linux machine and make it executable 20 | 21 | `# chmod +x volume_Limit_Calculator.sh` 22 | 23 | - Run the script 24 | 25 | `# ./volume_Limit_Calculator.sh` 26 | 27 | ---------------------------------- 28 | -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 4 | # except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 9 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under the License. 11 | 12 | default: all 13 | 14 | .DEFAULT: 15 | cd src && $(MAKE) $@ 16 | cd tests && $(MAKE) $@ 17 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/New-MetadataToken.tests.ps1: -------------------------------------------------------------------------------- 1 | # Pester 2 | 3 | Describe "New-MetadataToken" { 4 | BeforeAll { 5 | Write-Host 'This test assume there is an access to the instance metadata.' -BackgroundColor Yellow -ForegroundColor Black 6 | } 7 | 8 | Context "Calling New-MetadataToken" { 9 | It 'When Metadata is reachable' { 10 | $output = New-MetadataToken 11 | 12 | $output[0] | Should -Be 200 13 | 14 | } 15 | 16 | It 'When Metadata is not reachable' { 17 | $output = New-MetadataToken -Uri "http://169.254.169.254/latest/apix/token" 18 | 19 | $output | Should -Be 0 20 | } 21 | } 22 | AfterAll { 23 | } 24 | } -------------------------------------------------------------------------------- /Lambda/Functions/AutoShutEC2/README.md: -------------------------------------------------------------------------------- 1 | Auto Shut EC2 2 | ============= 3 | This script will automatically shut down running AWS EC2 instances that are not tagged with the **noshut** keyword. Useful to ensure test instances don't continue running unintended. This can be deployed as an AWS Lambda function in your test AWS account and scheduled to run at specific time and frequency. The IAM role for Lambda function should allow the `ec2:StopInstances` and `ec2:DescribeInstances` actions. 4 | 5 | **Warning**: This script is intended to be used in test environments only where keeping EC2 instances running unintended for long periods of time is not desirable. This script will **STOP** all EC2 instances in all AWS regions if the EC2 instance is not tagged with the keyword **noshut**. Please use with care. 6 | -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/attributes/default.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 4 | # except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 9 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under the License. 11 | 12 | 13 | # Controls the integer percentage set as the 14 | # maximum CPU for Ruby. 15 | default['cpulimit']['cpu-limit'] = "20" 16 | -------------------------------------------------------------------------------- /APIGateway/Tools/curl_for_latency/README.md: -------------------------------------------------------------------------------- 1 | # curl_for_latency 2 | 3 | *Bash script for checking latency when communicating with API Gateway through CloudFront.* 4 | 5 | ---- 6 | 7 | This script will execute three (3) requests to the endpoint at two (2) second intervals. The results show the total time taken for the request and response, and the time for each step. Descriptions are included for what is occurring. 8 | 9 | ## Requirements 10 | 11 | * The script `curl_for_latency.sh` requires the following modifications. 12 | * Replace the `method` and `URL` in the curl command 13 | * *-X `GET` `"https://1234567890.execute-api.us-west-2.amazonaws.com/stage/resource?nocaching=$(uuidgen)"`* 14 | * Optional: Add custom headers by including them below the verbose option `-v` as `-H 'header-key:value'` -------------------------------------------------------------------------------- /CloudFormation/CloudFormer/README.md: -------------------------------------------------------------------------------- 1 | # CloudFormer Implementation for Existing VPCs 2 | 3 | This version of the [CloudFormer solution](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-cloudformer.html) can be used to launch the solution into an existing VPC. 4 | 5 | This version replaces the "VPCSelection" parameter with two new parameters "VpcId" and "SubnetId". 6 | 7 | [AWS-specific parameter types](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-specific-parameter-types) "AWS::EC2::VPC::Id" and "AWS::EC2::Subnet::Id" have been used to populate selections based on resources available in the account. The subnet selected MUST be a public subnet with an Internet Gateway. Selecting a private subnet that uses a NAT Gateway will not work. 8 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/SSMAgent-Toolkit.psm1: -------------------------------------------------------------------------------- 1 | # Get public and private function definition files. 2 | $Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue ) 3 | $Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue ) 4 | 5 | # Dot source the files 6 | Foreach ($import in @($Public + $Private )) { 7 | Try { 8 | . $import.FullName 9 | # Write-host "Importing $($import.FullName)" -ForegroundColor Yellow 10 | Export-ModuleMember -Function $Public.Basename 11 | #Export-ModuleMember -Variable "script:defaultfilepath", "script:loglocation" 12 | } 13 | Catch { 14 | Write-Error -Message "Failed to import function $($import.fullname): $_" 15 | } 16 | } -------------------------------------------------------------------------------- /Lambda/Functions/echo/lambda_function.py: -------------------------------------------------------------------------------- 1 | """Created by: Andrew R. DeFilippis""" 2 | 3 | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 6 | # except in compliance with the License. A copy of the License is located at 7 | # 8 | # http://aws.amazon.com/apache2.0/ 9 | # 10 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 11 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under the License. 13 | 14 | 15 | def lambda_handler(event, context): 16 | """Respond with the ingested event to echo back what is received. 17 | """ 18 | return event 19 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/Get-InstanceID.tests.ps1: -------------------------------------------------------------------------------- 1 | # Pester 2 | 3 | Describe "Get-InstanceID" { 4 | BeforeAll { 5 | Write-Host 'This test assume there is an access to the instance metadata.' -BackgroundColor Yellow -ForegroundColor Black 6 | } 7 | 8 | Context "Calling Get-InstanceID" { 9 | It 'When returning a valid value for Instance ID' { 10 | $metadatainfo = New-MetadataToken 11 | $output = Get-InstanceID -Token $metadatainfo[1] 12 | 13 | $output | Should -Match 'i-\b[0-9,a-z]{17}\b' 14 | } 15 | 16 | It 'When Metadata is not reachable' { 17 | $output = Get-InstanceID -Token "abcdef0123456789" 18 | 19 | $output | Should -Be $null 20 | } 21 | } 22 | AfterAll { 23 | } 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/README.md: -------------------------------------------------------------------------------- 1 | # SSM Agent Toolkit - Test 2 | 3 | This test is based on [Pester](https://github.com/pester/Pester). The test will go through invoking all the functions with different inputs to test all possible scenarios. 4 | 5 | ## Output 6 | 7 | Sample output in [Output.txt](https://github.com/awslabs/aws-support-tools/raw/master/Systems%20Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/Output.txt) 8 | 9 | ## Usage 10 | 11 | After downloading the ZIP file and extract for SSMAgent-Toolkit. Run the followings as administrator in PowerShell. 12 | 13 | ```powershell 14 | Import-Module .\SSMAgent-Toolkit.psm1;Invoke-SSMChecks 15 | Invoke-Pester -Output Detailed 16 | ``` 17 | 18 | ### Prerequisites 19 | 20 | Get the latest version of Pester 21 | 22 | ### Installing 23 | 24 | No installation is required on Windows systems. 25 | 26 | ## Authors 27 | 28 | * Ali Alzand -------------------------------------------------------------------------------- /Elasticsearch Service/DeleteIndices/LICENSE: -------------------------------------------------------------------------------- 1 | MIT No Attribution 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 10 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 11 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 12 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 13 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/metadata.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 4 | # except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 9 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under the License. 11 | 12 | name 'cpulimit-ruby' 13 | maintainer 'Nicholas Alteen' 14 | maintainer_email 'alteenn@amazon.com' 15 | license 'All Rights Reserved' 16 | description 'Installs/Configures cpulimit-ruby' 17 | long_description 'Installs/Configures cpulimit-ruby' 18 | version '0.1.0' 19 | chef_version '>= 12.1' if respond_to?(:chef_version) -------------------------------------------------------------------------------- /MWAA/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 10 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 11 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 12 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 13 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Private/Write-Log.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Write a log output 4 | .Description 5 | This is a helper function to write a log output 6 | .Example 7 | Write-Log -Message "info message" 8 | Write-Log -Message "Error message" -LogLevel "ERROR" 9 | .INPUTS 10 | Message = Message 11 | LogLevel = default as "INFO" 12 | .OUTPUTS 13 | Write-host the message with LogLevel and timestamp 14 | [2020-10-19T17:48:21.9656326-04:00] [INFO] amazonssmagent service is available. 15 | #> 16 | 17 | function Write-Log { 18 | [CmdletBinding()] 19 | param ( 20 | [Parameter(Mandatory = $true)] 21 | $Message, 22 | [ValidateSet('INFO', 'WARN', 'ERROR', 'DEBUG')] 23 | $LogLevel = 'INFO' 24 | ) 25 | 26 | $timestamp = Get-Date -Format o 27 | Write-Host "[$($timestamp)] [$($LogLevel)] $($Message) " 28 | 29 | } -------------------------------------------------------------------------------- /Lambda/FindEniMappings/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 10 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 11 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 12 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 13 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /Cognito/identity-pool-integrator-onelogin/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, 6 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 10 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 11 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 12 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 13 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /EC2 Auto Scaling/Multiple ENI Auto Scaling group/README.md: -------------------------------------------------------------------------------- 1 | The script lets you automatically attach a second elastic network interface (ENI) in a difference subnet than an instance's primary ENI when Amazon EC2 Auto Scaling launches a new instance. 2 | You can optionally have one of the ENI's in a public subnet and the other in a private subnet. The scripts also deletes ENIs attached to the instance when instances are being terminated to avoid exhausting private IP addresses in the subnet and reaching the ENI limit in your account. 3 | 4 | **This solution supports Warm pools and scale into Warm pools**. 5 | 6 | **Note:** The following resolution is for an Auto Scaling Group enabled in single or multiple Availability Zones, with two or more subnets in each enabled Availability Zone. Amazon EC2 does not allow multiple ENIs in different Availability Zones to be attached to the same instance simultaneously 7 | 8 | This script is for a lambda function which uses Python 3.8 for the Runtime. This script is triggered by a lifecycle hook in the auto scaling group 9 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/Get-ServiceAvailability.tests.ps1: -------------------------------------------------------------------------------- 1 | # Pester 2 | 3 | Describe "Get-ServiceAvailability" { 4 | BeforeAll { 5 | Write-Host 'This test assume the SSM Agent installed.' -BackgroundColor Yellow -ForegroundColor Black 6 | $Check = "Amazon SSM agent service running" 7 | } 8 | 9 | Context "Calling Get-ServiceAvailability" { 10 | It 'When Service exist' { 11 | $output = Get-ServiceAvailability -ServiceName "AmazonSSMAgent" 12 | 13 | $output[0] | Should -Be 1 14 | $output[1] | Should -Be "Running" 15 | } 16 | 17 | It 'When the service does not exist' { 18 | $output = Get-ServiceAvailability -ServiceName "AmazonSSMAgentx" 19 | 20 | $output.Check | Should -Be $Check 21 | $output.Value | Should -Be "Fail" 22 | $output.Note | Should -Be "Please make sure the SSM agent is installed" 23 | } 24 | } 25 | AfterAll { 26 | } 27 | } -------------------------------------------------------------------------------- /SES/SESReports/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 5 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/Get-Region.tests.ps1: -------------------------------------------------------------------------------- 1 | # Pester 2 | 3 | Describe "Get-Region" { 4 | BeforeAll { 5 | Write-Host 'This test assume there is an access to the instance metadata.' -BackgroundColor Yellow -ForegroundColor Black 6 | } 7 | 8 | Context "Calling Get-Region" { 9 | It 'When returning a valid value for the region' { 10 | $metadatainfo = New-MetadataToken 11 | $output = Get-Region -Token $metadatainfo[1] 12 | 13 | $output | Should -BeIn @("us-east-2","us-east-1","us-west-1","us-west-2","af-south-1","ap-east-1","ap-south-1","ap-northeast-3","ap-northeast-2","ap-southeast-1","ap-southeast-2","ap-northeast-1","ca-central-1","cn-north-1","cn-northwest-1","eu-central-1","eu-west-1","eu-west-2","eu-south-1","eu-west-3","eu-north-1","me-south-1","sa-east-1") 14 | } 15 | 16 | It 'When Metadata is not reachable' { 17 | $output = Get-Region -Token "abcdef0123456789" 18 | 19 | $output | Should -Be 0 20 | } 21 | } 22 | AfterAll { 23 | } 24 | } -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/templates/default/cpulimit.sh.erb: -------------------------------------------------------------------------------- 1 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 4 | # except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 9 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under the License. 11 | 12 | #!/bin/bash 13 | maxcpu="<%= node['cpulimit']['cpu-limit'] %>" 14 | 15 | while [ 1 ] 16 | do 17 | for pid in `ps axf | grep ruby | grep -v grep | awk '{print $1}'` 18 | do 19 | cpuutilization="$(ps -eo pid,%cpu | grep $pid | grep -v grep | awk '{print $2}')" 20 | 21 | if [ $cpuutilization > $maxcpu".0" ] 22 | then 23 | cpulimit="$(which cpulimit)" 24 | resp="$($cpulimit -l $maxcpu -p $pid)" 25 | fi 26 | done 27 | 28 | sleep 1 29 | done 30 | -------------------------------------------------------------------------------- /SNS/SNSReflect/sns_event.json: -------------------------------------------------------------------------------- 1 | { 2 | "Records": [ 3 | { 4 | "EventSource": "aws:sns", 5 | "EventVersion": "1.0", 6 | "EventSubscriptionArn": "arn:aws:sns:us-east-1::lambda_topic:", 7 | "Sns": { 8 | "Type": "Notification", 9 | "MessageId": "", 10 | "TopicArn": "arn:aws:sns:us-east-1::lambda_topic", 11 | "Subject": "TestInvoke", 12 | "Message": "", 13 | "Timestamp": "2015-04-02T07:36:57.451Z", 14 | "SignatureVersion": "1", 15 | "Signature": "r0Dc5YVHuAglGcmZ9Q7SpFb2PuRDFmJNprJlAEEk8CzSq9Btu8U7dxOu++uU", 16 | "SigningCertUrl": "http://sns.us-east-1.amazonaws.com/SimpleNotificationService-d6d679a1d18e95c2f9ffcf11f4f9e198.pem", 17 | "UnsubscribeUrl": "http://cloudcast.amazon.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1::example_topic:", 18 | "MessageAttributes": { 19 | "key": { 20 | "Type": "String", 21 | "Value": "value" 22 | } 23 | } 24 | } 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/memrchr.c: -------------------------------------------------------------------------------- 1 | /** 2 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 5 | # except in compliance with the License. A copy of the License is located at 6 | # 7 | # http://aws.amazon.com/apache2.0/ 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 10 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations under the License. 12 | */ 13 | 14 | #include 15 | 16 | /* 17 | * Reverse memchr() 18 | * Find the last occurrence of 'c' in the buffer 's' of size 'n'. 19 | */ 20 | void * 21 | memrchr(s, c, n) 22 | const void *s; 23 | int c; 24 | size_t n; 25 | { 26 | if (n != 0) { 27 | const unsigned char *cp; 28 | cp = (unsigned char *)s + n; 29 | do { 30 | if (*(--cp) == (unsigned char)c) 31 | return((void *)cp); 32 | } while (--n != 0); 33 | } 34 | return((void *)0); 35 | } 36 | -------------------------------------------------------------------------------- /Lambda/CheckFunctionConcurrency/README.md: -------------------------------------------------------------------------------- 1 | # Lambda - Check Function Concurrency 2 | 3 | This script will check the concurrency configuration for a given region in your AWS account. The Account Level Concurrent Execution Limit and Function Level Concurrent Execution Limits will be displayed. No changes to your account will be made. 4 | 5 | Setting the per function concurrency can impact the concurrency pool available to other functions, and this script is helpful to quickly determine which functions are making use of per function concurrency. 6 | 7 | For more information on managing Lambda concurrency, see https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html 8 | 9 | ## Requirements 10 | This script requires Python 3.6+ 11 | 12 | The following IAM permissions are required in your AWS Account: 13 | 14 | Lambda 15 | * GetAccountSettings 16 | * ListFunctions 17 | * GetFunction 18 | 19 | STS 20 | * getCallerIdentity 21 | 22 | ## Usage 23 | 24 | `python3 CheckFunctionConcurrency.py` 25 | 26 | This script will use the credentials configured with the AWS CLI if available. If not, it will ask for an AWS access key and secret key. 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/tests/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 4 | # except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 9 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under the License. 11 | 12 | CC?=gcc 13 | CFLAGS?=-Wall -g 14 | TARGETS=busy process_iterator_test 15 | SRC=../src 16 | SYSLIBS?=-lpthread 17 | LIBS=$(SRC)/list.o $(SRC)/process_iterator.o $(SRC)/process_group.o 18 | UNAME := $(shell uname) 19 | 20 | ifeq ($(UNAME), FreeBSD) 21 | LIBS+=-lkvm 22 | endif 23 | 24 | all:: $(TARGETS) 25 | 26 | busy: busy.c 27 | $(CC) -o busy busy.c $(SYSLIBS) $(CFLAGS) 28 | 29 | process_iterator_test: process_iterator_test.c $(LIBS) 30 | $(CC) -I$(SRC) -o process_iterator_test process_iterator_test.c $(LIBS) $(SYSLIBS) $(CFLAGS) 31 | 32 | clean: 33 | rm -f *~ *.o $(TARGETS) 34 | 35 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Tests/Get-ServiceStatus.tests.ps1: -------------------------------------------------------------------------------- 1 | # Pester 2 | 3 | Describe "Get-ServiceStatus" { 4 | BeforeAll { 5 | Write-Host 'This test assume the SSM Agent installed.' -BackgroundColor Yellow -ForegroundColor Black 6 | $ServiceName = "AmazonSSMAgent" 7 | $Check = "Amazon SSM agent service running" 8 | } 9 | 10 | Context "Calling Get-ServiceStatus" { 11 | It 'When AmazonSSMAgent service is Running' { 12 | $output = Get-ServiceStatus -ServiceName $ServiceName -ServiceStatus "Running" 13 | 14 | $output.Check | Should -Be $Check 15 | $output.Value | Should -Be "Pass" 16 | $output.Note | Should -Be "$ServiceName service is in Running state. This is the desired state" 17 | } 18 | 19 | It 'When AmazonSSMAgent service is not Running' { 20 | $output = Get-ServiceStatus -ServiceName $ServiceName -ServiceStatus "Stopped" 21 | 22 | $output.Check | Should -Be $Check 23 | $output.Value | Should -Be "Fail" 24 | $output.Note | Should -Be "Please make sure the $ServiceName service is in Running state" 25 | } 26 | } 27 | AfterAll { 28 | } 29 | } -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/tests/busy.c: -------------------------------------------------------------------------------- 1 | /** 2 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 5 | # except in compliance with the License. A copy of the License is located at 6 | # 7 | # http://aws.amazon.com/apache2.0/ 8 | # 9 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 10 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations under the License. 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | void *loop() 20 | { 21 | while(1); 22 | } 23 | 24 | int main(int argc, char **argv) { 25 | 26 | int i = 0; 27 | int num_threads = 1; 28 | if (argc == 2) num_threads = atoi(argv[1]); 29 | for (i=0; i 15 | #include 16 | #include 17 | #ifndef __APPLE__ 18 | #include 19 | #endif 20 | #include 21 | #include "process_iterator.h" 22 | 23 | //See this link to port to other systems: http://www.steve.org.uk/Reference/Unix/faq_8.html#SEC85 24 | 25 | #ifdef __linux__ 26 | 27 | #include "process_iterator_linux.c" 28 | 29 | #elif defined __FreeBSD__ 30 | 31 | #include "process_iterator_freebsd.c" 32 | 33 | #elif defined __APPLE__ 34 | 35 | #include "process_iterator_apple.c" 36 | 37 | #else 38 | 39 | #error Platform not supported 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Private/Test-RegistryValue.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Test registry value 4 | .Description 5 | This is a helper function to test registry value and whether if the key is available or not. 6 | .Example 7 | Test-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AmazonSSMAgent' -Value 'Environment' 8 | .INPUTS 9 | Path = The registry path 10 | Value = The key to check on that path 11 | .OUTPUTS 12 | Return $true if exist or $false if not 13 | #> 14 | function Test-RegistryValue { 15 | [CmdletBinding()] 16 | param ( 17 | [parameter(Mandatory = $true)] 18 | [ValidateNotNullOrEmpty()]$Path, 19 | [parameter(Mandatory = $true)] 20 | [ValidateNotNullOrEmpty()]$Value 21 | ) 22 | 23 | try { 24 | if (Get-ItemProperty -Path $Path | Select-Object -ExpandProperty $Value -ErrorAction SilentlyContinue) { 25 | return $true 26 | } 27 | else { 28 | Write-Log -Message "Registry key $Path\$Value does not exist" -LogLevel "INFO" 29 | return $false 30 | } 31 | 32 | } 33 | catch { 34 | Write-Log -Message "Failed..." -LogLevel "ERROR" 35 | Write-Log -Message $($PSitem) -LogLevel "ERROR" 36 | return $false 37 | } 38 | } -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Public/Get-ServiceStatus.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Check the if the the service running state. 4 | .Description 5 | This is a public function used to check the if the the service running state. 6 | .Example 7 | Get-ServiceStatus -ServiceStatus "Running" 8 | .INPUTS 9 | ServiceName 10 | ServiceStatus 11 | .OUTPUTS 12 | New-PSObjectResponse -Check "$check" -Status "$value" -Note "$note" 13 | #> 14 | Function Get-ServiceStatus { 15 | [CmdletBinding()] 16 | param ( 17 | [String]$ServiceName = "amazonssmagent", 18 | [String]$ServiceStatus 19 | ) 20 | 21 | $check = "Amazon SSM agent service running" 22 | Write-Log -Message "New check....." 23 | Write-Log -Message "$check" 24 | 25 | if ($ServiceStatus -ne "Running") { 26 | $value = "Fail" 27 | $note = "Please make sure the $ServiceName service is in Running state" 28 | Write-Log -Message "$ServiceName service is not in Running state" -LogLevel "ERROR" 29 | } 30 | else { 31 | $value = "Pass" 32 | $note = "$ServiceName service is in Running state. This is the desired state" 33 | Write-Log -Message $note 34 | } 35 | 36 | return New-PSObjectResponse -Check "$check" -Status "$value" -Note "$note" 37 | } -------------------------------------------------------------------------------- /EC2/NitroInstanceChecks/Readme.md: -------------------------------------------------------------------------------- 1 | You can use this script to do the pre-requisites checks before changing the instance type to Nitro. This script performs the following actions: 2 | 3 | - Verify if NVMe module is installed on your instance. If yes then it will verify if it is loaded in the intiramfs image. 4 | 5 | - Verify if ENA module is installed on your instance. 6 | 7 | - Analyses the “/etc/fstab” and look for the block devices being mounted using device names. It will give you a prompt to ask if you want to regenerate and modify your current “/etc/fstab” file to replace the device name of each partition with its UUID. The original fstab file will be saved as /etc/fstab.backup.$(date +%F-%H:%M:%S) for e.g /etc/fstab.backup.2018-05-01-22:06:05 8 | 9 | [WARNING: Provide "y" only if you want this script to rewrite the current "/etc/fstab" file. If you provide "n" or "No", it will just print the correct /etc/fstab file in the output but would not replace it] 10 | 11 | 12 | ------- Running the scrips ------- 13 | 14 | - Place the script on your instance and make it executable 15 | 16 | # chmod +x nitro_check_script.sh 17 | 18 | - Run the script as a "root" user or "sudo" otherwise it would fail with the following message "This script must be run as root" 19 | 20 | # sudo ./nitro_check_script.sh 21 | 22 | ---------------------------------- 23 | -------------------------------------------------------------------------------- /OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 4 | # except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 9 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under the License. 11 | 12 | CC?=gcc 13 | CFLAGS?=-Wall -g -D_GNU_SOURCE 14 | TARGETS=cpulimit 15 | LIBS=list.o process_iterator.o process_group.o 16 | 17 | UNAME := $(shell uname) 18 | 19 | ifeq ($(UNAME), FreeBSD) 20 | LIBS+=-lkvm 21 | endif 22 | 23 | all:: $(TARGETS) $(LIBS) 24 | 25 | cpulimit: cpulimit.c $(LIBS) 26 | $(CC) -o cpulimit cpulimit.c $(LIBS) $(CFLAGS) 27 | 28 | process_iterator.o: process_iterator.c process_iterator.h 29 | $(CC) -c process_iterator.c $(CFLAGS) 30 | 31 | list.o: list.c list.h 32 | $(CC) -c list.c $(CFLAGS) 33 | 34 | process_group.o: process_group.c process_group.h process_iterator.o list.o 35 | $(CC) -c process_group.c $(CFLAGS) 36 | 37 | clean: 38 | rm -f *~ *.o $(TARGETS) 39 | 40 | -------------------------------------------------------------------------------- /Systems Manager/SSMAgent-Toolkit-Windows/SSMAgent-Toolkit/Public/Get-ServiceAvailability.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Check the if the service is available under Windows Services. 4 | .Description 5 | This is a public function used to check the if the service is available under Windows Services. 6 | .Example 7 | Get-ServiceAvailability 8 | .INPUTS 9 | ServiceName 10 | .OUTPUTS 11 | New-PSObjectResponse -Check "$check" -Status "$value" -Note "$note" 12 | #> 13 | Function Get-ServiceAvailability { 14 | [CmdletBinding()] 15 | param ( 16 | [String]$ServiceName = "amazonssmagent" 17 | ) 18 | $check = "Amazon SSM agent service running" 19 | Write-Log -Message "New check....." 20 | Write-Log -Message "$check" 21 | 22 | Write-Log -Message "Checking if we can retrieve the service using Get-Service $ServiceName" 23 | $Service = Get-Service $ServiceName -ErrorAction SilentlyContinue 24 | 25 | if ($Service) { 26 | Write-Log -Message "$ServiceName service is available." 27 | return 1, $Service.Status 28 | } 29 | else { 30 | $value = "Fail" 31 | $note = "Please make sure the SSM agent is installed" 32 | Write-Log -Message "$ServiceName service is not available. Please make sure the SSM agent is installed." -LogLevel "ERROR" 33 | } 34 | return New-PSObjectResponse -Check "$check" -Status "$value" -Note "$note" 35 | } -------------------------------------------------------------------------------- /APIGateway/Tools/vpc_link_lister/README.md: -------------------------------------------------------------------------------- 1 | A Python Lambda function to iterate over the API Gateway REST API vpclinks and list the associated NLB and associated API/Resource/Method/Integration using the vpclink. 2 | 3 | To make sure Lambda Function is able to run successfully you would need to provide your function a minimum of following permissions 4 | 5 | ``` 6 | "Effect": "Allow", 7 | "Action": [ 8 | "apigateway:GET" 9 | ], 10 | "Resource": [ 11 | "arn:aws:apigateway:REGION::/restapis", 12 | "arn:aws:apigateway:REGION::/restapis/*", 13 | "arn:aws:apigateway:REGION::/vpclinks" 14 | ] 15 | ``` 16 | 17 | 18 | Output will look like following: 19 | ``` 20 | LISTING Resources attached to VPClINK ID mtc1oo 21 | Associated NLB is ['arn:aws:elasticloadbalancing:ap-southeast-2:xxxxxxxx:loadbalancer/net/NLBAPIGW/576527bf6f9b8c41'] 22 | LISTING FOR API = 5f8xxxxw42 23 | LISTING FOR API = 6g8xxxxcqi 24 | LISTING FOR API = 3grxxxxjvl 25 | API ID='3grxxxxjvl' Resource ID='gjg60r' Resource Path='/locations/{Id}/phonenumbers' HttpMethod='GET' ConnectionType='VPC_LINK' ConnectionId='mtc1oo' 26 | API ID='3grxxxxjvl' Resource ID='gjg60r' Resource Path='/locations/{Id}/phonenumbers' HttpMethod='POST' ConnectionType='VPC_LINK' ConnectionId='mtc1oo' 27 | API ID='3grxxxxjvl' Resource ID='h1o5b3' Resource Path='/locations/{Id}' HttpMethod='DELETE' ConnectionType='VPC_LINK'ConnectionId='mtc1oo' 28 | ``` 29 | -------------------------------------------------------------------------------- /EMR/Get_EMR_CLI_Export/README.md: -------------------------------------------------------------------------------- 1 | # Get EMR CLI Export # 2 | 3 | EMR provides AWS CLI export using the console. 4 | 5 | ![Image of AWS CLI export](./aws-cli-export.png) 6 | 7 | You will then get a single line of AWS CLI to create a cluster with the same settings. 8 | 9 | However, there is no API for command line tool. So this code is making AWS CLI for create-cluster programmatically. 10 | 11 | ## What this script does: 12 | 13 | - At first, it works parsing the parameters from “aws cli describe-cluster”. 14 | - And then it creates a parameter string to be appended after "aws cli create-cluster". 15 | - Example: 16 | ``` 17 | aws emr create-cluster --auto-scaling-role EMR_AutoScaling_DefaultRole \ 18 | --applications Name=Spark Name=Hadoop Name=Hive \ 19 | --ebs-root-volume-size 10 \ 20 | --ec2-attributes ... \ 21 | --service-role EMR_DefaultRole \ 22 | --release-label emr-5.25.0 \ 23 | --name 'test-emr-2019-08-04' \ 24 | --instance-groups ... \ 25 | --scale-down-behavior TERMINATE_AT_TASK_COMPLETION \ 26 | --region ap-northeast-2 27 | ``` 28 | 29 | ## Pre-requisition: 30 | 31 | - Python: https://www.python.org/ 32 | - boto3: https://boto3.amazonaws.com/v1/documentation/api/latest/index.html?id=docs_gateway 33 | - A cluster id that was already configured. 34 | 35 | ## How to use: 36 | 37 | Run following commands `python get_emr_cli_export.py YOUR-CLUSTER-ID` 38 | 39 | - Example: 40 | ``` 41 | python get_emr_cli_export.py j-2ABCABCABC 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /EC2/QuickInstanceEC2/DeployScripts/tomcat7_ubuntu14.04_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file 6 | # except in compliance with the License. A copy of the License is located at 7 | # 8 | # http://aws.amazon.com/apache2.0/ 9 | # 10 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" 11 | # BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under the License. 13 | 14 | # ensure user is root 15 | if [ "$(id -u)" != "0" ]; then 16 | echo "This script must be run as root. Use 'sudo ./