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
202
-
constYamlGetAtt=/!GetAtt\s+([A-Za-z][A-Za-z0-9]*)/g;// Matches !GetAtt LogicalId.Attribute - YAML short form get attribute
203
-
constYamlGetAttArray=/!GetAtt\s+\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches !GetAtt [LogicalId, Attribute] - YAML short form get attribute with array syntax
203
+
constYamlGetAtt=/!GetAtt\s+['"]?([A-Za-z][A-Za-z0-9]*)/g;// Matches !GetAtt LogicalId.Attribute - YAML short form get attribute with optional quotes
204
+
constYamlGetAttArray=/!GetAtt\s+\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches !GetAtt [LogicalId, Attribute] - YAML short form get attribute with array syntax
204
205
constYamlFindInMap=/!FindInMap\s+\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches !FindInMap [MappingName, Key1, Key2] - YAML short form mapping lookup
205
206
constYamlIf=/!If\s+\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches !If [ConditionName, TrueValue, FalseValue] - YAML short form conditional
206
207
constYamlConditionShort=/!Condition\s+([A-Za-z][A-Za-z0-9]*)/g;// Matches !Condition ConditionName - YAML short form condition reference
207
-
constYamlRefColon=/Ref:\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Ref: LogicalId - YAML long form reference
208
-
constYamlGetAttColon=/Fn::GetAtt:\s*\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Fn::GetAtt:[LogicalId, Attribute] - YAML long form get attribute
209
-
constYamlGetAttColonString=/Fn::GetAtt:\s*([A-Za-z][A-Za-z0-9]*)\./g;// Matches Fn::GetAtt: LogicalId.Attribute - YAML long form string syntax
210
-
constYamlFindInMapColon=/Fn::FindInMap:\s*\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Fn::FindInMap: [MappingName, Key1, Key2] - YAML long form mapping lookup
211
-
constYamlIfColon=/Fn::If:\s*\[\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Fn::If: [ConditionName, TrueValue, FalseValue] - YAML long form conditional
212
-
constYamlCondition=/Condition:\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches Condition: ConditionName - resource condition property in YAML
213
-
constYamlSingleDep=/DependsOn:\s*([A-Za-z][A-Za-z0-9]*)/g;// Matches DependsOn: LogicalId - single resource dependency in YAML
214
-
constYamlInlineDeps=/DependsOn:\s*\[([^\]]+)]/g;// Matches DependsOn: [Id1, Id2] - inline array format in YAML
208
+
constYamlRefColon=/(?<![A-Za-z])['"]?Ref['"]?\s*:\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Ref:, 'Ref':, "Ref": LogicalId with optional quoted values
constYamlValueOf=/['"]?Fn::ValueOf['"]?\s*:\s*\[\s*['"]?([A-Za-z][A-Za-z0-9]*)['"]?/g;// Matches Fn::ValueOf: [ParamName, Attr] with optional quotes
218
219
219
220
// Shared pattern for ${} variables - used by both JSON and YAML
220
221
constSubVariables=/\$\{([A-Za-z][A-Za-z0-9]*)(?:[.:]|(?=\}))/g;// Matches ${LogicalId} or ${Resource.Attr} or ${AWS::Region} - captures first segment only
221
222
222
223
constValidLogicalId=/^[A-Za-z][A-Za-z0-9.]+$/;
223
224
224
225
// Validated these regex, they will fail fast with ?= lookahead
constYamlListDep=/DependsOn:\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
226
+
constYamlListDep=
227
+
/(?<![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