Skip to content

Commit 01e68fb

Browse files
author
Andrew Lorien
committed
build
1 parent d71e092 commit 01e68fb

File tree

3 files changed

+24
-181
lines changed

3 files changed

+24
-181
lines changed

aliases

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ alias elbv2-dnsname='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma elbv2-dnsname'
116116
alias elbv2-subnets='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma elbv2-subnets'
117117
alias elbv2-target-groups='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma elbv2-target-groups'
118118
alias elbv2s='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma elbv2s'
119+
alias hosted-zone-a-records='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma hosted-zone-a-records'
119120
alias hosted-zone-ns-records='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma hosted-zone-ns-records'
120121
alias hosted-zones='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma hosted-zones'
121122
alias iam-role-principal='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma iam-role-principal'
@@ -275,7 +276,7 @@ alias vpcs='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma vpcs'
275276
# We'll find a less suprising place for this in future
276277
# region() needs to be a function in order to let it
277278
# set AWS_DEFAULT_REGION in the current shell
278-
function region() {
279+
function region() {
279280
local inputs=$(skim-stdin "$@");
280281
if [[ -z "$inputs" ]]; then
281282
echo "${AWS_DEFAULT_REGION:-'AWS_DEFAULT_REGION not set'}";

docs/command-reference.md

Lines changed: 21 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Create a CloudFormation Stack
204204
to take advantage of shorter commands*
205205

206206
USAGE: stack-create stack [template-file] [parameters-file] \
207-
[--capabilities=OPTIONAL_VALUE] [--role-arn=OPTIONAL_VALUE]
207+
[CAPABILITY_1 CAPABILITY_2] [--role-arn=OPTIONAL_VALUE]
208208

209209
$ stack-create params/asg-params-prod.json
210210
Resolved arguments: asg-prod ./asg.yml params/asg-params-prod.json
@@ -923,7 +923,7 @@ List scaling activities for Autoscaling Group(s)
923923
## autoscaling-commands
924924

925925

926-
### scaling-ecs
926+
### ##scaling-ecs
927927

928928
List autoscaling actions
929929
filter by environment (eg test1) or namespace (eg ecs)
@@ -1382,136 +1382,6 @@ List images for ECR Repositories
13821382
## ecs-commands
13831383

13841384

1385-
### ecs-clusters2
1386-
1387-
List ECS clusters
1388-
output includes clusterName,status,activeServicesCount,runningTasksCount,pendingTasksCount
1389-
if you pass an argument, it'll filter for clusters whose ARN contains your text
1390-
1391-
$ ecs-clusters test
1392-
test-octopus-ecs-cluster ACTIVE 1 1 0
1393-
test1-ecs-cluster ACTIVE 3 1 0
1394-
test3-ecs-cluster ACTIVE 3 1 0
1395-
test2-ecs-cluster ACTIVE 3 3 0
1396-
1397-
1398-
### ecs-services2
1399-
1400-
List ECS services
1401-
output includes serviceName,status,desiredCount,runningCount,pendingCount,createdAt
1402-
1403-
gets all clusters if no filter passed in
1404-
if you do pass a filter:
1405-
1. if your filter is the name of one of your clusters, it will list the services in that cluster (eg ecs-clusters test1 | ecs-services)
1406-
2. if your filter is not a cluster name, it will list the services in all clusters whose names match your filter (ie it filters on cluster name not service name)
1407-
3. if you do not pass a filter, it will list all services in all clusters
1408-
1409-
$ ecs-clusters test1|ecs-services
1410-
test1-ecs-admin-7URaUr0YGJHi ACTIVE 0 0 0 2023-09-13T17:16:48.198000+10:00
1411-
test1-ecs-public-wEaTAqGXqbpq ACTIVE 0 0 0 2023-09-13T16:54:54.162000+10:00
1412-
test1-ecs-hangfire-YNIo1hlx8rjn ACTIVE 1 1 0 2023-09-13T16:39:06.218000+10:00
1413-
1414-
1415-
### ecs-tasks
1416-
1417-
List ECS tasks
1418-
output includes taskDefinitionArn, createdAt, cpu, memory
1419-
1420-
gets all tasks if no filter passed in
1421-
if you do pass a filter, it filters on the task name. All clusters are included (I haven't worked out a way of passing a cluster name AND a filter)
1422-
1423-
$ ecs-tasks test2
1424-
arn:aws:ecs:ap-southeast-2:xxxxxxxxxxxx:task-definition/test2-public:18 2023-09-19T17:51:56.418000+10:00 2048 4096
1425-
arn:aws:ecs:ap-southeast-2:xxxxxxxxxxxx:task-definition/test2-admin:20 2023-08-29T10:03:36.956000+10:00 2048 4096
1426-
arn:aws:ecs:ap-southeast-2:xxxxxxxxxxxx:task-definition/test2-hangfire:22 2023-09-19T17:11:06.622000+10:00 1024 2048
1427-
1428-
1429-
### ecs-scaling-activities
1430-
1431-
LIst autoscaling activities - the actual scaling events that have happened
1432-
eg
1433-
ecs-scaling www
1434-
2023-11-22T06:24:50.937000+11:00 www-ecs-public-ServicePublic-OuN3rXBLvmx3-AlarmLow-64de4512-d901-4b26-a6a2-184bb1e90bc6 in state ALARM triggered policy www-ecs-public-target-tracking-mem70 Successfully set desired count to 2. Change successfully fulfilled by ecs.
1435-
2023-11-22T05:25:48.611000+11:00 www-ecs-public-ServicePublic-OuN3rXBLvmx3-AlarmHigh-6408c172-647e-4c0e-aac9-a800cd83317d in state ALARM triggered policy www-ecs-public-target-tracking-mem70 Successfully set desired count to 3. Change successfully fulfilled by ecs.
1436-
1437-
1438-
### ecs-scaling-actions
1439-
1440-
List autoscaling actions - cron-based scheduled scaling
1441-
filter by environment (eg test1) or namespace (eg ecs)
1442-
if you pass an argument, it'll filter for clusters whose ARN contains your text
1443-
1444-
$ scaling-ecs 'test.*down' # list the scale-down times of all our test environments
1445-
1446-
1447-
## ecs-commands2
1448-
1449-
1450-
### ecs-clusters2
1451-
1452-
List ECS clusters
1453-
output includes clusterName,status,activeServicesCount,runningTasksCount,pendingTasksCount
1454-
if you pass an argument, it'll filter for clusters whose ARN contains your text
1455-
1456-
$ ecs-clusters test
1457-
test-octopus-ecs-cluster ACTIVE 1 1 0
1458-
test1-ecs-cluster ACTIVE 3 1 0
1459-
test3-ecs-cluster ACTIVE 3 1 0
1460-
test2-ecs-cluster ACTIVE 3 3 0
1461-
1462-
1463-
### ecs-services2
1464-
1465-
List ECS services
1466-
output includes serviceName,status,desiredCount,runningCount,pendingCount,createdAt
1467-
1468-
gets all clusters if no filter passed in
1469-
if you do pass a filter:
1470-
1. if your filter is the name of one of your clusters, it will list the services in that cluster (eg ecs-clusters test1 | ecs-services)
1471-
2. if your filter is not a cluster name, it will list the services in all clusters whose names match your filter (ie it filters on cluster name not service name)
1472-
3. if you do not pass a filter, it will list all services in all clusters
1473-
1474-
$ ecs-clusters test1|ecs-services
1475-
test1-ecs-admin-7URaUr0YGJHi ACTIVE 0 0 0 2023-09-13T17:16:48.198000+10:00
1476-
test1-ecs-public-wEaTAqGXqbpq ACTIVE 0 0 0 2023-09-13T16:54:54.162000+10:00
1477-
test1-ecs-hangfire-YNIo1hlx8rjn ACTIVE 1 1 0 2023-09-13T16:39:06.218000+10:00
1478-
1479-
1480-
### ecs-tasks
1481-
1482-
List ECS tasks
1483-
output includes taskDefinitionArn, createdAt, cpu, memory
1484-
1485-
gets all tasks if no filter passed in
1486-
if you do pass a filter, it filters on the task name. All clusters are included (I haven't worked out a way of passing a cluster name AND a filter)
1487-
1488-
$ ecs-tasks test2
1489-
arn:aws:ecs:ap-southeast-2:xxxxxxxxxxxx:task-definition/test2-public:18 2023-09-19T17:51:56.418000+10:00 2048 4096
1490-
arn:aws:ecs:ap-southeast-2:xxxxxxxxxxxx:task-definition/test2-admin:20 2023-08-29T10:03:36.956000+10:00 2048 4096
1491-
arn:aws:ecs:ap-southeast-2:xxxxxxxxxxxx:task-definition/test2-hangfire:22 2023-09-19T17:11:06.622000+10:00 1024 2048
1492-
1493-
1494-
### ecs-scaling-activities
1495-
1496-
LIst autoscaling activities - the actual scaling events that have happened
1497-
eg
1498-
ecs-scaling www
1499-
2023-11-22T06:24:50.937000+11:00 www-ecs-public-ServicePublic-OuN3rXBLvmx3-AlarmLow-64de4512-d901-4b26-a6a2-184bb1e90bc6 in state ALARM triggered policy www-ecs-public-target-tracking-mem70 Successfully set desired count to 2. Change successfully fulfilled by ecs.
1500-
2023-11-22T05:25:48.611000+11:00 www-ecs-public-ServicePublic-OuN3rXBLvmx3-AlarmHigh-6408c172-647e-4c0e-aac9-a800cd83317d in state ALARM triggered policy www-ecs-public-target-tracking-mem70 Successfully set desired count to 3. Change successfully fulfilled by ecs.
1501-
1502-
1503-
### ecs-scaling-actions
1504-
1505-
List autoscaling actions - cron-based scheduled scaling
1506-
filter by environment (eg test1) or namespace (eg ecs)
1507-
if you pass an argument, it'll filter for clusters whose ARN contains your text
1508-
1509-
$ scaling-ecs 'test.*down' # list the scale-down times of all our test environments
1510-
1511-
1512-
## ecs-commands~
1513-
1514-
15151385
### ecs-clusters
15161386

15171387
List ECS clusters
@@ -1558,7 +1428,7 @@ if you do pass a filter, it filters on the task name. All clusters are included
15581428

15591429
### ecs-scaling-activities
15601430

1561-
LIst autoscaling activities - the actual scaling events that have happened
1431+
List autoscaling activities - the actual scaling events that have happened
15621432
eg
15631433
ecs-scaling www
15641434
2023-11-22T06:24:50.937000+11:00 www-ecs-public-ServicePublic-OuN3rXBLvmx3-AlarmLow-64de4512-d901-4b26-a6a2-184bb1e90bc6 in state ALARM triggered policy www-ecs-public-target-tracking-mem70 Successfully set desired count to 2. Change successfully fulfilled by ecs.
@@ -2102,35 +1972,6 @@ Generate NS records for delegating domain to AWS
21021972
$ hosted-zones | hosted-zone-a-records
21031973

21041974

2105-
## route53-commandsTEMP
2106-
2107-
2108-
### hosted-zones
2109-
2110-
List Route53 Hosted Zones
2111-
2112-
$ hosted-zones
2113-
/hostedzone/Z3333333333333 5 NotPrivateZone bash-my-aws.org.
2114-
/hostedzone/Z5555555555555 2 NotPrivateZone bash-my-universe.com.
2115-
/hostedzone/Z4444444444444 3 NotPrivateZone bashmyaws.org.
2116-
/hostedzone/Z1111111111111 3 NotPrivateZone bash-my-aws.com.
2117-
/hostedzone/Z2222222222222 3 NotPrivateZone bashmyaws.com.
2118-
2119-
2120-
### hosted-zone-ns-records
2121-
2122-
Generate NS records for delegating domain to AWS
2123-
2124-
$ hosted-zones bash-my-aws.org
2125-
/hostedzone/ZJ6ZCG2UD6OKX 5 NotPrivateZone bash-my-aws.org.
2126-
2127-
$ hosted-zones bash-my-aws.org | hosted-zone-ns-records
2128-
bash-my-aws.org. 300 IN NS ns-786.awsdns-34.net.
2129-
bash-my-aws.org. 300 IN NS ns-1549.awsdns-01.co.uk.
2130-
bash-my-aws.org. 300 IN NS ns-362.awsdns-45.com.
2131-
bash-my-aws.org. 300 IN NS ns-1464.awsdns-55.org.
2132-
2133-
21341975
## s3-commands
21351976

21361977

@@ -2251,24 +2092,24 @@ Run a command locally on EC2 instance(s) running Windows
22512092
$ ssm-instances Windows | ssm-send-command-windows Get-Hotfix
22522093
Command ID: a0eeeddc-2edf-42bc-b0c7-122f5bc50956
22532094
Waiting for command to complete...
2254-
i-0fake1234abcd
2255-
Source Description HotFixID InstalledBy InstalledOn
2256-
------ ----------- -------- ----------- -----------
2257-
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2258-
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2259-
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2260-
FAKEAPP01234 Update KB2345678 NT AUTHORITY\SYSTEM 1/9/2019 12:00:00 AM
2261-
FAKEAPP01234 Update KB3456789 NT AUTHORITY\SYSTEM 3/11/2021 12:00:00 AM
2262-
FAKEAPP01234 Security Update KB4567890 NT AUTHORITY\SYSTEM 4/21/2019 12:00:00 AM
2263-
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 5/15/2019 12:00:00 AM
2264-
FAKEAPP01234 Security Update KB6789012 NT AUTHORITY\SYSTEM 6/12/2019 12:00:00 AM
2265-
---Output truncated---
2266-
i-0fake1234abcd
2267-
Source Description HotFixID InstalledBy InstalledOn
2268-
------ ----------- -------- ----------- -----------
2269-
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2270-
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2271-
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2095+
i-0fake1234abcd
2096+
Source Description HotFixID InstalledBy InstalledOn
2097+
------ ----------- -------- ----------- -----------
2098+
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2099+
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2100+
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2101+
FAKEAPP01234 Update KB2345678 NT AUTHORITY\SYSTEM 1/9/2019 12:00:00 AM
2102+
FAKEAPP01234 Update KB3456789 NT AUTHORITY\SYSTEM 3/11/2021 12:00:00 AM
2103+
FAKEAPP01234 Security Update KB4567890 NT AUTHORITY\SYSTEM 4/21/2019 12:00:00 AM
2104+
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 5/15/2019 12:00:00 AM
2105+
FAKEAPP01234 Security Update KB6789012 NT AUTHORITY\SYSTEM 6/12/2019 12:00:00 AM
2106+
---Output truncated---
2107+
i-0fake1234abcd
2108+
Source Description HotFixID InstalledBy InstalledOn
2109+
------ ----------- -------- ----------- -----------
2110+
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2111+
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2112+
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
22722113

22732114
See also: ssm-send-command-windows
22742115

functions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ elbv2-dnsname
116116
elbv2-subnets
117117
elbv2-target-groups
118118
elbv2s
119+
hosted-zone-a-records
119120
hosted-zone-ns-records
120121
hosted-zones
121122
iam-role-principal

0 commit comments

Comments
 (0)