Skip to content

Commit 2f087a1

Browse files
authored
Merge pull request #51 from cloudgraphdev/feature/CG-1087
feat: Add Additional data to transit gateway attachment
2 parents dc4afb2 + 35a560c commit 2f087a1

5 files changed

Lines changed: 3 additions & 39 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ CloudGraph AWS Provider will ask you what regions you would like to crawl and wi
8080
| cloud9 | |
8181
| cloudformationStack | cloudformationStack, iamRole, sns |
8282
| cloudformationStackSet | iamRole |
83-
| cloudfront | cloudwatch, elb, s3 |
83+
| cloudfront | elb, s3 |
8484
| cloudtrail | cloudwatch, cloudwatchLog, kms, s3, sns |
85-
| cloudwatch | cloudfront, cloudtrail, cloudwatchLog, sns |
85+
| cloudwatch | cloudtrail, cloudwatchLog, sns |
8686
| cloudwatchLog | cloudtrail, cloudwatch, ecsCluster, elasticSearchDomain, kms, managedAirflow, rdsDbInstance |
8787
| codebuild | iamRole, kms, vpc, securityGroup, subnet |
8888
| cognitoIdentityPool | iamRole, iamOpenIdConnectProvider, iamSamlProvider, elasticSearchDomain |

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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,6 @@ export type AwsCloudFormationStackSetParameter = {
741741

742742
export type AwsCloudfront = AwsBaseService & {
743743
callerReference?: Maybe<Scalars['String']>;
744-
cloudwatch?: Maybe<Array<Maybe<AwsCloudwatch>>>;
745744
customErrorResponses?: Maybe<Array<Maybe<AwsCloudfrontCustomErrorResponse>>>;
746745
defaultCacheBehavior?: Maybe<AwsCloudfrontCacheBehavior>;
747746
defaultRootObject?: Maybe<Scalars['String']>;
@@ -897,7 +896,6 @@ export type AwsCloudtrailStatus = {
897896
export type AwsCloudwatch = AwsBaseService & {
898897
actions?: Maybe<Array<Maybe<Scalars['String']>>>;
899898
actionsEnabled?: Maybe<Scalars['String']>;
900-
cloudfront?: Maybe<Array<Maybe<AwsCloudfront>>>;
901899
cloudtrail?: Maybe<Array<Maybe<AwsCloudtrail>>>;
902900
cloudwatchLog?: Maybe<Array<Maybe<AwsCloudwatchLog>>>;
903901
comparisonOperator?: Maybe<Scalars['String']>;

0 commit comments

Comments
 (0)