Skip to content

Commit 313d9f4

Browse files
committed
Merge branch 'alpha' into feature/CG-1192
2 parents 179132a + fc5d719 commit 313d9f4

33 files changed

Lines changed: 404 additions & 274 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# [0.81.0-alpha.4](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.81.0-alpha.3...0.81.0-alpha.4) (2022-05-12)
2+
3+
4+
### Bug Fixes
5+
6+
* Added missing return to resolve promise ([904b25d](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/904b25dc52e019b0bcf7da6f8051a63f3a7e8a56))
7+
* Added SSLCertificateId needed for the NIST 16.5 rule ([def7137](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/def7137e0d0e4e1c4afdc6345fc0b4a3640fc22d))
8+
9+
# [0.81.0-alpha.3](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.81.0-alpha.2...0.81.0-alpha.3) (2022-05-11)
10+
11+
12+
### Bug Fixes
13+
14+
* Added validations and retry settings ([200c7f2](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/200c7f238c1b4f5142770e357ea4fc4a1e16d155))
15+
* Added validations and retry settings ([fec06cb](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/fec06cb6d869099797a017b582dcbbfbac17c60d))
16+
17+
# [0.81.0-alpha.2](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.81.0-alpha.1...0.81.0-alpha.2) (2022-05-10)
18+
19+
20+
### Bug Fixes
21+
22+
* fixed services that returned only the first page of paged results ([fcbd78b](https://github.com/cloudgraphdev/cloudgraph-provider-aws/commit/fcbd78bbbabefca9e7e4c37ec9b28618601a2e3d))
23+
124
# [0.81.0-alpha.1](https://github.com/cloudgraphdev/cloudgraph-provider-aws/compare/0.80.0...0.81.0-alpha.1) (2022-05-04)
225

326

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.81.0-alpha.1",
3+
"version": "0.81.0-alpha.4",
44
"description": "cloud-graph provider plugin for AWS used to fetch AWS cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",

src/config/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export const ROUTE_53_CUSTOM_DELAY = 200
88
export const IAM_CUSTOM_DELAY = 1000
99
export const CLOUDFORMATION_STACK_CUSTOM_DELAY = 1000
1010
export const MESSAGE_INTERVAL = 45000
11+
export const SNS_CUSTOM_DELAY = 1000

src/services/apiGatewayResource/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ const getResources = async ({ apiGw, restApiId }): Promise<ListOfResource> =>
6666

6767
if (position) {
6868
listAllResources(position)
69+
} else {
70+
resolve(resourceList)
6971
}
70-
71-
resolve(resourceList)
7272
}
7373
)
7474
} catch (error) {

src/services/apiGatewayRestApi/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export const getRestApisForRegion = async (
6565

6666
if (position) {
6767
listAllRestApis(position)
68+
} else {
69+
resolve(restApiList)
6870
}
69-
70-
resolve(restApiList)
7171
})
7272
} catch (error) {
7373
resolve([])

src/services/cloud9/data.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@ const errorLog = new AwsErrorLog(serviceName)
2828
const endpoint = initTestEndpoint(serviceName)
2929
const MAX_ITEMS = 25
3030

31-
const listEnvironmentsForRegion = async ({ cloud9, resolveRegion }) =>
31+
const listEnvironmentsForRegion = async ({
32+
cloud9,
33+
resolveRegion,
34+
}: {
35+
cloud9: Cloud9
36+
resolveRegion: () => void
37+
}): Promise<EnvironmentId[]> =>
3238
new Promise<EnvironmentId[]>(resolve => {
3339
const environmentIdList: EnvironmentIdList = []
3440
const listEnvironmentsOpts: ListEnvironmentsRequest = {}
35-
const listAllEnvironments = (token?: string) => {
41+
const listAllEnvironments = (token?: string): void => {
3642
if (token) {
3743
listEnvironmentsOpts.nextToken = token
3844
}
@@ -61,9 +67,9 @@ const listEnvironmentsForRegion = async ({ cloud9, resolveRegion }) =>
6167
lt.foundMoreCloud9Environments(environmentIds.length)
6268
)
6369
listAllEnvironments(nextToken)
70+
} else {
71+
resolve(environmentIdList)
6472
}
65-
66-
resolve(environmentIdList)
6773
}
6874
)
6975
} catch (error) {

src/services/cloudFormationStack/data.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,28 @@ const getAllStacks = async (cf: CloudFormation): Promise<Stack[]> =>
4242
opts.NextToken = token
4343
}
4444

45-
cf.describeStacks(opts, (err: AWSError, data: DescribeStacksOutput) => {
46-
const { Stacks = [], NextToken } = data || {}
47-
48-
if (err) {
49-
errorLog.generateAwsErrorLog({
50-
functionName: 'CloudFormationStack:describeStacks',
51-
err,
52-
})
53-
}
45+
try {
46+
cf.describeStacks(opts, (err: AWSError, data: DescribeStacksOutput) => {
47+
const { Stacks = [], NextToken } = data || {}
5448

55-
fullStacks.push(...Stacks)
49+
if (err) {
50+
errorLog.generateAwsErrorLog({
51+
functionName: 'CloudFormationStack:describeStacks',
52+
err,
53+
})
54+
}
5655

57-
if (NextToken) {
58-
listAllStacks(NextToken)
59-
}
56+
fullStacks.push(...Stacks)
6057

61-
resolve(fullStacks)
62-
})
58+
if (NextToken) {
59+
listAllStacks(NextToken)
60+
} else {
61+
resolve(fullStacks)
62+
}
63+
})
64+
} catch (error) {
65+
resolve([])
66+
}
6367
}
6468
listAllStacks()
6569
})

src/services/cloudfront/data.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ const listCloudfrontDistributions = async (
6868
* No Distributions Found
6969
*/
7070
if (isEmpty(Items)) {
71-
resolve([])
71+
return resolve([])
7272
}
7373

7474
distributions.push(...Items)
7575

7676
if (IsTruncated) {
7777
listDistributions(nextToken)
78+
} else {
79+
resolve(distributions)
7880
}
79-
80-
resolve(distributions)
8181
}
8282
)
8383
}

src/services/cloudwatch/data.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ const listMetricAlarmsForRegion = async ({
7676
if (nextToken) {
7777
logger.debug(lt.foundMoreCloudwatchAlarms(metricAlarms.length))
7878
listAllAlarms(nextToken)
79+
} else {
80+
resolve(metricAlarmsList)
7981
}
80-
81-
resolve(metricAlarmsList)
8282
}
8383
)
8484
} catch (error) {
@@ -88,7 +88,10 @@ const listMetricAlarmsForRegion = async ({
8888
listAllAlarms()
8989
})
9090

91-
const getResourceTags = async (cloudwatch: CloudWatch, arn: string) =>
91+
const getResourceTags = async (
92+
cloudwatch: CloudWatch,
93+
arn: string
94+
): Promise<TagMap> =>
9295
new Promise<TagMap>(resolve => {
9396
try {
9497
cloudwatch.listTagsForResource(

src/services/cloudwatchLogs/data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ const listLogGroupsForRegion = async ({
7676
region,
7777
}))
7878

79-
resolve(logGroupsData)
79+
if (!nextToken) {
80+
resolve(logGroupsData)
81+
}
8082
}
8183
)
8284
} catch (error) {

0 commit comments

Comments
 (0)