aws-cdk-constructs 2.30.6.post3__tar.gz → 2.31.2__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.
Files changed (73) hide show
  1. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/PKG-INFO +1 -1
  2. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/__init__.py +1 -1
  3. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/bucket.py +30 -27
  4. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/ecs/fargate_validator.py +5 -5
  5. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs.egg-info/PKG-INFO +1 -1
  6. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs.egg-info/requires.txt +1 -1
  7. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/setup.py +1 -1
  8. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/LICENSE.txt +0 -0
  9. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/MANIFEST.in +0 -0
  10. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/README.md +0 -0
  11. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/api/__init__.py +0 -0
  12. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/api/api.py +0 -0
  13. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/__init__.py +0 -0
  14. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/auth_flow.py +0 -0
  15. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/base_edge_constructs.py +0 -0
  16. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/configuration.py +0 -0
  17. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/edge_function.py +0 -0
  18. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/edge_role.py +0 -0
  19. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/log_level.py +0 -0
  20. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/secret_generator.py +0 -0
  21. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/bucket/with_configuration.py +0 -0
  22. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/__init__.py +0 -0
  23. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/_types/__init__.py +0 -0
  24. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/_types/document.py +0 -0
  25. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/_types/graph.py +0 -0
  26. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/_types/relational.py +0 -0
  27. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/database.py +0 -0
  28. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/database/types.py +0 -0
  29. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/ecs/__init__.py +0 -0
  30. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/ecs/cluster.py +0 -0
  31. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/ecs/microservice.py +0 -0
  32. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/efs/__init__.py +0 -0
  33. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/efs/volume.py +0 -0
  34. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/add-index/index.js +0 -0
  35. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/add-index/index.js.map +0 -0
  36. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/check-auth/index.js +0 -0
  37. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/check-auth/index.js.LICENSE.txt +0 -0
  38. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/check-auth/index.js.map +0 -0
  39. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/parse-auth/index.js +0 -0
  40. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/parse-auth/index.js.LICENSE.txt +0 -0
  41. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/parse-auth/index.js.map +0 -0
  42. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/refresh-auth/index.js +0 -0
  43. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/refresh-auth/index.js.LICENSE.txt +0 -0
  44. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/refresh-auth/index.js.map +0 -0
  45. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/secret-generator/index.js +0 -0
  46. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/secret-generator/index.js.map +0 -0
  47. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/sign-out/index.js +0 -0
  48. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/sign-out/index.js.LICENSE.txt +0 -0
  49. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/sign-out/index.js.map +0 -0
  50. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/with_configuration/index.js +0 -0
  51. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/with_configuration/index.js.LICENSE.txt +0 -0
  52. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/lambdas/with_configuration/index.js.map +0 -0
  53. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/load_balancer/__init__.py +0 -0
  54. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/load_balancer/alb.py +0 -0
  55. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/load_balancer/nlb.py +0 -0
  56. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/microservice/__init__.py +0 -0
  57. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/microservice/base_user_data.sh +0 -0
  58. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/microservice/manage_connection_to_nlb_instance_security_group_ingress/lambda_function.js +0 -0
  59. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/microservice/microservice.py +0 -0
  60. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/security_group/__init__.py +0 -0
  61. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/security_group/security_group.py +0 -0
  62. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/service_user_for_iac/__init__.py +0 -0
  63. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/service_user_for_iac/service_user_for_iac.py +0 -0
  64. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/service_user_for_static_assets/__init__.py +0 -0
  65. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/service_user_for_static_assets/service_user_for_static_assets.py +0 -0
  66. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/utils.py +0 -0
  67. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/windows_server/__init__.py +0 -0
  68. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/windows_server/user_data.ps1 +0 -0
  69. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs/windows_server/windows_server.py +0 -0
  70. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs.egg-info/SOURCES.txt +0 -0
  71. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs.egg-info/dependency_links.txt +0 -0
  72. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/aws_cdk_constructs.egg-info/top_level.txt +0 -0
  73. {aws_cdk_constructs-2.30.6.post3 → aws_cdk_constructs-2.31.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aws_cdk_constructs
3
- Version: 2.30.6.post3
3
+ Version: 2.31.2
4
4
  Summary: AWS CDK constructs
5
5
  Home-page: https://bitbucket.org/cioapps/aws-cdk-constructs
6
6
  Author: author
@@ -15,4 +15,4 @@ from .load_balancer import Alb, Nlb
15
15
  from .security_group import SecurityGroup
16
16
  from .windows_server import WindowsServer
17
17
 
18
- __version__ = '2.30.6-3'
18
+ __version__ = '2.31.2'
@@ -11,6 +11,7 @@ from aws_cdk import (
11
11
  aws_cloudfront as _cloudfront,
12
12
  aws_cloudfront_origins as _cloudfront_origins,
13
13
  aws_certificatemanager as _certificate,
14
+ aws_ec2 as _ec2,
14
15
  )
15
16
  from aws_cdk_constructs.bucket.edge_function import EdgeFunction
16
17
  import boto3
@@ -639,30 +640,39 @@ class Bucket(Construct):
639
640
  if include_cdn:
640
641
  # Cloudflare doc https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare
641
642
  cloudflare_ips = [
642
- '2400:cb00::/32',
643
- '2405:8100::/32',
644
- '2405:b500::/32',
645
- '2606:4700::/32',
646
- '2803:f800::/32',
647
- '2c0f:f248::/32',
648
- '2a06:98c0::/29',
643
+ '173.245.48.0/20',
649
644
  '103.21.244.0/22',
650
645
  '103.22.200.0/22',
651
646
  '103.31.4.0/22',
652
- '104.16.0.0/13',
653
- '104.24.0.0/14',
654
- '108.162.192.0/18',
655
- '131.0.72.0/22',
656
647
  '141.101.64.0/18',
657
- '162.158.0.0/15',
658
- '172.64.0.0/13',
659
- '173.245.48.0/20',
660
- '188.114.96.0/20',
648
+ '108.162.192.0/18',
661
649
  '190.93.240.0/20',
650
+ '188.114.96.0/20',
662
651
  '197.234.240.0/22',
663
652
  '198.41.128.0/17',
653
+ '162.158.0.0/15',
654
+ '104.16.0.0/13',
655
+ '104.24.0.0/14',
656
+ '172.64.0.0/13',
657
+ '131.0.72.0/22',
658
+ '2400:cb00::/32',
659
+ '2606:4700::/32',
660
+ '2803:f800::/32',
661
+ '2405:b500::/32',
662
+ '2405:8100::/32',
663
+ '2a06:98c0::/29',
664
+ '2c0f:f248::/32',
664
665
  ]
665
666
 
667
+ # Retrieve VPC CIDR from ID
668
+ vpc_id = self.aws_account['vpc']
669
+ self._vpc = _ec2.Vpc.from_lookup(
670
+ self,
671
+ 'VPC',
672
+ vpc_id=vpc_id,
673
+ )
674
+ vpc_cidr = self._vpc.vpc_cidr_block
675
+
666
676
  # Only allow access from Cloudflare IPs
667
677
  self._bucket.add_to_resource_policy(
668
678
  _iam.PolicyStatement(
@@ -673,21 +683,14 @@ class Bucket(Construct):
673
683
  'arn:aws:s3:::' + bucket_name + '/*',
674
684
  ],
675
685
  conditions={
676
- 'NotIpAddress': {'aws:SourceIp': cloudflare_ips}
686
+ 'NotIpAddress': {
687
+ 'aws:VpcSourceIp': vpc_cidr,
688
+ 'aws:SourceIp': cloudflare_ips,
689
+ },
690
+ 'StringNotEquals': {'aws:SourceVpc': vpc_id},
677
691
  },
678
692
  )
679
693
  )
680
- self._bucket.add_to_resource_policy(
681
- _iam.PolicyStatement(
682
- effect=_iam.Effect.ALLOW,
683
- principals=[_iam.AnyPrincipal()],
684
- actions=['s3:GetObject'],
685
- resources=[
686
- 'arn:aws:s3:::' + bucket_name + '/*',
687
- ],
688
- conditions={'IpAddress': {'aws:SourceIp': cloudflare_ips}},
689
- )
690
- )
691
694
 
692
695
  # To be refactored. You want to include only once the CORS configuration.
693
696
  # if public_read_access and include_cdn are both "true"
@@ -1,6 +1,6 @@
1
1
  import enum
2
2
 
3
- from pydantic import BaseModel, validator
3
+ from pydantic import BaseModel, field_validator
4
4
 
5
5
 
6
6
  class FargateTypes(enum.Enum):
@@ -65,19 +65,19 @@ class FargateValidator(BaseModel):
65
65
  cpu: int
66
66
  mem: int
67
67
 
68
- @validator('cpu')
68
+ @field_validator('cpu')
69
69
  def cpu_must_be_valid(cls, v, values, **kwargs):
70
70
  allowed_cpus = [x.get('cpu') for x in FargateTypes.valid_values.value]
71
71
  if v not in allowed_cpus:
72
72
  raise ValueError(f'Fargate task cpu must be one of {allowed_cpus}')
73
73
  return v
74
74
 
75
- @validator('mem')
75
+ @field_validator('mem')
76
76
  def memory_must_be_valid_for_cpu_setting(cls, v, values, **kwargs):
77
77
  allowed_mems = next(
78
78
  x.get('mem')
79
79
  for x in FargateTypes.valid_values.value
80
- if x.get('cpu') == values.get('cpu')
80
+ if x.get('cpu') == values.data.get('cpu')
81
81
  )
82
82
 
83
83
  if type(allowed_mems) is dict:
@@ -91,6 +91,6 @@ class FargateValidator(BaseModel):
91
91
 
92
92
  if v not in allowed_mems:
93
93
  raise ValueError(
94
- f"Fargate task memory must be one of {allowed_mems} when cpu is {values.get('cpu')}"
94
+ f"Fargate task memory must be one of {allowed_mems} when cpu is {values.data.get('cpu')}"
95
95
  )
96
96
  return v
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aws-cdk-constructs
3
- Version: 2.30.6.post3
3
+ Version: 2.31.2
4
4
  Summary: AWS CDK constructs
5
5
  Home-page: https://bitbucket.org/cioapps/aws-cdk-constructs
6
6
  Author: author
@@ -2,4 +2,4 @@ aws-cdk-lib==2.123.0
2
2
  aws-cdk.aws-neptune-alpha==2.123.0a0
3
3
  constructs<11.0.0,>=10.0.0
4
4
  boto3==1.26.59
5
- pydantic==1.10.15
5
+ pydantic==2.7.3
@@ -25,7 +25,7 @@ setuptools.setup(
25
25
  f"aws-cdk.aws-neptune-alpha=={AWS_CDK_VERSION}a0", # Including "a0" postfix as its an alpha version
26
26
  "constructs>=10.0.0,<11.0.0",
27
27
  "boto3==1.26.59",
28
- "pydantic==1.10.15",
28
+ "pydantic==2.7.3",
29
29
  ],
30
30
  python_requires=">=3.6",
31
31
  classifiers=[