Skip to content

Commit f88c3cc

Browse files
committed
Merge branch 'alpha' into feature/CG-1203
2 parents 4bb8603 + cd0e9d0 commit f88c3cc

20 files changed

Lines changed: 438 additions & 4 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [0.82.0-alpha.3](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.82.0-alpha.2...0.82.0-alpha.3) (2022-05-24)
2+
3+
4+
### Features
5+
6+
* **services:** Add service vpcPeeringConnection ([b5bda76](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/b5bda76de47268f12390b4f554067e6347187da3))
7+
18
# [0.82.0-alpha.2](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.82.0-alpha.1...0.82.0-alpha.2) (2022-05-23)
29

310

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ CloudGraph AWS Provider will ask you what regions you would like to crawl and wi
160160
| systemsManagerInstance | ec2, iamRole |
161161
| systemsManagerDocument | |
162162
| transitGateway | transitGatewayAttachment, transitGatewayRouteTable, vpnConnection |
163-
| transitGatewayAttachment | transitGateway, transitGatewayRouteTable, vpc, vpnConnection |
163+
| transitGatewayAttachment | transitGateway, transitGatewayRouteTable, vpc, vpnConnection |
164164
| transitGatewayRouteTable | transitGateway, transitGatewayAttachment |
165-
| vpc | alb, codebuild, dmsReplicationInstance, ec2, eip, elb, ecsService, efsMountTarget, eksCluster igw, elastiCacheCluster, elasticSearchDomain, lambda, nacl, natGateway, networkInterface, rdsClusterSnapshot, rdsDbInstance, redshiftCluster, route53HostedZone, routeTable, subnet, flowLog, vpnGateway, transitGatewayAttachment, vpcEndpoint |
165+
| vpc | alb, codebuild, dmsReplicationInstance, ec2, eip, elb, ecsService, efsMountTarget, eksCluster igw, elastiCacheCluster, elasticSearchDomain, lambda, nacl, natGateway, networkInterface, rdsClusterSnapshot, rdsDbInstance, redshiftCluster, route53HostedZone, routeTable, subnet, flowLog, vpnGateway, transitGatewayAttachment, vpcEndpoint, vpcPeeringConnection |
166166
| vpcEndpoint | networkInterface, routeTable, securityGroup, subnet, vpc |
167+
| vpcPeeringConnection | vpc |
167168
| vpnConnection | customerGateway, transitGateway, transitGatewayAttachment, vpnGateway |
168169
| vpnGateway | vpc, vpnConnection |
169170
| wafV2WebAcl | appSync, apiGatewayStage, alb |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudgraph/cg-provider-aws",
3-
"version": "0.82.0-alpha.2",
3+
"version": "0.82.0-alpha.3",
44
"description": "cloud-graph provider plugin for AWS used to fetch AWS cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",

src/enums/schemasMap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default {
8080
[services.subnet]: 'awsSubnet',
8181
[services.vpc]: 'awsVpc',
8282
[services.vpcEndpoint]: 'awsVpcEndpoint',
83+
[services.vpcPeeringConnection]: 'awsVpcPeeringConnection',
8384
[services.vpnGateway]: 'awsVpnGateway',
8485
[services.sqs]: 'awsSqs',
8586
[services.rdsCluster]: 'awsRdsCluster',

src/enums/serviceAliases.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,5 @@ export default {
7474
[services.transitGatewayRouteTable]: 'transitGatewayRouteTables',
7575
[services.vpcEndpoint]: 'vpcEndpoints',
7676
[services.vpnConnection]: 'vpnConnections',
77+
[services.vpcPeeringConnection]: 'vpcPeeringConnections',
7778
}

src/enums/serviceMap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ import VpcEndpoint from '../services/vpcEndpoint'
100100
import APIGatewayDomainName from '../services/apiGatewayDomainName'
101101
import APIGatewayHttpApi from '../services/apiGatewayHttpApi'
102102
import TransitGatewayRouteTable from '../services/transitGatewayRouteTable'
103+
import VpcPeeringConnection from '../services/vpcPeeringConnection'
103104

104105
/**
105106
* serviceMap is an object that contains all currently supported services for AWS
@@ -165,6 +166,7 @@ export default {
165166
[services.subnet]: AwsSubnet,
166167
[services.vpc]: VPC,
167168
[services.vpcEndpoint]: VpcEndpoint,
169+
[services.vpcPeeringConnection]: VpcPeeringConnection,
168170
[services.sqs]: SQS,
169171
[services.rdsCluster]: RDSCluster,
170172
[services.rdsClusterSnapshot]: RdsClusterSnapshot,

src/enums/services.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export default {
9595
transitGatewayRouteTable: 'transitGatewayRouteTable',
9696
vpc: 'vpc',
9797
vpcEndpoint: 'vpcEndpoint',
98+
vpcPeeringConnection: 'vpcPeeringConnection',
9899
vpnConnection: 'vpnConnection',
99100
vpnGateway: 'vpnGateway',
100101
wafV2WebAcl: 'wafV2WebAcl',

src/properties/logger.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,4 +680,8 @@ export default {
680680
* Access Analyzers
681681
*/
682682
fetchedaccessAnalyzers: (num: number): string => `Found ${num} Access Analyzers`,
683+
/**
684+
* Vpc Peering Connections
685+
*/
686+
fetchedVpcPeeringConnections: (num: number): string => `Found ${num} Vpc Peering Connections`,
683687
}

src/services/account/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ type awsAccount implements awsOptionalService @key(fields: "id") {
9696
transitGatewayRouteTables: [awsTransitGatewayRouteTable]
9797
vpc: [awsVpc]
9898
vpcEndpoints: [awsVpcEndpoint]
99+
vpcPeeringConnections: [awsVpcPeeringConnection]
99100
vpnConnections: [awsVpnConnection]
100101
vpnGateway: [awsVpnGateway]
101102
wafV2WebAcl: [awsWafV2WebAcl]

src/services/tag/connections.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import { RawAwsApiGatewayHttpApi } from '../apiGatewayHttpApi/data'
7070
import { RawAwsApiGatewayDomainName } from '../apiGatewayDomainName/data'
7171
import { RawAwsAnalyzerSummary } from '../iamAccessAnalyzer/data'
7272
import { RawAwsTransitGatewayRouteTable } from '../transitGatewayRouteTable/data'
73+
import { RawAwsVpcPeeringConnection } from '../vpcPeeringConnection/data'
7374

7475
const findServiceInstancesWithTag = (tag: any, service: any): any => {
7576
const { id } = tag
@@ -1809,6 +1810,32 @@ export default ({
18091810
}
18101811
}
18111812

1813+
/**
1814+
* Find related Vpc Peering Connections
1815+
*/
1816+
const vpcPeeringConnections: {
1817+
name: string
1818+
data: { [property: string]: RawAwsVpcPeeringConnection[] }
1819+
} = data.find(({ name }) => name === services.vpcPeeringConnection)
1820+
if (vpcPeeringConnections?.data?.[region]) {
1821+
const dataAtRegion = findServiceInstancesWithTag(
1822+
tag,
1823+
vpcPeeringConnections.data[region]
1824+
)
1825+
if (!isEmpty(dataAtRegion)) {
1826+
for (const instance of dataAtRegion) {
1827+
const { VpcPeeringConnectionId: id }: RawAwsVpcPeeringConnection = instance
1828+
1829+
connections.push({
1830+
id,
1831+
resourceType: services.vpcPeeringConnection,
1832+
relation: 'child',
1833+
field: 'vpcPeeringConnections',
1834+
})
1835+
}
1836+
}
1837+
}
1838+
18121839
/**
18131840
* Find related Transit Gateway Route tables
18141841
*/

0 commit comments

Comments
 (0)