This file contains hidden or 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
| awscli: | |
| image: omerxx/awscli | |
| volumes: | |
| - ~/.aws:/root/.aws | |
| command: tail -f /dev/null | |
| # Usage: | |
| # Save as docker-compose.yml | |
| # Run docker-compose up -d | |
| # Run docker exec -it $(docker ps -q) /bin/sh |
This file contains hidden or 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
| pipeline: | |
| frontend: | |
| image: node | |
| commands: | |
| - npm install | |
| - npm test | |
| backend: | |
| image: golang | |
| commands: | |
| - go test -v |
This file contains hidden or 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
| pipeline: | |
| deploy-server-elastic-beanstalk: | |
| image: peloton/drone-elastic-beanstalk | |
| region: us-east-2 | |
| application: drone | |
| version_label: ${DRONE_BUILD_NUMBER}-${DRONE_BRANCH}-drone-server | |
| description: Drone server [Deployed with DroneCI] | |
| environment_name: production-drone | |
| environment_update: true |
This file contains hidden or 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
| TargetGroup: | |
| Type: AWS::ElasticLoadBalancingV2::TargetGroup | |
| Properties: | |
| VpcId: !Ref VPC | |
| Port: 80 | |
| Protocol: HTTP | |
| Matcher: | |
| HttpCode: 200-299 | |
| HealthCheckIntervalSeconds: 80 | |
| HealthCheckPath: !Ref HealthCheckPath |
This file contains hidden or 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
| TaskDefinition: | |
| Type: AWS::ECS::TaskDefinition | |
| Properties: | |
| Cpu: !Ref VCpu | |
| RequiresCompatibilities: | |
| - !Ref RequiresCompatibilities | |
| Family: !Ref ServiceName | |
| NetworkMode: !Ref NetworkMode | |
| ExecutionRoleArn: arn:aws:iam::000:role/EcsTaskExecutionRole | |
| TaskRoleArn: arn:aws:iam::000:role/EcsTaskExecutionRole |
This file contains hidden or 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
| Resources: | |
| Service: | |
| Type: AWS::ECS::Service | |
| DependsOn: ListenerRule | |
| Properties: | |
| Cluster: !Ref Cluster | |
| ServiceName: !Ref ServiceName | |
| LaunchType: !Ref LaunchType | |
| DesiredCount: !Ref DesiredCount | |
| DeploymentConfiguration: |
This file contains hidden or 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
| Resources: | |
| ECSCluster: | |
| Type: AWS::ECS::Cluster | |
| Properties: | |
| ClusterName: !Ref EnvironmentName | |
| ECSAutoScalingGroup: | |
| Type: AWS::AutoScaling::AutoScalingGroup | |
| Properties: | |
| VPCZoneIdentifier: !Ref Subnets |
This file contains hidden or 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
| TaskDefinition: | |
| Type: AWS::ECS::TaskDefinition | |
| Properties: | |
| Family: !Ref ServiceName | |
| ContainerDefinitions: | |
| - Name: !Sub ${ServiceName}-container | |
| Essential: true | |
| Image: !Ref DockerImage | |
| Memory: !Ref Memory | |
| PortMappings: |
This file contains hidden or 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
| import os | |
| import boto3 | |
| import datetime | |
| import dateutil | |
| DEFAULT_MAX_MEM = 3000 | |
| LOW_CLUSTER_CPU_TH = 20 | |
| HIGH_CLUSTER_CPU_TH = 65 | |
| CONTAINERS_MAX_MEM = { | |
| 'cluster1': 1200, |
This file contains hidden or 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
| def lambda_handler(event, context): | |
| import boto3 | |
| client = boto3.client('ecs', aws_access_key_id='', aws_secret_access_key='') | |
| response = client.list_tasks(cluster='mycluster', family='myservice', maxResults=1,desiredStatus='RUNNING') | |
| stoptask = response['taskArns'][0].split('/')[1] | |
| print client.stop_task(cluster='mycluster', task=stoptask, reason='chaos monkey') |