Skip to content

Commit 79c8c1c

Browse files
authored
Merge pull request #53 from cloudgraphdev/beta
RELEASE: 0.80.0
2 parents 30dd364 + 7de405e commit 79c8c1c

File tree

30 files changed

+223
-76
lines changed

30 files changed

+223
-76
lines changed

CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
1+
# [0.80.0-beta.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0...0.80.0-beta.1) (2022-05-02)
2+
3+
4+
### Bug Fixes
5+
6+
* Fixed some duplication issues without destroying data first ([7d798b4](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/7d798b48fede8baa1b5cfb2c6f30a9096a6937a3))
7+
* Included rawPolicy for aws services ([6ee5cef](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/6ee5cef489b35613c4bf47f0c3b5d9d4a06fcbfa))
8+
9+
10+
### Features
11+
12+
* Add Additional data to transit gateway attachment ([35a560c](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/35a560cdd4eb408767275adee309d95a6badae73))
13+
* Add cloudfront connection to cloudwatch service ([d2936d6](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/d2936d654189e56a021da946c76ab51b82b76276))
14+
* Add restrictionType to Cloudfront, geoRestriction ([a51e670](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/a51e67087ab2721026cbcc32e96ecb089852468c))
15+
16+
17+
### Reverts
18+
19+
* Revert "feat: Add cloudfront connection to cloudwatch service" ([7ae11b8](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/7ae11b853f7c62f07aa12471cd1f6f00326942e6))
20+
* Revert "Update README file conenctions" ([b27810f](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/b27810fb62fee7926ffd9fb1e6e74f2f53479649))
21+
22+
# [0.80.0-alpha.5](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.80.0-alpha.4...0.80.0-alpha.5) (2022-05-02)
23+
24+
25+
### Features
26+
27+
* Add cloudfront connection to cloudwatch service ([d2936d6](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/d2936d654189e56a021da946c76ab51b82b76276))
28+
29+
# [0.80.0-alpha.4](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.80.0-alpha.3...0.80.0-alpha.4) (2022-05-02)
30+
31+
32+
### Features
33+
34+
* Add Additional data to transit gateway attachment ([35a560c](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/35a560cdd4eb408767275adee309d95a6badae73))
35+
36+
37+
### Reverts
38+
39+
* Revert "feat: Add cloudfront connection to cloudwatch service" ([7ae11b8](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/7ae11b853f7c62f07aa12471cd1f6f00326942e6))
40+
* Revert "Update README file conenctions" ([b27810f](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/b27810fb62fee7926ffd9fb1e6e74f2f53479649))
41+
42+
# [0.80.0-alpha.3](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.80.0-alpha.2...0.80.0-alpha.3) (2022-04-28)
43+
44+
45+
### Bug Fixes
46+
47+
* Fixed some duplication issues without destroying data first ([7d798b4](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/7d798b48fede8baa1b5cfb2c6f30a9096a6937a3))
48+
49+
50+
### Features
51+
52+
* Add cloudfront connection to cloudwatch service ([4fdf50c](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/4fdf50c98ca9b4f0aeb6b2322771d75c6f3084a5))
53+
54+
# [0.80.0-alpha.2](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.80.0-alpha.1...0.80.0-alpha.2) (2022-04-25)
55+
56+
57+
### Bug Fixes
58+
59+
* Included rawPolicy for aws services ([6ee5cef](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/6ee5cef489b35613c4bf47f0c3b5d9d4a06fcbfa))
60+
61+
# [0.80.0-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.79.0...0.80.0-alpha.1) (2022-04-25)
62+
63+
64+
### Features
65+
66+
* Add restrictionType to Cloudfront, geoRestriction ([a51e670](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/a51e67087ab2721026cbcc32e96ecb089852468c))
67+
168
# [0.79.0](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.78.1...0.79.0) (2022-04-22)
269

370

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 | elb, s3 |
83+
| cloudfront | cloudwatch, elb, s3 |
8484
| cloudtrail | cloudwatch, cloudwatchLog, kms, s3, sns |
85-
| cloudwatch | cloudtrail, cloudwatchLog, sns |
85+
| cloudwatch | cloudfront, 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 |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudgraph/cg-provider-aws",
3-
"version": "0.79.0",
3+
"version": "0.80.0-beta.1",
44
"description": "cloud-graph provider plugin for AWS used to fetch AWS cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",

src/services/apiGatewayRestApi/format.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default ({
3434
arn,
3535
region,
3636
description,
37+
rawPolicy: policy,
3738
policy: formatIamJsonPolicy(policy),
3839
endpointConfiguration,
3940
apiKeySource,

src/services/apiGatewayRestApi/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type awsApiGatewayEndpointConfiguration {
66

77
type awsApiGatewayRestApi implements awsBaseService @key(fields: "arn") {
88
description: String @search(by: [hash, regexp, fulltext])
9+
rawPolicy: String @search(by: [hash, regexp])
910
policy: awsIamJSONPolicy
1011
endpointConfiguration: awsApiGatewayEndpointConfiguration
1112
apiKeySource: String @search(by: [hash])

src/services/billing/mutation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default `mutation($input: [AddawsBillingInput!]!) {
2-
addawsBilling(input: $input) {
2+
addawsBilling(input: $input, upsert: true) {
33
numUids
44
}
5-
}`
5+
}`

src/services/billing/schema.graphql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
type awsBilling {
2-
id: String! @id @search(by: [hash])
3-
accountId: String! @id @search(by: [hash])
1+
type awsBilling implements awsOptionalService @key(fields: "id") {
42
totalCostMonthToDate: awsTotalBillingInfo
53
totalCostLast30Days: awsTotalBillingInfo
64
monthToDateDailyAverage: [awsServiceBillingInfo]

src/services/cloudfront/format.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Origin,
55
} from 'aws-sdk/clients/cloudfront'
66
import cuid from 'cuid'
7-
import isEmpty from 'lodash/isEmpty'
87

98
import t from '../../properties/translations'
109
import { formatTagsFromMap } from '../../utils/format'
@@ -118,7 +117,7 @@ export default ({
118117
CallerReference: callerReference,
119118
DefaultRootObject: defaultRootObject,
120119
HttpVersion: httpVersion,
121-
Restrictions: { GeoRestriction: { Items: geoRestrictions = [] } } = {
120+
Restrictions: { GeoRestriction: { Items: locations = [], RestrictionType: restrictionType = ''} } = {
122121
GeoRestriction: { RestrictionType: '', Items: [], Quantity: 0 },
123122
},
124123
Logging: logging,
@@ -237,9 +236,10 @@ export default ({
237236
domainName,
238237
enabled: enabled ? t.yes : t.no,
239238
etag,
240-
geoRestrictions: !isEmpty(geoRestrictions)
241-
? geoRestrictions.join(',')
242-
: 'none',
239+
geoRestriction: {
240+
restrictionType,
241+
locations,
242+
},
243243
httpVersion,
244244
ipv6Enabled: isIpv6Enabled ? t.yes : t.no,
245245
lastModified: lastModified.toISOString(),

src/services/cloudfront/schema.graphql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type awsCloudfront implements awsBaseService @key(fields: "id") {
1010
ipv6Enabled: String @search(by: [hash])
1111
defaultRootObject: String @search(by: [hash])
1212
webAclId: String @search(by: [hash])
13-
geoRestrictions: String @search(by: [hash, regexp])
13+
geoRestriction: awsCloudfrontGeoRestriction
1414
customErrorResponses: [awsCloudfrontCustomErrorResponse]
1515
defaultCacheBehavior: awsCloudfrontCacheBehavior
1616
orderedCacheBehaviors: [awsCloudfrontCacheBehavior]
@@ -21,6 +21,7 @@ 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)
2425
}
2526

2627
type awsCloudfrontOriginData {
@@ -94,3 +95,8 @@ type awsCloudfrontLoggingConfig {
9495
bucket: String @search(by: [hash, regexp])
9596
prefix: String @search(by: [hash, regexp])
9697
}
98+
99+
type awsCloudfrontGeoRestriction {
100+
restrictionType: String @search(by: [hash, regexp])
101+
locations: [String] @search(by: [hash, regexp])
102+
}

src/services/cloudwatch/connections.ts

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

68
export default ({
79
service: cloudwatch,
@@ -15,7 +17,11 @@ export default ({
1517
}): {
1618
[property: string]: ServiceConnection[]
1719
} => {
18-
const { AlarmName: id, AlarmActions: alarmActions } = cloudwatch
20+
const {
21+
AlarmName: id,
22+
AlarmActions: alarmActions,
23+
Dimensions: dimensions,
24+
} = cloudwatch
1925
const connections: ServiceConnection[] = []
2026

2127
/**
@@ -40,6 +46,33 @@ export default ({
4046
}
4147
}
4248

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[
56+
globalRegionName
57+
].filter(({ summary: { Id: cloudfrontId } }: RawAwsCloudfront) =>
58+
dimensions?.some(d => d.Value === cloudfrontId)
59+
)
60+
61+
if (!isEmpty(cloudfrontsInRegion)) {
62+
for (const cf of cloudfrontsInRegion) {
63+
const {
64+
summary: { Id: cloudfrontId },
65+
}: RawAwsCloudfront = cf
66+
connections.push({
67+
id: cloudfrontId,
68+
resourceType: services.cloudfront,
69+
relation: 'child',
70+
field: 'cloudfront',
71+
})
72+
}
73+
}
74+
}
75+
4376
const result = {
4477
[id]: connections,
4578
}

0 commit comments

Comments
 (0)