aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Buchholz <tomalok@gmail.com>2019-06-10 20:52:04 -0700
committerMike Crute <mike@crute.us>2019-07-05 12:51:09 -0700
commitdef572e470d4d3ce6378d8b9b26b7716896ca536 (patch)
tree49de2e3d3277f6f17e113d96294fe30cc9accf12
parentbc4e1ec30f9ac38685c6861d6ebd6ee80a307305 (diff)
downloadalpine-ec2-ami-def572e470d4d3ce6378d8b9b26b7716896ca536.tar.bz2
alpine-ec2-ami-def572e470d4d3ce6378d8b9b26b7716896ca536.tar.xz
alpine-ec2-ami-def572e470d4d3ce6378d8b9b26b7716896ca536.zip
new AMIs (with metadata tags), handle ClientError in prune-amis.py
-rw-r--r--releases/alpine.yaml103
-rw-r--r--scripts/prune-amis.py.in6
2 files changed, 70 insertions, 39 deletions
diff --git a/releases/alpine.yaml b/releases/alpine.yaml
index 9823199..1b40d41 100644
--- a/releases/alpine.yaml
+++ b/releases/alpine.yaml
@@ -9,50 +9,77 @@ current-x86_64:
9 arch: x86_64 9 arch: x86_64
10 revision: r0 10 revision: r0
11 end_of_life: '2021-01-01T00:00:00' 11 end_of_life: '2021-01-01T00:00:00'
12 build_time: 1559014278 12 build_time: 1560223551
13 artifacts: 13 artifacts:
14 ap-northeast-1: ami-0251fa7f8f8ed0a3b 14 ap-northeast-1: ami-0bb4073495ff2021e
15 ap-northeast-2: ami-0bb32f18ed247323e 15 ap-northeast-2: ami-028d3d1675161319e
16 ap-south-1: ami-0ca42c8d33ec3ef66 16 ap-south-1: ami-0f94a69d1ff0a7860
17 ap-southeast-1: ami-032330b6de2f39f75 17 ap-southeast-1: ami-0f1c039e595dd2d02
18 ap-southeast-2: ami-0681743c5235cb677 18 ap-southeast-2: ami-0ca5b7ca3caa92758
19 ca-central-1: ami-0dfcf967a696ee901 19 ca-central-1: ami-05a3c167410bf6b35
20 eu-central-1: ami-07a8060b90f208cf2 20 eu-central-1: ami-02df82b83ad2cdaec
21 eu-north-1: ami-0f25dd1f2ab208b34 21 eu-north-1: ami-0f7b7e2bef1209f6c
22 eu-west-1: ami-07453094c6d42a07e 22 eu-west-1: ami-09234e83a8015efa4
23 eu-west-2: ami-03fa8e7cff9293332 23 eu-west-2: ami-091a16ac6bd29bdd3
24 eu-west-3: ami-07aad42fdc4a7e79b 24 eu-west-3: ami-084cb673481c3f793
25 sa-east-1: ami-04cac088d12e5ebf0 25 sa-east-1: ami-014d631c23ebf306a
26 us-east-1: ami-0c2c618b193741157 26 us-east-1: ami-04a29b11e34acf54d
27 us-east-2: ami-012e1a22371695544 27 us-east-2: ami-0d9445885a19e00ca
28 us-west-1: ami-00f0f067a7d90b7e4 28 us-west-1: ami-0bef2dc6d3f4e19a2
29 us-west-2: ami-0ed0fed8f127914fb 29 us-west-2: ami-0af07dadd734834a7
30edge-x86_64: 30edge-x86_64:
31 edge: 31 edge:
32 alpine-ami-edge-x86_64-20190528032210: 32 alpine-ami-edge-x86_64-20190611013502:
33 description: Alpine Linux edge x86_64 20190528032210 - https://github.com/mcrute/alpine-ec2-ami 33 description: Alpine Linux edge x86_64 20190611013502 - https://github.com/mcrute/alpine-ec2-ami
34 profile: alpine 34 profile: alpine
35 profile_build: edge-x86_64 35 profile_build: edge-x86_64
36 version: edge 36 version: edge
37 release: edge 37 release: edge
38 arch: x86_64 38 arch: x86_64
39 revision: '20190528032210' 39 revision: '20190611013502'
40 end_of_life: '2019-05-29T03:22:10' 40 end_of_life: '2019-06-12T01:35:02'
41 build_time: 1559014836 41 build_time: 1560217495
42 artifacts: 42 artifacts:
43 ap-northeast-1: ami-03a19ed410069a4d8 43 ap-northeast-1: ami-0e4ad0a988beaadd0
44 ap-northeast-2: ami-05988a6c4660792ce 44 ap-northeast-2: ami-0fa8819de67a529ed
45 ap-south-1: ami-08aaeba360cdab5a4 45 ap-south-1: ami-007b857e93d455a5d
46 ap-southeast-1: ami-01ae6c2b20966a358 46 ap-southeast-1: ami-06c7dbd709213a1af
47 ap-southeast-2: ami-00193ff2f592dc22c 47 ap-southeast-2: ami-0640965542f4783f9
48 ca-central-1: ami-086b7f5aa4cf0194e 48 ca-central-1: ami-07d1273f35efb64d0
49 eu-central-1: ami-089db5b316937779b 49 eu-central-1: ami-0d19961f6fbb14cf2
50 eu-north-1: ami-02ed2f6e56115d6f2 50 eu-north-1: ami-0c90cce137ba0a365
51 eu-west-1: ami-0afa00bfa1c870509 51 eu-west-1: ami-0c902d47d3941eba5
52 eu-west-2: ami-0b1e309dfd74525f2 52 eu-west-2: ami-0ac5ef7a7cc272443
53 eu-west-3: ami-0404d34bb3376e370 53 eu-west-3: ami-0e5b8927e00c7d6fa
54 sa-east-1: ami-053be80e8c7b1ad62 54 sa-east-1: ami-061957e3677b43094
55 us-east-1: ami-0d1ea89d2b00334f5 55 us-east-1: ami-012598956fe159ff9
56 us-east-2: ami-0939714c9fe9ec10e 56 us-east-2: ami-039647ff1acb463a3
57 us-west-1: ami-0b9c5086efa0f067b 57 us-west-1: ami-0edcc6f8b14fb9e29
58 us-west-2: ami-0719ffe4d94e67432 58 us-west-2: ami-08e91c3b5d1331347
59 alpine-ami-edge-x86_64-20190611031724:
60 description: Alpine Linux edge x86_64 20190611031724 - https://github.com/mcrute/alpine-ec2-ami
61 profile: alpine
62 profile_build: edge-x86_64
63 version: edge
64 release: edge
65 arch: x86_64
66 revision: '20190611031724'
67 end_of_life: '2019-06-12T03:17:24'
68 build_time: 1560224089
69 artifacts:
70 ap-northeast-1: ami-0c97e7cdda534346b
71 ap-northeast-2: ami-00cceaf8288ee7386
72 ap-south-1: ami-09e1d1ef7cd517a64
73 ap-southeast-1: ami-037323416789f3ce1
74 ap-southeast-2: ami-0d182653643257211
75 ca-central-1: ami-008c0bd239c168b34
76 eu-central-1: ami-0d808164dace58b4e
77 eu-north-1: ami-0c3152b1fd3b21ae9
78 eu-west-1: ami-031b9d6c98019452b
79 eu-west-2: ami-029d4646a3ea4fc0f
80 eu-west-3: ami-0d1e6f66f5a7fc568
81 sa-east-1: ami-0b00f41d3df265296
82 us-east-1: ami-014a8bfc05b292686
83 us-east-2: ami-0d99a25549626e548
84 us-west-1: ami-03f03158096a615cd
85 us-west-2: ami-09a619850cd514295
diff --git a/scripts/prune-amis.py.in b/scripts/prune-amis.py.in
index dd6f6d8..3009204 100644
--- a/scripts/prune-amis.py.in
+++ b/scripts/prune-amis.py.in
@@ -5,6 +5,7 @@ from datetime import datetime
5import os 5import os
6import sys 6import sys
7import boto3 7import boto3
8from botocore.exceptions import ClientError
8import yaml 9import yaml
9 10
10LEVELS = ['revision', 'release', 'version'] 11LEVELS = ['revision', 'release', 'version']
@@ -107,7 +108,8 @@ for region in AWS.get_available_regions('ec2'):
107 print("* scanning: " + region + '...') 108 print("* scanning: " + region + '...')
108 EC2 = AWS.client('ec2', region_name=region) 109 EC2 = AWS.client('ec2', region_name=region)
109 110
110 for image in EC2.describe_images(Owners=['self'])['Images']: 111 try:
112 for image in EC2.describe_images(Owners=['self'])['Images']:
111 113
112 action = '? UNKNOWN' 114 action = '? UNKNOWN'
113 if region in prune and image['ImageId'] in prune[region]: 115 if region in prune and image['ImageId'] in prune[region]:
@@ -127,6 +129,8 @@ for region in AWS.get_available_regions('ec2'):
127 EC2.delete_snapshot( 129 EC2.delete_snapshot(
128 SnapshotId=blockdev['Ebs']['SnapshotId']) 130 SnapshotId=blockdev['Ebs']['SnapshotId'])
129 print() 131 print()
132 except ClientError as e:
133 print(e)
130 134
131# update releases/<profile>.yaml 135# update releases/<profile>.yaml
132with open(RELEASE_YAML, 'w') as data: 136with open(RELEASE_YAML, 'w') as data: