Repository navigation
fix(E3511): accept a role name for AWS::Batch::ComputeEnvironment ServiceRole - #4926
Closed
pcbeingused333 wants to merge 1 commit into
Closed
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
…viceRole Batch takes either the role's full ARN or its name for ServiceRole, with the path prefix when the role's path is not "/" (the resource documentation: "specify /foo/bar as the role name"), and CloudFormation creates the environment with a name. E3511 required an ARN for every property it checks, so a role name was reported. For ServiceRole only, a value that does not start with "arn:" is a role name and is accepted; a value that does is still checked against the ARN pattern. The other properties still need an ARN. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
Contributor
|
Superseded by #4942, which deletes E3511 entirely. The enhanced-schemas change (resource-provider-enhanced-schemas#74) is merged and published, so all six properties now carry format: AWS::IAM::Role.Arn or anyOf: [Role.Arn, Role.Name], and E1156/E1165 own the check. That also fixes the Batch false positive this PR targeted, including the path-prefixed name form (/foo/bar) that wasn't in #4838. See #4941. |
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.
Issue #, if available: #4838
Description of changes:
E3511 requires an IAM role ARN for every property it checks, including
AWS::Batch::ComputeEnvironmentServiceRole. ForServiceRole, Batch accepts either the full ARN or just the role name (the property documentation says that with only a name, Batch assumes the ARN doesn't use theservice-rolepath prefix), and CloudFormation creates the compute environment with a name, so the rule reported a false positive.The rule now treats a
ServiceRolevalue that does not start witharn:as a role name and accepts it, with or without a path prefix (the documentation says: "If your specified role has a path other than/, you must specify either the full role ARN or prefix the role name with the path ... specify/foo/baras the role name"). A value that starts witharn:is still checked against the ARN pattern, so a malformed ARN is still reported. The other properties the rule covers (SpotIamFleetRole,ExecutionRoleArn,IamFleetRole, ...) still require an ARN.Tests:
test_role_arn_pattern.pygets cases onServiceRolefor a role name, a path-prefixed name, a name with a custom path, an ARN and a malformed ARN (still reported), and for a role name onExecutionRoleArn, which is still reported. The role-name case fails without the change. The IAM rule tests andtest_rules_collections.pypass (121 tests), and the template from the issue no longer produces E3511. Not tested: creating the stack in AWS (the issue reportsCREATE_COMPLETEwith a role name).By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This change was prepared with Claude Code.