fix: avoid cfn-lint W1030 on TaskRoleArn when TaskRole is unset - #404
Open
credfeto wants to merge 2 commits into
Open
fix: avoid cfn-lint W1030 on TaskRoleArn when TaskRole is unset#404credfeto wants to merge 2 commits into
credfeto wants to merge 2 commits into
Conversation
TaskRoleArn resolved a bare Ref to the TaskRole parameter, whose
default is an empty string. cfn-lint flags this because the resolved
value does not match the IAM Role ARN pattern. Added a HasTaskRole
condition (same fix already applied in funfair-ethereum-proxy-server)
so the property is only set when a TaskRole is actually supplied,
otherwise it resolves to AWS::NoValue.
Prompt: Run Cloud Formation Linter
1s
Run "$CFN_LINT_VENV/bin/cfn-lint" --info --include-checks I --template "$TEMPLATE"
2026-09-03 20:37:21,269 - cfnlint.runner.template.runner - INFO - Run scan of template /build/runners/agents/build05/_work/BuildBot/BuildBot/cloudformation.json
W1030 {'Ref': 'TaskRole'} is not a 'AWS::IAM::Role.Arn' with pattern '^arn:aws[a-zA-Z-]*:iam::\d{12}:role/.+$' when 'Ref' is resolved
/build/runners/agents/build05/_work/BuildBot/BuildBot/cloudformation.json:282:11 we've fixed this in other repos can you apply the same fix eg. funfair-etherum-proxy-server
Claude-Session: https://claude.ai/code/session_014jXxyHtaWdgBDwrwjMRmns
credfeto
marked this pull request as ready for review
September 3, 2026 18:56
credfeto
enabled auto-merge
September 3, 2026 18:56
Member
Author
Roslyn analyzer findings
|
Member
Author
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cfn-lint's W1030 check was flagging
TaskRoleArnincloudformation.jsonbecause it resolves a bareRef: TaskRole, andTaskRole's default is an empty string, which does not match the IAM Role ARN pattern.Applied the same fix already merged in
funfair-ethereum-proxy-server: added aHasTaskRolecondition, andTaskRoleArnnow resolves toAWS::NoValue(property omitted) whenTaskRoleis left at its default, or to the suppliedRefotherwise.Verified locally with
cfn-lint --info --include-checks I --template cloudformation.json: clean, no W1030.https://claude.ai/code/session_014jXxyHtaWdgBDwrwjMRmns