Skip to content

Commit b515680

Browse files
committed
add test for EC2
1 parent 99e3028 commit b515680

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

test/test_ec2_stack.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
from aws_cdk import App, Environment
3-
from aws_cdk.assertions import Template
4-
# from aws_cdk.assertions import Capture, Match
3+
from aws_cdk.assertions import Template, Match
4+
# from aws_cdk.assertions import Capture
55

66
from app.ec2_instance_stack import EC2InstanceStack
77

@@ -30,3 +30,20 @@ def test_vpc():
3030
"Value": "ec2-instance/VPC"}]
3131
}
3232
)
33+
34+
35+
def test_ec2():
36+
template.has_resource_properties(
37+
"AWS::EC2::Instance",
38+
{"InstanceType": Match.string_like_regexp("t2.small")}
39+
)
40+
41+
template.has_resource_properties(
42+
"AWS::EC2::Instance",
43+
{"AvailabilityZone": Match.string_like_regexp("dummy1a")}
44+
)
45+
46+
template.has_resource_properties(
47+
"AWS::EC2::Instance",
48+
{"ImageId": Match.string_like_regexp("ami-")}
49+
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy