Skip to content

Commit 62eb02f

Browse files
author
Jesus Ibanez
committed
feat: adding api gateway v2 services
1 parent 38d8579 commit 62eb02f

File tree

27 files changed

+1457
-228
lines changed

27 files changed

+1457
-228
lines changed

src/enums/serviceMap.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import Account from '../services/account'
22
import ACM from '../services/acm'
33
import ALB from '../services/alb'
44
import APIGatewayApiKey from '../services/apiGatewayApiKey'
5-
import APIGatewayDomainName from '../services/apiGatewayDomainName'
6-
import APIGatewayHttpApi from '../services/apiGatewayHttpApi'
5+
import APIGatewayDomainName from '../services/apiGateway2DomainName'
6+
import APIGatewayV2HttpApi from '../services/apiGateway2HttpApi'
77
import APIGatewayResource from '../services/apiGatewayResource'
88
import APIGatewayRestApi from '../services/apiGatewayRestApi'
99
import APIGatewayStage from '../services/apiGatewayStage'
1010
import APIGatewayUsagePlan from '../services/apiGatewayUsagePlan'
1111
import APIGatewayVpcLink from '../services/apiGatewayVpcLink'
12+
import APIGatewayV2VpcLink from '../services/apiGateway2VpcLink'
1213
import AppSync from '../services/appSync'
1314
import ASG from '../services/asg'
1415
import AthenaDataCatalog from '../services/athenaDataCatalog'
@@ -141,13 +142,14 @@ export default {
141142
[services.acm]: ACM,
142143
[services.alb]: ALB,
143144
[services.apiGatewayDomainName]: APIGatewayDomainName,
144-
[services.apiGatewayHttpApi]: APIGatewayHttpApi,
145+
[services.apiGatewayHttpApi]: APIGatewayV2HttpApi,
145146
[services.apiGatewayResource]: APIGatewayResource,
146147
[services.apiGatewayRestApi]: APIGatewayRestApi,
147148
[services.apiGatewayApiKey]: APIGatewayApiKey,
148149
[services.apiGatewayVpcLink]: APIGatewayVpcLink,
149150
[services.apiGatewayUsagePlan]: APIGatewayUsagePlan,
150151
[services.apiGatewayStage]: APIGatewayStage,
152+
[services.apiGatewayV2VpcLink]: APIGatewayV2VpcLink,
151153
[services.athenaDataCatalog]: AthenaDataCatalog,
152154
[services.asg]: ASG,
153155
[services.billing]: Billing,

src/enums/services.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default {
99
apiGatewayVpcLink: 'apiGatewayVpcLink',
1010
apiGatewayUsagePlan: 'apiGatewayUsagePlan',
1111
apiGatewayStage: 'apiGatewayStage',
12+
apiGatewayV2VpcLink: 'apiGatewayV2VpcLink',
1213
appSync: 'appSync',
1314
asg: 'asg',
1415
athenaDataCatalog: 'athenaDataCatalog',

src/properties/logger.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export default {
128128
`Created and added ${num} Api Gateways to this region`,
129129
fetchedApiGatewayRestApis: (num: number): string =>
130130
`Fetched ${num} Api Gateway Rest Apis`,
131+
fetchedApiGatewayV2HttpApis: (num: number): string =>
132+
`Fetched ${num} Api Gateway V2 HTTP Apis`,
131133
fetchedApiGatewayResources: (num: number): string =>
132134
`Fetched ${num} Api Gateway Resources`,
133135
fetchedApiGatewayStages: (num: number): string =>
@@ -140,6 +142,7 @@ export default {
140142
`Fetched ${num} Api Gateway Vpc Links`,
141143
fetchedApiGatewayUsagePlans: (num: number): string =>
142144
`Fetched ${num} Api Gateway Usage Plans`,
145+
fetchedVpcLinks: (num: number): string => `Fetched ${num} VPC links`,
143146
fetchingApiGatewayData:
144147
'Fetching API Gateway data for this AWS account via the AWS SDK...',
145148
doneFetchingApiGatewayData: '✅ Done fetching API Gateway Data ✅',
@@ -153,6 +156,22 @@ export default {
153156
gettingApiGatewayModels:
154157
'Fetching authorizers for each Api Gateway Models...',
155158
gettingApiGatewayStageTags: 'Fetching tags for each Api Gateway Stage...',
159+
gettingApiGatewayV2Models:
160+
'Fetching models for each Api Gateway V2 Http Api...',
161+
gettingApiGatewayV2Authorizers:
162+
'Fetching authorizers for each Api Gateway V2 Http Api...',
163+
gettingApiGatewayV2Deployments:
164+
'Fetching deployments for each Api Gateway V2 Http Api...',
165+
gettingApiGatewayV2Stages:
166+
'Fetching stages for each Api Gateway V2 Http Api...',
167+
gettingApiGatewayV2Integrations:
168+
'Fetching integrations for each Api Gateway V2 Http Api...',
169+
gettingApiGatewayV2IntegrationsResponses:
170+
'Fetching integrations responses for each Api Gateway V2 Http Api...',
171+
gettingApiGatewayV2Routes:
172+
'Fetching routes for each Api Gateway V2 Http Api...',
173+
gettingApiGatewayV2RoutesResponses:
174+
'Fetching routes responses for each Api Gateway V2 Http Api...',
156175
/**
157176
* Vpc
158177
*/
@@ -305,7 +324,8 @@ export default {
305324
lookingforRdsClusters: 'Looking for RDS Clusters...',
306325
creatingRdsInstance: (num: number): string => `Creating RDS Instance #${num}`,
307326
fetchedRdsClusters: (num: number): string => `Fetched ${num} RDS Clusters`,
308-
fetchedDocdbClusters: (num: number): string => `Fetched ${num} DocDB Clusters`,
327+
fetchedDocdbClusters: (num: number): string =>
328+
`Fetched ${num} DocDB Clusters`,
309329
fetchedRdsGlobalClusters: (num: number): string =>
310330
`Fetched ${num} RDS Global Clusters`,
311331
fetchedRdsInstances: (num: number): string =>

src/services/apiGatewayDomainName/format.ts renamed to src/services/apiGateway2DomainName/format.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default ({
1717
const {
1818
DomainName: domainName,
1919
ApiMappingSelectionExpression: apiMappingSelectionExpression,
20+
ApiMappings: apiMappings,
2021
DomainNameConfigurations: domainNameConfigurations = [],
2122
Tags: tags = {},
2223
} = service
@@ -30,6 +31,12 @@ export default ({
3031
region,
3132
domainName,
3233
apiMappingSelectionExpression,
34+
apiMappings: apiMappings?.map(am => ({
35+
apiId: am.ApiId,
36+
apiMappingId: am.ApiMappingId,
37+
apiMappingKey: am.ApiMappingKey,
38+
stage: am.Stage,
39+
})),
3340
configurations:
3441
domainNameConfigurations?.map(dn => ({
3542
id: generateUniqueId({

src/services/apiGatewayDomainName/schema.graphql renamed to src/services/apiGateway2DomainName/schema.graphql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,21 @@ type awsApiGatewayDomainNameConfiguration
1616
ownershipVerificationCertificateArn: String @search(by: [hash, regexp])
1717
}
1818

19+
type awsApiGatewayMapping
20+
@generate(
21+
query: { get: false, query: false, aggregate: false }
22+
mutation: { add: false, delete: false }
23+
subscription: false
24+
) {
25+
apiId: String! @id @search(by: [hash])
26+
apiMappingId: String @search(by: [hash, regexp])
27+
apiMappingKey: String @search(by: [hash, regexp])
28+
stage: String @search(by: [hash, regexp])
29+
}
30+
1931
type awsApiGatewayDomainName implements awsBaseService @key(fields: "arn") {
2032
domainName: String @search(by: [hash, regexp])
33+
apiMappings: [awsApiGatewayMapping]
2134
apiMappingSelectionExpression: String @search(by: [hash, regexp])
2235
configurations: [awsApiGatewayDomainNameConfiguration]
2336
tags: [awsRawTag]

src/services/apiGatewayHttpApi/connections.ts renamed to src/services/apiGateway2HttpApi/connections.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { ServiceConnection } from '@cloudgraph/sdk'
22
import { isEmpty } from 'lodash'
33

4-
import { RawAwsApiGatewayHttpApi } from './data'
4+
import { RawAwsApiGatewayV2HttpApi } from './data'
55

66
import { domainNameArn } from '../../utils/generateArns'
7-
import { RawAwsApiGatewayDomainName } from '../apiGatewayDomainName/data'
7+
import { RawAwsApiGatewayDomainName } from '../apiGateway2DomainName/data'
88
import services from '../../enums/services'
99

1010
export default ({
@@ -14,7 +14,7 @@ export default ({
1414
account,
1515
}: {
1616
account: string
17-
service: RawAwsApiGatewayHttpApi
17+
service: RawAwsApiGatewayV2HttpApi
1818
data: Array<{ name: string; data: { [property: string]: any[] } }>
1919
region: string
2020
}): {

0 commit comments

Comments
 (0)