@@ -139,28 +139,47 @@ def get_aws_datazone_domain(type, id, clfn, descfn, topkey, key, filterid):
139139 response = response + page [topkey ]
140140 if response == []: print ("Empty response for " + type + " id=" + str (id )+ " returning" ); return True
141141 for j in response :
142- common .write_import (type ,j [key ],None )
142+ dzid = j [key ]
143+ dv = j ['domainVersion' ]
144+ if dv == "V1" :
145+ #print(str(j))
146+ resp2 = client .get_domain (identifier = j [key ])
147+ sso = resp2 ['singleSignOn' ]['type' ]
148+ dst = resp2 ['status' ]
149+ #print("sso="+str(sso)+" dst="+str(dst)," dzid=",dzid)
150+ common .write_import (type ,j [key ],None )
151+ common .add_dependancy ("aws_datazone_project" , j [key ])
152+ common .add_dependancy ("aws_datazone_glossary" , j [key ])
153+ common .add_dependancy ("aws_datazone_environment_profile" , j [key ])
154+ common .add_dependancy ("aws_datazone_environment_blueprint_configuration" , j [key ])
155+
156+ if sso != "DISABLED" :
157+ common .add_dependancy ("aws_datazone_user_profile" , j [key ])
158+ else :
159+ print ("skipping sso=" + str (sso )+ " dst=" + str (dst )+ " dzid=" + dzid )
160+ return True
161+
162+ else :
163+ response = client .get_domain (identifier = id )
164+ if response == []: print ("Empty response for " + type + " id=" + str (id )+ " returning" ); return True
165+ j = response
166+ dv = j ['domainVersion' ]
167+ if dv == "V1" :
168+ resp2 = client .get_domain (identifier = j [key ])
169+ sso = resp2 ['singleSignOn' ]['type' ]
170+ dst = resp2 ['status' ]
171+ #print("sso="+str(sso)+" dst="+str(dst)," dzid=",dzid)
172+ common .write_import (type ,j [key ],None )
143173 # provider crashes on import
144174 common .add_dependancy ("aws_datazone_project" , j [key ])
145175 common .add_dependancy ("aws_datazone_glossary" , j [key ])
146-
147176 common .add_dependancy ("aws_datazone_environment_profile" , j [key ])
148177 common .add_dependancy ("aws_datazone_environment_blueprint_configuration" , j [key ])
149- common .add_dependancy ("aws_datazone_user_profile" , j [key ])
150-
151-
152- else :
153- response = client .get_domain (identifier = id )
154- if response == []: print ("Empty response for " + type + " id=" + str (id )+ " returning" ); return True
155- j = response
156- common .write_import (type ,j [key ],None )
157- # provider crashes on import
158- common .add_dependancy ("aws_datazone_project" , j [key ])
159- common .add_dependancy ("aws_datazone_glossary" , j [key ])
160-
161- common .add_dependancy ("aws_datazone_environment_profile" , j [key ])
162- common .add_dependancy ("aws_datazone_environment_blueprint_configuration" , j [key ])
163- common .add_dependancy ("aws_datazone_user_profile" , j [key ])
178+ if sso != "DISABLED" :
179+ common .add_dependancy ("aws_datazone_user_profile" , j [key ])
180+ else :
181+ print ("skipping sso=" + str (sso )+ " dst=" + str (dst )+ " dzid=" + dzid )
182+ return True
164183
165184 except Exception as e :
166185 common .handle_error (e ,str (inspect .currentframe ().f_code .co_name ),clfn ,descfn ,topkey ,id )
@@ -363,8 +382,15 @@ def get_aws_datazone_environment_profile(type, id, clfn, descfn, topkey, key, fi
363382 print ("WARNING must pass domain id to get_aws_datazone_environment_profile" )
364383 return True
365384 else :
366- for page in paginator .paginate (domainIdentifier = id ):
367- response = response + page [topkey ]
385+ try :
386+ for page in paginator .paginate (domainIdentifier = id ):
387+ response = response + page [topkey ]
388+ except Exception as e :
389+ print (str (e ))
390+ print ("WARNING: no environment profiles found for domain id " + id )
391+ globals .rproc [type + "." + id ]= True
392+ return True
393+
368394 pkey = type + "." + id
369395 if response == []:
370396 if globals .debug : print ("Empty response for " + type + " id=" + str (id )+ " returning" )
0 commit comments