Skip to content

Instantly share code, notes, and snippets.

Bill Wang ozbillwang

Block or report user

Report or block ozbillwang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ecs-service-targetgroup-twin.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: 'Registers ecs tasks to a second target group'
Parameters:
ClusterArn:
Description: 'ANR of cluster the service resides in'
Type: String
ServiceName:
Description: 'Name of the service to register'
Type: String
ContainerName:
View multiple-ports-per-ecs-service.md

Unfortunately as of writing this (Oct 18, 2017) there is no built in integration for multiple target groups per AWS ECS service. Here are a few things you can try:

  1. If your application just serves port 80 (HTTP) & port 443 (HTTPS) then you should consider using the application load balancer and terminating SSL at the load balancer. This will allow your application to function using just port 80.

  2. If your application serves different ports that are backed by different components, perhaps speaking different protocols then you should consider splitting the application into multiple ECS services. This has the benefit of allowing the different components to independently scale

@ozbillwang
ozbillwang / a new way to manage tags with terraform.md
Created Feb 1, 2018
a new way to manage tags with terraform
View a new way to manage tags with terraform.md
@ozbillwang
ozbillwang / varnishlog-examples.sh
Created Jan 15, 2018 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
View varnishlog-examples.sh
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@ozbillwang
ozbillwang / serverelss_build.md
Last active Jan 24, 2018
how to build serverless framework by yourself.
View serverelss_build.md

Sometime, you can't wait and try new features in serverless framework (github.com/serverless/serverless)

https://github.com/serverless/serverless/issues/4325#issuecomment-340746187

run below commands, this build will generate new serverless command.

cd <serverless_repo_full_path>
# Fake the environment "SENTRY_DSN", otherwise, it will stop the build
export SENTRY_DSN=demo
View list contributors.md
curl -k https://api.github.com/repos/<user>/<repo>/contributors |jq '.[].login'

Generate CONTRIBUTING.md:

curl -k https://api.github.com/repos/<user>/<repo>/contributors |jq -r '.[].login' >  CONTRIBUTING.md
View gist:1ca847bc01c8105ff7174a631e19a27e
@ozbillwang
ozbillwang / .travis.yml
Created Aug 1, 2017
terraform validates with Travis CI
View .travis.yml
env:
- tf_version=0.8.8
- tf_version=0.9.11
sudo: required
language: bash
before_install:
- wget https://releases.hashicorp.com/terraform/${tf_version}/terraform_${tf_version}_linux_amd64.zip -O /tmp/terraform.zip
@ozbillwang
ozbillwang / aurora_cluster.tf
Created Jun 5, 2017 — forked from sandcastle/aurora_cluster.tf
Creates a AWS RDS Aurora Cluster with Terraform
View aurora_cluster.tf
########################
## Variables
########################
variable "environment_name" {
description = "The name of the environment"
}
variable "vpc_id" {
You can’t perform that action at this time.