-
Notifications
You must be signed in to change notification settings - Fork 1
/
ops.yml
119 lines (119 loc) · 3.92 KB
/
ops.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
version: "1"
commands:
# setup aws ecs fargate infrastructure
- name: setup-aws-ecs-fargate:0.3.2
run: ./node_modules/.bin/ts-node /ops/src/setup.ts
description: "setup an environment"
# environment variables
env:
# add static env vars
static:
- STACK_TYPE=aws-ecs-fargate
- AWS_REGION=us-west-1
- JSII_DEPRECATED=quiet
# add and store aws secrets
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
# pass environment host and database configurations
configs:
- DEV_AWS_ECS_FARGATE_STATE
- STG_AWS_ECS_FARGATE_STATE
- PRD_AWS_ECS_FARGATE_STATE
- DEV_AWS_ECS_FARGATE_CLUSTER_VAULT_ARN
- STG_AWS_ECS_FARGATE_CLUSTER_VAULT_ARN
- PRD_AWS_ECS_FARGATE_CLUSTER_VAULT_ARN
- DEV_AWS_ECS_FARGATE_SERVICE_VAULT_ARN
- STG_AWS_ECS_FARGATE_SERVICE_VAULT_ARN
- PRD_AWS_ECS_FARGATE_SERVICE_VAULT_ARN
# deploy environment on aws ecs fargate workflow
- name: deploy-aws-ecs-fargate:0.3.2
run: ./node_modules/.bin/ts-node /ops/src/deploy.ts
description: "deploy to an environment"
env:
# add static env vars
static:
- STACK_TYPE=aws-ecs-fargate
- AWS_REGION=us-west-1
- JSII_DEPRECATED=quiet
# add and store aws secrets
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
# pass environment host, resource, and database connections
configs:
- DEV_AWS_ECS_FARGATE_STATE
- STG_AWS_ECS_FARGATE_STATE
- PRD_AWS_ECS_FARGATE_STATE
- DEV_AWS_ECS_FARGATE_CLUSTER_VAULT_ARN
- STG_AWS_ECS_FARGATE_CLUSTER_VAULT_ARN
- PRD_AWS_ECS_FARGATE_CLUSTER_VAULT_ARN
- DEV_AWS_ECS_FARGATE_SERVICE_VAULT_ARN
- STG_AWS_ECS_FARGATE_SERVICE_VAULT_ARN
- PRD_AWS_ECS_FARGATE_SERVICE_VAULT_ARN
# destroy aws ecs fargate infrastructure
- name: destroy-aws-ecs-fargate:0.1.0
run: ./node_modules/.bin/ts-node /ops/src/destroy.ts
description: "destroy an environment"
env:
# add static env vars
static:
- STACK_TYPE=aws-ecs-fargate
- AWS_REGION=us-west-1
# add and store aws secrets
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
# connect to bastion private network with ssh
- name: ssh-aws-ecs-fargate:0.1.0
run: ./node_modules/.bin/ts-node /ops/src/ssh.ts
description: "connect to bastion with ssh"
env:
# add static env vars
static:
- STACK_TYPE=aws-ecs-fargate
- AWS_REGION=us-west-1
# add and store aws secrets
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
# connect application port from client to server
- name: tunnel-aws-ecs-fargate:0.1.0
run: ./node_modules/.bin/ts-node /ops/src/tunnel.ts
description: "connect to bastion with ssh"
# add static env vars
env:
static:
- STACK_TYPE=aws-ecs-fargate
- AWS_REGION=us-west-1
# add and store aws secrets
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
# manage and lock secrets vault
- name: vault-aws-ecs-fargate:0.1.2
run: ./node_modules/.bin/ts-node /ops/src/vault.ts
description: "manage secrets vault"
env:
# add static env vars
static:
- STACK_TYPE=aws-ecs-fargate
- AWS_REGION=us-west-1
# pass and store aws secrets
secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
help:
usage: ops run vault <sub-cmd> <--key> <--value>
arguments:
init: 'init the environments vault'
set: 'set a key in the enviroment vault'
ls: 'list keys in the environment vault'
rm: ' remove a specific key in the environment vault'
destroy: 'destroy the environment vault'