aws-cdk-constructs 2.45.0__tar.gz → 2.47.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.45.0/aws_cdk_constructs.egg-info → aws_cdk_constructs-2.47.1}/PKG-INFO +1 -1
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/__init__.py +1 -1
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/bucket.py +31 -7
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/ecs/cluster.py +15 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1/aws_cdk_constructs.egg-info}/PKG-INFO +1 -1
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_bucket.py +41 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_ecs_cluster.py +66 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/LICENSE.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/MANIFEST.in +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/README.md +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/api/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/api/api.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/auth_flow.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/base_edge_constructs.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/configuration.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/edge_function.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/edge_role.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/log_level.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/secret_generator.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/with_configuration.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/_types/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/_types/document.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/_types/graph.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/_types/relational.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/database.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/types.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/ecs/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/ecs/fargate_validator.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/ecs/microservice.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/efs/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/efs/volume.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/add-index/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/add-index/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/check-auth/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/check-auth/index.js.LICENSE.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/check-auth/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/parse-auth/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/parse-auth/index.js.LICENSE.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/parse-auth/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/refresh-auth/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/refresh-auth/index.js.LICENSE.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/refresh-auth/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/secret-generator/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/secret-generator/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/sign-out/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/sign-out/index.js.LICENSE.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/sign-out/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/with_configuration/index.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/with_configuration/index.js.LICENSE.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/with_configuration/index.js.map +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/load_balancer/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/load_balancer/alb.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/load_balancer/nlb.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/microservice/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/microservice/base_user_data.sh +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/microservice/manage_connection_to_nlb_instance_security_group_ingress/lambda_function.js +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/microservice/microservice.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/security_group/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/security_group/security_group.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/service_user_for_iac/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/service_user_for_iac/service_user_for_iac.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/service_user_for_static_assets/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/service_user_for_static_assets/service_user_for_static_assets.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/utils.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/windows_server/__init__.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/windows_server/user_data.ps1 +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/windows_server/windows_server.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/SOURCES.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/dependency_links.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/requires.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/top_level.txt +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/setup.cfg +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/setup.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_alb.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_database.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_ecs_microservice.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_efs_volume.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_fargate_validator.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_microservice.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_nlb.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_security_group.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_service_user_for_iac.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_service_user_for_static_assets.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_utils.py +0 -0
- {aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_windows_server.py +0 -0
|
@@ -107,6 +107,8 @@ class Bucket(Construct):
|
|
|
107
107
|
cdn_ssl_certificate_arn (str): If "will_implement_cdn" is "True" and you want to enable HTTPS for your CloudFront distribution, specify the SSL certificate ARN to use. NB: this certificate must be in North Virginia
|
|
108
108
|
|
|
109
109
|
bucket_policy_statements: List[_iam.PolicyStatement]: List of policy statements to be added to the Bucket policy. Default: []
|
|
110
|
+
|
|
111
|
+
bucket_static_website_origin (str): Whether or not the S3 Bucket should be configured as Static Website Origin on CloudFront. It cannot be combined with bucket_has_authentication='True'. Default: false
|
|
110
112
|
"""
|
|
111
113
|
|
|
112
114
|
@property
|
|
@@ -459,6 +461,7 @@ class Bucket(Construct):
|
|
|
459
461
|
_cloudfront.ResponseHeadersPolicy, None
|
|
460
462
|
] = None,
|
|
461
463
|
user_pool_client: Union[None, _cognito.UserPoolClient] = None,
|
|
464
|
+
bucket_static_website_origin: str = 'false',
|
|
462
465
|
**kwargs,
|
|
463
466
|
) -> None:
|
|
464
467
|
super().__init__(scope, id, **kwargs)
|
|
@@ -521,6 +524,23 @@ class Bucket(Construct):
|
|
|
521
524
|
and will_implement_cdn.lower() == 'true'
|
|
522
525
|
)
|
|
523
526
|
|
|
527
|
+
if (
|
|
528
|
+
bucket_static_website_origin
|
|
529
|
+
and bucket_static_website_origin.lower() == 'true'
|
|
530
|
+
and bucket_has_authentication
|
|
531
|
+
and bucket_has_authentication.lower() == 'true'
|
|
532
|
+
):
|
|
533
|
+
raise ValueError(
|
|
534
|
+
'bucket_static_website_origin and bucket_has_authentication cannot both be enabled. '
|
|
535
|
+
'Static website origin requires public bucket access, which conflicts with authenticated access.'
|
|
536
|
+
)
|
|
537
|
+
|
|
538
|
+
static_website_origin = (
|
|
539
|
+
bucket_static_website_origin
|
|
540
|
+
and isinstance(bucket_static_website_origin, str)
|
|
541
|
+
and bucket_static_website_origin.lower() == 'true'
|
|
542
|
+
)
|
|
543
|
+
|
|
524
544
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CloudFormation outputs
|
|
525
545
|
if not omit_cloudformation_template_outputs:
|
|
526
546
|
cdk.CfnOutput(
|
|
@@ -707,12 +727,20 @@ class Bucket(Construct):
|
|
|
707
727
|
allowed_headers=['*'],
|
|
708
728
|
)
|
|
709
729
|
|
|
730
|
+
# Define origin type
|
|
731
|
+
if static_website_origin:
|
|
732
|
+
origin = _cloudfront_origins.S3StaticWebsiteOrigin(self.bucket)
|
|
733
|
+
else:
|
|
734
|
+
origin = (
|
|
735
|
+
_cloudfront_origins.S3BucketOrigin.with_origin_access_control(
|
|
736
|
+
self.bucket
|
|
737
|
+
)
|
|
738
|
+
)
|
|
739
|
+
|
|
710
740
|
# Create CloudFront distribution
|
|
711
741
|
if create_cdn:
|
|
712
742
|
default_behavior = _cloudfront.BehaviorOptions(
|
|
713
|
-
origin=
|
|
714
|
-
self.bucket
|
|
715
|
-
),
|
|
743
|
+
origin=origin,
|
|
716
744
|
compress=True,
|
|
717
745
|
# viewer_protocol_policy=_cloudfront.ViewerProtocolPolicy.HTTPS_ONLY,
|
|
718
746
|
allowed_methods=_cloudfront.AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
|
|
@@ -805,10 +833,6 @@ class Bucket(Construct):
|
|
|
805
833
|
)
|
|
806
834
|
)
|
|
807
835
|
|
|
808
|
-
origin = origins.S3BucketOrigin.with_origin_access_control(
|
|
809
|
-
self.bucket
|
|
810
|
-
)
|
|
811
|
-
|
|
812
836
|
redirect_paths = RedirectPaths(
|
|
813
837
|
sign_in='/parseauth',
|
|
814
838
|
auth_refresh='/refreshauth',
|
|
@@ -80,6 +80,8 @@ class ECSCluster(Construct):
|
|
|
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
82
|
|
|
83
|
+
ec2_send_emails (Optional - bool): When set to true, attaches the SMTP relay security group (defined by ``smtp_relay_security_group`` in the environment account parameters) to the EC2 launch template, allowing instances to send emails through the relay. Default is false.
|
|
84
|
+
|
|
83
85
|
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
|
|
84
86
|
"""
|
|
85
87
|
|
|
@@ -101,6 +103,7 @@ class ECSCluster(Construct):
|
|
|
101
103
|
ssl_certificate_arn: Optional[str] = None,
|
|
102
104
|
load_balancer_idle_timeout: Optional[int] = None,
|
|
103
105
|
ec2_enable: Optional[bool] = False,
|
|
106
|
+
ec2_send_emails: Optional[bool] = False,
|
|
104
107
|
ec2_instance_type: Optional[str] = None,
|
|
105
108
|
ec2_desired_capacity: Optional[int] = None,
|
|
106
109
|
ec2_max_capacity: Optional[int] = None,
|
|
@@ -243,6 +246,18 @@ class ECSCluster(Construct):
|
|
|
243
246
|
security_group=self.ecs_sg,
|
|
244
247
|
instance_type=_ec2.InstanceType(ec2_instance_type),
|
|
245
248
|
)
|
|
249
|
+
|
|
250
|
+
if ec2_send_emails:
|
|
251
|
+
sg = _ec2.SecurityGroup.from_security_group_id(
|
|
252
|
+
scope=self,
|
|
253
|
+
id=f'{app_name}-mail-sg',
|
|
254
|
+
security_group_id=self.aws_account.get(
|
|
255
|
+
'smtp_relay_security_group'
|
|
256
|
+
),
|
|
257
|
+
mutable=False,
|
|
258
|
+
)
|
|
259
|
+
launch_template.add_security_group(sg)
|
|
260
|
+
|
|
246
261
|
auto_scaling_group = _autoscaling.AutoScalingGroup(
|
|
247
262
|
self,
|
|
248
263
|
f'{app_name}-asg',
|
|
@@ -725,6 +725,47 @@ def test_bucket_includes_cloudfront(app, stack, environment_parameters):
|
|
|
725
725
|
)
|
|
726
726
|
|
|
727
727
|
|
|
728
|
+
def test_bucket_static_website_origin(app, stack, environment_parameters):
|
|
729
|
+
cdn_domain = 'test.dev.fao.org'
|
|
730
|
+
cdn_ssl_certificate_arn = 'arn:aws:acm:us-east-1:test:certificate/test'
|
|
731
|
+
Bucket(
|
|
732
|
+
scope=stack,
|
|
733
|
+
id='test-bucket-id',
|
|
734
|
+
app_name='test-app',
|
|
735
|
+
environment='Development',
|
|
736
|
+
environments_parameters=environment_parameters,
|
|
737
|
+
bucket_name='test-bucket-name',
|
|
738
|
+
will_implement_cdn='True',
|
|
739
|
+
cdn_domain_names=[cdn_domain],
|
|
740
|
+
cdn_ssl_certificate_arn=cdn_ssl_certificate_arn,
|
|
741
|
+
bucket_static_website_origin='True',
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
template = Template.from_stack(stack)
|
|
745
|
+
template.has_resource_properties(
|
|
746
|
+
'AWS::CloudFront::Distribution',
|
|
747
|
+
{
|
|
748
|
+
'DistributionConfig': {
|
|
749
|
+
'Aliases': [cdn_domain],
|
|
750
|
+
'PriceClass': 'PriceClass_100',
|
|
751
|
+
'ViewerCertificate': {
|
|
752
|
+
'AcmCertificateArn': cdn_ssl_certificate_arn,
|
|
753
|
+
'MinimumProtocolVersion': 'TLSv1.2_2021',
|
|
754
|
+
'SslSupportMethod': 'sni-only',
|
|
755
|
+
},
|
|
756
|
+
'Origins': [
|
|
757
|
+
{
|
|
758
|
+
'CustomOriginConfig': {
|
|
759
|
+
'OriginProtocolPolicy': 'http-only',
|
|
760
|
+
'OriginSSLProtocols': ['TLSv1.2'],
|
|
761
|
+
},
|
|
762
|
+
},
|
|
763
|
+
],
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
)
|
|
767
|
+
|
|
768
|
+
|
|
728
769
|
def test_bucket_with_object_ownership_when_no_public_read_access(
|
|
729
770
|
app, stack, environment_parameters
|
|
730
771
|
):
|
|
@@ -667,6 +667,72 @@ def test_ecs_with_ec2_creates_right_launch_template(
|
|
|
667
667
|
)
|
|
668
668
|
|
|
669
669
|
|
|
670
|
+
def test_ecs_with_ec2_send_emails_attaches_smtp_security_group(
|
|
671
|
+
stack, vpc, hosted_zone, environment_parameters, mocker
|
|
672
|
+
):
|
|
673
|
+
mocker.patch('aws_cdk.aws_ec2.Vpc.from_lookup', return_value=vpc)
|
|
674
|
+
mocker.patch(
|
|
675
|
+
'aws_cdk_constructs.ecs.cluster.ECSCluster._get_ami_id',
|
|
676
|
+
return_value='ami-123',
|
|
677
|
+
)
|
|
678
|
+
|
|
679
|
+
ECSCluster(
|
|
680
|
+
scope=stack,
|
|
681
|
+
id='x',
|
|
682
|
+
environment='development',
|
|
683
|
+
environments_parameters=environment_parameters,
|
|
684
|
+
app_name='testapp',
|
|
685
|
+
hosted_zone=hosted_zone,
|
|
686
|
+
ec2_enable=True,
|
|
687
|
+
ec2_instance_type='t2.micro',
|
|
688
|
+
ec2_max_capacity=1,
|
|
689
|
+
ec2_desired_capacity=1,
|
|
690
|
+
ec2_send_emails=True,
|
|
691
|
+
)
|
|
692
|
+
template = Template.from_stack(stack)
|
|
693
|
+
template.has_resource_properties(
|
|
694
|
+
'AWS::EC2::LaunchTemplate',
|
|
695
|
+
{
|
|
696
|
+
'LaunchTemplateData': {
|
|
697
|
+
'SecurityGroupIds': Match.array_with(['smtp-relay-sg-id'])
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
)
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
def test_ecs_with_ec2_send_emails_false_does_not_attach_smtp_security_group(
|
|
704
|
+
stack, vpc, hosted_zone, environment_parameters, mocker
|
|
705
|
+
):
|
|
706
|
+
mocker.patch('aws_cdk.aws_ec2.Vpc.from_lookup', return_value=vpc)
|
|
707
|
+
mocker.patch(
|
|
708
|
+
'aws_cdk_constructs.ecs.cluster.ECSCluster._get_ami_id',
|
|
709
|
+
return_value='ami-123',
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
ECSCluster(
|
|
713
|
+
scope=stack,
|
|
714
|
+
id='x',
|
|
715
|
+
environment='development',
|
|
716
|
+
environments_parameters=environment_parameters,
|
|
717
|
+
app_name='testapp',
|
|
718
|
+
hosted_zone=hosted_zone,
|
|
719
|
+
ec2_enable=True,
|
|
720
|
+
ec2_instance_type='t2.micro',
|
|
721
|
+
ec2_max_capacity=1,
|
|
722
|
+
ec2_desired_capacity=1,
|
|
723
|
+
ec2_send_emails=False,
|
|
724
|
+
)
|
|
725
|
+
template = Template.from_stack(stack)
|
|
726
|
+
launch_templates = template.find_resources('AWS::EC2::LaunchTemplate')
|
|
727
|
+
launch_template = list(launch_templates.values())[0]
|
|
728
|
+
security_group_ids = (
|
|
729
|
+
launch_template.get('Properties', {})
|
|
730
|
+
.get('LaunchTemplateData', {})
|
|
731
|
+
.get('SecurityGroupIds', [])
|
|
732
|
+
)
|
|
733
|
+
assert 'smtp-relay-sg-id' not in security_group_ids
|
|
734
|
+
|
|
735
|
+
|
|
670
736
|
def test_ecs_with_ec2_creates_asg(
|
|
671
737
|
stack, vpc, hosted_zone, environment_parameters, mocker
|
|
672
738
|
):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/__init__.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/auth_flow.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/configuration.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/edge_function.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/edge_role.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/bucket/log_level.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/_types/graph.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/database.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/database/types.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/ecs/fargate_validator.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/ecs/microservice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/lambdas/sign-out/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/load_balancer/__init__.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/load_balancer/alb.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/load_balancer/nlb.py
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs/microservice/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/requires.txt
RENAMED
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/aws_cdk_constructs.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_cdk_constructs-2.45.0 → aws_cdk_constructs-2.47.1}/tests/test_service_user_for_static_assets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|