cdk-factory 0.16.10__py3-none-any.whl → 0.16.12__py3-none-any.whl
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.
Potentially problematic release.
This version of cdk-factory might be problematic. Click here for more details.
- cdk_factory/configurations/resources/ecs_cluster.py +87 -0
- cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +72 -49
- cdk_factory/stack_library/ecs/__init__.py +14 -0
- cdk_factory/stack_library/ecs/ecs_cluster_stack.py +240 -0
- cdk_factory/version.py +1 -1
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.12.dist-info}/METADATA +1 -1
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.12.dist-info}/RECORD +10 -8
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.12.dist-info}/WHEEL +0 -0
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.12.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.12.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ECS Cluster Configuration
|
|
3
|
+
|
|
4
|
+
Defines the configuration schema for ECS cluster stacks.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Optional, Dict, Any, List
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class EcsClusterConfig:
|
|
11
|
+
"""
|
|
12
|
+
Configuration for an ECS cluster.
|
|
13
|
+
|
|
14
|
+
This class defines all the configurable parameters for an ECS cluster,
|
|
15
|
+
providing explicit control over cluster creation and settings.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(self, config: Dict[str, Any]) -> None:
|
|
19
|
+
self._config = config or {}
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def name(self) -> str:
|
|
23
|
+
"""Name of the ECS cluster. Supports template variables like {{WORKLOAD_NAME}}-{{ENVIRONMENT}}-cluster"""
|
|
24
|
+
return self._config.get("name", "cluster")
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def container_insights(self) -> bool:
|
|
28
|
+
"""Enable container insights for the cluster"""
|
|
29
|
+
return self._config.get("container_insights", True)
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def cluster_settings(self) -> Optional[List[Dict[str, str]]]:
|
|
33
|
+
"""Additional cluster settings as name-value pairs"""
|
|
34
|
+
return self._config.get("cluster_settings")
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def cloud_map_namespace(self) -> Optional[Dict[str, Any]]:
|
|
38
|
+
"""Cloud Map namespace configuration for service discovery"""
|
|
39
|
+
return self._config.get("cloud_map_namespace")
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def execute_command_configuration(self) -> Optional[Dict[str, Any]]:
|
|
43
|
+
"""Execute command configuration for ECS"""
|
|
44
|
+
return self._config.get("execute_command_configuration")
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def vpc_id(self) -> Optional[str]:
|
|
48
|
+
"""VPC ID where the cluster should be created"""
|
|
49
|
+
return self._config.get("vpc_id")
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def ssm_vpc_id(self) -> Optional[str]:
|
|
53
|
+
"""SSM parameter path to import VPC ID"""
|
|
54
|
+
return self._config.get("ssm_vpc_id")
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def create_instance_role(self) -> bool:
|
|
58
|
+
"""Whether to create an ECS instance role"""
|
|
59
|
+
return self._config.get("create_instance_role", True)
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def instance_role_name(self) -> Optional[str]:
|
|
63
|
+
"""Custom name for the ECS instance role"""
|
|
64
|
+
return self._config.get("instance_role_name")
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def instance_profile_name(self) -> Optional[str]:
|
|
68
|
+
"""Custom name for the ECS instance profile"""
|
|
69
|
+
return self._config.get("instance_profile_name")
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def managed_policies(self) -> List[str]:
|
|
73
|
+
"""List of AWS managed policies to attach to the instance role"""
|
|
74
|
+
return self._config.get("managed_policies", [
|
|
75
|
+
"service-role/AmazonEC2ContainerServiceforEC2Role",
|
|
76
|
+
"AmazonSSMManagedInstanceCore"
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def inline_policies(self) -> Optional[Dict[str, Dict[str, Any]]]:
|
|
81
|
+
"""Inline IAM policies to attach to the instance role"""
|
|
82
|
+
return self._config.get("inline_policies")
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def export_ssm_parameters(self) -> bool:
|
|
86
|
+
"""Whether to export cluster information to SSM parameters"""
|
|
87
|
+
return self._config.get("export_ssm_parameters", True)
|
|
@@ -248,10 +248,12 @@ class AutoScalingStack(IStack, VPCProviderMixin):
|
|
|
248
248
|
# Add base commands
|
|
249
249
|
user_data.add_commands("set -euxo pipefail")
|
|
250
250
|
|
|
251
|
-
# Add custom commands from config
|
|
251
|
+
# Add custom commands from config (with variable substitution)
|
|
252
252
|
for command in self.asg_config.user_data_commands:
|
|
253
|
-
|
|
254
|
-
self.
|
|
253
|
+
# Perform variable substitution on the command
|
|
254
|
+
substituted_command = self._substitute_variables(command)
|
|
255
|
+
user_data.add_commands(substituted_command)
|
|
256
|
+
self.user_data_commands.append(substituted_command)
|
|
255
257
|
|
|
256
258
|
# Add user data scripts from files (with variable substitution)
|
|
257
259
|
if self.asg_config.user_data_scripts:
|
|
@@ -324,6 +326,49 @@ class AutoScalingStack(IStack, VPCProviderMixin):
|
|
|
324
326
|
|
|
325
327
|
logger.info(f"Added user data script from {script_type}: {script_config.get('path', 'inline')}")
|
|
326
328
|
|
|
329
|
+
def _substitute_variables(self, command: str) -> str:
|
|
330
|
+
"""
|
|
331
|
+
Perform variable substitution on a user data command.
|
|
332
|
+
Uses workload and deployment configuration for substitution.
|
|
333
|
+
"""
|
|
334
|
+
if not command:
|
|
335
|
+
return command
|
|
336
|
+
|
|
337
|
+
# Start with the original command
|
|
338
|
+
substituted_command = command
|
|
339
|
+
|
|
340
|
+
# Define available variables for substitution
|
|
341
|
+
variables = {}
|
|
342
|
+
|
|
343
|
+
# Add workload variables
|
|
344
|
+
if self.workload:
|
|
345
|
+
variables.update({
|
|
346
|
+
"WORKLOAD_NAME": getattr(self.workload, 'name', ''),
|
|
347
|
+
"ENVIRONMENT": getattr(self.workload, 'environment', ''),
|
|
348
|
+
"WORKLOAD": getattr(self.workload, 'name', ''),
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
# Add deployment variables
|
|
352
|
+
if self.deployment:
|
|
353
|
+
variables.update({
|
|
354
|
+
"DEPLOYMENT_NAME": getattr(self.deployment, 'name', ''),
|
|
355
|
+
"REGION": getattr(self.deployment, 'region', ''),
|
|
356
|
+
"ACCOUNT": getattr(self.deployment, 'account', ''),
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
# Add stack-level variables
|
|
360
|
+
variables.update({
|
|
361
|
+
"STACK_NAME": self.stack_name,
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
# Perform substitution
|
|
365
|
+
for var_name, var_value in variables.items():
|
|
366
|
+
if var_value is not None:
|
|
367
|
+
placeholder = f"{{{{{var_name}}}}}" # {{VAR_NAME}}
|
|
368
|
+
substituted_command = substituted_command.replace(placeholder, str(var_value))
|
|
369
|
+
|
|
370
|
+
return substituted_command
|
|
371
|
+
|
|
327
372
|
def _add_container_user_data(
|
|
328
373
|
self, user_data: ec2.UserData, container_config: Dict[str, Any]
|
|
329
374
|
) -> None:
|
|
@@ -587,56 +632,34 @@ class AutoScalingStack(IStack, VPCProviderMixin):
|
|
|
587
632
|
# Scheduled action implementation would go here
|
|
588
633
|
pass
|
|
589
634
|
|
|
590
|
-
def _create_ecs_cluster_if_needed(self, asg_name: str)
|
|
591
|
-
"""
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
logger.debug("No ECS configuration detected, skipping cluster creation")
|
|
635
|
+
def _create_ecs_cluster_if_needed(self, asg_name: str):
|
|
636
|
+
"""
|
|
637
|
+
ECS cluster creation should be handled by the dedicated EcsClusterStack module.
|
|
638
|
+
This method only handles SSM imports for cluster name injection.
|
|
639
|
+
"""
|
|
640
|
+
# Check if ECS cluster name is available via SSM imports
|
|
641
|
+
if self.has_ssm_import("ecs_cluster_name"):
|
|
642
|
+
logger.info(f"ECS cluster name available via SSM imports")
|
|
643
|
+
# Inject cluster name into user data if available
|
|
644
|
+
if self.user_data and self.user_data_commands:
|
|
645
|
+
self._inject_cluster_name_into_user_data()
|
|
602
646
|
return
|
|
603
647
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
logger.info(f"Creating ECS cluster: {cluster_name}")
|
|
608
|
-
|
|
609
|
-
# Create ECS cluster
|
|
610
|
-
self.ecs_cluster = ecs.Cluster(
|
|
611
|
-
self,
|
|
612
|
-
"ECSCluster",
|
|
613
|
-
cluster_name=cluster_name,
|
|
614
|
-
vpc=self.vpc,
|
|
615
|
-
container_insights=True
|
|
616
|
-
)
|
|
617
|
-
|
|
618
|
-
# Inject the cluster name into user data if user data exists
|
|
619
|
-
if self.user_data and self.user_data_commands:
|
|
620
|
-
self._inject_cluster_name_into_user_data(cluster_name)
|
|
621
|
-
|
|
622
|
-
# Export cluster name
|
|
623
|
-
cdk.CfnOutput(
|
|
624
|
-
self,
|
|
625
|
-
f"{cluster_name}-name",
|
|
626
|
-
value=self.ecs_cluster.cluster_name,
|
|
627
|
-
export_name=f"{self.deployment.build_resource_name(cluster_name)}-name",
|
|
628
|
-
)
|
|
629
|
-
|
|
630
|
-
# Export cluster ARN
|
|
631
|
-
cdk.CfnOutput(
|
|
632
|
-
self,
|
|
633
|
-
f"{cluster_name}-arn",
|
|
634
|
-
value=self.ecs_cluster.cluster_arn,
|
|
635
|
-
export_name=f"{self.deployment.build_resource_name(cluster_name)}-arn",
|
|
648
|
+
logger.warning(
|
|
649
|
+
"No ECS cluster name found in SSM imports. "
|
|
650
|
+
"Use the dedicated EcsClusterStack module to create ECS clusters."
|
|
636
651
|
)
|
|
637
652
|
|
|
638
|
-
def _inject_cluster_name_into_user_data(self
|
|
639
|
-
"""Inject the ECS cluster name into user data commands"""
|
|
653
|
+
def _inject_cluster_name_into_user_data(self) -> None:
|
|
654
|
+
"""Inject the ECS cluster name into user data commands using SSM imports"""
|
|
655
|
+
# Check if ECS cluster name is available via SSM imports
|
|
656
|
+
if self.has_ssm_import("ecs_cluster_name"):
|
|
657
|
+
cluster_name = self.get_ssm_imported_value("ecs_cluster_name")
|
|
658
|
+
logger.info(f"Using ECS cluster name from SSM: {cluster_name}")
|
|
659
|
+
else:
|
|
660
|
+
logger.warning("No ECS cluster name found in SSM imports, skipping cluster name injection")
|
|
661
|
+
return
|
|
662
|
+
|
|
640
663
|
injected_commands = []
|
|
641
664
|
cluster_name_injected = False
|
|
642
665
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ECS Stack Library
|
|
3
|
+
|
|
4
|
+
Contains ECS-related stack modules for creating and managing
|
|
5
|
+
ECS clusters, services, and related resources.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .ecs_cluster_stack import EcsClusterStack
|
|
9
|
+
from .ecs_service_stack import EcsServiceStack
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"EcsClusterStack",
|
|
13
|
+
"EcsServiceStack"
|
|
14
|
+
]
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ECS Cluster Stack Module
|
|
3
|
+
|
|
4
|
+
Provides a dedicated stack for creating and configuring ECS clusters
|
|
5
|
+
with proper configurability and explicit resource management.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import logging
|
|
9
|
+
from typing import Optional, Dict, Any, List
|
|
10
|
+
|
|
11
|
+
from aws_cdk import (
|
|
12
|
+
aws_ecs as ecs,
|
|
13
|
+
aws_ec2 as ec2,
|
|
14
|
+
aws_iam as iam,
|
|
15
|
+
aws_ssm as ssm,
|
|
16
|
+
RemovalPolicy,
|
|
17
|
+
Stack,
|
|
18
|
+
CfnOutput
|
|
19
|
+
)
|
|
20
|
+
from constructs import Construct
|
|
21
|
+
|
|
22
|
+
from cdk_factory.configurations.stack import StackConfig
|
|
23
|
+
from cdk_factory.configurations.deployment import DeploymentConfig
|
|
24
|
+
from cdk_factory.configurations.workload import WorkloadConfig
|
|
25
|
+
from cdk_factory.interfaces.ssm_parameter_mixin import SsmParameterMixin
|
|
26
|
+
from cdk_factory.configurations.resources.ecs_cluster import EcsClusterConfig
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
logger = logging.getLogger(__name__)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class EcsClusterStack(Stack, SsmParameterMixin):
|
|
33
|
+
"""
|
|
34
|
+
A dedicated stack for creating and managing ECS clusters.
|
|
35
|
+
|
|
36
|
+
This stack provides explicit configuration of ECS clusters including:
|
|
37
|
+
- Cluster naming
|
|
38
|
+
- Container insights
|
|
39
|
+
- Cluster settings
|
|
40
|
+
- SSM parameter exports
|
|
41
|
+
- IAM role configurations
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def __init__(
|
|
45
|
+
self,
|
|
46
|
+
scope: Construct,
|
|
47
|
+
construct_id: str,
|
|
48
|
+
stack_config: StackConfig,
|
|
49
|
+
deployment: DeploymentConfig,
|
|
50
|
+
workload: WorkloadConfig,
|
|
51
|
+
**kwargs
|
|
52
|
+
):
|
|
53
|
+
"""
|
|
54
|
+
Initialize the ECS Cluster stack.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
scope: The CDK construct scope
|
|
58
|
+
construct_id: The construct ID
|
|
59
|
+
stack_config: Stack configuration
|
|
60
|
+
deployment: Deployment configuration
|
|
61
|
+
workload: Workload configuration
|
|
62
|
+
"""
|
|
63
|
+
super().__init__(scope, construct_id, **kwargs)
|
|
64
|
+
|
|
65
|
+
self.stack_config = stack_config
|
|
66
|
+
self.deployment = deployment
|
|
67
|
+
self.workload = workload
|
|
68
|
+
|
|
69
|
+
# Load ECS cluster configuration
|
|
70
|
+
self.ecs_config: EcsClusterConfig = EcsClusterConfig(
|
|
71
|
+
stack_config.dictionary.get("ecs_cluster", {})
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
logger.info(f"Creating ECS Cluster stack: {construct_id}")
|
|
75
|
+
|
|
76
|
+
# Create the ECS cluster
|
|
77
|
+
self._create_ecs_cluster()
|
|
78
|
+
|
|
79
|
+
# Create IAM roles if needed
|
|
80
|
+
self._create_iam_roles()
|
|
81
|
+
|
|
82
|
+
# Export cluster information
|
|
83
|
+
self._export_cluster_info()
|
|
84
|
+
|
|
85
|
+
logger.info(f"ECS Cluster stack created: {construct_id}")
|
|
86
|
+
|
|
87
|
+
def _create_ecs_cluster(self):
|
|
88
|
+
"""Create the ECS cluster with explicit configuration."""
|
|
89
|
+
logger.info(f"Creating ECS cluster: {self.ecs_config.name}")
|
|
90
|
+
|
|
91
|
+
# Build cluster settings
|
|
92
|
+
cluster_settings = []
|
|
93
|
+
|
|
94
|
+
# Add container insights if enabled
|
|
95
|
+
if self.ecs_config.container_insights:
|
|
96
|
+
cluster_settings.append({
|
|
97
|
+
"name": "containerInsights",
|
|
98
|
+
"value": "enabled"
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
# Add custom cluster settings
|
|
102
|
+
if self.ecs_config.cluster_settings:
|
|
103
|
+
cluster_settings.extend(self.ecs_config.cluster_settings)
|
|
104
|
+
|
|
105
|
+
# Create the ECS cluster
|
|
106
|
+
self.ecs_cluster = ecs.Cluster(
|
|
107
|
+
self,
|
|
108
|
+
"ECSCluster",
|
|
109
|
+
cluster_name=self.ecs_config.name,
|
|
110
|
+
vpc=self._get_vpc(),
|
|
111
|
+
container_insights=self.ecs_config.container_insights,
|
|
112
|
+
default_cloud_map_namespace=(
|
|
113
|
+
self.ecs_config.cloud_map_namespace
|
|
114
|
+
if self.ecs_config.cloud_map_namespace else None
|
|
115
|
+
),
|
|
116
|
+
execute_command_configuration=(
|
|
117
|
+
self.ecs_config.execute_command_configuration
|
|
118
|
+
if self.ecs_config.execute_command_configuration else None
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
logger.info(f"Created ECS cluster: {self.ecs_config.name}")
|
|
123
|
+
|
|
124
|
+
def _create_iam_roles(self):
|
|
125
|
+
"""Create IAM roles for the ECS cluster if configured."""
|
|
126
|
+
if not self.ecs_config.create_instance_role:
|
|
127
|
+
return
|
|
128
|
+
|
|
129
|
+
logger.info("Creating ECS instance role")
|
|
130
|
+
|
|
131
|
+
# Create the instance role
|
|
132
|
+
self.instance_role = iam.Role(
|
|
133
|
+
self,
|
|
134
|
+
"ECSInstanceRole",
|
|
135
|
+
assumed_by=iam.ServicePrincipal("ec2.amazonaws.com"),
|
|
136
|
+
role_name=self.ecs_config.instance_role_name or f"{self.ecs_config.name}-instance-role"
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Add managed policies
|
|
140
|
+
for policy in self.ecs_config.managed_policies:
|
|
141
|
+
self.instance_role.add_managed_policy(
|
|
142
|
+
iam.ManagedPolicy.from_aws_managed_policy_name(policy)
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
# Add inline policies if provided
|
|
146
|
+
if self.ecs_config.inline_policies:
|
|
147
|
+
for policy_name, policy_document in self.ecs_config.inline_policies.items():
|
|
148
|
+
self.instance_role.add_to_policy(
|
|
149
|
+
iam.PolicyStatement.from_json(policy_document)
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
# Create instance profile
|
|
153
|
+
self.instance_profile = iam.CfnInstanceProfile(
|
|
154
|
+
self,
|
|
155
|
+
"ECSInstanceProfile",
|
|
156
|
+
roles=[self.instance_role.role_name],
|
|
157
|
+
instance_profile_name=self.ecs_config.instance_profile_name or f"{self.ecs_config.name}-instance-profile"
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
logger.info("Created ECS instance role and profile")
|
|
161
|
+
|
|
162
|
+
def _get_vpc(self):
|
|
163
|
+
"""Get the VPC for the ECS cluster."""
|
|
164
|
+
if self.ecs_config.vpc_id:
|
|
165
|
+
# Import VPC by ID
|
|
166
|
+
return ec2.Vpc.from_lookup(
|
|
167
|
+
self,
|
|
168
|
+
"VPC",
|
|
169
|
+
vpc_id=self.ecs_config.vpc_id
|
|
170
|
+
)
|
|
171
|
+
elif self.ecs_config.ssm_vpc_id:
|
|
172
|
+
# Import VPC from SSM
|
|
173
|
+
vpc_id = self._import_ssm_parameter_value(
|
|
174
|
+
self.ecs_config.ssm_vpc_id,
|
|
175
|
+
required=True
|
|
176
|
+
)
|
|
177
|
+
return ec2.Vpc.from_lookup(
|
|
178
|
+
self,
|
|
179
|
+
"VPC",
|
|
180
|
+
vpc_id=vpc_id
|
|
181
|
+
)
|
|
182
|
+
else:
|
|
183
|
+
# Use default VPC
|
|
184
|
+
return ec2.Vpc.from_lookup(
|
|
185
|
+
self,
|
|
186
|
+
"VPC",
|
|
187
|
+
is_default=True
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
def _export_cluster_info(self):
|
|
191
|
+
"""Export cluster information via SSM parameters and CloudFormation outputs."""
|
|
192
|
+
logger.info("Exporting ECS cluster information")
|
|
193
|
+
|
|
194
|
+
# Export cluster name
|
|
195
|
+
self.export_ssm_parameter(
|
|
196
|
+
f"/{self.deployment.name}/{self.workload.name}/ecs/cluster/name",
|
|
197
|
+
self.ecs_config.name,
|
|
198
|
+
"ECS Cluster Name"
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
# Export cluster ARN
|
|
202
|
+
self.export_ssm_parameter(
|
|
203
|
+
f"/{self.deployment.name}/{self.workload.name}/ecs/cluster/arn",
|
|
204
|
+
self.ecs_cluster.cluster_arn,
|
|
205
|
+
"ECS Cluster ARN"
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
# Export instance role ARN if created
|
|
209
|
+
if hasattr(self, 'instance_role'):
|
|
210
|
+
self.export_ssm_parameter(
|
|
211
|
+
f"/{self.deployment.name}/{self.workload.name}/ecs/instance-role/arn",
|
|
212
|
+
self.instance_role.role_arn,
|
|
213
|
+
"ECS Instance Role ARN"
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
# CloudFormation outputs
|
|
217
|
+
CfnOutput(
|
|
218
|
+
self,
|
|
219
|
+
"cluster-name",
|
|
220
|
+
value=self.ecs_config.name,
|
|
221
|
+
description=f"Name of the ECS cluster: {self.ecs_config.name}",
|
|
222
|
+
export_name=f"{self.deployment.name}-ecs-cluster-name"
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
CfnOutput(
|
|
226
|
+
self,
|
|
227
|
+
"cluster-arn",
|
|
228
|
+
value=self.ecs_cluster.cluster_arn,
|
|
229
|
+
description=f"ARN of the ECS cluster: {self.ecs_config.name}",
|
|
230
|
+
export_name=f"{self.deployment.name}-ecs-cluster-arn"
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
if hasattr(self, 'instance_role'):
|
|
234
|
+
CfnOutput(
|
|
235
|
+
self,
|
|
236
|
+
"instance-role-arn",
|
|
237
|
+
value=self.instance_role.role_arn,
|
|
238
|
+
description=f"ARN of the ECS instance role: {self.ecs_config.name}",
|
|
239
|
+
export_name=f"{self.deployment.name}-ecs-instance-role-arn"
|
|
240
|
+
)
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.16.
|
|
1
|
+
__version__ = "0.16.12"
|
|
@@ -2,7 +2,7 @@ cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
cdk_factory/app.py,sha256=RnX0-pwdTAPAdKJK_j13Zl8anf9zYKBwboR0KA8K8xM,10346
|
|
3
3
|
cdk_factory/cdk.json,sha256=SKZKhJ2PBpFH78j-F8S3VDYW-lf76--Q2I3ON-ZIQfw,3106
|
|
4
4
|
cdk_factory/cli.py,sha256=FGbCTS5dYCNsfp-etshzvFlGDCjC28r6rtzYbe7KoHI,6407
|
|
5
|
-
cdk_factory/version.py,sha256=
|
|
5
|
+
cdk_factory/version.py,sha256=SAMCCZXLVjpbIMZUK3fel2LF9pnzvZrYuoLBraKZrMc,24
|
|
6
6
|
cdk_factory/builds/README.md,sha256=9BBWd7bXpyKdMU_g2UljhQwrC9i5O_Tvkb6oPvndoZk,90
|
|
7
7
|
cdk_factory/commands/command_loader.py,sha256=QbLquuP_AdxtlxlDy-2IWCQ6D-7qa58aphnDPtp_uTs,3744
|
|
8
8
|
cdk_factory/configurations/base_config.py,sha256=JKjhNsy0RCUZy1s8n5D_aXXI-upR9izaLtCTfKYiV9k,9624
|
|
@@ -31,6 +31,7 @@ cdk_factory/configurations/resources/cognito.py,sha256=udX2AJ1ITLhy4f1XiJQwrva6F
|
|
|
31
31
|
cdk_factory/configurations/resources/docker.py,sha256=hUbuxkuhcQu9LnLX7I8_57eTmHefEAGVnOHO37MkqC4,2166
|
|
32
32
|
cdk_factory/configurations/resources/dynamodb.py,sha256=HsZMOaRwfuNPwKIzokeeE3f5zAQLTB5hRb_GzYq2ibg,2903
|
|
33
33
|
cdk_factory/configurations/resources/ecr.py,sha256=o9hHzEBVPoxUvWZGXGbRJ-98FmP6fMLY5a1-qg42jL0,8253
|
|
34
|
+
cdk_factory/configurations/resources/ecs_cluster.py,sha256=5U4PizVZtbx6-LNL1RgF_UcTQD2C_j9LJlb-yt5CCtg,3031
|
|
34
35
|
cdk_factory/configurations/resources/ecs_service.py,sha256=fAW4EuBNhPrE7G0QcHXongKoAnFeGMRS6iP7OuGP5Fw,4926
|
|
35
36
|
cdk_factory/configurations/resources/exisiting.py,sha256=EVOLnkB-DGfTlmDgyQ5DD5k2zYfpFxqI3gugDR7mifI,478
|
|
36
37
|
cdk_factory/configurations/resources/lambda_edge.py,sha256=MjmiwDkys4aoRvDQhH3MT6BgeShzJXNWL7761HJrLtQ,3404
|
|
@@ -86,7 +87,7 @@ cdk_factory/stack_library/acm/__init__.py,sha256=4FNRLykblcKZvq_wieYwvv9N_jgrZnJ
|
|
|
86
87
|
cdk_factory/stack_library/acm/acm_stack.py,sha256=hflRXyOSjqGeJxBx87EV3Z3MJ5HEX2rnrjJ_E9wwhH8,5862
|
|
87
88
|
cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=l6J5uurBQqbhj9JuvQitV9PiIHS5kqa-dFWifCeA3GM,39347
|
|
88
89
|
cdk_factory/stack_library/auto_scaling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
|
-
cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=
|
|
90
|
+
cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=8Ho7QLbW0MLEmnD0ApglFgZC8Bh5ODT2jERNoAUxz3Y,30128
|
|
90
91
|
cdk_factory/stack_library/aws_lambdas/lambda_stack.py,sha256=SFbBPvvCopbyiuYtq-O5sQkFCf94Wzua6aDUXiFDSB4,26161
|
|
91
92
|
cdk_factory/stack_library/buckets/README.md,sha256=XkK3UNVtRLE7NtUvbhCOBBYUYi8hlrrSaI1s3GJVrqI,78
|
|
92
93
|
cdk_factory/stack_library/buckets/bucket_stack.py,sha256=SLoZqSffAqmeBBEVUQg54D_8Ad5UKdkjEAmKAVgAqQo,1778
|
|
@@ -97,7 +98,8 @@ cdk_factory/stack_library/cognito/cognito_stack.py,sha256=zEHkKVCIeyZywPs_GIMXCX
|
|
|
97
98
|
cdk_factory/stack_library/dynamodb/dynamodb_stack.py,sha256=TVyOrUhgaSuN8uymkpaQcpOaSA0lkYJ8QUMgakTCKus,6771
|
|
98
99
|
cdk_factory/stack_library/ecr/README.md,sha256=xw2wPx9WN03Y4BBwqvbi9lAFGNyaD1FUNpqxVJX14Oo,179
|
|
99
100
|
cdk_factory/stack_library/ecr/ecr_stack.py,sha256=1xA68sxFVyqreYjXrP_7U9I8RF9RtFeR6KeEfSWuC2U,2118
|
|
100
|
-
cdk_factory/stack_library/ecs/__init__.py,sha256=
|
|
101
|
+
cdk_factory/stack_library/ecs/__init__.py,sha256=ZZLBmuSt6z_cnFz6OkIFv_APmjqf706wWROruZGyFEI,289
|
|
102
|
+
cdk_factory/stack_library/ecs/ecs_cluster_stack.py,sha256=gYNPJuzqYw40dYr0nPwt9vyk1tjGCZRafV98cqpVLpE,7979
|
|
101
103
|
cdk_factory/stack_library/ecs/ecs_service_stack.py,sha256=c6K3BjlXyldr8ikvEhfC9C-LpKJILQQkwwU9DNlepH4,27747
|
|
102
104
|
cdk_factory/stack_library/lambda_edge/__init__.py,sha256=ByBJ_CWdc4UtTmFBZH-6pzBMNkjkdtE65AmnB0Fs6lM,156
|
|
103
105
|
cdk_factory/stack_library/lambda_edge/lambda_edge_stack.py,sha256=CdId_1kcZmYr1lLI9AD3-KqtE6voC3641PIloJmWiNI,16414
|
|
@@ -134,8 +136,8 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJ
|
|
|
134
136
|
cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
|
|
135
137
|
cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
|
|
136
138
|
cdk_factory/workload/workload_factory.py,sha256=yDI3cRhVI5ELNDcJPLpk9UY54Uind1xQoV3spzT4z7E,6068
|
|
137
|
-
cdk_factory-0.16.
|
|
138
|
-
cdk_factory-0.16.
|
|
139
|
-
cdk_factory-0.16.
|
|
140
|
-
cdk_factory-0.16.
|
|
141
|
-
cdk_factory-0.16.
|
|
139
|
+
cdk_factory-0.16.12.dist-info/METADATA,sha256=n0rDgo0sPzkmsgDuEGer0D42bSshFdWPLSLB1RtC8Ow,2452
|
|
140
|
+
cdk_factory-0.16.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
141
|
+
cdk_factory-0.16.12.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
142
|
+
cdk_factory-0.16.12.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
143
|
+
cdk_factory-0.16.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|