Skip to content

Commit 6fea928

Browse files
committed
chore: add FIPS Updates to the ec2 demo examples
Signed-off-by: Renan Rodrigo <[email protected]>
1 parent 36d9a0d commit 6fea928

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

examples/ec2.py

+15-20
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,13 @@ def launch_basic(ec2, daily):
9292
print(instance.availability_zone)
9393

9494

95-
def launch_pro(ec2, daily):
96-
"""Show basic functionality on PRO instances."""
97-
print("Launching Pro instance...")
98-
with ec2.launch(daily) as instance:
99-
instance.wait()
100-
print(instance.execute("sudo ua status --wait"))
101-
print("Deleting Pro instance...")
102-
103-
104-
def launch_pro_fips(ec2, daily):
105-
"""Show basic functionality on PRO instances."""
106-
print("Launching Pro FIPS instance...")
107-
with ec2.launch(daily) as instance:
95+
def launch_pro(ec2, name, image):
96+
"""Show basic functionality on Pro instances."""
97+
print("Launching {} instance...".format(name))
98+
with ec2.launch(image) as instance:
10899
instance.wait()
109-
print(instance.execute("sudo ua status --wait"))
110-
print("Deleting Pro FIPS instance...")
100+
print(instance.execute("sudo pro status --wait"))
101+
print("Deleting {} instance...".format(name))
111102

112103

113104
def handle_ssh_key(ec2, key_name):
@@ -140,13 +131,17 @@ def demo():
140131
key_name = "test-ec2"
141132
handle_ssh_key(ec2, key_name)
142133

143-
daily = ec2.daily_image(release="bionic")
144-
daily_pro = ec2.daily_image(release="bionic", image_type=ImageType.PRO)
145-
daily_pro_fips = ec2.daily_image(release="bionic", image_type=ImageType.PRO_FIPS)
134+
daily = ec2.daily_image(release="focal")
135+
daily_pro = ec2.daily_image(release="focal", image_type=ImageType.PRO)
136+
daily_pro_fips = ec2.daily_image(release="focal", image_type=ImageType.PRO_FIPS)
137+
daily_pro_fips_updates = ec2.daily_image(
138+
release="focal", image_type=ImageType.PRO_FIPS_UPDATES
139+
)
146140

147141
launch_basic(ec2, daily)
148-
launch_pro(ec2, daily_pro)
149-
launch_pro_fips(ec2, daily_pro_fips)
142+
launch_pro(ec2, "PRO", daily_pro)
143+
launch_pro(ec2, "PRO FIPS", daily_pro_fips)
144+
launch_pro(ec2, "PRO FIPS UPDATES", daily_pro_fips_updates)
150145
custom_vpc(ec2, daily)
151146
snapshot(ec2, daily)
152147
launch_multiple(ec2, daily)

0 commit comments

Comments
 (0)