Skip to content

Commit 43b0fc4

Browse files
authored
chore: add baseline transform test for issue #2297 (#2706)
1 parent 56d34ff commit 43b0fc4

4 files changed

+398
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Resources:
2+
AppApi:
3+
Type: AWS::Serverless::HttpApi
4+
Properties:
5+
FailOnWarnings: true
6+
StageName: $default
7+
AppFunction:
8+
Type: AWS::Serverless::Function
9+
Properties:
10+
InlineCode: foo
11+
Handler: bar
12+
Runtime: nodejs14.x
13+
Events:
14+
AppHandler:
15+
Type: HttpApi
16+
Properties:
17+
ApiId: !Ref AppApi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"Resources": {
3+
"AppApi": {
4+
"Properties": {
5+
"Body": {
6+
"info": {
7+
"title": {
8+
"Ref": "AWS::StackName"
9+
},
10+
"version": "1.0"
11+
},
12+
"openapi": "3.0.1",
13+
"paths": {
14+
"$default": {
15+
"x-amazon-apigateway-any-method": {
16+
"isDefaultRoute": true,
17+
"responses": {},
18+
"x-amazon-apigateway-integration": {
19+
"httpMethod": "POST",
20+
"payloadFormatVersion": "2.0",
21+
"type": "aws_proxy",
22+
"uri": {
23+
"Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${AppFunction.Arn}/invocations"
24+
}
25+
}
26+
}
27+
}
28+
},
29+
"tags": [
30+
{
31+
"name": "httpapi:createdBy",
32+
"x-amazon-apigateway-tag-value": "SAM"
33+
}
34+
]
35+
},
36+
"FailOnWarnings": true
37+
},
38+
"Type": "AWS::ApiGatewayV2::Api"
39+
},
40+
"AppApiApiGatewayDefaultStage": {
41+
"Properties": {
42+
"ApiId": {
43+
"Ref": "AppApi"
44+
},
45+
"AutoDeploy": true,
46+
"StageName": "$default",
47+
"Tags": {
48+
"httpapi:createdBy": "SAM"
49+
}
50+
},
51+
"Type": "AWS::ApiGatewayV2::Stage"
52+
},
53+
"AppFunction": {
54+
"Properties": {
55+
"Code": {
56+
"ZipFile": "foo"
57+
},
58+
"Handler": "bar",
59+
"Role": {
60+
"Fn::GetAtt": [
61+
"AppFunctionRole",
62+
"Arn"
63+
]
64+
},
65+
"Runtime": "nodejs14.x",
66+
"Tags": [
67+
{
68+
"Key": "lambda:createdBy",
69+
"Value": "SAM"
70+
}
71+
]
72+
},
73+
"Type": "AWS::Lambda::Function"
74+
},
75+
"AppFunctionAppHandlerPermission": {
76+
"Properties": {
77+
"Action": "lambda:InvokeFunction",
78+
"FunctionName": {
79+
"Ref": "AppFunction"
80+
},
81+
"Principal": "apigateway.amazonaws.com",
82+
"SourceArn": {
83+
"Fn::Sub": [
84+
"arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*",
85+
{
86+
"__ApiId__": {
87+
"Ref": "AppApi"
88+
},
89+
"__Stage__": "*"
90+
}
91+
]
92+
}
93+
},
94+
"Type": "AWS::Lambda::Permission"
95+
},
96+
"AppFunctionRole": {
97+
"Properties": {
98+
"AssumeRolePolicyDocument": {
99+
"Statement": [
100+
{
101+
"Action": [
102+
"sts:AssumeRole"
103+
],
104+
"Effect": "Allow",
105+
"Principal": {
106+
"Service": [
107+
"lambda.amazonaws.com"
108+
]
109+
}
110+
}
111+
],
112+
"Version": "2012-10-17"
113+
},
114+
"ManagedPolicyArns": [
115+
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
116+
],
117+
"Tags": [
118+
{
119+
"Key": "lambda:createdBy",
120+
"Value": "SAM"
121+
}
122+
]
123+
},
124+
"Type": "AWS::IAM::Role"
125+
}
126+
}
127+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"Resources": {
3+
"AppApi": {
4+
"Properties": {
5+
"Body": {
6+
"info": {
7+
"title": {
8+
"Ref": "AWS::StackName"
9+
},
10+
"version": "1.0"
11+
},
12+
"openapi": "3.0.1",
13+
"paths": {
14+
"$default": {
15+
"x-amazon-apigateway-any-method": {
16+
"isDefaultRoute": true,
17+
"responses": {},
18+
"x-amazon-apigateway-integration": {
19+
"httpMethod": "POST",
20+
"payloadFormatVersion": "2.0",
21+
"type": "aws_proxy",
22+
"uri": {
23+
"Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${AppFunction.Arn}/invocations"
24+
}
25+
}
26+
}
27+
}
28+
},
29+
"tags": [
30+
{
31+
"name": "httpapi:createdBy",
32+
"x-amazon-apigateway-tag-value": "SAM"
33+
}
34+
]
35+
},
36+
"FailOnWarnings": true
37+
},
38+
"Type": "AWS::ApiGatewayV2::Api"
39+
},
40+
"AppApiApiGatewayDefaultStage": {
41+
"Properties": {
42+
"ApiId": {
43+
"Ref": "AppApi"
44+
},
45+
"AutoDeploy": true,
46+
"StageName": "$default",
47+
"Tags": {
48+
"httpapi:createdBy": "SAM"
49+
}
50+
},
51+
"Type": "AWS::ApiGatewayV2::Stage"
52+
},
53+
"AppFunction": {
54+
"Properties": {
55+
"Code": {
56+
"ZipFile": "foo"
57+
},
58+
"Handler": "bar",
59+
"Role": {
60+
"Fn::GetAtt": [
61+
"AppFunctionRole",
62+
"Arn"
63+
]
64+
},
65+
"Runtime": "nodejs14.x",
66+
"Tags": [
67+
{
68+
"Key": "lambda:createdBy",
69+
"Value": "SAM"
70+
}
71+
]
72+
},
73+
"Type": "AWS::Lambda::Function"
74+
},
75+
"AppFunctionAppHandlerPermission": {
76+
"Properties": {
77+
"Action": "lambda:InvokeFunction",
78+
"FunctionName": {
79+
"Ref": "AppFunction"
80+
},
81+
"Principal": "apigateway.amazonaws.com",
82+
"SourceArn": {
83+
"Fn::Sub": [
84+
"arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*",
85+
{
86+
"__ApiId__": {
87+
"Ref": "AppApi"
88+
},
89+
"__Stage__": "*"
90+
}
91+
]
92+
}
93+
},
94+
"Type": "AWS::Lambda::Permission"
95+
},
96+
"AppFunctionRole": {
97+
"Properties": {
98+
"AssumeRolePolicyDocument": {
99+
"Statement": [
100+
{
101+
"Action": [
102+
"sts:AssumeRole"
103+
],
104+
"Effect": "Allow",
105+
"Principal": {
106+
"Service": [
107+
"lambda.amazonaws.com"
108+
]
109+
}
110+
}
111+
],
112+
"Version": "2012-10-17"
113+
},
114+
"ManagedPolicyArns": [
115+
"arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
116+
],
117+
"Tags": [
118+
{
119+
"Key": "lambda:createdBy",
120+
"Value": "SAM"
121+
}
122+
]
123+
},
124+
"Type": "AWS::IAM::Role"
125+
}
126+
}
127+
}

0 commit comments

Comments
 (0)