@@ -279,7 +279,8 @@ export default class Provider extends CloudGraph.Client {
279279 }
280280 const resourceNames : string [ ] = sortResourcesDependencies ( relations , [
281281 ...new Set < string > ( configuredResources . split ( ',' ) ) ,
282- ] )
282+ ] ) . concat ( [ 'label' , 'tag' ] )
283+
283284 const { projectId } = account
284285 const config = { ...account }
285286
@@ -351,8 +352,6 @@ export default class Provider extends CloudGraph.Client {
351352 // data so we can pass along accountId
352353 // TODO: find a better way to handle this
353354 let mergedRawData : rawDataInterface [ ] = [ ]
354- const tagRegion = GLOBAL_REGION
355- const tags = { name : 'tag' , data : { [ tagRegion ] : [ ] } }
356355 const crawledAccounts = [ ]
357356 for ( const account of configuredAccounts ) {
358357 const { projectId } = account
@@ -370,43 +369,6 @@ export default class Provider extends CloudGraph.Client {
370369 }
371370 }
372371
373- // Handle global tag entities
374- try {
375- for ( const { data : entityData } of rawData ) {
376- for ( const region of Object . keys ( entityData ) ) {
377- const dataAtRegion = entityData [ region ]
378- dataAtRegion . forEach ( singleEntity => {
379- if ( ! isEmpty ( singleEntity . Tags ) ) {
380- for ( const [ key , value ] of Object . entries ( singleEntity . Tags ) ) {
381- if (
382- ! tags . data [ tagRegion ] . find (
383- ( { id } ) => id === `${ key } :${ value } `
384- )
385- ) {
386- tags . data [ tagRegion ] . push ( {
387- id : `${ key } :${ value } ` ,
388- key,
389- value,
390- } )
391- }
392- }
393- }
394- } )
395- }
396- }
397- const existingTagsIdx = rawData . findIndex ( ( { name } ) => {
398- return name === 'tag'
399- } )
400- if ( existingTagsIdx > - 1 ) {
401- rawData [ existingTagsIdx ] = tags
402- } else {
403- rawData . push ( tags )
404- }
405- } catch ( error : any ) {
406- this . logger . error ( 'There was an error aggregating tags' )
407- this . logger . debug ( error )
408- }
409-
410372 /**
411373 * Loop through the sdk data to format entities and build connections
412374 * 1. Format data with provider service format function
0 commit comments