Skip to content

Commit e5b48c1

Browse files
authored
Merge pull request #31 from cloudgraphdev/feature/CG-1073
feat (vpc): add elb and nacl connections and pluralize connection fields where appropriate
2 parents d8ff12d + f96f486 commit e5b48c1

24 files changed

Lines changed: 158 additions & 111 deletions

File tree

src/services/alb/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type awsAlb implements awsBaseService @key(fields: "arn") {
1717
tags: [awsRawTag]
1818
securityGroups: [awsSecurityGroup] @hasInverse(field: alb)
1919
ec2Instance: [awsEc2] @hasInverse(field: alb) #change to plural
20-
vpc: [awsVpc] @hasInverse(field: alb)
20+
vpc: [awsVpc] @hasInverse(field: albs)
2121
route53Record: [awsRoute53Record] @hasInverse(field: alb) #change to plural
2222
listeners: [awsAlbListener]
2323
subnet: [awsSubnet] @hasInverse(field: alb) #change to plural

src/services/ecsService/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type awsEcsService implements awsBaseService @key(fields: "arn") {
3232
iamRoles: [awsIamRole] @hasInverse(field: ecsServices)
3333
securityGroups: [awsSecurityGroup] @hasInverse(field: ecsService)
3434
subnet: [awsSubnet] @hasInverse(field: ecsService) #change to plural
35-
vpc: [awsVpc] @hasInverse(field: ecsService)
35+
vpc: [awsVpc] @hasInverse(field: ecsServices)
3636
}
3737

3838
type awsEcsDeployment

src/services/efsMountTarget/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type awsEfsMountTarget implements awsOptionalService @key(fields: "id") {
88
efs: [awsEfs] @hasInverse(field: efsMountTarget)
99
networkInterface: [awsNetworkInterface] @hasInverse(field: efsMountTarget) #change to plural
1010
subnet: [awsSubnet] @hasInverse(field: efsMountTarget) #change to plural
11-
vpc: [awsVpc] @hasInverse(field: efsMountTarget)
11+
vpc: [awsVpc] @hasInverse(field: efsMountTargets)
1212
}
1313

1414
# TODO: add an arn if possible

src/services/eip/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default ({
4141
accountId: account,
4242
arn: eipAllocationArn({region, account, id}),
4343
region,
44-
vpc: domain === 'vpc' ? t.yes : t.no,
44+
isVpc: domain === 'vpc' ? t.yes : t.no,
4545
customerOwnedIp,
4646
customerOwnedIpv4Pool,
4747
domain,

src/services/eip/schema.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type awsEip implements awsBaseService @key(fields: "arn") {
22
tags: [awsRawTag]
3-
vpc: String @search(by: [hash])
3+
isVpc: String @search(by: [hash])
44
domain: String @search(by: [hash, regexp])
55
publicIp: String @search(by: [hash, regexp])
66
privateIp: String @search(by: [hash, regexp])
@@ -12,7 +12,7 @@ type awsEip implements awsBaseService @key(fields: "arn") {
1212
networkBorderGroup: String @search(by: [hash, regexp])
1313
customerOwnedIp: String @search(by: [hash])
1414
customerOwnedIpv4Pool: String @search(by: [hash, regexp])
15-
vpcs: [awsVpc] @hasInverse(field: eip) #change to singular
15+
vpc: [awsVpc] @hasInverse(field: eips)
1616
ec2Instance: [awsEc2] @hasInverse(field: eip)
1717
networkInterface: [awsNetworkInterface] @hasInverse(field: eip)
1818
}

src/services/eksCluster/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type awsEksCluster implements awsBaseService @key(fields: "arn") {
1717
kms: [awsKms] @hasInverse(field: eksCluster)
1818
securityGroups: [awsSecurityGroup] @hasInverse(field: eksCluster)
1919
subnets: [awsSubnet] @hasInverse(field: eksCluster)
20-
vpc: [awsVpc] @hasInverse(field: eksCluster)
20+
vpc: [awsVpc] @hasInverse(field: eksClusters)
2121
ec2Instances: [awsEc2] @hasInverse(field: eksCluster)
2222
}
2323

src/services/elb/connections.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { SecurityGroup } from 'aws-sdk/clients/ec2'
1010

1111
import services from '../../enums/services'
1212
import { RawAwsSubnet } from '../subnet/data'
13+
import { RawAwsVpc } from '../vpc/data'
1314
import { elbArn } from '../../utils/generateArns'
1415

1516
/**
@@ -77,7 +78,7 @@ export default ({
7778

7879
if (vpcs?.data?.[region]) {
7980
const vpc = vpcs.data[region].find(
80-
({ VpcId }: SecurityGroup) => VpcId === vpcId
81+
({ VpcId }: RawAwsVpc) => VpcId === vpcId
8182
)
8283

8384
if (vpc) {

src/services/elb/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type awsElb implements awsBaseService @key(fields: "arn") {
1919
tags: [awsRawTag]
2020
cloudfrontDistribution: [awsCloudfront] @hasInverse(field: elb)
2121
securityGroups: [awsSecurityGroup] @hasInverse(field: elb)
22-
vpc: [awsVpc] @hasInverse(field: elb)
22+
vpc: [awsVpc] @hasInverse(field: elbs)
2323
route53Record: [awsRoute53Record] @hasInverse(field: elb) #change to plural
2424
subnet: [awsSubnet] @hasInverse(field: elb) #change to plural
2525
ecsService: [awsEcsService] @hasInverse(field: elb)

src/services/flowLogs/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type awsFlowLog implements awsOptionalService @key(fields: "id") {
1212
format: String @search(by: [hash, regexp, fulltext])
1313
maxAggregationInterval: Int @search
1414
tags: [awsRawTag]
15-
vpc: [awsVpc] @hasInverse(field: flowLogs)
15+
vpc: [awsVpc] @hasInverse(field: flowLog)
1616
iamRole: [awsIamRole] @hasInverse(field: flowLogs)
1717
networkInterface: [awsNetworkInterface] @hasInverse(field: flowLogs) #change to plural
1818
subnet: [awsSubnet] @hasInverse(field: flowLogs) #change to plural

src/services/igw/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type awsIgw implements awsBaseService @key(fields: "arn") {
22
owner: String @search(by: [hash, regexp])
33
attachments: [awsIgwAttachment]
44
tags: [awsRawTag]
5-
vpc: [awsVpc] @hasInverse(field: igw)
5+
vpc: [awsVpc] @hasInverse(field: igws)
66
}
77

88
type awsIgwAttachment {

0 commit comments

Comments
 (0)