new AMIs (with metadata tags), handle ClientError in prune-amis.py

This commit is contained in:
Jake Buchholz 2019-06-10 20:52:04 -07:00 committed by Mike Crute
parent bc4e1ec30f
commit def572e470
2 changed files with 70 additions and 39 deletions

View File

@ -9,50 +9,77 @@ current-x86_64:
arch: x86_64
revision: r0
end_of_life: '2021-01-01T00:00:00'
build_time: 1559014278
build_time: 1560223551
artifacts:
ap-northeast-1: ami-0251fa7f8f8ed0a3b
ap-northeast-2: ami-0bb32f18ed247323e
ap-south-1: ami-0ca42c8d33ec3ef66
ap-southeast-1: ami-032330b6de2f39f75
ap-southeast-2: ami-0681743c5235cb677
ca-central-1: ami-0dfcf967a696ee901
eu-central-1: ami-07a8060b90f208cf2
eu-north-1: ami-0f25dd1f2ab208b34
eu-west-1: ami-07453094c6d42a07e
eu-west-2: ami-03fa8e7cff9293332
eu-west-3: ami-07aad42fdc4a7e79b
sa-east-1: ami-04cac088d12e5ebf0
us-east-1: ami-0c2c618b193741157
us-east-2: ami-012e1a22371695544
us-west-1: ami-00f0f067a7d90b7e4
us-west-2: ami-0ed0fed8f127914fb
ap-northeast-1: ami-0bb4073495ff2021e
ap-northeast-2: ami-028d3d1675161319e
ap-south-1: ami-0f94a69d1ff0a7860
ap-southeast-1: ami-0f1c039e595dd2d02
ap-southeast-2: ami-0ca5b7ca3caa92758
ca-central-1: ami-05a3c167410bf6b35
eu-central-1: ami-02df82b83ad2cdaec
eu-north-1: ami-0f7b7e2bef1209f6c
eu-west-1: ami-09234e83a8015efa4
eu-west-2: ami-091a16ac6bd29bdd3
eu-west-3: ami-084cb673481c3f793
sa-east-1: ami-014d631c23ebf306a
us-east-1: ami-04a29b11e34acf54d
us-east-2: ami-0d9445885a19e00ca
us-west-1: ami-0bef2dc6d3f4e19a2
us-west-2: ami-0af07dadd734834a7
edge-x86_64:
edge:
alpine-ami-edge-x86_64-20190528032210:
description: Alpine Linux edge x86_64 20190528032210 - https://github.com/mcrute/alpine-ec2-ami
alpine-ami-edge-x86_64-20190611013502:
description: Alpine Linux edge x86_64 20190611013502 - https://github.com/mcrute/alpine-ec2-ami
profile: alpine
profile_build: edge-x86_64
version: edge
release: edge
arch: x86_64
revision: '20190528032210'
end_of_life: '2019-05-29T03:22:10'
build_time: 1559014836
revision: '20190611013502'
end_of_life: '2019-06-12T01:35:02'
build_time: 1560217495
artifacts:
ap-northeast-1: ami-03a19ed410069a4d8
ap-northeast-2: ami-05988a6c4660792ce
ap-south-1: ami-08aaeba360cdab5a4
ap-southeast-1: ami-01ae6c2b20966a358
ap-southeast-2: ami-00193ff2f592dc22c
ca-central-1: ami-086b7f5aa4cf0194e
eu-central-1: ami-089db5b316937779b
eu-north-1: ami-02ed2f6e56115d6f2
eu-west-1: ami-0afa00bfa1c870509
eu-west-2: ami-0b1e309dfd74525f2
eu-west-3: ami-0404d34bb3376e370
sa-east-1: ami-053be80e8c7b1ad62
us-east-1: ami-0d1ea89d2b00334f5
us-east-2: ami-0939714c9fe9ec10e
us-west-1: ami-0b9c5086efa0f067b
us-west-2: ami-0719ffe4d94e67432
ap-northeast-1: ami-0e4ad0a988beaadd0
ap-northeast-2: ami-0fa8819de67a529ed
ap-south-1: ami-007b857e93d455a5d
ap-southeast-1: ami-06c7dbd709213a1af
ap-southeast-2: ami-0640965542f4783f9
ca-central-1: ami-07d1273f35efb64d0
eu-central-1: ami-0d19961f6fbb14cf2
eu-north-1: ami-0c90cce137ba0a365
eu-west-1: ami-0c902d47d3941eba5
eu-west-2: ami-0ac5ef7a7cc272443
eu-west-3: ami-0e5b8927e00c7d6fa
sa-east-1: ami-061957e3677b43094
us-east-1: ami-012598956fe159ff9
us-east-2: ami-039647ff1acb463a3
us-west-1: ami-0edcc6f8b14fb9e29
us-west-2: ami-08e91c3b5d1331347
alpine-ami-edge-x86_64-20190611031724:
description: Alpine Linux edge x86_64 20190611031724 - https://github.com/mcrute/alpine-ec2-ami
profile: alpine
profile_build: edge-x86_64
version: edge
release: edge
arch: x86_64
revision: '20190611031724'
end_of_life: '2019-06-12T03:17:24'
build_time: 1560224089
artifacts:
ap-northeast-1: ami-0c97e7cdda534346b
ap-northeast-2: ami-00cceaf8288ee7386
ap-south-1: ami-09e1d1ef7cd517a64
ap-southeast-1: ami-037323416789f3ce1
ap-southeast-2: ami-0d182653643257211
ca-central-1: ami-008c0bd239c168b34
eu-central-1: ami-0d808164dace58b4e
eu-north-1: ami-0c3152b1fd3b21ae9
eu-west-1: ami-031b9d6c98019452b
eu-west-2: ami-029d4646a3ea4fc0f
eu-west-3: ami-0d1e6f66f5a7fc568
sa-east-1: ami-0b00f41d3df265296
us-east-1: ami-014a8bfc05b292686
us-east-2: ami-0d99a25549626e548
us-west-1: ami-03f03158096a615cd
us-west-2: ami-09a619850cd514295

View File

@ -5,6 +5,7 @@ from datetime import datetime
import os
import sys
import boto3
from botocore.exceptions import ClientError
import yaml
LEVELS = ['revision', 'release', 'version']
@ -107,7 +108,8 @@ for region in AWS.get_available_regions('ec2'):
print("* scanning: " + region + '...')
EC2 = AWS.client('ec2', region_name=region)
for image in EC2.describe_images(Owners=['self'])['Images']:
try:
for image in EC2.describe_images(Owners=['self'])['Images']:
action = '? UNKNOWN'
if region in prune and image['ImageId'] in prune[region]:
@ -127,6 +129,8 @@ for region in AWS.get_available_regions('ec2'):
EC2.delete_snapshot(
SnapshotId=blockdev['Ebs']['SnapshotId'])
print()
except ClientError as e:
print(e)
# update releases/<profile>.yaml
with open(RELEASE_YAML, 'w') as data: