@@ -240,6 +240,7 @@ type ResourceDatum struct {
240240 IdentityVersion int64
241241 CustomInherentRegionIdentity bool
242242 customIdentityAttribute string
243+ CustomInherentRegionParser string
243244}
244245
245246func (r ResourceDatum ) IsARNFormatGlobal () bool {
@@ -567,11 +568,27 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) {
567568 case "CustomInherentRegionIdentity" :
568569 d .CustomInherentRegionIdentity = true
569570 d .WrappedImport = true
570- d .CustomImport = true
571571
572572 args := common .ParseArgs (m [3 ])
573+
574+ if len (args .Positional ) < 2 {
575+ v .errs = append (v .errs , fmt .Errorf ("CustomInherentRegionIdentity missing required parameters: at %s" , fmt .Sprintf ("%s.%s" , v .packageName , v .functionName )))
576+ continue
577+ }
578+
573579 d .customIdentityAttribute = args .Positional [0 ]
574580
581+ attr := args .Positional [1 ]
582+ if funcName , importSpec , err := parseIdentifierSpec (attr ); err != nil {
583+ v .errs = append (v .errs , fmt .Errorf ("%q at %s: %w" , attr , fmt .Sprintf ("%s.%s" , v .packageName , v .functionName ), err ))
584+ continue
585+ } else {
586+ d .CustomInherentRegionParser = funcName
587+ if importSpec != nil {
588+ d .goImports = append (d .goImports , * importSpec )
589+ }
590+ }
591+
575592 if attr , ok := args .Keyword ["identityDuplicateAttributes" ]; ok {
576593 attrs := strings .Split (attr , ";" )
577594 d .IdentityDuplicateAttrs = tfslices .ApplyToAll (attrs , func (s string ) string {
0 commit comments