Skip to content

Commit f3d4d96

Browse files
committed
fix: try ami name in scope
1 parent f84fc1f commit f3d4d96

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/aws_resize.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
ec2_client = boto3.client('ec2')
88
ec2_resource = boto3.resource('ec2')
99

10-
# Get the AMI name from environment variable
11-
AMI_NAME = os.environ.get('PRE_AMI_NAME')
12-
1310
def launch_temporary_instance():
1411
# Describe the AMI
12+
AMI_NAME = os.environ.get('PRE_AMI_NAME')
1513
images = ec2_client.describe_images(Owners=['self'], Filters=[{'Name': 'name', 'Values': [AMI_NAME]}])
1614
if not images['Images']:
1715
raise Exception(f"No AMI found with name: {AMI_NAME}")

0 commit comments

Comments
 (0)