Skip to content

Commit

Permalink
Merge pull request #165 from cloudgraphdev/feat/EP-3389
Browse files Browse the repository at this point in the history
feat: adding api gateway v2 services
  • Loading branch information
jesuseib authored Oct 18, 2023
2 parents 4ff65f3 + 62eb02f commit 5f321cd
Show file tree
Hide file tree
Showing 27 changed files with 1,457 additions and 228 deletions.
8 changes: 5 additions & 3 deletions src/enums/serviceMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import Account from '../services/account'
import ACM from '../services/acm'
import ALB from '../services/alb'
import APIGatewayApiKey from '../services/apiGatewayApiKey'
import APIGatewayDomainName from '../services/apiGatewayDomainName'
import APIGatewayHttpApi from '../services/apiGatewayHttpApi'
import APIGatewayDomainName from '../services/apiGateway2DomainName'
import APIGatewayV2HttpApi from '../services/apiGateway2HttpApi'
import APIGatewayResource from '../services/apiGatewayResource'
import APIGatewayRestApi from '../services/apiGatewayRestApi'
import APIGatewayStage from '../services/apiGatewayStage'
import APIGatewayUsagePlan from '../services/apiGatewayUsagePlan'
import APIGatewayVpcLink from '../services/apiGatewayVpcLink'
import APIGatewayV2VpcLink from '../services/apiGateway2VpcLink'
import AppSync from '../services/appSync'
import ASG from '../services/asg'
import AthenaDataCatalog from '../services/athenaDataCatalog'
Expand Down Expand Up @@ -141,13 +142,14 @@ export default {
[services.acm]: ACM,
[services.alb]: ALB,
[services.apiGatewayDomainName]: APIGatewayDomainName,
[services.apiGatewayHttpApi]: APIGatewayHttpApi,
[services.apiGatewayHttpApi]: APIGatewayV2HttpApi,
[services.apiGatewayResource]: APIGatewayResource,
[services.apiGatewayRestApi]: APIGatewayRestApi,
[services.apiGatewayApiKey]: APIGatewayApiKey,
[services.apiGatewayVpcLink]: APIGatewayVpcLink,
[services.apiGatewayUsagePlan]: APIGatewayUsagePlan,
[services.apiGatewayStage]: APIGatewayStage,
[services.apiGatewayV2VpcLink]: APIGatewayV2VpcLink,
[services.athenaDataCatalog]: AthenaDataCatalog,
[services.asg]: ASG,
[services.billing]: Billing,
Expand Down
1 change: 1 addition & 0 deletions src/enums/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default {
apiGatewayVpcLink: 'apiGatewayVpcLink',
apiGatewayUsagePlan: 'apiGatewayUsagePlan',
apiGatewayStage: 'apiGatewayStage',
apiGatewayV2VpcLink: 'apiGatewayV2VpcLink',
appSync: 'appSync',
asg: 'asg',
athenaDataCatalog: 'athenaDataCatalog',
Expand Down
22 changes: 21 additions & 1 deletion src/properties/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export default {
`Created and added ${num} Api Gateways to this region`,
fetchedApiGatewayRestApis: (num: number): string =>
`Fetched ${num} Api Gateway Rest Apis`,
fetchedApiGatewayV2HttpApis: (num: number): string =>
`Fetched ${num} Api Gateway V2 HTTP Apis`,
fetchedApiGatewayResources: (num: number): string =>
`Fetched ${num} Api Gateway Resources`,
fetchedApiGatewayStages: (num: number): string =>
Expand All @@ -140,6 +142,7 @@ export default {
`Fetched ${num} Api Gateway Vpc Links`,
fetchedApiGatewayUsagePlans: (num: number): string =>
`Fetched ${num} Api Gateway Usage Plans`,
fetchedVpcLinks: (num: number): string => `Fetched ${num} VPC links`,
fetchingApiGatewayData:
'Fetching API Gateway data for this AWS account via the AWS SDK...',
doneFetchingApiGatewayData: '✅ Done fetching API Gateway Data ✅',
Expand All @@ -153,6 +156,22 @@ export default {
gettingApiGatewayModels:
'Fetching authorizers for each Api Gateway Models...',
gettingApiGatewayStageTags: 'Fetching tags for each Api Gateway Stage...',
gettingApiGatewayV2Models:
'Fetching models for each Api Gateway V2 Http Api...',
gettingApiGatewayV2Authorizers:
'Fetching authorizers for each Api Gateway V2 Http Api...',
gettingApiGatewayV2Deployments:
'Fetching deployments for each Api Gateway V2 Http Api...',
gettingApiGatewayV2Stages:
'Fetching stages for each Api Gateway V2 Http Api...',
gettingApiGatewayV2Integrations:
'Fetching integrations for each Api Gateway V2 Http Api...',
gettingApiGatewayV2IntegrationsResponses:
'Fetching integrations responses for each Api Gateway V2 Http Api...',
gettingApiGatewayV2Routes:
'Fetching routes for each Api Gateway V2 Http Api...',
gettingApiGatewayV2RoutesResponses:
'Fetching routes responses for each Api Gateway V2 Http Api...',
/**
* Vpc
*/
Expand Down Expand Up @@ -305,7 +324,8 @@ export default {
lookingforRdsClusters: 'Looking for RDS Clusters...',
creatingRdsInstance: (num: number): string => `Creating RDS Instance #${num}`,
fetchedRdsClusters: (num: number): string => `Fetched ${num} RDS Clusters`,
fetchedDocdbClusters: (num: number): string => `Fetched ${num} DocDB Clusters`,
fetchedDocdbClusters: (num: number): string =>
`Fetched ${num} DocDB Clusters`,
fetchedRdsGlobalClusters: (num: number): string =>
`Fetched ${num} RDS Global Clusters`,
fetchedRdsInstances: (num: number): string =>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default ({
const {
DomainName: domainName,
ApiMappingSelectionExpression: apiMappingSelectionExpression,
ApiMappings: apiMappings,
DomainNameConfigurations: domainNameConfigurations = [],
Tags: tags = {},
} = service
Expand All @@ -30,6 +31,12 @@ export default ({
region,
domainName,
apiMappingSelectionExpression,
apiMappings: apiMappings?.map(am => ({
apiId: am.ApiId,
apiMappingId: am.ApiMappingId,
apiMappingKey: am.ApiMappingKey,
stage: am.Stage,
})),
configurations:
domainNameConfigurations?.map(dn => ({
id: generateUniqueId({
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ type awsApiGatewayDomainNameConfiguration
ownershipVerificationCertificateArn: String @search(by: [hash, regexp])
}

type awsApiGatewayMapping
@generate(
query: { get: false, query: false, aggregate: false }
mutation: { add: false, delete: false }
subscription: false
) {
apiId: String! @id @search(by: [hash])
apiMappingId: String @search(by: [hash, regexp])
apiMappingKey: String @search(by: [hash, regexp])
stage: String @search(by: [hash, regexp])
}

type awsApiGatewayDomainName implements awsBaseService @key(fields: "arn") {
domainName: String @search(by: [hash, regexp])
apiMappings: [awsApiGatewayMapping]
apiMappingSelectionExpression: String @search(by: [hash, regexp])
configurations: [awsApiGatewayDomainNameConfiguration]
tags: [awsRawTag]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ServiceConnection } from '@cloudgraph/sdk'
import { isEmpty } from 'lodash'

import { RawAwsApiGatewayHttpApi } from './data'
import { RawAwsApiGatewayV2HttpApi } from './data'

import { domainNameArn } from '../../utils/generateArns'
import { RawAwsApiGatewayDomainName } from '../apiGatewayDomainName/data'
import { RawAwsApiGatewayDomainName } from '../apiGateway2DomainName/data'
import services from '../../enums/services'

export default ({
Expand All @@ -14,7 +14,7 @@ export default ({
account,
}: {
account: string
service: RawAwsApiGatewayHttpApi
service: RawAwsApiGatewayV2HttpApi
data: Array<{ name: string; data: { [property: string]: any[] } }>
region: string
}): {
Expand Down
Loading

0 comments on commit 5f321cd

Please sign in to comment.