Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cosmos/operators/aws_ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

logger = get_logger(__name__)

DEFAULT_CONN_ID = "aws_default"
DEFAULT_CONTAINER_NAME = "dbt"
DEFAULT_ENVIRONMENT_VARIABLES: dict[str, str] = {}

try:
Expand All @@ -47,10 +49,10 @@ class DbtAwsEcsBaseOperator(AbstractDbtBase, EcsRunTaskOperator): # type: ignor
def __init__(
self,
# arguments required by EcsRunTaskOperator
aws_conn_id: str,
cluster: str,
task_definition: str,
container_name: str,
container_name: str = DEFAULT_CONTAINER_NAME,
aws_conn_id: str = DEFAULT_CONN_ID,
#
profile_config: ProfileConfig | None = None,
command: list[str] | None = None,
Expand All @@ -66,6 +68,7 @@ def __init__(
"aws_conn_id": aws_conn_id,
"task_definition": task_definition,
"cluster": cluster,
"container_name": container_name,
Comment thread
tatiana marked this conversation as resolved.
"overrides": None,
}
)
Expand Down
1 change: 1 addition & 0 deletions tests/operators/test_aws_ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def test_dbt_aes_ecs_overrides_parameter():

assert "containerOverrides" in actual_overrides
actual_container_overrides = actual_overrides["containerOverrides"][0]
assert actual_container_overrides["name"] == "my-dbt-container-name"
Comment thread
pankajastro marked this conversation as resolved.
assert isinstance(actual_container_overrides["command"], list), "`command` should be of type list"

assert "environment" in actual_container_overrides
Expand Down