Skip to content

Commit 5af9175

Browse files
committed
update following comments
1 parent b777616 commit 5af9175

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

packages/cdkConstructs/src/constructs/PythonLambdaFunction.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
ManagedPolicy,
55
PolicyStatement,
66
Role,
7-
IManagedPolicy
7+
IManagedPolicy,
8+
IRole
89
} from "aws-cdk-lib/aws-iam"
910
import {
1011
Architecture,
@@ -18,7 +19,7 @@ import {
1819
import {join} from "node:path"
1920
import {createSharedLambdaResources} from "./lambdaSharedResources"
2021
import {addSuppressions} from "../utils/helpers"
21-
import {Key} from "aws-cdk-lib/aws-kms"
22+
import {IKey} from "aws-cdk-lib/aws-kms"
2223
import {CfnDeliveryStream} from "aws-cdk-lib/aws-kinesisfirehose"
2324

2425
export interface PythonLambdaFunctionProps {
@@ -96,27 +97,27 @@ export interface PythonLambdaFunctionProps {
9697
* Optional KMS key for encrypting CloudWatch Logs.
9798
* If not provided, the value is imported from account resources export.
9899
*/
99-
readonly cloudWatchLogsKmsKey?: Key
100+
readonly cloudWatchLogsKmsKey?: IKey
100101
/**
101102
* Optional IAM policy for allowing CloudWatch to use the KMS key for encrypting logs.
102103
* If not provided, the value is imported from account resources export.
103104
*/
104-
readonly cloudwatchEncryptionKMSPolicy?: ManagedPolicy
105+
readonly cloudwatchEncryptionKMSPolicy?: IManagedPolicy
105106
/**
106-
* Optional Kinesis stream for forwarding logs to Splunk.
107+
* Optional firehose delivery stream for forwarding logs to Splunk.
107108
* If not provided, the value is imported from account resources export.
108109
*/
109110
readonly splunkDeliveryStream?: CfnDeliveryStream
110111
/**
111112
* Optional IAM role for the subscription filter that forwards logs to Splunk.
112113
* If not provided, the value is imported from account resources export.
113114
*/
114-
readonly splunkSubscriptionFilterRole?: Role
115+
readonly splunkSubscriptionFilterRole?: IRole
115116
/**
116117
* Optional IAM policy for allowing lambdas to use Lambda Insights log groups and streams.
117118
* If not provided, the value is imported from account resources export.
118119
*/
119-
readonly lambdaInsightsLogGroupPolicy?: ManagedPolicy
120+
readonly lambdaInsightsLogGroupPolicy?: IManagedPolicy
120121
/**
121122
* Whether to create a subscription filter on the Lambda log group to forward logs to Splunk. Defaults to true.
122123
*/

packages/cdkConstructs/src/constructs/TypescriptLambdaFunction.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Duration} from "aws-cdk-lib"
22
import {
33
IManagedPolicy,
4+
IRole,
45
ManagedPolicy,
56
PolicyStatement,
67
Role
@@ -16,7 +17,7 @@ import {Construct} from "constructs"
1617
import {join} from "node:path"
1718
import {createSharedLambdaResources} from "./lambdaSharedResources"
1819
import {addSuppressions} from "../utils/helpers"
19-
import {Key} from "aws-cdk-lib/aws-kms"
20+
import {IKey} from "aws-cdk-lib/aws-kms"
2021
import {CfnDeliveryStream} from "aws-cdk-lib/aws-kinesisfirehose"
2122

2223
export interface TypescriptLambdaFunctionProps {
@@ -90,27 +91,27 @@ export interface TypescriptLambdaFunctionProps {
9091
* Optional KMS key for encrypting CloudWatch Logs.
9192
* If not provided, the value is imported from account resources export.
9293
*/
93-
readonly cloudWatchLogsKmsKey?: Key
94+
readonly cloudWatchLogsKmsKey?: IKey
9495
/**
9596
* Optional IAM policy for allowing CloudWatch to use the KMS key for encrypting logs.
9697
* If not provided, the value is imported from account resources export.
9798
*/
98-
readonly cloudwatchEncryptionKMSPolicy?: ManagedPolicy
99+
readonly cloudwatchEncryptionKMSPolicy?: IManagedPolicy
99100
/**
100-
* Optional Kinesis stream for forwarding logs to Splunk.
101+
* Optional firehose delivery stream for forwarding logs to Splunk.
101102
* If not provided, the value is imported from account resources export.
102103
*/
103104
readonly splunkDeliveryStream?: CfnDeliveryStream
104105
/**
105106
* Optional IAM role for the subscription filter that forwards logs to Splunk.
106107
* If not provided, the value is imported from account resources export.
107108
*/
108-
readonly splunkSubscriptionFilterRole?: Role
109+
readonly splunkSubscriptionFilterRole?: IRole
109110
/**
110111
* Optional IAM policy for allowing lambdas to use Lambda Insights log groups and streams.
111112
* If not provided, the value is imported from account resources export.
112113
*/
113-
readonly lambdaInsightsLogGroupPolicy?: ManagedPolicy
114+
readonly lambdaInsightsLogGroupPolicy?: IManagedPolicy
114115
/**
115116
* Whether to create a subscription filter on the Lambda log group to forward logs to Splunk. Defaults to true.
116117
*/

packages/cdkConstructs/src/constructs/lambdaSharedResources.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import {Construct} from "constructs"
22
import {Fn, RemovalPolicy} from "aws-cdk-lib"
33
import {Architecture, ILayerVersion, LayerVersion} from "aws-cdk-lib/aws-lambda"
4-
import {Key} from "aws-cdk-lib/aws-kms"
4+
import {IKey, Key} from "aws-cdk-lib/aws-kms"
55
import {CfnLogGroup, CfnSubscriptionFilter, LogGroup} from "aws-cdk-lib/aws-logs"
66
import {
77
IManagedPolicy,
8+
IRole,
89
ManagedPolicy,
910
PolicyStatement,
1011
Role,
@@ -21,11 +22,11 @@ export interface SharedLambdaResourceProps {
2122
readonly logRetentionInDays: number
2223
readonly additionalPolicies: Array<IManagedPolicy>
2324
readonly architecture: Architecture
24-
readonly cloudWatchLogsKmsKey?: Key
25-
readonly cloudwatchEncryptionKMSPolicy?: ManagedPolicy
25+
readonly cloudWatchLogsKmsKey?: IKey
26+
readonly cloudwatchEncryptionKMSPolicy?: IManagedPolicy
2627
readonly splunkDeliveryStream?: CfnDeliveryStream
27-
readonly splunkSubscriptionFilterRole?: Role
28-
readonly lambdaInsightsLogGroupPolicy?: ManagedPolicy
28+
readonly splunkSubscriptionFilterRole?: IRole
29+
readonly lambdaInsightsLogGroupPolicy?: IManagedPolicy
2930
readonly addSplunkSubscriptionFilter?: boolean
3031
}
3132

0 commit comments

Comments
 (0)