11import { ServiceConnection } from '@cloudgraph/sdk'
22
3- import services from '../../enums/services'
43import { Cluster } from 'aws-sdk/clients/kafka'
4+ import services from '../../enums/services'
55
66/**
77 * Msk
@@ -22,42 +22,35 @@ export default ({
2222} ) : { [ key : string ] : ServiceConnection [ ] } => {
2323 const connections : ServiceConnection [ ] = [ ]
2424
25- const {
26- ClusterArn : id ,
27- Serverless : serverless ,
28- } = mskCluster || { }
29-
25+ const { ClusterArn : id , Serverless : serverless } = mskCluster || { }
26+
3027 /**
3128 * Add subnets
3229 */
33- serverless ?. VpcConfigs
34- ?. filter ( vc => vc . SubnetIds )
35- ?. forEach ( vc => {
36- connections . push (
37- ...vc ?. SubnetIds ?. map ( subnetId => ( {
38- id : subnetId ,
39- resourceType : services . subnet ,
40- relation : 'child' ,
41- field : 'subnet' ,
42- } ) )
43- )
44- } )
30+ serverless ?. VpcConfigs ?. filter ( vc => vc . SubnetIds ) ?. forEach ( vc => {
31+ connections . push (
32+ ...vc ?. SubnetIds ?. map ( subnetId => ( {
33+ id : subnetId ,
34+ resourceType : services . subnet ,
35+ relation : 'child' ,
36+ field : 'subnets' ,
37+ } ) )
38+ )
39+ } )
4540
4641 /**
4742 * Add Security Groups
4843 */
49- serverless ?. VpcConfigs
50- ?. filter ( vc => vc . SecurityGroupIds )
51- ?. forEach ( vc => {
52- connections . push (
53- ...vc ?. SecurityGroupIds ?. map ( sgId => ( {
54- id : sgId ,
55- resourceType : services . sg ,
56- relation : 'child' ,
57- field : 'securityGroups' ,
58- } ) )
59- )
60- } )
44+ serverless ?. VpcConfigs ?. filter ( vc => vc . SecurityGroupIds ) ?. forEach ( vc => {
45+ connections . push (
46+ ...vc ?. SecurityGroupIds ?. map ( sgId => ( {
47+ id : sgId ,
48+ resourceType : services . sg ,
49+ relation : 'child' ,
50+ field : 'securityGroups' ,
51+ } ) )
52+ )
53+ } )
6154
6255 const mskResult = {
6356 [ id ] : connections ,
0 commit comments