4
4
from pydantic import BaseModel , computed_field , field_validator , model_validator
5
5
from pathlib import Path
6
6
7
- from easyecs .helpers .common import template_with_env_var
8
7
from easyecs .helpers .exceptions import FileNotFoundException
9
8
10
9
@@ -28,11 +27,10 @@ class EcsFileRoleModel(BaseModel):
28
27
@field_validator ("arn" )
29
28
def set_arn (cls , arn ):
30
29
arn_pattern : str = r"^arn:aws:iam::\d{0,12}:role\/[\w\d_\/.-]*$"
31
- parsed_arn = template_with_env_var (arn )
32
30
assert re .match (
33
- arn_pattern , parsed_arn
34
- ), f"Role ARN does not respect arn pattern : { parsed_arn } "
35
- return parsed_arn
31
+ arn_pattern , arn
32
+ ), f"Role ARN does not respect arn pattern : { arn } "
33
+ return arn
36
34
37
35
@field_validator ("statements" )
38
36
def validate_unique_sid (cls , statements ):
@@ -80,11 +78,8 @@ class EcsFileVolumeModel(BaseModel):
80
78
81
79
@field_validator ("id" )
82
80
def set_id (cls , id ):
83
- parsed_id = template_with_env_var (id )
84
- assert parsed_id .startswith (
85
- "fs-"
86
- ), f"EFS ID should start with fs- instead got { parsed_id } "
87
- return parsed_id
81
+ assert id .startswith ("fs-" ), f"EFS ID should start with fs- instead got { id } "
82
+ return id
88
83
89
84
90
85
class EcsFileContainerHealthCheckModel (BaseModel ):
@@ -126,10 +121,6 @@ def validate_volumes(cls, volumes):
126
121
resolved_volumes .append (f"{ resolved_from_dir } /{ resolved_from_file } :{ _to } " )
127
122
return resolved_volumes
128
123
129
- @field_validator ("image" )
130
- def validate_image (cls , image ):
131
- return template_with_env_var (image )
132
-
133
124
134
125
class EcsTaskDefinitionModel (BaseModel ):
135
126
resources : EcsFileResourcesModel
0 commit comments