-
Notifications
You must be signed in to change notification settings - Fork 621
Description
CloudFormation Lint Version
1.40.0 and 1.40.4
What operating system are you using?
Mac, Ubuntu, Amazon Linux 2023
Describe the bug
cfn-lint incorrectly reports a W3037 warning for valid IAM actions apigateway:TagResource and apigateway:UntagResource.
These actions are officially supported by AWS API Gateway and are required for tagging and untagging API Gateway resources. However, cfn-lint flags them as invalid operations under API Gateway, preventing valid CloudFormation templates from passing lint checks.
Expected behavior
Expected behavior
cfn-lint should recognize apigateway:TagResource and apigateway:UntagResource as valid AWS API Gateway IAM actions and should not raise a W3037 warning.
These actions are officially documented by AWS and are required for tagging and untagging API Gateway resources. The linter should allow these permissions without flagging them as invalid operations.
Reproduction template
To Reproduce
Steps to reproduce the behavior:
- Create a simple CloudFormation template containing the following IAM policy:
Policies:- PolicyName: ApiGatewayTagging
PolicyDocument:
Version: 2010-09-09
Statement:
- Effect: Allow
Action:
- apigateway:TagResource
- apigateway:UntagResource
Resource: "*"
- PolicyName: ApiGatewayTagging
- Run the cfn-lint command:
cfn-lint -t template.yaml - Observe the output:
W3037 '*resource' is not one of ['addcertificatetodomain', 'createaccessassociation', 'createroutingrule', 'delete', 'deleteroutingrule', 'get', 'getroutingrule', 'listroutingrules', 'patch', 'post', 'put', 'rejectaccessassociation', 'removecertificatefromdomain', 'setwebacl', 'updatedomainnamemanagementpolicy', 'updatedomainnamepolicy', 'updaterestapipolicy', 'updateroutingrule']
bootstrap/CrossAccount-Deploy-Role.yaml:1062:25
W3037 'untagresource' is not one of ['addcertificatetodomain', 'createaccessassociation', 'createroutingrule', 'delete', 'deleteroutingrule', 'get', 'getroutingrule', 'listroutingrules', 'patch', 'post', 'put', 'rejectaccessassociation', 'removecertificatefromdomain', 'setwebacl', 'updatedomainnamemanagementpolicy', 'updatedomainnamepolicy', 'updaterestapipolicy', 'updateroutingrule']
bootstrap/CrossAccount-Deploy-Role.yaml:1062:25