aws-cdk-constructs 2.41.0__tar.gz → 2.41.1__tar.gz
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.
- {aws_cdk_constructs-2.41.0/aws_cdk_constructs.egg-info → aws_cdk_constructs-2.41.1}/PKG-INFO +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/__init__.py +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/edge_function.py +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/secret_generator.py +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/with_configuration.py +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/_types/relational.py +141 -13
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/database.py +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/ecs/cluster.py +10 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/add-index/index.js +2 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/add-index/index.js.map +1 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/check-auth/index.js +3 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/lambdas/check-auth/index.js.LICENSE.txt +2 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/check-auth/index.js.map +1 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/parse-auth/index.js +3 -0
- {aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/refresh-auth → aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/parse-auth}/index.js.LICENSE.txt +3 -1
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/parse-auth/index.js.map +1 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/refresh-auth/index.js +3 -0
- {aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/parse-auth → aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/refresh-auth}/index.js.LICENSE.txt +3 -1
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/refresh-auth/index.js.map +1 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/secret-generator/index.js +2 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/secret-generator/index.js.map +1 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/sign-out/index.js +3 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/lambdas/sign-out/index.js.LICENSE.txt +2 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/sign-out/index.js.map +1 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/with_configuration/index.js +3 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/lambdas/with_configuration/index.js.map +1 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/load_balancer/alb.py +4 -0
- aws_cdk_constructs-2.41.1/aws_cdk_constructs/microservice/manage_connection_to_nlb_instance_security_group_ingress/lambda_function.js +93 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/microservice/microservice.py +37 -2
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/windows_server/windows_server.py +10 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1/aws_cdk_constructs.egg-info}/PKG-INFO +1 -1
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_alb.py +30 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_database.py +26 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_ecs_cluster.py +38 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_microservice.py +122 -0
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/add-index/index.js +0 -2
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/add-index/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/check-auth/index.js +0 -3
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/check-auth/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/parse-auth/index.js +0 -3
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/parse-auth/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/refresh-auth/index.js +0 -3
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/refresh-auth/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/secret-generator/index.js +0 -2
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/secret-generator/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/sign-out/index.js +0 -3
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/sign-out/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/with_configuration/index.js +0 -3
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/lambdas/with_configuration/index.js.map +0 -1
- aws_cdk_constructs-2.41.0/aws_cdk_constructs/microservice/manage_connection_to_nlb_instance_security_group_ingress/lambda_function.js +0 -67
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/LICENSE.txt +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/MANIFEST.in +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/README.md +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/api/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/api/api.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/auth_flow.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/base_edge_constructs.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/bucket.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/configuration.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/edge_role.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/log_level.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/_types/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/_types/document.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/_types/graph.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/types.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/ecs/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/ecs/fargate_validator.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/ecs/microservice.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/efs/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/efs/volume.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/lambdas/with_configuration/index.js.LICENSE.txt +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/load_balancer/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/load_balancer/nlb.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/microservice/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/microservice/base_user_data.sh +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/security_group/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/security_group/security_group.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/service_user_for_iac/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/service_user_for_iac/service_user_for_iac.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/service_user_for_static_assets/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/service_user_for_static_assets/service_user_for_static_assets.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/utils.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/windows_server/__init__.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/windows_server/user_data.ps1 +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs.egg-info/SOURCES.txt +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs.egg-info/dependency_links.txt +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs.egg-info/requires.txt +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs.egg-info/top_level.txt +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/setup.cfg +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/setup.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_bucket.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_ecs_microservice.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_efs_volume.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_fargate_validator.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_nlb.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_security_group.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_service_user_for_iac.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_service_user_for_static_assets.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_utils.py +0 -0
- {aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/tests/test_windows_server.py +0 -0
{aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/bucket/edge_function.py
RENAMED
|
@@ -113,7 +113,7 @@ class EdgeFunction(BaseEdgeConstruct):
|
|
|
113
113
|
edge_function = aws_lambda.Function(
|
|
114
114
|
self._edge_stack,
|
|
115
115
|
name + 'Function',
|
|
116
|
-
runtime=aws_lambda.Runtime.
|
|
116
|
+
runtime=aws_lambda.Runtime.NODEJS_22_X,
|
|
117
117
|
handler='index.handler',
|
|
118
118
|
code=code,
|
|
119
119
|
role=role.role,
|
|
@@ -31,7 +31,7 @@ class SecretGenerator(
|
|
|
31
31
|
self,
|
|
32
32
|
'Function',
|
|
33
33
|
uuid='cloudcomponents-cdk-cloudfront-authorization-secret-generator',
|
|
34
|
-
runtime=aws_cdk.aws_lambda.Runtime.
|
|
34
|
+
runtime=aws_cdk.aws_lambda.Runtime.NODEJS_22_X,
|
|
35
35
|
handler='index.handler',
|
|
36
36
|
code=aws_cdk.aws_lambda.Code.from_asset(
|
|
37
37
|
path=os.path.join(dirname, '../lambdas/secret-generator/')
|
|
@@ -37,7 +37,7 @@ class WithConfiguration(Construct):
|
|
|
37
37
|
self,
|
|
38
38
|
'MyHandler',
|
|
39
39
|
uuid='cloudcomponents-cdk-lambda-at-edge-pattern-with-my-configuration',
|
|
40
|
-
runtime=aws_lambda.Runtime.
|
|
40
|
+
runtime=aws_lambda.Runtime.NODEJS_22_X,
|
|
41
41
|
code=aws_lambda.Code.from_asset(
|
|
42
42
|
os.path.join(dirname, '../lambdas/with_configuration/')
|
|
43
43
|
),
|
|
@@ -4,6 +4,8 @@ from aws_cdk import (
|
|
|
4
4
|
aws_kms as _kms,
|
|
5
5
|
aws_route53 as route53,
|
|
6
6
|
aws_iam as _iam,
|
|
7
|
+
aws_logs as _logs,
|
|
8
|
+
custom_resources as _cr,
|
|
7
9
|
)
|
|
8
10
|
import aws_cdk as cdk
|
|
9
11
|
from typing import Union, List
|
|
@@ -190,6 +192,53 @@ def RelationalDatabase(
|
|
|
190
192
|
else database_engine_version
|
|
191
193
|
)
|
|
192
194
|
|
|
195
|
+
should_be_cloudwatch_audit_log = (
|
|
196
|
+
cloudwatch_audit_log
|
|
197
|
+
and isinstance(cloudwatch_audit_log, str)
|
|
198
|
+
and cloudwatch_audit_log.lower() == 'true'
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
cloudwatch_logs_exports = None
|
|
202
|
+
cloudwatch_logs_retention = None
|
|
203
|
+
if should_be_cloudwatch_audit_log and is_production:
|
|
204
|
+
logs_service_user = _iam.User(
|
|
205
|
+
scope,
|
|
206
|
+
id='logs_service_user',
|
|
207
|
+
managed_policies=None,
|
|
208
|
+
user_name=f'SRVUSR-{app_name}_{environment}_logs',
|
|
209
|
+
)
|
|
210
|
+
logs_service_user_policies = _iam.ManagedPolicy(
|
|
211
|
+
scope,
|
|
212
|
+
'logs_service_user_policies',
|
|
213
|
+
statements=[
|
|
214
|
+
# S3 Configuration bucket permissions
|
|
215
|
+
_iam.PolicyStatement(
|
|
216
|
+
actions=[
|
|
217
|
+
'logs:GetLogEvents',
|
|
218
|
+
],
|
|
219
|
+
resources=[
|
|
220
|
+
f'arn:aws:logs:eu-west-1:{account_id}:log-group:/aws/rds/cluster/{app_name}*/audit:*',
|
|
221
|
+
],
|
|
222
|
+
),
|
|
223
|
+
_iam.PolicyStatement(
|
|
224
|
+
actions=[
|
|
225
|
+
'logs:DescribeLogGroups',
|
|
226
|
+
'logs:DescribeLogStreams',
|
|
227
|
+
],
|
|
228
|
+
resources=[
|
|
229
|
+
f'arn:aws:logs:eu-west-1:{account_id}:log-group::log-stream:',
|
|
230
|
+
],
|
|
231
|
+
),
|
|
232
|
+
],
|
|
233
|
+
)
|
|
234
|
+
logs_service_user.add_managed_policy(logs_service_user_policies)
|
|
235
|
+
# If user specified change to cloud watch log setting
|
|
236
|
+
cloudwatch_logs_exports = _rds.cloudwatch_logs_exports = ['audit']
|
|
237
|
+
cloudwatch_logs_retention = _logs.RetentionDays.TWO_WEEKS
|
|
238
|
+
if is_not_production:
|
|
239
|
+
cloudwatch_logs_exports = None
|
|
240
|
+
cloudwatch_logs_retention = None
|
|
241
|
+
|
|
193
242
|
# ~~~~~~~~~~~~~~~~
|
|
194
243
|
# RDS Cluster
|
|
195
244
|
# ~~~~~~~~~~~~~~~~
|
|
@@ -215,6 +264,8 @@ def RelationalDatabase(
|
|
|
215
264
|
storage_encryption_key=encryption_key,
|
|
216
265
|
s3_export_buckets=s3_export_buckets,
|
|
217
266
|
s3_import_buckets=s3_import_buckets,
|
|
267
|
+
cloudwatch_logs_exports=cloudwatch_logs_exports,
|
|
268
|
+
cloudwatch_logs_retention=cloudwatch_logs_retention,
|
|
218
269
|
)
|
|
219
270
|
|
|
220
271
|
_cluster.add_rotation_single_user(
|
|
@@ -289,6 +340,50 @@ def RelationalDatabase(
|
|
|
289
340
|
'SchedulerUptimeDays', tag_scheduler_uptime_days
|
|
290
341
|
)
|
|
291
342
|
|
|
343
|
+
# Tag LogGroup
|
|
344
|
+
log_group_name = (
|
|
345
|
+
f'/aws/rds/cluster/{_cluster.cluster_identifier}/audit'
|
|
346
|
+
)
|
|
347
|
+
log_group_tags = {
|
|
348
|
+
'ApplicationName': app_name,
|
|
349
|
+
'Environment': environment,
|
|
350
|
+
'DatabaseAuditLog': app_name,
|
|
351
|
+
}
|
|
352
|
+
_cr.AwsCustomResource(
|
|
353
|
+
scope,
|
|
354
|
+
f'TagClusterLogGroupAudit',
|
|
355
|
+
on_create=_cr.AwsSdkCall(
|
|
356
|
+
service='CloudWatchLogs',
|
|
357
|
+
action='TagLogGroup',
|
|
358
|
+
parameters={
|
|
359
|
+
'logGroupName': log_group_name,
|
|
360
|
+
'tags': log_group_tags,
|
|
361
|
+
},
|
|
362
|
+
physical_resource_id=_cr.PhysicalResourceId.of(log_group_name),
|
|
363
|
+
),
|
|
364
|
+
on_update=_cr.AwsSdkCall(
|
|
365
|
+
service='CloudWatchLogs',
|
|
366
|
+
action='TagLogGroup',
|
|
367
|
+
parameters={
|
|
368
|
+
'logGroupName': log_group_name,
|
|
369
|
+
'tags': log_group_tags,
|
|
370
|
+
},
|
|
371
|
+
physical_resource_id=_cr.PhysicalResourceId.of(log_group_name),
|
|
372
|
+
),
|
|
373
|
+
on_delete=_cr.AwsSdkCall(
|
|
374
|
+
service='CloudWatchLogs',
|
|
375
|
+
action='TagLogGroup',
|
|
376
|
+
parameters={
|
|
377
|
+
'logGroupName': log_group_name,
|
|
378
|
+
'tags': log_group_tags,
|
|
379
|
+
},
|
|
380
|
+
physical_resource_id=_cr.PhysicalResourceId.of(log_group_name),
|
|
381
|
+
),
|
|
382
|
+
policy=_cr.AwsCustomResourcePolicy.from_sdk_calls(
|
|
383
|
+
resources=_cr.AwsCustomResourcePolicy.ANY_RESOURCE
|
|
384
|
+
),
|
|
385
|
+
)
|
|
386
|
+
|
|
292
387
|
# ~~~~~~~~~~~~~~~~
|
|
293
388
|
# RDS Instance
|
|
294
389
|
# ~~~~~~~~~~~~~~~~
|
|
@@ -297,7 +392,7 @@ def RelationalDatabase(
|
|
|
297
392
|
# Default RDS license model is NONE
|
|
298
393
|
license_model = None
|
|
299
394
|
# Default RDS cloudwatch logs export in NONE
|
|
300
|
-
cloudwatch_logs_exports = None
|
|
395
|
+
# cloudwatch_logs_exports = None
|
|
301
396
|
|
|
302
397
|
if is_oracle:
|
|
303
398
|
|
|
@@ -324,18 +419,6 @@ def RelationalDatabase(
|
|
|
324
419
|
# If user specified change to BRING_YOUR_OWN_LICENSE
|
|
325
420
|
license_model = _rds.LicenseModel.BRING_YOUR_OWN_LICENSE
|
|
326
421
|
|
|
327
|
-
should_be_cloudwatch_audit_log = (
|
|
328
|
-
cloudwatch_audit_log
|
|
329
|
-
and isinstance(cloudwatch_audit_log, str)
|
|
330
|
-
and cloudwatch_audit_log.lower() == 'true'
|
|
331
|
-
)
|
|
332
|
-
|
|
333
|
-
if should_be_cloudwatch_audit_log:
|
|
334
|
-
# If user specified change to cloud watch log setting
|
|
335
|
-
cloudwatch_logs_exports = _rds.cloudwatch_logs_exports = [
|
|
336
|
-
'audit'
|
|
337
|
-
]
|
|
338
|
-
|
|
339
422
|
if is_sqlserver:
|
|
340
423
|
# Default SQL server license model is LICENSE_INCLUDED
|
|
341
424
|
license_model = _rds.LicenseModel.LICENSE_INCLUDED
|
|
@@ -372,6 +455,7 @@ def RelationalDatabase(
|
|
|
372
455
|
storage_encryption_key=encryption_key,
|
|
373
456
|
character_set_name=character_set_name,
|
|
374
457
|
cloudwatch_logs_exports=cloudwatch_logs_exports,
|
|
458
|
+
cloudwatch_logs_retention=cloudwatch_logs_retention,
|
|
375
459
|
s3_export_buckets=s3_export_buckets,
|
|
376
460
|
s3_import_buckets=s3_import_buckets,
|
|
377
461
|
)
|
|
@@ -461,6 +545,50 @@ def RelationalDatabase(
|
|
|
461
545
|
'SchedulerUptimeDays', tag_scheduler_uptime_days
|
|
462
546
|
)
|
|
463
547
|
|
|
548
|
+
# Tag LogGroup
|
|
549
|
+
log_group_name = (
|
|
550
|
+
f'/aws/rds/instance/{_instance.instance_identifier}/audit'
|
|
551
|
+
)
|
|
552
|
+
log_group_tags = {
|
|
553
|
+
'ApplicationName': app_name,
|
|
554
|
+
'Environment': environment,
|
|
555
|
+
'DatabaseAuditLog': app_name,
|
|
556
|
+
}
|
|
557
|
+
_cr.AwsCustomResource(
|
|
558
|
+
scope,
|
|
559
|
+
f'TagInstanceLogGroupAudit',
|
|
560
|
+
on_create=_cr.AwsSdkCall(
|
|
561
|
+
service='CloudWatchLogs',
|
|
562
|
+
action='TagLogGroup',
|
|
563
|
+
parameters={
|
|
564
|
+
'logGroupName': log_group_name,
|
|
565
|
+
'tags': log_group_tags,
|
|
566
|
+
},
|
|
567
|
+
physical_resource_id=_cr.PhysicalResourceId.of(log_group_name),
|
|
568
|
+
),
|
|
569
|
+
on_update=_cr.AwsSdkCall(
|
|
570
|
+
service='CloudWatchLogs',
|
|
571
|
+
action='TagLogGroup',
|
|
572
|
+
parameters={
|
|
573
|
+
'logGroupName': log_group_name,
|
|
574
|
+
'tags': log_group_tags,
|
|
575
|
+
},
|
|
576
|
+
physical_resource_id=_cr.PhysicalResourceId.of(log_group_name),
|
|
577
|
+
),
|
|
578
|
+
on_delete=_cr.AwsSdkCall(
|
|
579
|
+
service='CloudWatchLogs',
|
|
580
|
+
action='TagLogGroup',
|
|
581
|
+
parameters={
|
|
582
|
+
'logGroupName': log_group_name,
|
|
583
|
+
'tags': log_group_tags,
|
|
584
|
+
},
|
|
585
|
+
physical_resource_id=_cr.PhysicalResourceId.of(log_group_name),
|
|
586
|
+
),
|
|
587
|
+
policy=_cr.AwsCustomResourcePolicy.from_sdk_calls(
|
|
588
|
+
resources=_cr.AwsCustomResourcePolicy.ANY_RESOURCE
|
|
589
|
+
),
|
|
590
|
+
)
|
|
591
|
+
|
|
464
592
|
# ~~~~~~~~~~~~~~~~
|
|
465
593
|
# Returns
|
|
466
594
|
# ~~~~~~~~~~~~~~~~
|
{aws_cdk_constructs-2.41.0 → aws_cdk_constructs-2.41.1}/aws_cdk_constructs/database/database.py
RENAMED
|
@@ -98,7 +98,7 @@ class Database(Construct):
|
|
|
98
98
|
|
|
99
99
|
rubrik_backup (str): to enable/disable Rubrik backup using tag `RubrikBackup` - format Boolean (`true`, `false`). Default: true
|
|
100
100
|
|
|
101
|
-
cloudwatch_audit_log (str): Applicable only to
|
|
101
|
+
cloudwatch_audit_log (str): Applicable only to relational and Neptune instances. The default is no log exports. Specify this param in case you want to have the audit log export enabled. Neptune: if you also pass a custom cluster parameter group remember to add "neptune_enable_audit_log": "1" to it. If no cluster parameter group is provided it will be added automatically.
|
|
102
102
|
|
|
103
103
|
dns_record: (Optional | str) The DNS record associated to the Database if multiple Databases
|
|
104
104
|
|
|
@@ -79,6 +79,8 @@ class ECSCluster(Construct):
|
|
|
79
79
|
ec2_tag_scheduler_uptime_days (Optional - str): The tag to be used to filter the EC2 instances to be used by the scheduler.
|
|
80
80
|
|
|
81
81
|
ec2_tag_scheduler_skip (Optional - str): The tag to be used to filter the EC2 instances to be used by the scheduler.
|
|
82
|
+
|
|
83
|
+
will_drop_invalid_headers (Optional | str): Indicates whether HTTP headers with invalid header fields are removed by the load balancer ('true') or routed to targets ('false'). Default: false
|
|
82
84
|
"""
|
|
83
85
|
|
|
84
86
|
def __init__(
|
|
@@ -105,6 +107,7 @@ class ECSCluster(Construct):
|
|
|
105
107
|
ec2_tag_scheduler_uptime: Optional[str] = '08:00-18:00',
|
|
106
108
|
ec2_tag_scheduler_uptime_days: Optional[str] = '1-2-3-4-5',
|
|
107
109
|
ec2_tag_scheduler_skip: Optional[str] = 'False',
|
|
110
|
+
will_drop_invalid_headers: str = 'False',
|
|
108
111
|
) -> None:
|
|
109
112
|
self.id = id
|
|
110
113
|
self.scope = scope
|
|
@@ -145,6 +148,12 @@ class ECSCluster(Construct):
|
|
|
145
148
|
|
|
146
149
|
self._create_cluster()
|
|
147
150
|
if create_alb:
|
|
151
|
+
drop_invalid_headers = (
|
|
152
|
+
will_drop_invalid_headers
|
|
153
|
+
and isinstance(will_drop_invalid_headers, str)
|
|
154
|
+
and will_drop_invalid_headers.lower() == 'true'
|
|
155
|
+
)
|
|
156
|
+
|
|
148
157
|
path = '_'.join(self.node.path.split('/')[:-1])[:28]
|
|
149
158
|
|
|
150
159
|
self.alb = Alb(
|
|
@@ -162,6 +171,7 @@ class ECSCluster(Construct):
|
|
|
162
171
|
internet_facing=internet_facing,
|
|
163
172
|
use_cdn=use_cdn,
|
|
164
173
|
load_balancer_idle_timeout_in_seconds=load_balancer_idle_timeout,
|
|
174
|
+
will_drop_invalid_header_fields=drop_invalid_headers,
|
|
165
175
|
)
|
|
166
176
|
else:
|
|
167
177
|
self.alb = None
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var n={};({54979:function(n,e){var t=this&&this.__awaiter||function(n,e,t,i){return new(t||(t=Promise))(function(r,o){function u(n){try{a(i.next(n))}catch(n){o(n)}}function c(n){try{a(i.throw(n))}catch(n){o(n)}}function a(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t(function(n){n(e)})).then(u,c)}a((i=i.apply(n,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.handler=void 0,e.handler=n=>t(void 0,void 0,void 0,function*(){const e=n.Records[0].cf.request,t=e.uri;return t.endsWith("/")?e.uri+="index.html":t.includes(".")||(e.uri+="/index.html"),e})}})[54979].call(n,0,n),module.exports=n})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-index/index.js","mappings":"uBAGIA,EAAsB,CAAC,G,mZCDd,EAAAC,QACFC,GAC4D,OAAD,4BAC9D,MAAMC,EAAUD,EAAME,QAAQ,GAAGC,GAAGF,QAC9BG,EAAMH,EAAQG,IAWpB,OARIA,EAAIC,SAAS,KACbJ,EAAQG,KAAO,aAGTA,EAAIE,SAAS,OACnBL,EAAQG,KAAO,eAGZH,CACX,E,IDdgB,OAAOM,KAAKT,EAAoB,EAAEA,G","sources":["webpack://aws-cdk-constructs/webpack/startup","webpack://aws-cdk-constructs/./lambda-src/add-index/index.ts"],"sourcesContent":["// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = {};\n__webpack_modules__[54979].call(__webpack_exports__,0,__webpack_exports__);\n","import type { CloudFrontRequestEvent, CloudFrontResponseResult, CloudFrontRequestResult } from 'aws-lambda';\n\nexport const handler =\n async (event: CloudFrontRequestEvent):\n Promise<CloudFrontResponseResult | CloudFrontRequestResult> => {\n const request = event.Records[0].cf.request;\n const uri = request.uri;\n\n // Check whether the URI is missing a file name.\n if (uri.endsWith('/')) {\n request.uri += 'index.html';\n }\n // Check whether the URI is missing a file extension.\n else if (!uri.includes('.')) {\n request.uri += '/index.html';\n }\n\n return request;\n }"],"names":["__webpack_exports__","handler","event","request","Records","cf","uri","endsWith","includes","call"],"sourceRoot":""}
|