Skip to content

Instantly share code, notes, and snippets.

View toricls's full-sized avatar
🐔
Cock a doodle doo

Tori Hara toricls

🐔
Cock a doodle doo
View GitHub Profile
@toricls
toricls / app-runner-template.yml
Created May 19, 2021 06:57
AWS App Runner CloudFormation Template generated using AWS Copilot
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation template that represents a request driven web service on AWS App Runner.
Parameters:
AppName:
Type: String
EnvName:
Type: String
WorkloadName:
@toricls
toricls / SF-Fargate-Task.md
Last active April 29, 2021 13:39
Resilient Fargate task scheduling with Step Functions and EventBridge

image

@toricls
toricls / time-to-redemption.yaml
Created November 13, 2019 02:57
CloudFormation Existing Resource Import で利用するテンプレートの例 see also https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html
AWSTemplateFormatVersion: 2010-09-09
Description: It's time to redemption
Resources:
# これが罪深くも過去に手で作られた IAM ユーザー (Import の対象)
MyHandCraftedIAMUser:
Type: AWS::IAM::User
DeletionPolicy: Retain
# こちらは CFn でちゃんと作る IAM グループ
MyCFnCreatedIAMGroup:
@toricls
toricls / enable-ci-for-ecs.sh
Last active August 31, 2019 07:38
Enable CloudWatch Container Insights for ALL existing ECS clusters in a region
#!/usr/bin/env bash
set -eu
aws ecs list-clusters \
| jq -r '.clusterArns[]' \
| xargs -I '{}' aws ecs update-cluster-settings --cluster '{}' --settings name=containerInsights,value=enabled
@toricls
toricls / Time-based-auto-scaling-on-fargate.md
Created August 5, 2019 01:49
Example: Time-based Auto Scaling on Amazon ECS + AWS Fargate

Set parameters

$ export ECS_CLUSTER_NAME={YOUR_ECS_CLUSTER_NAME}
$ export ECS_SERVICE_NAME={YOUR_ECS_SERVICE_NAME}

RegisterScalableTarget

package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/dji/tello"
)
func main() {

Keybase proof

I hereby claim:

  • I am toricls on github.
  • I am toricls (https://keybase.io/toricls) on keybase.
  • I have a public key ASDocbYVSt6F09EnpYmENXRKhVmZ6qotzoPLqSZubEFZPAo

To claim this, I am signing this object:

@toricls
toricls / amazon-history.js
Created April 12, 2018 07:13 — forked from yociya/amazon-history.js
Amazonの注文履歴を年毎に集計して出力します 利用額 / 注文件数 / 最高額(1注文での) 使い方はコメントを参照
var historyUrl = 'https://www.amazon.co.jp/gp/css/order-history?orderFilter=year-$year$&startIndex=$index$';
function beforeSendHook(xhr){
xhr.setRequestHeader('X-Requested-With'
, {
toString: function(){
return '';
}
}
);
@toricls
toricls / auth.js
Created February 21, 2018 18:38
Very basic AWS Amplify auth in Vue (signup, signin, signout)
import Amplify, { Auth } from 'aws-amplify';
const types = {
AUTHENTICATE: 'AUTHENTICATE',
SIGNOUT: 'SIGNOUT',
SET_ATTRIBUTES: 'SET_ATTRIBUTES',
};
Amplify.configure({
Auth: {
@toricls
toricls / transformed.yaml
Created December 14, 2017 04:37
A transformed version of 'Hello World' AWS SAM template (see original version here: https://gist.github.com/toricls/7d078e6d25515f26b73bfa3a6f4f0ec5)
AWSTemplateFormatVersion: '2010-09-09'
Description: A hello world application.
Resources:
HelloWorldFunctionRole:
Type: 'AWS::IAM::Role'
Properties:
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
AssumeRolePolicyDocument:
Version: 2012-10-17