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
| # metric creation for the cloudwatch logs | |
| resource "aws_cloudwatch_log_metric_filter" "cloudwatch_filter" { | |
| name = "MyLogFilter" | |
| log_group_name = "/aws/ecs/my-service" | |
| pattern = "This text should trigger alarm" | |
| metric_transformation { | |
| name = "MyLogMetric" | |
| namespace = "MyLogNamespace" | |
| value = "1" | |
| } |
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
| is_NaN = df.isnull() | |
| row_has_NaN = is_NaN.any(axis=1) | |
| rows_with_NaN = df[row_has_NaN] | |
| print(rows_with_NaN) |
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
| console.log('hello') |
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
| # ----------------------------- | |
| # PostgreSQL configuration file | |
| # ----------------------------- | |
| # | |
| # This file consists of lines of the form: | |
| # | |
| # name = value | |
| # | |
| # (The "=" is optional.) Whitespace may be used. Comments are introduced with | |
| # "#" anywhere on a line. The complete list of parameter names and allowed |
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
| resource "docker_container" "hello_world_app" { | |
| image = "hello_world_app:latest" | |
| name = "hello_world_app" | |
| restart = "always" | |
| volumes { | |
| container_path = "/myapp" | |
| # replace the host_path with full path for your project directory starting from root directory / | |
| host_path = "/path/to/your/project/directory" | |
| read_only = false | |
| } |
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
| FROM node:10 | |
| RUN mkdir /myapp | |
| # Create app directory | |
| WORKDIR /myapp | |
| COPY ./package.json /myapp/package.json | |
| COPY ./package-lock.json /myapp/package-lock.json |
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 json | |
| import pandas as pd | |
| import numpy as np | |
| import paramiko | |
| import pysftp | |
| def lambda_handler(event, context): | |
| # test for pandas | |
| data = {'name':["Tom", "John", "Andre", "Sam"], |
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
| #!/bin/bash | |
| export LIB_DIR="python" | |
| rm -rf ${LIB_DIR} && mkdir -p ${LIB_DIR} | |
| docker run --rm -v $(pwd):/foo -w /foo lambci/lambda:build-python3.6 \ | |
| pip install -r requirements.txt -t ${LIB_DIR} |
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
| pandas==1.0.3 | |
| paramiko==2.7.1 | |
| pysftp==0.2.9 |
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 get_instance_details(instance_id, client): | |
| response = client.describe_instances( | |
| InstanceIds=[ | |
| instance_id, | |
| ], | |
| ) | |
| return dict( | |
| instance_type = response['Reservations'][0]['Instances'][0]['InstanceType'], | |
| state = response['Reservations'][0]['Instances'][0]['State']['Name'], | |
| ) |
NewerOlder