Skip to content

Commit c302a2a

Browse files
committed
feat (vpc): add elb and nacl connections and pluralize connection fields where appropriate
1 parent d79a230 commit c302a2a

24 files changed

Lines changed: 158 additions & 110 deletions

File tree

src/services/alb/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type awsAlb @key(fields: "arn") {
2121
tags: [awsRawTag]
2222
securityGroups: [awsSecurityGroup] @hasInverse(field: alb)
2323
ec2Instance: [awsEc2] @hasInverse(field: alb) #change to plural
24-
vpc: [awsVpc] @hasInverse(field: alb)
24+
vpc: [awsVpc] @hasInverse(field: albs)
2525
route53Record: [awsRoute53Record] @hasInverse(field: alb) #change to plural
2626
listeners: [awsAlbListener]
2727
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
@@ -35,7 +35,7 @@ type awsEcsService @key(fields: "arn") {
3535
iamRoles: [awsIamRole] @hasInverse(field: ecsService)
3636
securityGroups: [awsSecurityGroup] @hasInverse(field: ecsService)
3737
subnet: [awsSubnet] @hasInverse(field: ecsService) #change to plural
38-
vpc: [awsVpc] @hasInverse(field: ecsService)
38+
vpc: [awsVpc] @hasInverse(field: ecsServices)
3939
}
4040

4141
type awsEcsDeployment

src/services/efsMountTarget/schema.graphql

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

1717
# 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
@@ -4,7 +4,7 @@ type awsEip @key(fields: "arn") {
44
arn: String! @id @search(by: [hash, regexp])
55
region: String @search(by: [hash, regexp])
66
tags: [awsRawTag]
7-
vpc: String @search(by: [hash])
7+
isVpc: String @search(by: [hash])
88
domain: String @search(by: [hash, regexp])
99
publicIp: String @search(by: [hash, regexp])
1010
privateIp: String @search(by: [hash, regexp])
@@ -16,7 +16,7 @@ type awsEip @key(fields: "arn") {
1616
networkBorderGroup: String @search(by: [hash, regexp])
1717
customerOwnedIp: String @search(by: [hash])
1818
customerOwnedIpv4Pool: String @search(by: [hash, regexp])
19-
vpcs: [awsVpc] @hasInverse(field: eip) #change to singular
19+
vpc: [awsVpc] @hasInverse(field: eips)
2020
ec2Instance: [awsEc2] @hasInverse(field: eip)
2121
networkInterface: [awsNetworkInterface] @hasInverse(field: eip)
2222
}

src/services/eksCluster/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type awsEksCluster @key(fields: "arn") {
2121
kms: [awsKms] @hasInverse(field: eksCluster)
2222
securityGroups: [awsSecurityGroup] @hasInverse(field: eksCluster)
2323
subnet: [awsSubnet] @hasInverse(field: eksCluster) #change to plural
24-
vpc: [awsVpc] @hasInverse(field: eksCluster)
24+
vpc: [awsVpc] @hasInverse(field: eksClusters)
2525
}
2626

2727
type awsEksVpcConfigResponse {

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
@@ -23,7 +23,7 @@ type awsElb @key(fields: "arn") {
2323
tags: [awsRawTag]
2424
cloudfrontDistribution: [awsCloudfront] @hasInverse(field: elb)
2525
securityGroups: [awsSecurityGroup] @hasInverse(field: elb)
26-
vpc: [awsVpc] @hasInverse(field: elb)
26+
vpc: [awsVpc] @hasInverse(field: elbs)
2727
route53Record: [awsRoute53Record] @hasInverse(field: elb) #change to plural
2828
subnet: [awsSubnet] @hasInverse(field: elb) #change to plural
2929
ecsService: [awsEcsService] @hasInverse(field: elb)

src/services/flowLogs/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type awsFlowLog @key(fields: "id") {
1515
format: String @search(by: [hash, regexp, fulltext])
1616
maxAggregationInterval: Int @search
1717
tags: [awsRawTag]
18-
vpc: [awsVpc] @hasInverse(field: flowLogs)
18+
vpc: [awsVpc] @hasInverse(field: flowLog)
1919
iamRole: [awsIamRole] @hasInverse(field: flowLogs)
2020
networkInterface: [awsNetworkInterface] @hasInverse(field: flowLogs) #change to plural
2121
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
@@ -6,7 +6,7 @@ type awsIgw @key(fields: "arn") {
66
owner: String @search(by: [hash, regexp])
77
attachments: [awsIgwAttachment]
88
tags: [awsRawTag]
9-
vpc: [awsVpc] @hasInverse(field: igw)
9+
vpc: [awsVpc] @hasInverse(field: igws)
1010
}
1111

1212
type awsIgwAttachment {

0 commit comments

Comments
 (0)