You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constYamlRef=/!Ref\s+([A-Za-z][A-Za-z0-9]*)/g;// Matches !Ref LogicalId - YAML short form reference
216
-
constYamlGetAtt=/!GetAtt\s+([A-Za-z][A-Za-z0-9]*)/g;// Matches !GetAtt LogicalId.Attribute - YAML short form get attribute
217
-
constYamlGetAttArray=/!GetAtt\s+\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches !GetAtt [LogicalId, Attribute] - YAML short form get attribute with array syntax
206
+
constYamlGetAtt=/!GetAtt\s+['"]?([A-Za-z][A-Za-z0-9]*)/g;// Matches !GetAtt LogicalId.Attribute - YAML short form get attribute with optional quotes
207
+
constYamlGetAttArray=/!GetAtt\s+\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches !GetAtt [LogicalId, Attribute] - YAML short form get attribute with array syntax
218
208
constYamlFindInMap=/!FindInMap\s+\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches !FindInMap [MappingName, Key1, Key2] - YAML short form mapping lookup
219
-
constYamlSub=/!Sub\s+["']?([^"'\n]+)["']?/g;// Matches !Sub "template string" - YAML short form string substitution
220
-
constYamlRefColon=/Ref:\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Ref: LogicalId - YAML long form reference
221
-
constYamlGetAttColon=/Fn::GetAtt:\s*\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Fn::GetAtt: [LogicalId, Attribute] - YAML long form get attribute
222
-
constYamlFindInMapColon=/Fn::FindInMap:\s*\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Fn::FindInMap: [MappingName, Key1, Key2] - YAML long form mapping lookup
223
-
constYamlSubColon=/Fn::Sub:\s*["']?([^"'\n]+)["']?/g;// Matches Fn::Sub: "template string" - YAML long form string substitution
224
-
constYamlCondition=/Condition:\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Condition: ConditionName - resource condition property in YAML
225
-
constYamlSubVariables=/\$\{([A-Za-z][A-Za-z0-9:]*)\}/g;// Matches ${LogicalId} or ${AWS::Region} - variables in Fn::Sub templates
226
-
constYamlSingleDep=/DependsOn:\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches DependsOn: LogicalId - single resource dependency in YAML
227
-
constYamlInlineDeps=/DependsOn:\s*\[([^\]]+)]/g;// Matches DependsOn: [Id1, Id2] - inline array format in YAML
209
+
constYamlIf=/!If\s+\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches !If [ConditionName, TrueValue, FalseValue] - YAML short form conditional
210
+
constYamlConditionShort=/!Condition\s+([A-Za-z][A-Za-z0-9]*)/g;// Matches !Condition ConditionName - YAML short form condition reference
211
+
constYamlRefColon=/(?<![A-Za-z])['"]?Ref['"]?\s*:\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Ref:, 'Ref':, "Ref": LogicalId with optional quoted values
constYamlGetAttColonString=/['"]?Fn::GetAtt['"]?\s*:\s*['"]?([A-Za-z][A-Za-z0-9]*)\./g;// Matches Fn::GetAtt: LogicalId.Attribute with optional quotes
214
+
constYamlFindInMapColon=/['"]?Fn::FindInMap['"]?\s*:\s*\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Fn::FindInMap: [MappingName, ...] with optional quotes
215
+
constYamlIfColon=/['"]?Fn::If['"]?\s*:\s*\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Fn::If: [ConditionName, ...] with optional quotes
216
+
constYamlCondition=/(?<![A-Za-z])['"]?Condition['"]?\s*:\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Condition:, 'Condition':, "Condition": ConditionName with optional quoted values
217
+
constYamlSingleDep=/(?<![A-Za-z])['"]?DependsOn['"]?\s*:\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches DependsOn: LogicalId with optional quotes
218
+
constYamlInlineDeps=/(?<![A-Za-z])['"]?DependsOn['"]?\s*:\s*\[([^\]]+)]/g;// Matches DependsOn: [Id1, Id2] with optional quotes
228
219
constYamlListItem=/-\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches - LogicalId in YAML list format
229
220
constYamlInlineItemPattern=/([A-Za-z][A-Za-z0-9]*)/g;// Matches LogicalId within the inline array
221
+
constYamlValueOfShort=/!ValueOf\s+\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches !ValueOf [ParamName, Attr] - YAML short form
222
+
constYamlValueOf=/['"]?Fn::ValueOf['"]?\s*:\s*\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Fn::ValueOf: [ParamName, Attr] with optional quotes
223
+
224
+
// Shared pattern for ${} variables - used by both JSON and YAML
225
+
constSubVariables=/\$\{([A-Za-z][A-Za-z0-9]*)(?:[.:]|(?=\}))/g;// Matches ${LogicalId} or ${Resource.Attr} or ${AWS::Region} - captures first segment only
230
226
231
227
constValidLogicalId=/^[A-Za-z][A-Za-z0-9.]+$/;
232
228
233
229
// Validated these regex, they will fail fast with ?= lookahead
/(?<![A-Za-z])['"]?DependsOn['"]?\s*:\s*\n(\s*-\s*[A-Za-z][A-Za-z0-9]*(?:\s+-\s*[A-Za-z][A-Za-z0-9]*)*)/g;// Matches DependsOn: followed by YAML list items
0 commit comments