@gradientedge/cdk-utils-aws 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/construct/api-to-any-target/main.d.ts +11 -0
- package/dist/src/construct/api-to-any-target/main.js +11 -2
- package/dist/src/construct/api-to-any-target/target.d.ts +16 -1
- package/dist/src/construct/api-to-any-target/target.js +16 -1
- package/dist/src/construct/api-to-any-target/types.d.ts +52 -0
- package/dist/src/construct/api-to-eventbridge-target/api.d.ts +18 -0
- package/dist/src/construct/api-to-eventbridge-target/api.js +18 -0
- package/dist/src/construct/api-to-eventbridge-target/event.d.ts +7 -0
- package/dist/src/construct/api-to-eventbridge-target/event.js +7 -0
- package/dist/src/construct/api-to-eventbridge-target/main.d.ts +12 -0
- package/dist/src/construct/api-to-eventbridge-target/main.js +12 -3
- package/dist/src/construct/api-to-eventbridge-target/types.d.ts +67 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +7 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +7 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.d.ts +13 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.js +13 -4
- package/dist/src/construct/api-to-eventbridge-target-with-sns/types.d.ts +12 -0
- package/dist/src/construct/api-to-lambda-target/api.d.ts +19 -0
- package/dist/src/construct/api-to-lambda-target/api.js +19 -0
- package/dist/src/construct/api-to-lambda-target/main.d.ts +24 -0
- package/dist/src/construct/api-to-lambda-target/main.js +24 -2
- package/dist/src/construct/api-to-lambda-target/types.d.ts +41 -0
- package/dist/src/construct/application-configuration/main.d.ts +29 -1
- package/dist/src/construct/application-configuration/main.js +28 -1
- package/dist/src/construct/application-configuration/types.d.ts +5 -0
- package/dist/src/construct/event-handler/handler.d.ts +23 -1
- package/dist/src/construct/event-handler/handler.js +23 -1
- package/dist/src/construct/event-handler/main.d.ts +13 -0
- package/dist/src/construct/event-handler/main.js +13 -0
- package/dist/src/construct/event-handler/types.d.ts +35 -0
- package/dist/src/construct/lambda-with-iam-access/main.d.ts +21 -0
- package/dist/src/construct/lambda-with-iam-access/main.js +21 -2
- package/dist/src/construct/lambda-with-iam-access/types.d.ts +18 -0
- package/dist/src/construct/piped-event-handler/main.d.ts +9 -0
- package/dist/src/construct/piped-event-handler/main.js +9 -0
- package/dist/src/construct/piped-event-handler/types.d.ts +7 -0
- package/dist/src/construct/rest-api-lambda/main.d.ts +23 -0
- package/dist/src/construct/rest-api-lambda/main.js +19 -2
- package/dist/src/construct/rest-api-lambda/types.d.ts +14 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.d.ts +12 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.js +12 -2
- package/dist/src/construct/rest-api-lambda-with-cache/types.d.ts +6 -0
- package/dist/src/construct/site-with-ecs-backend/constants.d.ts +5 -0
- package/dist/src/construct/site-with-ecs-backend/constants.js +5 -0
- package/dist/src/construct/site-with-ecs-backend/main.d.ts +37 -0
- package/dist/src/construct/site-with-ecs-backend/main.js +37 -2
- package/dist/src/construct/site-with-ecs-backend/types.d.ts +45 -0
- package/dist/src/construct/site-with-lambda-backend/constants.d.ts +8 -0
- package/dist/src/construct/site-with-lambda-backend/constants.js +8 -0
- package/dist/src/construct/site-with-lambda-backend/main.d.ts +31 -0
- package/dist/src/construct/site-with-lambda-backend/main.js +31 -2
- package/dist/src/construct/site-with-lambda-backend/types.d.ts +42 -0
- package/dist/src/construct/static-asset-deployment/main.d.ts +10 -0
- package/dist/src/construct/static-asset-deployment/main.js +10 -1
- package/dist/src/construct/static-asset-deployment/types.d.ts +14 -0
- package/dist/src/construct/static-site/main.d.ts +17 -0
- package/dist/src/construct/static-site/main.js +17 -2
- package/dist/src/construct/static-site/types.d.ts +18 -0
- package/dist/src/services/api-gateway/main.d.ts +20 -20
- package/dist/src/services/api-gateway/main.js +20 -20
- package/dist/src/services/api-gateway/types.d.ts +7 -0
- package/dist/src/services/appconfig/constants.d.ts +2 -2
- package/dist/src/services/appconfig/constants.js +2 -2
- package/dist/src/services/appconfig/main.d.ts +5 -5
- package/dist/src/services/appconfig/main.js +5 -5
- package/dist/src/services/appconfig/types.d.ts +11 -1
- package/dist/src/services/certificate-manager/types.d.ts +8 -0
- package/dist/src/services/cloudfront/main.d.ts +28 -28
- package/dist/src/services/cloudfront/main.js +28 -28
- package/dist/src/services/cloudfront/types.d.ts +8 -0
- package/dist/src/services/cloudwatch/logs.d.ts +4 -4
- package/dist/src/services/cloudwatch/logs.js +4 -4
- package/dist/src/services/cloudwatch/main.d.ts +24 -24
- package/dist/src/services/cloudwatch/main.js +25 -24
- package/dist/src/services/cloudwatch/types.d.ts +66 -0
- package/dist/src/services/dynamodb/main.d.ts +2 -2
- package/dist/src/services/dynamodb/main.js +2 -2
- package/dist/src/services/dynamodb/types.d.ts +8 -0
- package/dist/src/services/elastic-container-registry/main.d.ts +1 -1
- package/dist/src/services/elastic-container-registry/main.js +1 -1
- package/dist/src/services/elastic-container-service/main.d.ts +13 -13
- package/dist/src/services/elastic-container-service/main.js +16 -13
- package/dist/src/services/elastic-container-service/types.d.ts +30 -1
- package/dist/src/services/elastic-file-system/types.d.ts +9 -0
- package/dist/src/services/elastic-kubernetes-service/main.d.ts +3 -3
- package/dist/src/services/elastic-kubernetes-service/main.js +7 -3
- package/dist/src/services/elastic-kubernetes-service/types.d.ts +4 -0
- package/dist/src/services/elasticache/main.d.ts +14 -14
- package/dist/src/services/elasticache/main.js +18 -14
- package/dist/src/services/elasticache/types.d.ts +4 -0
- package/dist/src/services/eventbridge/main.d.ts +11 -11
- package/dist/src/services/eventbridge/main.js +19 -11
- package/dist/src/services/eventbridge/target.d.ts +5 -1
- package/dist/src/services/eventbridge/target.js +6 -1
- package/dist/src/services/eventbridge/types.d.ts +27 -1
- package/dist/src/services/evidently/types.d.ts +10 -0
- package/dist/src/services/identity-access-management/main.d.ts +42 -42
- package/dist/src/services/identity-access-management/main.js +42 -42
- package/dist/src/services/key-management-service/types.d.ts +2 -0
- package/dist/src/services/lambda/main.d.ts +25 -25
- package/dist/src/services/lambda/main.js +26 -25
- package/dist/src/services/lambda/types.d.ts +34 -0
- package/dist/src/services/route53/main.js +2 -0
- package/dist/src/services/route53/types.d.ts +3 -0
- package/dist/src/services/secrets-manager/main.js +2 -0
- package/dist/src/services/secrets-manager/types.d.ts +4 -0
- package/dist/src/services/simple-notification-service/types.d.ts +2 -0
- package/dist/src/services/simple-queue-service/main.js +2 -0
- package/dist/src/services/simple-queue-service/types.d.ts +11 -0
- package/dist/src/services/simple-storage-service/main.d.ts +1 -1
- package/dist/src/services/simple-storage-service/main.js +5 -1
- package/dist/src/services/simple-storage-service/types.d.ts +16 -0
- package/dist/src/services/step-function/types.d.ts +54 -0
- package/dist/src/services/systems-manager/main.d.ts +15 -4
- package/dist/src/services/systems-manager/main.js +17 -4
- package/dist/src/services/systems-manager/types.d.ts +8 -0
- package/dist/src/services/virtual-private-cloud/ipv6.d.ts +19 -1
- package/dist/src/services/virtual-private-cloud/ipv6.js +26 -1
- package/dist/src/services/virtual-private-cloud/main.js +1 -2
- package/dist/src/services/virtual-private-cloud/types.d.ts +5 -0
- package/dist/src/services/web-application-firewall/types.d.ts +4 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts +9 -3
- package/dist/src/utils/index.js +10 -3
- package/package.json +5 -5
|
@@ -6,7 +6,7 @@ import { IBucket } from 'aws-cdk-lib/aws-s3';
|
|
|
6
6
|
import { Queue } from 'aws-cdk-lib/aws-sqs';
|
|
7
7
|
import { CommonConstruct } from '../../common/index.js';
|
|
8
8
|
/**
|
|
9
|
-
* Provides operations on AWS
|
|
9
|
+
* Provides operations on AWS Identity and Access Management (IAM).
|
|
10
10
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
11
11
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
12
12
|
* @example
|
|
@@ -72,7 +72,7 @@ export declare class IamManager {
|
|
|
72
72
|
/**
|
|
73
73
|
* @summary Method to create iam statement to list s3 buckets
|
|
74
74
|
* @param scope scope in which this resource is defined
|
|
75
|
-
* @param bucket
|
|
75
|
+
* @param bucket the S3 bucket to grant list access to
|
|
76
76
|
*/
|
|
77
77
|
statementForListBucket(scope: CommonConstruct, bucket: IBucket): PolicyStatement;
|
|
78
78
|
/**
|
|
@@ -83,22 +83,22 @@ export declare class IamManager {
|
|
|
83
83
|
/**
|
|
84
84
|
* @summary Method to create iam statement to get s3 objects in buckets
|
|
85
85
|
* @param scope scope in which this resource is defined
|
|
86
|
-
* @param bucket
|
|
87
|
-
* @param resourceArns list of ARNs to allow access to
|
|
86
|
+
* @param bucket the S3 bucket to grant read access to
|
|
87
|
+
* @param resourceArns optional list of ARNs to allow access to, defaults to all objects in the bucket
|
|
88
88
|
*/
|
|
89
89
|
statementForGetAnyS3Objects(scope: CommonConstruct, bucket: IBucket, resourceArns?: string[]): PolicyStatement;
|
|
90
90
|
/**
|
|
91
91
|
* @summary Method to create iam statement to delete s3 objects in buckets
|
|
92
92
|
* @param scope scope in which this resource is defined
|
|
93
|
-
* @param bucket
|
|
94
|
-
* @param resourceArns list of ARNs to allow access to
|
|
93
|
+
* @param bucket the S3 bucket to grant delete access to
|
|
94
|
+
* @param resourceArns optional list of ARNs to allow access to, defaults to all objects in the bucket
|
|
95
95
|
*/
|
|
96
96
|
statementForDeleteAnyS3Objects(scope: CommonConstruct, bucket: IBucket, resourceArns?: string[]): PolicyStatement;
|
|
97
97
|
/**
|
|
98
98
|
* @summary Method to create iam statement to write s3 objects in buckets
|
|
99
99
|
* @param scope scope in which this resource is defined
|
|
100
|
-
* @param bucket
|
|
101
|
-
* @param resourceArns list of ARNs to allow access to
|
|
100
|
+
* @param bucket the S3 bucket to grant write access to
|
|
101
|
+
* @param resourceArns optional list of ARNs to allow access to, defaults to all objects in the bucket
|
|
102
102
|
*/
|
|
103
103
|
statementForPutAnyS3Objects(scope: CommonConstruct, bucket: IBucket, resourceArns?: string[]): PolicyStatement;
|
|
104
104
|
/**
|
|
@@ -119,7 +119,7 @@ export declare class IamManager {
|
|
|
119
119
|
/**
|
|
120
120
|
* @summary Method to create iam statement to assume iam role
|
|
121
121
|
* @param scope scope in which this resource is defined
|
|
122
|
-
* @param servicePrincipals
|
|
122
|
+
* @param servicePrincipals the list of service principals allowed to assume the role
|
|
123
123
|
*/
|
|
124
124
|
statementForAssumeRole(scope: CommonConstruct, servicePrincipals: ServicePrincipal[]): PolicyStatement;
|
|
125
125
|
/**
|
|
@@ -130,14 +130,14 @@ export declare class IamManager {
|
|
|
130
130
|
/**
|
|
131
131
|
* @summary Method to create iam statement to run ecs task
|
|
132
132
|
* @param scope scope in which this resource is defined
|
|
133
|
-
* @param cluster
|
|
134
|
-
* @param task
|
|
133
|
+
* @param cluster the ECS cluster the task runs in
|
|
134
|
+
* @param task the ECS task definition to allow running
|
|
135
135
|
*/
|
|
136
136
|
statementForRunEcsTask(scope: CommonConstruct, cluster: ICluster, task: ITaskDefinition): PolicyStatement;
|
|
137
137
|
/**
|
|
138
138
|
* @summary Method to create iam statement to create log stream
|
|
139
139
|
* @param scope scope in which this resource is defined
|
|
140
|
-
* @param logGroup
|
|
140
|
+
* @param logGroup the CloudWatch log group to allow creating log streams in
|
|
141
141
|
*/
|
|
142
142
|
statementForCreateLogStream(scope: CommonConstruct, logGroup: CfnLogGroup): PolicyStatement;
|
|
143
143
|
/**
|
|
@@ -148,7 +148,7 @@ export declare class IamManager {
|
|
|
148
148
|
/**
|
|
149
149
|
* @summary Method to create iam statement to write log events
|
|
150
150
|
* @param scope scope in which this resource is defined
|
|
151
|
-
* @param logGroup
|
|
151
|
+
* @param logGroup the CloudWatch log group to allow writing log events to
|
|
152
152
|
*/
|
|
153
153
|
statementForPutLogEvent(scope: CommonConstruct, logGroup: CfnLogGroup): PolicyStatement;
|
|
154
154
|
/**
|
|
@@ -177,12 +177,12 @@ export declare class IamManager {
|
|
|
177
177
|
*/
|
|
178
178
|
createPolicyForCloudfrontInvalidation(resourceArns?: string[]): PolicyDocument;
|
|
179
179
|
/**
|
|
180
|
-
* @summary Method to create iam policy for
|
|
180
|
+
* @summary Method to create iam policy for SQS event processing
|
|
181
181
|
* @param id scoped id of the resource
|
|
182
182
|
* @param scope scope in which this resource is defined
|
|
183
|
-
* @param sqsQueue
|
|
184
|
-
* @param eventBridgeRule
|
|
185
|
-
* @param servicePrincipals
|
|
183
|
+
* @param sqsQueue the SQS queue to grant access to
|
|
184
|
+
* @param eventBridgeRule the EventBridge rule that sends events to the queue
|
|
185
|
+
* @param servicePrincipals optional list of service principals, defaults to events.amazonaws.com
|
|
186
186
|
*/
|
|
187
187
|
createPolicyForSqsEvent(id: string, scope: CommonConstruct, sqsQueue: Queue, eventBridgeRule: IRule, servicePrincipals?: ServicePrincipal[]): PolicyDocument;
|
|
188
188
|
/**
|
|
@@ -192,73 +192,73 @@ export declare class IamManager {
|
|
|
192
192
|
*/
|
|
193
193
|
createRoleForCloudfrontInvalidation(id: string, scope: CommonConstruct): Role;
|
|
194
194
|
/**
|
|
195
|
-
* @summary Method to create iam
|
|
195
|
+
* @summary Method to create iam role for CloudTrail
|
|
196
196
|
* @param id scoped id of the resource
|
|
197
197
|
* @param scope scope in which this resource is defined
|
|
198
|
-
* @param logGroup
|
|
198
|
+
* @param logGroup the CloudWatch log group for CloudTrail to deliver logs to
|
|
199
199
|
*/
|
|
200
200
|
createRoleForCloudTrail(id: string, scope: CommonConstruct, logGroup: CfnLogGroup): CfnRole;
|
|
201
201
|
/**
|
|
202
|
-
* @summary Method to create iam
|
|
202
|
+
* @summary Method to create iam role for ECS event-driven task execution
|
|
203
203
|
* @param id scoped id of the resource
|
|
204
204
|
* @param scope scope in which this resource is defined
|
|
205
|
-
* @param cluster
|
|
206
|
-
* @param task
|
|
205
|
+
* @param cluster the ECS cluster the task runs in
|
|
206
|
+
* @param task the ECS task definition to allow running
|
|
207
207
|
*/
|
|
208
208
|
createRoleForEcsEvent(id: string, scope: CommonConstruct, cluster: ICluster, task: ITaskDefinition): Role;
|
|
209
209
|
/**
|
|
210
|
-
* @summary Method to create iam
|
|
210
|
+
* @summary Method to create iam role for ECS task execution
|
|
211
211
|
* @param id scoped id of the resource
|
|
212
212
|
* @param scope scope in which this resource is defined
|
|
213
|
-
* @param policy
|
|
213
|
+
* @param policy the inline policy document to attach to the role
|
|
214
214
|
*/
|
|
215
215
|
createRoleForEcsExecution(id: string, scope: CommonConstruct, policy: PolicyDocument): Role;
|
|
216
216
|
/**
|
|
217
|
-
* @summary Method to create iam
|
|
217
|
+
* @summary Method to create iam role for Lambda function execution
|
|
218
218
|
* @param id scoped id of the resource
|
|
219
219
|
* @param scope scope in which this resource is defined
|
|
220
|
-
* @param policy
|
|
221
|
-
* @param servicePrincipal
|
|
220
|
+
* @param policy the inline policy document to attach to the role
|
|
221
|
+
* @param servicePrincipal optional service principal, defaults to lambda.amazonaws.com
|
|
222
222
|
*/
|
|
223
223
|
createRoleForLambda(id: string, scope: CommonConstruct, policy: PolicyDocument, servicePrincipal?: ServicePrincipal): Role;
|
|
224
224
|
/**
|
|
225
|
-
* @summary Method to create iam
|
|
225
|
+
* @summary Method to create iam role for AppConfig Secrets Manager integration
|
|
226
226
|
* @param id scoped id of the resource
|
|
227
227
|
* @param scope scope in which this resource is defined
|
|
228
|
-
* @param policy
|
|
229
|
-
* @param servicePrincipal
|
|
228
|
+
* @param policy the inline policy document to attach to the role
|
|
229
|
+
* @param servicePrincipal optional service principal, defaults to appconfig.amazonaws.com
|
|
230
230
|
*/
|
|
231
231
|
createRoleForAppConfigSecrets(id: string, scope: CommonConstruct, policy: PolicyDocument, servicePrincipal?: ServicePrincipal): Role;
|
|
232
232
|
/**
|
|
233
|
-
* @summary Method to create iam
|
|
233
|
+
* @summary Method to create iam role for Step Function execution
|
|
234
234
|
* @param id scoped id of the resource
|
|
235
235
|
* @param scope scope in which this resource is defined
|
|
236
|
-
* @param policy
|
|
237
|
-
* @param servicePrincipal
|
|
236
|
+
* @param policy the inline policy document to attach to the role
|
|
237
|
+
* @param servicePrincipal optional service principal, defaults to states.amazonaws.com
|
|
238
238
|
*/
|
|
239
239
|
createRoleForStepFunction(id: string, scope: CommonConstruct, policy: PolicyDocument, servicePrincipal?: ServicePrincipal): Role;
|
|
240
240
|
/**
|
|
241
|
-
* @summary Method to create iam
|
|
241
|
+
* @summary Method to create iam role for SQS to Step Function pipe
|
|
242
242
|
* @param id scoped id of the resource
|
|
243
243
|
* @param scope scope in which this resource is defined
|
|
244
|
-
* @param queueArn the
|
|
245
|
-
* @param stepFunctionArn the
|
|
244
|
+
* @param queueArn the ARN of the SQS queue (source)
|
|
245
|
+
* @param stepFunctionArn the ARN of the Step Function (target)
|
|
246
246
|
*/
|
|
247
247
|
createRoleForSqsToSfnPipe(id: string, scope: CommonConstruct, queueArn: string, stepFunctionArn: string): Role;
|
|
248
248
|
/**
|
|
249
|
-
* @summary Method to create iam
|
|
249
|
+
* @summary Method to create iam role for SQS to Lambda pipe
|
|
250
250
|
* @param id scoped id of the resource
|
|
251
251
|
* @param scope scope in which this resource is defined
|
|
252
|
-
* @param queueArn the
|
|
253
|
-
* @param lambdaArn the
|
|
252
|
+
* @param queueArn the ARN of the SQS queue (source)
|
|
253
|
+
* @param lambdaArn the ARN of the Lambda function (target)
|
|
254
254
|
*/
|
|
255
255
|
createRoleForSqsToLambdaPipe(id: string, scope: CommonConstruct, queueArn: string, lambdaArn: string): Role;
|
|
256
256
|
/**
|
|
257
|
-
* @summary Method to create iam
|
|
257
|
+
* @summary Method to create iam role for DynamoDB stream to Lambda function pipe
|
|
258
258
|
* @param id scoped id of the resource
|
|
259
259
|
* @param scope scope in which this resource is defined
|
|
260
|
-
* @param dynamoDbStreamArn the
|
|
261
|
-
* @param lambdaFunctionArn the
|
|
260
|
+
* @param dynamoDbStreamArn the ARN of the DynamoDB stream (source)
|
|
261
|
+
* @param lambdaFunctionArn the ARN of the Lambda function (target)
|
|
262
262
|
*/
|
|
263
263
|
createRoleForDynamoDbToLambdaPipe(id: string, scope: CommonConstruct, dynamoDbStreamArn: string, lambdaFunctionArn: string): Role;
|
|
264
264
|
}
|
|
@@ -2,7 +2,7 @@ import { Stack } from 'aws-cdk-lib';
|
|
|
2
2
|
import { CfnRole, Effect, ManagedPolicy, PolicyDocument, PolicyStatement, Role, ServicePrincipal, } from 'aws-cdk-lib/aws-iam';
|
|
3
3
|
import { createCfnOutput } from '../../utils/index.js';
|
|
4
4
|
/**
|
|
5
|
-
* Provides operations on AWS
|
|
5
|
+
* Provides operations on AWS Identity and Access Management (IAM).
|
|
6
6
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
7
7
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
8
8
|
* @example
|
|
@@ -137,7 +137,7 @@ export class IamManager {
|
|
|
137
137
|
/**
|
|
138
138
|
* @summary Method to create iam statement to list s3 buckets
|
|
139
139
|
* @param scope scope in which this resource is defined
|
|
140
|
-
* @param bucket
|
|
140
|
+
* @param bucket the S3 bucket to grant list access to
|
|
141
141
|
*/
|
|
142
142
|
statementForListBucket(scope, bucket) {
|
|
143
143
|
return new PolicyStatement({
|
|
@@ -160,8 +160,8 @@ export class IamManager {
|
|
|
160
160
|
/**
|
|
161
161
|
* @summary Method to create iam statement to get s3 objects in buckets
|
|
162
162
|
* @param scope scope in which this resource is defined
|
|
163
|
-
* @param bucket
|
|
164
|
-
* @param resourceArns list of ARNs to allow access to
|
|
163
|
+
* @param bucket the S3 bucket to grant read access to
|
|
164
|
+
* @param resourceArns optional list of ARNs to allow access to, defaults to all objects in the bucket
|
|
165
165
|
*/
|
|
166
166
|
statementForGetAnyS3Objects(scope, bucket, resourceArns) {
|
|
167
167
|
return new PolicyStatement({
|
|
@@ -173,8 +173,8 @@ export class IamManager {
|
|
|
173
173
|
/**
|
|
174
174
|
* @summary Method to create iam statement to delete s3 objects in buckets
|
|
175
175
|
* @param scope scope in which this resource is defined
|
|
176
|
-
* @param bucket
|
|
177
|
-
* @param resourceArns list of ARNs to allow access to
|
|
176
|
+
* @param bucket the S3 bucket to grant delete access to
|
|
177
|
+
* @param resourceArns optional list of ARNs to allow access to, defaults to all objects in the bucket
|
|
178
178
|
*/
|
|
179
179
|
statementForDeleteAnyS3Objects(scope, bucket, resourceArns) {
|
|
180
180
|
return new PolicyStatement({
|
|
@@ -186,8 +186,8 @@ export class IamManager {
|
|
|
186
186
|
/**
|
|
187
187
|
* @summary Method to create iam statement to write s3 objects in buckets
|
|
188
188
|
* @param scope scope in which this resource is defined
|
|
189
|
-
* @param bucket
|
|
190
|
-
* @param resourceArns list of ARNs to allow access to
|
|
189
|
+
* @param bucket the S3 bucket to grant write access to
|
|
190
|
+
* @param resourceArns optional list of ARNs to allow access to, defaults to all objects in the bucket
|
|
191
191
|
*/
|
|
192
192
|
statementForPutAnyS3Objects(scope, bucket, resourceArns) {
|
|
193
193
|
return new PolicyStatement({
|
|
@@ -232,7 +232,7 @@ export class IamManager {
|
|
|
232
232
|
/**
|
|
233
233
|
* @summary Method to create iam statement to assume iam role
|
|
234
234
|
* @param scope scope in which this resource is defined
|
|
235
|
-
* @param servicePrincipals
|
|
235
|
+
* @param servicePrincipals the list of service principals allowed to assume the role
|
|
236
236
|
*/
|
|
237
237
|
statementForAssumeRole(scope, servicePrincipals) {
|
|
238
238
|
return new PolicyStatement({
|
|
@@ -256,8 +256,8 @@ export class IamManager {
|
|
|
256
256
|
/**
|
|
257
257
|
* @summary Method to create iam statement to run ecs task
|
|
258
258
|
* @param scope scope in which this resource is defined
|
|
259
|
-
* @param cluster
|
|
260
|
-
* @param task
|
|
259
|
+
* @param cluster the ECS cluster the task runs in
|
|
260
|
+
* @param task the ECS task definition to allow running
|
|
261
261
|
*/
|
|
262
262
|
statementForRunEcsTask(scope, cluster, task) {
|
|
263
263
|
return new PolicyStatement({
|
|
@@ -270,7 +270,7 @@ export class IamManager {
|
|
|
270
270
|
/**
|
|
271
271
|
* @summary Method to create iam statement to create log stream
|
|
272
272
|
* @param scope scope in which this resource is defined
|
|
273
|
-
* @param logGroup
|
|
273
|
+
* @param logGroup the CloudWatch log group to allow creating log streams in
|
|
274
274
|
*/
|
|
275
275
|
statementForCreateLogStream(scope, logGroup) {
|
|
276
276
|
return new PolicyStatement({
|
|
@@ -299,7 +299,7 @@ export class IamManager {
|
|
|
299
299
|
/**
|
|
300
300
|
* @summary Method to create iam statement to write log events
|
|
301
301
|
* @param scope scope in which this resource is defined
|
|
302
|
-
* @param logGroup
|
|
302
|
+
* @param logGroup the CloudWatch log group to allow writing log events to
|
|
303
303
|
*/
|
|
304
304
|
statementForPutLogEvent(scope, logGroup) {
|
|
305
305
|
return new PolicyStatement({
|
|
@@ -390,12 +390,12 @@ export class IamManager {
|
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
392
|
/**
|
|
393
|
-
* @summary Method to create iam policy for
|
|
393
|
+
* @summary Method to create iam policy for SQS event processing
|
|
394
394
|
* @param id scoped id of the resource
|
|
395
395
|
* @param scope scope in which this resource is defined
|
|
396
|
-
* @param sqsQueue
|
|
397
|
-
* @param eventBridgeRule
|
|
398
|
-
* @param servicePrincipals
|
|
396
|
+
* @param sqsQueue the SQS queue to grant access to
|
|
397
|
+
* @param eventBridgeRule the EventBridge rule that sends events to the queue
|
|
398
|
+
* @param servicePrincipals optional list of service principals, defaults to events.amazonaws.com
|
|
399
399
|
*/
|
|
400
400
|
createPolicyForSqsEvent(id, scope, sqsQueue, eventBridgeRule, servicePrincipals) {
|
|
401
401
|
return new PolicyDocument({
|
|
@@ -429,10 +429,10 @@ export class IamManager {
|
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
432
|
-
* @summary Method to create iam
|
|
432
|
+
* @summary Method to create iam role for CloudTrail
|
|
433
433
|
* @param id scoped id of the resource
|
|
434
434
|
* @param scope scope in which this resource is defined
|
|
435
|
-
* @param logGroup
|
|
435
|
+
* @param logGroup the CloudWatch log group for CloudTrail to deliver logs to
|
|
436
436
|
*/
|
|
437
437
|
createRoleForCloudTrail(id, scope, logGroup) {
|
|
438
438
|
const policy = new PolicyDocument({
|
|
@@ -455,11 +455,11 @@ export class IamManager {
|
|
|
455
455
|
return role;
|
|
456
456
|
}
|
|
457
457
|
/**
|
|
458
|
-
* @summary Method to create iam
|
|
458
|
+
* @summary Method to create iam role for ECS event-driven task execution
|
|
459
459
|
* @param id scoped id of the resource
|
|
460
460
|
* @param scope scope in which this resource is defined
|
|
461
|
-
* @param cluster
|
|
462
|
-
* @param task
|
|
461
|
+
* @param cluster the ECS cluster the task runs in
|
|
462
|
+
* @param task the ECS task definition to allow running
|
|
463
463
|
*/
|
|
464
464
|
createRoleForEcsEvent(id, scope, cluster, task) {
|
|
465
465
|
const policy = new PolicyDocument({
|
|
@@ -476,10 +476,10 @@ export class IamManager {
|
|
|
476
476
|
return role;
|
|
477
477
|
}
|
|
478
478
|
/**
|
|
479
|
-
* @summary Method to create iam
|
|
479
|
+
* @summary Method to create iam role for ECS task execution
|
|
480
480
|
* @param id scoped id of the resource
|
|
481
481
|
* @param scope scope in which this resource is defined
|
|
482
|
-
* @param policy
|
|
482
|
+
* @param policy the inline policy document to attach to the role
|
|
483
483
|
*/
|
|
484
484
|
createRoleForEcsExecution(id, scope, policy) {
|
|
485
485
|
const role = new Role(scope, `${id}`, {
|
|
@@ -496,11 +496,11 @@ export class IamManager {
|
|
|
496
496
|
return role;
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
499
|
-
* @summary Method to create iam
|
|
499
|
+
* @summary Method to create iam role for Lambda function execution
|
|
500
500
|
* @param id scoped id of the resource
|
|
501
501
|
* @param scope scope in which this resource is defined
|
|
502
|
-
* @param policy
|
|
503
|
-
* @param servicePrincipal
|
|
502
|
+
* @param policy the inline policy document to attach to the role
|
|
503
|
+
* @param servicePrincipal optional service principal, defaults to lambda.amazonaws.com
|
|
504
504
|
*/
|
|
505
505
|
createRoleForLambda(id, scope, policy, servicePrincipal) {
|
|
506
506
|
const role = new Role(scope, `${id}`, {
|
|
@@ -517,11 +517,11 @@ export class IamManager {
|
|
|
517
517
|
return role;
|
|
518
518
|
}
|
|
519
519
|
/**
|
|
520
|
-
* @summary Method to create iam
|
|
520
|
+
* @summary Method to create iam role for AppConfig Secrets Manager integration
|
|
521
521
|
* @param id scoped id of the resource
|
|
522
522
|
* @param scope scope in which this resource is defined
|
|
523
|
-
* @param policy
|
|
524
|
-
* @param servicePrincipal
|
|
523
|
+
* @param policy the inline policy document to attach to the role
|
|
524
|
+
* @param servicePrincipal optional service principal, defaults to appconfig.amazonaws.com
|
|
525
525
|
*/
|
|
526
526
|
createRoleForAppConfigSecrets(id, scope, policy, servicePrincipal) {
|
|
527
527
|
const role = new Role(scope, `${id}`, {
|
|
@@ -535,11 +535,11 @@ export class IamManager {
|
|
|
535
535
|
return role;
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
538
|
-
* @summary Method to create iam
|
|
538
|
+
* @summary Method to create iam role for Step Function execution
|
|
539
539
|
* @param id scoped id of the resource
|
|
540
540
|
* @param scope scope in which this resource is defined
|
|
541
|
-
* @param policy
|
|
542
|
-
* @param servicePrincipal
|
|
541
|
+
* @param policy the inline policy document to attach to the role
|
|
542
|
+
* @param servicePrincipal optional service principal, defaults to states.amazonaws.com
|
|
543
543
|
*/
|
|
544
544
|
createRoleForStepFunction(id, scope, policy, servicePrincipal) {
|
|
545
545
|
const role = new Role(scope, `${id}`, {
|
|
@@ -556,11 +556,11 @@ export class IamManager {
|
|
|
556
556
|
return role;
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
|
-
* @summary Method to create iam
|
|
559
|
+
* @summary Method to create iam role for SQS to Step Function pipe
|
|
560
560
|
* @param id scoped id of the resource
|
|
561
561
|
* @param scope scope in which this resource is defined
|
|
562
|
-
* @param queueArn the
|
|
563
|
-
* @param stepFunctionArn the
|
|
562
|
+
* @param queueArn the ARN of the SQS queue (source)
|
|
563
|
+
* @param stepFunctionArn the ARN of the Step Function (target)
|
|
564
564
|
*/
|
|
565
565
|
createRoleForSqsToSfnPipe(id, scope, queueArn, stepFunctionArn) {
|
|
566
566
|
const role = new Role(scope, `${id}`, {
|
|
@@ -575,11 +575,11 @@ export class IamManager {
|
|
|
575
575
|
return role;
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
|
-
* @summary Method to create iam
|
|
578
|
+
* @summary Method to create iam role for SQS to Lambda pipe
|
|
579
579
|
* @param id scoped id of the resource
|
|
580
580
|
* @param scope scope in which this resource is defined
|
|
581
|
-
* @param queueArn the
|
|
582
|
-
* @param lambdaArn the
|
|
581
|
+
* @param queueArn the ARN of the SQS queue (source)
|
|
582
|
+
* @param lambdaArn the ARN of the Lambda function (target)
|
|
583
583
|
*/
|
|
584
584
|
createRoleForSqsToLambdaPipe(id, scope, queueArn, lambdaArn) {
|
|
585
585
|
const role = new Role(scope, `${id}`, {
|
|
@@ -594,11 +594,11 @@ export class IamManager {
|
|
|
594
594
|
return role;
|
|
595
595
|
}
|
|
596
596
|
/**
|
|
597
|
-
* @summary Method to create iam
|
|
597
|
+
* @summary Method to create iam role for DynamoDB stream to Lambda function pipe
|
|
598
598
|
* @param id scoped id of the resource
|
|
599
599
|
* @param scope scope in which this resource is defined
|
|
600
|
-
* @param dynamoDbStreamArn the
|
|
601
|
-
* @param lambdaFunctionArn the
|
|
600
|
+
* @param dynamoDbStreamArn the ARN of the DynamoDB stream (source)
|
|
601
|
+
* @param lambdaFunctionArn the ARN of the Lambda function (target)
|
|
602
602
|
*/
|
|
603
603
|
createRoleForDynamoDbToLambdaPipe(id, scope, dynamoDbStreamArn, lambdaFunctionArn) {
|
|
604
604
|
const role = new Role(scope, `${id}`, {
|
|
@@ -27,8 +27,8 @@ export declare class LambdaManager {
|
|
|
27
27
|
* @summary Method to create a lambda layer (nodejs)
|
|
28
28
|
* @param id scoped id of the resource
|
|
29
29
|
* @param scope scope in which this resource is defined
|
|
30
|
-
* @param code
|
|
31
|
-
* @param architectures
|
|
30
|
+
* @param code the asset code for the layer
|
|
31
|
+
* @param architectures optional list of compatible architectures, defaults to ARM_64
|
|
32
32
|
*/
|
|
33
33
|
createLambdaLayer(id: string, scope: CommonConstruct, code: AssetCode, architectures?: Architecture[]): LayerVersion;
|
|
34
34
|
/**
|
|
@@ -41,17 +41,17 @@ export declare class LambdaManager {
|
|
|
41
41
|
* @summary Method to create a lambda function (nodejs)
|
|
42
42
|
* @param id scoped id of the resource
|
|
43
43
|
* @param scope scope in which this resource is defined
|
|
44
|
-
* @param props
|
|
45
|
-
* @param role
|
|
46
|
-
* @param layers
|
|
47
|
-
* @param code
|
|
48
|
-
* @param handler
|
|
49
|
-
* @param environment
|
|
50
|
-
* @param vpc
|
|
51
|
-
* @param securityGroups
|
|
52
|
-
* @param accessPoint
|
|
53
|
-
* @param mountPath
|
|
54
|
-
* @param vpcSubnets
|
|
44
|
+
* @param props the Lambda function properties
|
|
45
|
+
* @param role the IAM role for the function execution
|
|
46
|
+
* @param layers the list of Lambda layers to attach
|
|
47
|
+
* @param code the asset code for the function
|
|
48
|
+
* @param handler optional handler entry point, defaults to 'index.lambda_handler'
|
|
49
|
+
* @param environment optional environment variables to inject
|
|
50
|
+
* @param vpc optional VPC to place the function in
|
|
51
|
+
* @param securityGroups optional security groups when running in a VPC
|
|
52
|
+
* @param accessPoint optional EFS access point for file system mounting
|
|
53
|
+
* @param mountPath optional mount path for the EFS file system, defaults to '/mnt/msg'
|
|
54
|
+
* @param vpcSubnets optional subnet selection when running in a VPC
|
|
55
55
|
*/
|
|
56
56
|
createLambdaFunction(id: string, scope: CommonConstruct, props: LambdaProps, role: Role | CfnRole, layers: ILayerVersion[], code: AssetCode, handler?: string, environment?: any, vpc?: IVpc, securityGroups?: ISecurityGroup[], accessPoint?: IAccessPoint, mountPath?: string, vpcSubnets?: SubnetSelection): Function;
|
|
57
57
|
/**
|
|
@@ -73,23 +73,23 @@ export declare class LambdaManager {
|
|
|
73
73
|
* @summary Method to create a lambda function (nodejs) with docker image
|
|
74
74
|
* @param id scoped id of the resource
|
|
75
75
|
* @param scope scope in which this resource is defined
|
|
76
|
-
* @param props
|
|
77
|
-
* @param role
|
|
78
|
-
* @param code
|
|
79
|
-
* @param environment
|
|
80
|
-
* @param vpc
|
|
81
|
-
* @param securityGroups
|
|
82
|
-
* @param accessPoint
|
|
83
|
-
* @param mountPath
|
|
84
|
-
* @param vpcSubnets
|
|
76
|
+
* @param props the Lambda function properties
|
|
77
|
+
* @param role the IAM role for the function execution
|
|
78
|
+
* @param code the Docker image code for the function
|
|
79
|
+
* @param environment optional environment variables to inject
|
|
80
|
+
* @param vpc optional VPC to place the function in
|
|
81
|
+
* @param securityGroups optional security groups when running in a VPC
|
|
82
|
+
* @param accessPoint optional EFS access point for file system mounting
|
|
83
|
+
* @param mountPath optional mount path for the EFS file system, defaults to '/mnt/msg'
|
|
84
|
+
* @param vpcSubnets optional subnet selection when running in a VPC
|
|
85
85
|
*/
|
|
86
86
|
createLambdaDockerFunction(id: string, scope: CommonConstruct, props: LambdaProps, role: Role | CfnRole, code: DockerImageCode, environment?: any, vpc?: IVpc, securityGroups?: ISecurityGroup[], accessPoint?: IAccessPoint, mountPath?: string, vpcSubnets?: SubnetSelection): DockerImageFunction;
|
|
87
87
|
/**
|
|
88
|
-
* @summary Method to create a lambda function
|
|
88
|
+
* @summary Method to create a lambda function alias
|
|
89
89
|
* @param id scoped id of the resource
|
|
90
90
|
* @param scope scope in which this resource is defined
|
|
91
|
-
* @param props
|
|
92
|
-
* @param lambdaVersion
|
|
91
|
+
* @param props the Lambda alias properties
|
|
92
|
+
* @param lambdaVersion the Lambda function version to point the alias to
|
|
93
93
|
*/
|
|
94
94
|
createLambdaFunctionAlias(id: string, scope: CommonConstruct, props: LambdaAliasProps, lambdaVersion: IVersion): Alias;
|
|
95
95
|
}
|
|
@@ -28,8 +28,8 @@ export class LambdaManager {
|
|
|
28
28
|
* @summary Method to create a lambda layer (nodejs)
|
|
29
29
|
* @param id scoped id of the resource
|
|
30
30
|
* @param scope scope in which this resource is defined
|
|
31
|
-
* @param code
|
|
32
|
-
* @param architectures
|
|
31
|
+
* @param code the asset code for the layer
|
|
32
|
+
* @param architectures optional list of compatible architectures, defaults to ARM_64
|
|
33
33
|
*/
|
|
34
34
|
createLambdaLayer(id, scope, code, architectures) {
|
|
35
35
|
const lambdaLayer = new LayerVersion(scope, `${id}`, {
|
|
@@ -57,17 +57,17 @@ export class LambdaManager {
|
|
|
57
57
|
* @summary Method to create a lambda function (nodejs)
|
|
58
58
|
* @param id scoped id of the resource
|
|
59
59
|
* @param scope scope in which this resource is defined
|
|
60
|
-
* @param props
|
|
61
|
-
* @param role
|
|
62
|
-
* @param layers
|
|
63
|
-
* @param code
|
|
64
|
-
* @param handler
|
|
65
|
-
* @param environment
|
|
66
|
-
* @param vpc
|
|
67
|
-
* @param securityGroups
|
|
68
|
-
* @param accessPoint
|
|
69
|
-
* @param mountPath
|
|
70
|
-
* @param vpcSubnets
|
|
60
|
+
* @param props the Lambda function properties
|
|
61
|
+
* @param role the IAM role for the function execution
|
|
62
|
+
* @param layers the list of Lambda layers to attach
|
|
63
|
+
* @param code the asset code for the function
|
|
64
|
+
* @param handler optional handler entry point, defaults to 'index.lambda_handler'
|
|
65
|
+
* @param environment optional environment variables to inject
|
|
66
|
+
* @param vpc optional VPC to place the function in
|
|
67
|
+
* @param securityGroups optional security groups when running in a VPC
|
|
68
|
+
* @param accessPoint optional EFS access point for file system mounting
|
|
69
|
+
* @param mountPath optional mount path for the EFS file system, defaults to '/mnt/msg'
|
|
70
|
+
* @param vpcSubnets optional subnet selection when running in a VPC
|
|
71
71
|
*/
|
|
72
72
|
createLambdaFunction(id, scope, props, role, layers, code, handler, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
|
|
73
73
|
if (!props)
|
|
@@ -167,15 +167,15 @@ export class LambdaManager {
|
|
|
167
167
|
* @summary Method to create a lambda function (nodejs) with docker image
|
|
168
168
|
* @param id scoped id of the resource
|
|
169
169
|
* @param scope scope in which this resource is defined
|
|
170
|
-
* @param props
|
|
171
|
-
* @param role
|
|
172
|
-
* @param code
|
|
173
|
-
* @param environment
|
|
174
|
-
* @param vpc
|
|
175
|
-
* @param securityGroups
|
|
176
|
-
* @param accessPoint
|
|
177
|
-
* @param mountPath
|
|
178
|
-
* @param vpcSubnets
|
|
170
|
+
* @param props the Lambda function properties
|
|
171
|
+
* @param role the IAM role for the function execution
|
|
172
|
+
* @param code the Docker image code for the function
|
|
173
|
+
* @param environment optional environment variables to inject
|
|
174
|
+
* @param vpc optional VPC to place the function in
|
|
175
|
+
* @param securityGroups optional security groups when running in a VPC
|
|
176
|
+
* @param accessPoint optional EFS access point for file system mounting
|
|
177
|
+
* @param mountPath optional mount path for the EFS file system, defaults to '/mnt/msg'
|
|
178
|
+
* @param vpcSubnets optional subnet selection when running in a VPC
|
|
179
179
|
*/
|
|
180
180
|
createLambdaDockerFunction(id, scope, props, role, code, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
|
|
181
181
|
if (!props)
|
|
@@ -183,6 +183,7 @@ export class LambdaManager {
|
|
|
183
183
|
if (!props.functionName)
|
|
184
184
|
throw new Error(`Lambda functionName undefined for ${id}`);
|
|
185
185
|
const functionName = scope.resourceNameFormatter.format(props.functionName, scope.props.resourceNameOptions?.lambdaFunction);
|
|
186
|
+
/* Optionally provision a dead letter queue with a redrive queue for failed invocations */
|
|
186
187
|
let deadLetterQueue;
|
|
187
188
|
if (props.deadLetterQueueEnabled) {
|
|
188
189
|
const redriveQueue = scope.sqsManager.createRedriveQueueForLambda(`${id}-rdq`, scope, props);
|
|
@@ -225,11 +226,11 @@ export class LambdaManager {
|
|
|
225
226
|
return lambdaFunction;
|
|
226
227
|
}
|
|
227
228
|
/**
|
|
228
|
-
* @summary Method to create a lambda function
|
|
229
|
+
* @summary Method to create a lambda function alias
|
|
229
230
|
* @param id scoped id of the resource
|
|
230
231
|
* @param scope scope in which this resource is defined
|
|
231
|
-
* @param props
|
|
232
|
-
* @param lambdaVersion
|
|
232
|
+
* @param props the Lambda alias properties
|
|
233
|
+
* @param lambdaVersion the Lambda function version to point the alias to
|
|
233
234
|
*/
|
|
234
235
|
createLambdaFunctionAlias(id, scope, props, lambdaVersion) {
|
|
235
236
|
if (!props)
|