-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoln.1
193 lines (155 loc) · 4.39 KB
/
moln.1
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.TH MOLN 1
.SH NAME
moln \- Convenience shell script to work with cloud services.
.SH SYNOPSIS
.B moln {options} [cloud] [command] {arguments}
.SH DESCRIPTION
Moln presents a uniform api that is implemented using cli commands
from different cloud providers. This can be used to do simple work on
multiple cloud providers (all,aws,azure,gcloud) using the same
commands. Moln can also print the underlying cli command to refresh
your memory or when you need to do more advanced commands against the
cloud provider.
Feel free to copy snippets and learn from this code. But as a whole it
is licensed under the MIT license and requires legal notices.
.SH EXAMPLES
.B moln aws install
.B moln gcloud install
.B moln azure install
Download the aws cli commands and put links to them inside your $HOME/bin directory and put the actual code in $HOME/opt.
.B moln aws whoami
Show your cloud identity/account information.
.B moln aws list-vpcs
Show a list of virtual private clouds.
.B moln all list-vms
Show a list of virtual machines for all your cloud providers for your accounts.
.B moln aws assume-role full_access_dns TimeForWork
Create a subshell, within which you have access to a different role to gain privileges. The subshell session is called TimeForWork.
.SH OPTIONS
\fB\--list-help\fR list all available commands.
.br
\fB\--output=\fR[terminal|ascii|man|htmq|tex] choose output format.
.br
\fB\-l\fR list all available commands.
.br
\fB\-lc\fR list all available clouds.
.br
\fB\-v\fR verbose will show the underlying cli commands.
.br
\fB\-d\fR debug with a lot of information.
.br
.SH BASIC
\fBwhoami\fR Display active account/identity.
.br
·aws sts get-caller-identity
.br
·az account list
.br
·gcloud config list
.br
.SH BUCKET
\fBlist-buckets\fR List storage buckets, ie aws s3/gcloud storage/azure blobs.
.br
·aws s3api list-buckets --output json
.br
.SH COST
\fBlist-costs\fR Print a summary of monthly costs for the last 12 months.
.br
.SH DNS
\fBlist-hosted-zones\fR List zones the dns is configured to serve.
.br
·aws route53 --region us-east-1 list-hosted-zones
.br
\fBlist-dns-records\fR List dns records in a zone.
.br
·aws route53 list-resource-record-sets --hosted-zone-id=${ID}
.br
\fBupsert-dns-record NAME TYPE DEST\fR Insert or update a dns record.
.br
·aws route53 change-resource-record-sets --hosted-zone-id ${ID} --change-batch file://${FILE}
.br
\fBremove-dns-record NAME\fR Remove a dns record.
.br
·aws route53 change-resource-record-sets --hosted-zone-id ${ID} --change-batch file://${FILE}
.br
\fBlist-domains\fR List dns domains.
.br
·aws route53domains --region us-east-1 list-domains
.br
.SH GROUP
\fBlist-groups\fR List iam groups.
.br
·aws iam list-groups
.br
·az ad group list
.br
\fBlist-groups-for-user\fR List groups to which a user belongs.
.br
.SH CLI
\fBinstall\fR Install the specified cloud cli.
.br
.SH IP
\fBlist-ips\fR List allocated external ip numbers.
.br
·aws ec2 describe-addresses
.br
.SH ORG
.SH POLICY
\fBlist-policies\fR List iam policies.
.br
·aws iam list-policies
.br
.SH ROLE
\fBassume-role ROLE SESSION\fR Start a subshell with the rights of the assumed role.
.br
·aws sts assume-role --role-arn "arn:aws:iam::${AWS_ACCOUNT}:role/$ROLE" --role-session-name "$SESSION"
.br
\fBlist-roles\fR List iam roles.
.br
·aws iam list-roles
.br
.SH SUBNET
\fBlist-subnets\fR List all subnets.
.br
·aws ec2 describe-subnets
.br
.SH USER
\fBlist-users\fR List users in cloud account.
.br
·aws iam list-users
.br
·az ad user list
.br
·gcloud iam service-accounts --format=json list
.br
.SH VM
\fBcreate-vm-from-template NAME TEMPLATE_NAME\fR Create a virtual machine based on an existing vm template.
.br
·aws ec2 run-instances --launch-template LaunchTemplateName=${TEMPLATE_NAME} --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=${NAME}}]"
.br
·az foo bar ${TEMPLATE_NAME} ${NAME}
.br
\fBdestroy-vm NAMEID NAMEID\fR Destroy a virtual machine.
.br
.SH VPC
\fBlist-vpcs\fR List virtual private clouds/networks, aka vpc:s and vnets.
.br
·aws ec2 describe-vpcs
.br
·az network vnet list
.br
.SH WEBAPI
\fBlist-webapi-domains\fR List domain names mapped to web apis (REST/HTTPs) routers.
.br
·aws apigatewayv2 get-domain-names
.br
.SH AUTHOR
Written by Fredrik Öhrström.
.SH COPYRIGHT
Copyright \(co 2022-2023 Fredrik Öhrström.
.br
License MIT
.br
This is free software: you are free to change and redistribute it.
.br
There is NO WARRANTY, to the extent permitted by law.