File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import cuid from 'cuid'
21import { parseString } from '@fast-csv/parse'
3- import CloudGraph from '@cloudgraph/sdk'
2+ import CloudGraph , { generateUniqueId } from '@cloudgraph/sdk'
43import isArray from 'lodash/isArray'
54import toString from 'lodash/toString'
65import { AwsRawTag , AwsIamJsonPolicy } from '../types/generated'
@@ -91,17 +90,17 @@ export const formatIamJsonPolicy = (json: string): AwsIamJsonPolicy => {
9190
9291 const formatPrincipal = principal => {
9392 if ( ! principal ) return null
94- return Object . entries ( principal ) . map ( ( [ key , value ] ) => {
93+ return Object . entries ( principal ) . map ( ( [ key , value ] ) => {
9594 const conVal = ( isArray ( value ) ? value : [ value ] ) || [ ]
9695 return {
9796 key : key === '0' ? '' : key . toString ( ) ,
9897 value : conVal . map ( val => toString ( val ) ) ,
9998 }
100- } )
99+ } )
101100 }
102101
103102 return {
104- id : cuid ( ) ,
103+ id : generateUniqueId ( json ) ,
105104 version : object . Version ,
106105 statement : statement . map ( el => ( {
107106 action : isArray ( el . Action ) ? el . Action : [ toString ( el . Action ) ] ,
You can’t perform that action at this time.
0 commit comments