Skip to content

Commit

Permalink
Added ECS ProxyConfiguration, DependsOn, StartTimeout and StopTimeout…
Browse files Browse the repository at this point in the history
… parameters (cloudtools#1382)

Fixes cloudtools#1378
  • Loading branch information
cigan1 authored and markpeek committed May 6, 2019
1 parent 0573b75 commit dbf1ab1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
22 changes: 21 additions & 1 deletion troposphere/ecs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from . import AWSObject, AWSProperty
from .validators import boolean, integer, network_port, positive_integer
from .validators import (
boolean, integer, network_port, positive_integer, ecs_proxy_type
)


LAUNCH_TYPE_EC2 = 'EC2'
Expand Down Expand Up @@ -215,10 +217,18 @@ class Ulimit(AWSProperty):
}


class ContainerDependency(AWSProperty):
props = {
'Condition': (basestring, True),
'ContainerName': (basestring, True)
}


class ContainerDefinition(AWSProperty):
props = {
'Command': ([basestring], False),
'Cpu': (positive_integer, False),
'DependsOn': (ContainerDependency, False),
'DisableNetworking': (boolean, False),
'DnsSearchDomains': ([basestring], False),
'DnsServers': ([basestring], False),
Expand All @@ -242,6 +252,8 @@ class ContainerDefinition(AWSProperty):
'Privileged': (boolean, False),
'ReadonlyRootFilesystem': (boolean, False),
'RepositoryCredentials': (RepositoryCredentials, False),
'StartTimeout': (integer, False),
'StopTimeout': (integer, False),
'Ulimits': ([Ulimit], False),
'User': (basestring, False),
'VolumesFrom': ([VolumesFrom], False),
Expand Down Expand Up @@ -273,6 +285,13 @@ class Volume(AWSProperty):
}


class ProxyConfiguration(AWSProperty):
props = {
'ProxyConfigurationProperties': (dict, False),
'Type': (ecs_proxy_type, False)
}


class TaskDefinition(AWSObject):
resource_type = "AWS::ECS::TaskDefinition"

Expand All @@ -287,4 +306,5 @@ class TaskDefinition(AWSObject):
'RequiresCompatibilities': ([basestring], False),
'TaskRoleArn': (basestring, False),
'Volumes': ([Volume], False),
'ProxyConfiguration': (ProxyConfiguration, False)
}
11 changes: 11 additions & 0 deletions troposphere/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,14 @@ def priceclass_type(price_class):
)
)
return(price_class)


def ecs_proxy_type(proxy_type):
valid_types = ['APPMESH']
if proxy_type not in valid_types:
raise ValueError(
'Type must be one of: "%s"' % (
', '.join(valid_types)
)
)
return(proxy_type)

0 comments on commit dbf1ab1

Please sign in to comment.