Skip to content

Commit 1ad58e3

Browse files
authored
Merge pull request #4 from cloudgraphdev/feature/CG-1026
fix: Standardized aws service schemas using base schema
2 parents ff6e26a + f0f7cfd commit 1ad58e3

File tree

99 files changed

+893
-1483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+893
-1483
lines changed

src/services/account/schema.graphql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
type awsAccount @key(fields: "id") {
2-
id: String! @id @search(by: [hash])
1+
type awsAccount implements awsOptionalService @key(fields: "id") {
32
regions: [String] @search(by: [hash])
43
albs: [awsAlb]
54
apiGatewayResources: [awsApiGatewayResource]

src/services/alb/schema.graphql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
type awsAlb @key(fields: "arn") {
2-
id: String! @id @search(by: [hash, regexp])
1+
type awsAlb implements awsBaseService @key(fields: "arn") {
32
name: String @search(by: [hash, regexp])
4-
accountId: String! @search(by: [hash, regexp])
5-
arn: String! @id @search(by: [hash, regexp])
6-
region: String @search(by: [hash, regexp])
73
dnsName: String @search(by: [hash, regexp])
84
scheme: String @search(by: [hash, regexp])
95
type: String @search(by: [hash, regexp])

src/services/apiGatewayResource/schema.graphql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ type awsApiGatewayMethod @key(fields: "arn") {
66
apiKeyRequired: Boolean @search
77
}
88

9-
type awsApiGatewayResource @key(fields: "arn") {
10-
id: String! @search(by: [hash])
11-
accountId: String! @search(by: [hash])
12-
arn: String! @id @search(by: [hash, regexp])
13-
region: String @search(by: [hash, regexp])
9+
type awsApiGatewayResource implements awsBaseService @key(fields: "arn") {
1410
restApi: [awsApiGatewayRestApi] @hasInverse(field: resources) #change to plural
1511
path: String @search(by: [hash, regexp])
1612
methods: [awsApiGatewayMethod]
17-
}
13+
}

src/services/apiGatewayRestApi/schema.graphql

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ type awsApiGatewayEndpointConfiguration {
44
vpcEndpointIds: [String] @search(by: [hash])
55
}
66

7-
type awsApiGatewayRestApi @key(fields: "arn") {
8-
id: String! @id @search(by: [hash])
9-
accountId: String! @search(by: [hash])
10-
arn: String! @id @search(by: [hash, regexp])
11-
region: String @search(by: [hash, regexp])
7+
type awsApiGatewayRestApi implements awsBaseService @key(fields: "arn") {
128
description: String @search(by: [hash, regexp, fulltext])
139
policy: awsIamJSONPolicy
1410
endpointConfiguration: awsApiGatewayEndpointConfiguration
@@ -21,5 +17,3 @@ type awsApiGatewayRestApi @key(fields: "arn") {
2117
resources: [awsApiGatewayResource] @hasInverse(field: restApi)
2218
route53Record: [awsRoute53Record] @hasInverse(field: restApi) #change to plural
2319
}
24-
25-

src/services/apiGatewayStage/schema.graphql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ type awsApiGatewayStageVariable
2020
value: String @search(by: [hash])
2121
}
2222

23-
type awsApiGatewayStage @key(fields: "arn") {
24-
id: String! @search(by: [hash])
25-
accountId: String! @search(by: [hash])
26-
arn: String! @id @search(by: [hash, regexp])
27-
region: String @search(by: [hash, regexp])
23+
type awsApiGatewayStage implements awsBaseService @key(fields: "arn") {
2824
name: String @search(by: [hash, regexp])
2925
description: String @search(by: [hash, regexp, fulltext])
3026
cacheCluster: Boolean @search

src/services/appSync/schema.graphql

Lines changed: 83 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -4,135 +4,131 @@ type awsAppSyncApiKey
44
mutation: { add: false, delete: false }
55
subscription: false
66
) {
7-
id: String! @id @search(by: [hash])
8-
description: String @search(by: [hash, regexp])
9-
expires: Int @search
10-
}
7+
id: String! @id @search(by: [hash])
8+
description: String @search(by: [hash, regexp])
9+
expires: Int @search
10+
}
1111

1212
type awsAppSyncDataSource
1313
@generate(
1414
query: { get: false, query: true, aggregate: false }
1515
mutation: { add: false, delete: false }
1616
subscription: false
1717
) {
18-
id: String! @id @search(by: [hash])
19-
arn: String! @search(by: [hash])
20-
name: String @search(by: [hash, regexp])
21-
description: String @search(by: [hash, regexp])
22-
type: String @search(by: [hash, regexp])
23-
serviceRoleArn: String @search(by: [hash, regexp])
24-
dynamodbTableName: String @search(by: [hash, regexp])
25-
dynamodbAwsRegion: String @search(by: [hash, regexp])
26-
dynamodbUseCallerCredentials: String @search(by: [hash, regexp])
27-
dynamodbDeltaSyncBaseTableTTL: Int @search
28-
dynamodbDeltaSyncTableName: String @search(by: [hash, regexp])
29-
dynamodbDeltaSyncTableTTL: Int @search
30-
dynamodbVersioned: String @search(by: [hash, regexp])
31-
lambdaFunctionArn: String @search(by: [hash, regexp])
32-
elasticsearchEndpoint: String @search(by: [hash, regexp])
33-
elasticsearchAwsRegion: String @search(by: [hash, regexp])
34-
httpEndpoint: String @search(by: [hash, regexp])
35-
httpAuthorizationType: String @search(by: [hash, regexp])
36-
httpAuthorizationIamSigningRegion: String @search(by: [hash, regexp])
37-
httpAuthorizationIamSigningServiceName: String @search(by: [hash, regexp])
38-
relationalDatabaseSourceType: String @search(by: [hash, regexp])
39-
relationalDatabaseAwsRegion: String @search(by: [hash, regexp])
40-
relationalDatabaseClusterIdentifier: String @search(by: [hash, regexp])
41-
relationalDatabaseName: String @search(by: [hash, regexp])
42-
relationalDatabaseSchema: String @search(by: [hash, regexp])
43-
relationalDatabaseAwsSecretStoreArn: String @search(by: [hash, regexp])
44-
}
18+
id: String! @id @search(by: [hash])
19+
arn: String! @search(by: [hash])
20+
name: String @search(by: [hash, regexp])
21+
description: String @search(by: [hash, regexp])
22+
type: String @search(by: [hash, regexp])
23+
serviceRoleArn: String @search(by: [hash, regexp])
24+
dynamodbTableName: String @search(by: [hash, regexp])
25+
dynamodbAwsRegion: String @search(by: [hash, regexp])
26+
dynamodbUseCallerCredentials: String @search(by: [hash, regexp])
27+
dynamodbDeltaSyncBaseTableTTL: Int @search
28+
dynamodbDeltaSyncTableName: String @search(by: [hash, regexp])
29+
dynamodbDeltaSyncTableTTL: Int @search
30+
dynamodbVersioned: String @search(by: [hash, regexp])
31+
lambdaFunctionArn: String @search(by: [hash, regexp])
32+
elasticsearchEndpoint: String @search(by: [hash, regexp])
33+
elasticsearchAwsRegion: String @search(by: [hash, regexp])
34+
httpEndpoint: String @search(by: [hash, regexp])
35+
httpAuthorizationType: String @search(by: [hash, regexp])
36+
httpAuthorizationIamSigningRegion: String @search(by: [hash, regexp])
37+
httpAuthorizationIamSigningServiceName: String @search(by: [hash, regexp])
38+
relationalDatabaseSourceType: String @search(by: [hash, regexp])
39+
relationalDatabaseAwsRegion: String @search(by: [hash, regexp])
40+
relationalDatabaseClusterIdentifier: String @search(by: [hash, regexp])
41+
relationalDatabaseName: String @search(by: [hash, regexp])
42+
relationalDatabaseSchema: String @search(by: [hash, regexp])
43+
relationalDatabaseAwsSecretStoreArn: String @search(by: [hash, regexp])
44+
}
4545

4646
type awsAppSyncResolver
4747
@generate(
4848
query: { get: false, query: true, aggregate: false }
4949
mutation: { add: false, delete: false }
5050
subscription: false
5151
) {
52-
id: String! @id @search(by: [hash])
53-
arn: String! @search(by: [hash])
54-
typeName: String @search(by: [hash, regexp])
55-
fieldName: String @search(by: [hash, regexp])
56-
dataSourceName: String @search(by: [hash, regexp])
57-
requestMappingTemplate: String @search(by: [hash, regexp])
58-
responseMappingTemplate: String @search(by: [hash, regexp])
59-
kind: String @search(by: [hash, regexp])
60-
pipelineFunctionIds: [String] @search(by: [hash])
61-
syncConflictHandler: String @search(by: [hash, regexp])
62-
syncConflictDetection: String @search(by: [hash, regexp])
63-
syncLambdaConflictHandlerArn: String @search(by: [hash, regexp])
64-
cachingTTL: Int @search
65-
cachingKeys: [String] @search(by: [hash])
66-
}
52+
id: String! @id @search(by: [hash])
53+
arn: String! @search(by: [hash])
54+
typeName: String @search(by: [hash, regexp])
55+
fieldName: String @search(by: [hash, regexp])
56+
dataSourceName: String @search(by: [hash, regexp])
57+
requestMappingTemplate: String @search(by: [hash, regexp])
58+
responseMappingTemplate: String @search(by: [hash, regexp])
59+
kind: String @search(by: [hash, regexp])
60+
pipelineFunctionIds: [String] @search(by: [hash])
61+
syncConflictHandler: String @search(by: [hash, regexp])
62+
syncConflictDetection: String @search(by: [hash, regexp])
63+
syncLambdaConflictHandlerArn: String @search(by: [hash, regexp])
64+
cachingTTL: Int @search
65+
cachingKeys: [String] @search(by: [hash])
66+
}
6767

6868
type awsAppSyncFunction
6969
@generate(
7070
query: { get: false, query: true, aggregate: false }
7171
mutation: { add: false, delete: false }
7272
subscription: false
7373
) {
74-
id: String! @id @search(by: [hash])
75-
arn: String! @search(by: [hash])
76-
name: String @search(by: [hash, regexp])
77-
description: String @search(by: [hash, regexp])
78-
dataSourceName: String @search(by: [hash, regexp])
79-
requestMappingTemplate: String @search(by: [hash, regexp])
80-
responseMappingTemplate: String @search(by: [hash, regexp])
81-
functionVersion: String @search(by: [hash, regexp])
82-
resolvers: [awsAppSyncResolver]
83-
}
74+
id: String! @id @search(by: [hash])
75+
arn: String! @search(by: [hash])
76+
name: String @search(by: [hash, regexp])
77+
description: String @search(by: [hash, regexp])
78+
dataSourceName: String @search(by: [hash, regexp])
79+
requestMappingTemplate: String @search(by: [hash, regexp])
80+
responseMappingTemplate: String @search(by: [hash, regexp])
81+
functionVersion: String @search(by: [hash, regexp])
82+
resolvers: [awsAppSyncResolver]
83+
}
8484

8585
type awsAppSyncType
8686
@generate(
8787
query: { get: false, query: true, aggregate: false }
8888
mutation: { add: false, delete: false }
8989
subscription: false
9090
) {
91-
id: String! @id @search(by: [hash])
92-
arn: String! @search(by: [hash])
93-
name: String @search(by: [hash, regexp])
94-
description: String @search(by: [hash, regexp])
95-
definition: String @search(by: [hash, regexp])
96-
format: String @search(by: [hash, regexp])
97-
resolvers: [awsAppSyncResolver]
98-
}
91+
id: String! @id @search(by: [hash])
92+
arn: String! @search(by: [hash])
93+
name: String @search(by: [hash, regexp])
94+
description: String @search(by: [hash, regexp])
95+
definition: String @search(by: [hash, regexp])
96+
format: String @search(by: [hash, regexp])
97+
resolvers: [awsAppSyncResolver]
98+
}
9999

100100
type awsAppSyncGraphqlApiUris
101101
@generate(
102102
query: { get: false, query: true, aggregate: false }
103103
mutation: { add: false, delete: false }
104104
subscription: false
105105
) {
106-
id: String! @id @search(by: [hash])
107-
key: String! @search(by: [hash, regexp])
108-
value: String! @search(by: [hash, regexp])
109-
}
106+
id: String! @id @search(by: [hash])
107+
key: String! @search(by: [hash, regexp])
108+
value: String! @search(by: [hash, regexp])
109+
}
110110

111111
type awsAdditionalAuthenticationProvider
112112
@generate(
113113
query: { get: false, query: true, aggregate: false }
114114
mutation: { add: false, delete: false }
115115
subscription: false
116116
) {
117-
id: String! @id @search(by: [hash])
118-
authenticationType: String @search(by: [hash, regexp])
119-
openIDConnectIssuer: String @search(by: [hash, regexp])
120-
openIDConnectClientId: String @search(by: [hash, regexp])
121-
openIDConnectIatTTL: Int @search
122-
openIDConnectAuthTTL: Int @search
123-
userPoolId: String @search(by: [hash, regexp])
124-
userPoolAwsRegion: String @search(by: [hash, regexp])
125-
userPoolAppIdClientRegex: String @search(by: [hash, regexp])
126-
}
117+
id: String! @id @search(by: [hash])
118+
authenticationType: String @search(by: [hash, regexp])
119+
openIDConnectIssuer: String @search(by: [hash, regexp])
120+
openIDConnectClientId: String @search(by: [hash, regexp])
121+
openIDConnectIatTTL: Int @search
122+
openIDConnectAuthTTL: Int @search
123+
userPoolId: String @search(by: [hash, regexp])
124+
userPoolAwsRegion: String @search(by: [hash, regexp])
125+
userPoolAppIdClientRegex: String @search(by: [hash, regexp])
126+
}
127127
# TODO: add iam role connection
128128
# TODO: waf web acl connection
129129
# TODO: add cloudwatchLog connection
130-
type awsAppSync @key(fields: "arn") {
131-
id: String! @id @search(by: [hash])
132-
accountId: String! @search(by: [hash])
133-
arn: String! @id @search(by: [hash, regexp])
134-
region: String! @search(by: [hash, regexp])
135-
name: String! @search(by: [hash, regexp])
130+
type awsAppSync implements awsBaseService @key(fields: "arn") {
131+
name: String @search(by: [hash, regexp])
136132
authenticationType: String @search(by: [hash, regexp])
137133
logFieldLogLevel: String @search(by: [hash, regexp])
138134
logCloudWatchLogsRoleArn: String @search(by: [hash, regexp])
@@ -145,14 +141,15 @@ type awsAppSync @key(fields: "arn") {
145141
openIDConnectClientId: String @search(by: [hash, regexp])
146142
openIDConnectIatTTL: Int @search
147143
openIDConnectAuthTTL: Int @search
148-
uris: [awsAppSyncGraphqlApiUris]
144+
uris: [awsAppSyncGraphqlApiUris]
149145
tags: [awsRawTag]
150146
additionalAuthenticationProviders: [awsAdditionalAuthenticationProvider]
151147
xrayEnabled: String @search(by: [hash, regexp])
152148
wafWebAclArn: String @search(by: [hash, regexp])
153149
lambdaAuthorizerResultTtlInSeconds: Int @search
154150
lambdaAuthorizerUri: String @search(by: [hash, regexp])
155-
lambdaAuthorizerIdentityValidationExpression: String @search(by: [hash, regexp])
151+
lambdaAuthorizerIdentityValidationExpression: String
152+
@search(by: [hash, regexp])
156153
apiKeys: [awsAppSyncApiKey]
157154
dataSources: [awsAppSyncDataSource]
158155
functions: [awsAppSyncFunction]

0 commit comments

Comments
 (0)