Skip to content

Commit 7ae11b8

Browse files
committed
Revert "feat: Add cloudfront connection to cloudwatch service"
This reverts commit 4fdf50c.
1 parent b27810f commit 7ae11b8

4 files changed

Lines changed: 2 additions & 42 deletions

File tree

src/services/cloudfront/schema.graphql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ type awsCloudfront implements awsBaseService @key(fields: "id") {
2121
s3: [awsS3] @hasInverse(field: cloudfrontDistributions)
2222
tags: [awsRawTag]
2323
webAcl: [awsWafV2WebAcl] @hasInverse(field: cloudfront)
24-
cloudwatch: [awsCloudwatch] @hasInverse(field: cloudfront)
2524
}
2625

2726
type awsCloudfrontOriginData {

src/services/cloudwatch/connections.ts

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { ServiceConnection } from '@cloudgraph/sdk'
22
import { isEmpty } from 'lodash'
33
import { RawAwsCloudwatch } from './data'
4-
import { RawAwsCloudfront } from '../cloudfront/data'
54
import services from '../../enums/services'
6-
import { globalRegionName } from '../../enums/regions'
75

86
export default ({
97
service: cloudwatch,
@@ -17,11 +15,7 @@ export default ({
1715
}): {
1816
[property: string]: ServiceConnection[]
1917
} => {
20-
const {
21-
AlarmName: id,
22-
AlarmActions: alarmActions,
23-
Dimensions: dimensions,
24-
} = cloudwatch
18+
const { AlarmName: id, AlarmActions: alarmActions } = cloudwatch
2519
const connections: ServiceConnection[] = []
2620

2721
/**
@@ -46,32 +40,6 @@ export default ({
4640
}
4741
}
4842

49-
/**
50-
* Find Cloudfront
51-
* related to the cloudwatch
52-
*/
53-
const cloudfronts = data.find(({ name }) => name === services.cloudfront)
54-
if (cloudfronts?.data?.[globalRegionName]) {
55-
const cloudfrontsInRegion: RawAwsCloudfront[] = cloudfronts.data[globalRegionName].filter(
56-
({ summary: { Id: cloudfrontId } }: RawAwsCloudfront) =>
57-
dimensions?.some(d => d.Value === cloudfrontId)
58-
)
59-
60-
if (!isEmpty(cloudfrontsInRegion)) {
61-
for (const cf of cloudfrontsInRegion) {
62-
const {
63-
summary: { Id: cloudfrontId },
64-
}: RawAwsCloudfront = cf
65-
connections.push({
66-
id: cloudfrontId,
67-
resourceType: services.cloudfront,
68-
relation: 'child',
69-
field: 'cloudfront',
70-
})
71-
}
72-
}
73-
}
74-
7543
const result = {
7644
[id]: connections,
7745
}

src/services/cloudwatch/schema.graphql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ type awsCloudwatch implements awsBaseService @key(fields: "arn") {
1414
cloudwatchLog: [awsCloudwatchLog] @hasInverse(field: cloudwatch)
1515
sns: [awsSns] @hasInverse(field: cloudwatch)
1616
cloudtrail: [awsCloudtrail] @hasInverse(field: cloudwatch)
17-
cloudfront: [awsCloudfront] @hasInverse(field: cloudwatch)
1817
}
1918

2019
type awsCloudwatchDimensions

src/types/generated.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@ export type AwsCloudFormationStackSetParameter = {
742742

743743
export type AwsCloudfront = AwsBaseService & {
744744
callerReference?: Maybe<Scalars['String']>;
745-
cloudwatch?: Maybe<Array<Maybe<AwsCloudwatch>>>;
746745
customErrorResponses?: Maybe<Array<Maybe<AwsCloudfrontCustomErrorResponse>>>;
747746
defaultCacheBehavior?: Maybe<AwsCloudfrontCacheBehavior>;
748747
defaultRootObject?: Maybe<Scalars['String']>;
@@ -893,7 +892,6 @@ export type AwsCloudtrailStatus = {
893892
export type AwsCloudwatch = AwsBaseService & {
894893
actions?: Maybe<Array<Maybe<Scalars['String']>>>;
895894
actionsEnabled?: Maybe<Scalars['String']>;
896-
cloudfront?: Maybe<Array<Maybe<AwsCloudfront>>>;
897895
cloudtrail?: Maybe<Array<Maybe<AwsCloudtrail>>>;
898896
cloudwatchLog?: Maybe<Array<Maybe<AwsCloudwatchLog>>>;
899897
comparisonOperator?: Maybe<Scalars['String']>;
@@ -4215,12 +4213,8 @@ export type AwsTransitGateway = AwsBaseService & {
42154213
vpnEcmpSupport?: Maybe<Scalars['String']>;
42164214
};
42174215

4218-
export type AwsTransitGatewayAttachment = {
4219-
accountId: Scalars['String'];
4220-
arn: Scalars['String'];
4216+
export type AwsTransitGatewayAttachment = AwsBaseService & {
42214217
creationTime?: Maybe<Scalars['String']>;
4222-
id: Scalars['String'];
4223-
region?: Maybe<Scalars['String']>;
42244218
resourceId?: Maybe<Scalars['String']>;
42254219
resourceOwnerId?: Maybe<Scalars['String']>;
42264220
resourceType?: Maybe<Scalars['String']>;

0 commit comments

Comments
 (0)