This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import boto3 | |
import decimal | |
def lambda_handler(event, context): | |
table = boto3.resource('dynamodb').Table(os.getenv('TABLE_NAME')) | |
param = event['pathParameters']['param'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import json | |
import time | |
from datetime import datetime | |
def lambda_handler(event, context): | |
print(datetime.now().isoformat()) | |
records_count = len(event['Records']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as AWS from 'aws-sdk'; | |
import * as QueryString from 'querystring'; | |
const iot = new AWS.Iot(); | |
export async function handler(event: any) { | |
const endpoint = await iot.describeEndpoint({ | |
endpointType: 'iot:Data', | |
}).promise(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function handler(event: any) { | |
const id = event.pathParameters.id; | |
return { | |
statusCode: 200, | |
body: JSON.stringify({ | |
env: process.env.SYSTEM_ENV, | |
message: `your request message id is ${id}` | |
}), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as apigateway from '@aws-cdk/aws-apigateway'; | |
import * as lambda from '@aws-cdk/aws-lambda'; | |
import { Duration } from '@aws-cdk/core'; | |
import cdk = require('@aws-cdk/core'); | |
export class AppStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, systemEnv: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
// The code that defines your stack goes here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
ss = status | |
br = branch | |
brm = branch -m | |
brd = branch -d | |
brdd = branch -D | |
co = checkout | |
cob = checkout -b | |
adu = add -u | |
adup = add -u -p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import json | |
class DynamodbCapacityChecker(object): | |
def __init__(self): | |
self.client = boto3.client('dynamodb', region_name='ap-northeast-1') | |
def check(self) -> None: | |
tables = self.get_dynamodb_tables() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as apigateway from '@aws-cdk/aws-apigateway'; | |
import * as lambda from '@aws-cdk/aws-lambda'; | |
import * as dynamodb from '@aws-cdk/aws-dynamodb'; | |
import { Duration } from '@aws-cdk/core'; | |
import cdk = require('@aws-cdk/core'); | |
import { ResourceName } from './resourceName'; | |
export class AwscdkResourceNameSampleStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, resourceName: ResourceName, props?: cdk.StackProps) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as AWS from 'aws-sdk'; | |
const ssm = new AWS.SSM(); | |
export async function handler(event: any) { | |
const id = event.pathParameters.id; | |
var ssmSecureParam1 = await ssm.getParameter({ | |
Name: '/CDK/Sample/SecureParam1', | |
WithDecryption: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import requests | |
import locale | |
import jpholiday | |
from datetime import date, datetime, timedelta | |
from typing import List, Tuple | |
INCOMMING_WEBHOOK_URL = os.environ['INCOMMING_WEBHOOK_URL'] |
OlderNewer