Skip to content

Commit ab1d699

Browse files
authored
fix: update cfn-lint versions and match tests (#3651)
1 parent 119e2a2 commit ab1d699

30 files changed

+142
-66
lines changed

.cfnlintrc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ ignore_templates:
134134
- tests/translator/output/**/function_with_tracing.json # Obsolete DependsOn on resource
135135
- tests/translator/output/**/api_with_propagate_tags.json # TODO: Intentional error transform tests. Will be updated.
136136
- tests/translator/output/**/function_with_intrinsics_resource_attribute.json # CFN now supports intrinsics in DeletionPolicy
137+
- tests/translator/output/**/function_with_snapstart.json # Snapstart intentionally not attached to a lambda version which causes lint issues
138+
- tests/translator/output/**/managed_policies_everything.json # intentionally contains wrong arns
137139
ignore_checks:
138140
- E2531 # Deprecated runtime; not relevant for transform tests
141+
- E2533 # Another deprecated runtime; not relevant for transform tests
139142
- W2531 # EOL runtime; not relevant for transform tests
140143
- E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources
141144
- W2001 # Parameter not used
145+
- E3006 # Resource type check; we have some Foo Bar resources

bin/run_cfn_lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ ! -d "${VENV}" ]; then
99
python3 -m venv "${VENV}"
1010
fi
1111

12-
"${VENV}/bin/python" -m pip install cfn-lint==0.75.0 --upgrade --quiet
12+
"${VENV}/bin/python" -m pip install cfn-lint --upgrade --quiet
1313
# update cfn schema
1414
"${VENV}/bin/cfn-lint" -u
1515
"${VENV}/bin/cfn-lint" --format parseable

tests/translator/input/all_policy_templates.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Resources:
170170
EventBusName: name
171171

172172
- AcmGetCertificatePolicy:
173-
CertificateArn: arn
173+
CertificateArn: arn:aws:acm:us-west-2:987654321098:certificate/dec86919-7219-4e8d-8871-7f1609df2c7f
174174

175175
- Route53ChangeResourceRecordSetsPolicy:
176176
HostedZoneId: test

tests/translator/input/connector_with_non_id_source_and_destination.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Resources:
1111
Principal:
1212
Service: lambda.amazonaws.com
1313
ManagedPolicyArns:
14-
- arn:{AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
14+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
1515

1616
SamFunction:
1717
Type: AWS::Serverless::Function

tests/translator/input/embedded_connectors_hardcoded_props.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ Transform: AWS::Serverless-2016-10-31
22
Resources:
33
MyFunction:
44
Type: AWS::Lambda::Function
5+
Properties:
6+
Handler: index.handler
7+
Role: arn:aws:iam::111122223333:role/lambda-role
8+
Runtime: nodejs20.x
9+
Code:
10+
ZipFile: |
11+
exports.handler = function(event, context, callback) {
12+
return callback(null, 'success');
13+
}
514
615
MyRule:
716
Type: AWS::Events::Rule
@@ -13,6 +22,8 @@ Resources:
1322
Arn: !Ref MyTopic
1423
Permissions:
1524
- Write
25+
Properties:
26+
ScheduleExpression: rate(5 minutes)
1627

1728
MyQueue:
1829
Type: AWS::SQS::Queue
@@ -42,6 +53,8 @@ Resources:
4253
Id: MyFunction
4354
Permissions:
4455
- Write
56+
Properties:
57+
Name: MyApiV1
4558

4659
MyApiV2:
4760
Type: AWS::ApiGatewayV2::Api
@@ -54,6 +67,8 @@ Resources:
5467
Id: MyFunction
5568
Permissions:
5669
- Write
70+
Properties:
71+
Name: MyApiV2
5772

5873
MySNSTopic:
5974
Type: AWS::SNS::Topic

tests/translator/input/function_with_alias_and_all_properties_property.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Resources:
4242
- x86_64
4343
EphemeralStorage:
4444
Size: 1024
45-
Role: !Sub arn:${AWS::Partition}:iam::role
45+
Role: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1
4646
KmsKeyArn: !Sub arn:${AWS::Partition}:key:key
4747
FileSystemConfigs:
4848
- Arn: !GetAtt AccessPoint.Arn
@@ -72,7 +72,7 @@ Resources:
7272
- x86_64
7373
EphemeralStorage:
7474
Size: 1024
75-
Role: !Sub arn:${AWS::Partition}:iam::role
75+
Role: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1
7676
KmsKeyArn: !Sub arn:${AWS::Partition}:key:key
7777
FileSystemConfigs:
7878
- Arn: !GetAtt AccessPoint.Arn

tests/translator/input/function_with_sns_event_source_all_parameters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
NotificationTopic:
1010
Type: SNS
1111
Properties:
12-
Topic: topicArn-letsAddMoreSymbols
12+
Topic: arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f
1313
Region: region
1414
FilterPolicy:
1515
store:

tests/translator/input/graphqlapi_ddb_datasource_connector.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Resources:
1818
DynamoDb:
1919
MyDataSource:
2020
TableName: some-table
21-
TableArn: big-arn
21+
TableArn: arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f
2222
AnotherDataSource:
2323
TableName: cool-table
24-
TableArn: table-arn
24+
TableArn: arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f

tests/translator/input/graphqlapi_lambda_datasource_connector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ Resources:
1717
DataSources:
1818
Lambda:
1919
MyDataSource:
20-
FunctionArn: blah
20+
FunctionArn: arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f

tests/translator/output/all_policy_templates.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@
15801580
"Fn::Sub": [
15811581
"${certificateArn}",
15821582
{
1583-
"certificateArn": "arn"
1583+
"certificateArn": "arn:aws:acm:us-west-2:987654321098:certificate/dec86919-7219-4e8d-8871-7f1609df2c7f"
15841584
}
15851585
]
15861586
}

0 commit comments

Comments
 (0)