Skip to content

Commit 65a826c

Browse files
authored
chore: make custom domains api test nonblocking (#3191)
1 parent 2c06b57 commit 65a826c

22 files changed

+4071
-0
lines changed

integration/combination/test_custom_http_api_domains_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
from integration.config.service_names import CUSTOM_DOMAIN
44
from integration.helpers.base_internal_test import BaseInternalTest
5+
from integration.helpers.base_test import nonblocking
56
from integration.helpers.resource import current_region_not_included
67

78

89
@skipIf(
910
current_region_not_included([CUSTOM_DOMAIN]),
1011
"CustomDomain is not supported in this testing region",
1112
)
13+
@nonblocking
1214
class TestCustomHttpApiDomains(BaseInternalTest):
1315
def test_custom_http_api_domains_regional(self):
1416
self.create_and_verify_stack("combination/http_api_with_custom_domains_regional")

integration/combination/test_custom_rest_api_domains.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
from integration.config.service_names import CUSTOM_DOMAIN
44
from integration.helpers.base_internal_test import BaseInternalTest
5+
from integration.helpers.base_test import nonblocking
56
from integration.helpers.resource import current_region_not_included
67

78

89
@skipIf(
910
current_region_not_included([CUSTOM_DOMAIN]),
1011
"CustomDomain is not supported in this testing region",
1112
)
13+
@nonblocking
1214
class TestCustomRestApiDomains(BaseInternalTest):
1315
def test_custom_rest_api_domains_edge(self):
1416
self.create_and_verify_stack("combination/api_with_custom_domains_edge")
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Parameters:
2+
MyRestRegionalDomainName:
3+
Type: String
4+
MyRestRegionalDomainCert:
5+
Type: String
6+
HostedZoneId:
7+
Type: String
8+
9+
Globals:
10+
Api:
11+
Domain:
12+
DomainName:
13+
Ref: MyRestRegionalDomainName
14+
CertificateArn:
15+
Ref: MyRestRegionalDomainCert
16+
EndpointConfiguration: REGIONAL
17+
MutualTlsAuthentication:
18+
TruststoreUri: ${mtlsuri}
19+
TruststoreVersion: 0
20+
SecurityPolicy: TLS_1_2
21+
BasePath:
22+
- /get
23+
- /post
24+
Route53:
25+
HostedZoneId:
26+
Ref: HostedZoneId
27+
28+
Resources:
29+
MyFunction:
30+
Type: AWS::Serverless::Function
31+
Properties:
32+
InlineCode: |
33+
exports.handler = async (event) => {
34+
const response = {
35+
statusCode: 200,
36+
body: JSON.stringify('Hello from Lambda!'),
37+
};
38+
return response;
39+
};
40+
Handler: index.handler
41+
Runtime: nodejs14.x
42+
Events:
43+
ImplicitGet:
44+
Type: Api
45+
Properties:
46+
Method: Get
47+
Path: /get
48+
ImplicitPost:
49+
Type: Api
50+
Properties:
51+
Method: Post
52+
Path: /post
53+
Metadata:
54+
SamTransformTest: true
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Parameters:
2+
MyEdgeDomainName:
3+
Type: String
4+
MyEdgeDomainCert:
5+
Type: String
6+
HostedZoneId:
7+
Type: String
8+
9+
Resources:
10+
MyFunction:
11+
Type: AWS::Serverless::Function
12+
Properties:
13+
InlineCode: |
14+
exports.handler = async (event) => {
15+
const response = {
16+
statusCode: 200,
17+
body: JSON.stringify('Hello from Lambda!'),
18+
};
19+
return response;
20+
};
21+
Handler: index.handler
22+
Runtime: nodejs14.x
23+
Events:
24+
Fetch:
25+
Type: Api
26+
Properties:
27+
RestApiId:
28+
Ref: MyApi
29+
Method: Get
30+
Path: /get
31+
32+
MyApi:
33+
Type: AWS::Serverless::Api
34+
Properties:
35+
OpenApiVersion: 3.0.1
36+
StageName: Prod
37+
Domain:
38+
DomainName:
39+
Ref: MyEdgeDomainName
40+
CertificateArn:
41+
Ref: MyEdgeDomainCert
42+
EndpointConfiguration: EDGE
43+
BasePath:
44+
- /get
45+
Route53:
46+
HostedZoneId:
47+
Ref: HostedZoneId
48+
IpV6: true
49+
Metadata:
50+
SamTransformTest: true
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Parameters:
2+
MyDomainName:
3+
Type: String
4+
MyDomainCertificate:
5+
Type: String
6+
MyDomainOwnershipVerificationCertificate:
7+
Type: String
8+
HostedZoneId:
9+
Type: String
10+
11+
Globals:
12+
Api:
13+
Domain:
14+
DomainName:
15+
Ref: MyDomainName
16+
CertificateArn:
17+
Ref: MyDomainCertificate
18+
EndpointConfiguration: REGIONAL
19+
MutualTlsAuthentication:
20+
TruststoreUri: ${mtlsuri}
21+
TruststoreVersion: 0
22+
SecurityPolicy: TLS_1_2
23+
BasePath:
24+
- /get
25+
- /post
26+
Route53:
27+
HostedZoneId:
28+
Ref: HostedZoneId
29+
OwnershipVerificationCertificateArn:
30+
Ref: MyDomainOwnershipVerificationCertificate
31+
32+
Resources:
33+
MyFunction:
34+
Type: AWS::Serverless::Function
35+
Properties:
36+
InlineCode: |
37+
exports.handler = async (event) => {
38+
const response = {
39+
statusCode: 200,
40+
body: JSON.stringify('Hello from Lambda!'),
41+
};
42+
return response;
43+
};
44+
Handler: index.handler
45+
Runtime: nodejs14.x
46+
Events:
47+
ImplicitGet:
48+
Type: Api
49+
Properties:
50+
Method: Get
51+
Path: /get
52+
ImplicitPost:
53+
Type: Api
54+
Properties:
55+
Method: Post
56+
Path: /post
57+
Metadata:
58+
SamTransformTest: true
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Parameters:
2+
MyDomainName:
3+
Type: String
4+
MyDomainCert:
5+
Type: String
6+
HostedZoneId:
7+
Type: String
8+
9+
Globals:
10+
HttpApi:
11+
Domain:
12+
DomainName:
13+
Ref: MyDomainName
14+
CertificateArn:
15+
Ref: MyDomainCert
16+
EndpointConfiguration: REGIONAL
17+
MutualTlsAuthentication:
18+
TruststoreUri: ${mtlsuri}
19+
TruststoreVersion: 0
20+
SecurityPolicy: TLS_1_2
21+
BasePath:
22+
- /get
23+
- /post
24+
Route53:
25+
HostedZoneId:
26+
Ref: HostedZoneId
27+
28+
Resources:
29+
MyFunction:
30+
Type: AWS::Serverless::Function
31+
Properties:
32+
InlineCode: |
33+
exports.handler = async (event) => {
34+
const response = {
35+
statusCode: 200,
36+
body: JSON.stringify('Hello from Lambda!'),
37+
};
38+
return response;
39+
};
40+
Handler: index.handler
41+
Runtime: nodejs14.x
42+
Events:
43+
ImplicitGet:
44+
Type: HttpApi
45+
Properties:
46+
Method: Get
47+
Path: /get
48+
ApiId:
49+
Ref: MyApi
50+
ImplicitPost:
51+
Type: HttpApi
52+
Properties:
53+
Method: Post
54+
Path: /post
55+
ApiId:
56+
Ref: MyApi
57+
MyApi:
58+
Type: AWS::Serverless::HttpApi
59+
Properties:
60+
StageName: Prod
61+
Metadata:
62+
SamTransformTest: true
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Parameters:
2+
MyRegionalDomainName:
3+
Type: String
4+
MyRegionalDomainCert:
5+
Type: String
6+
MyOwnershipVerificationCert:
7+
Type: String
8+
HostedZoneId:
9+
Type: String
10+
11+
Globals:
12+
HttpApi:
13+
Domain:
14+
DomainName:
15+
Ref: MyRegionalDomainName
16+
CertificateArn:
17+
Ref: MyRegionalDomainCert
18+
EndpointConfiguration: REGIONAL
19+
MutualTlsAuthentication:
20+
TruststoreUri: ${mtlsuri}
21+
TruststoreVersion: 0
22+
SecurityPolicy: TLS_1_2
23+
BasePath:
24+
- /get
25+
- /post
26+
Route53:
27+
HostedZoneId:
28+
Ref: HostedZoneId
29+
OwnershipVerificationCertificateArn:
30+
Ref: MyOwnershipVerificationCert
31+
32+
Resources:
33+
MyFunction:
34+
Type: AWS::Serverless::Function
35+
Properties:
36+
InlineCode: |
37+
exports.handler = async (event) => {
38+
const response = {
39+
statusCode: 200,
40+
body: JSON.stringify('Hello from Lambda!'),
41+
};
42+
return response;
43+
};
44+
Handler: index.handler
45+
Runtime: nodejs14.x
46+
Events:
47+
ImplicitGet:
48+
Type: HttpApi
49+
Properties:
50+
Method: Get
51+
Path: /get
52+
ApiId:
53+
Ref: MyApi
54+
ImplicitPost:
55+
Type: HttpApi
56+
Properties:
57+
Method: Post
58+
Path: /post
59+
ApiId:
60+
Ref: MyApi
61+
MyApi:
62+
Type: AWS::Serverless::HttpApi
63+
Properties:
64+
StageName: Prod
65+
Metadata:
66+
SamTransformTest: true

0 commit comments

Comments
 (0)