What we will do Create new VPC Create an Internet Gateway and a NAT gateway Define subnets Create security group Create EC2 instance Integration with gitlab CI Define terraform file We will create few .tf files:
backend.tf for integration with gitlab CI, we need save state file on AWS S3 bucket, otherwise Terraform will create resources every time we run CI pipeline. terraform { backend "s3" { key = "terraform-pipeline/terraform.
How to Develop DynamoDB Locally
Download DynamoDB wget https://s3.ap-southeast-1.amazonaws.com/dynamodb-local-singapore/dynamodb_local_latest.tar.gz Extract file tar zxvf dynamodb_local_latest.tar.gz Start Dynamo DB locally We can start Dynamo DB service with docker or with JAVA.
start with docker edit docker-compose.yml
version: '3.8' services: dynamodb-local: command: "-jar DynamoDBLocal.jar -sharedDb -optimizeDbBeforeStartup -dbPath ./data" image: "amazon/dynamodb-local:latest" container_name: dynamodb-local ports: - "8000:8000" volumes: - "./docker/dynamodb:/home/dynamodblocal/data" working_dir: /home/dynamodblocal start container
docker-compose up -d start with JAVA directly java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb Create fake aws credential edit .
Using Aws Documentdb With Golang
Background AWS Document DB是基本兼容Mongo DB的AWS服务,Mongo DB是比较流行的非结构化文档数据库。使用Golang操作Document DB的方法
Gitlab Pipeline Trigger
使用Gitlab作为CI/CD工具,有的情况下需要从一个项目中触发两一个项目的pipeline,例如这样的场景:Project A是某个服务,
Php Call Lambda function through Cloudmap
Cloudmap是AWS的服务发现工具,假设我们已经有一个开发好的Lambda function,并且注册到了Cloudmap中,我们需要从P
Oauth2 Authcode Logic
Oauth2协议中,authcode也就是授权码模式的逻辑是需要用户参与的授权方式。它的步骤如下: (A)用户访问客户端,后者将前者导向认证服
How to install mysql client on AWS ECS task
If we need to install MySQL client on an AWS ECS task, Here is the steps:
install wget apt install wget install MySQL client wget [https://dev.mysql.com/get/mysql-apt-config_0.8.16-1_all.deb](https://dev.mysql.com/get/mysql-apt-config_0.8.16-1_all.deb) apt install lsb-release gnupg -y dpkg -i mysql-apt-config_0.8.16-1_all.deb apt update apt install mysql-client -y when connect to MySQL server add param: --ssl-mode=DISABLED
在kubernetes上部署Go Micro代码(一)
环境准备 用kubeadm安装好kubernetes环境,我用的测试环境是单节点的,master node和worker node部署在同一台机器
php的Yaf框架类加载顺序研究
代码 注册ini设置到global_library变量(yaf.c) STD_PHP_INI_ENTRY("yaf.library", "", PHP_INI_ALL, OnUpdateString, global_library, zend_yaf_globals, yaf_globals) 把global_library和local_library都
Docker部署完整的PHP-RPC-Golang环境
完全基于docker部署一个php通过rpc访问golang的环境。 基本架构 我们用PHP的Laravel框架来实现一个用户登录的Restfu