diff --git a/troposphere/ecs.py b/troposphere/ecs.py index d5b7a0518..e4074e9a6 100644 --- a/troposphere/ecs.py +++ b/troposphere/ecs.py @@ -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' @@ -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), @@ -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), @@ -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" @@ -287,4 +306,5 @@ class TaskDefinition(AWSObject): 'RequiresCompatibilities': ([basestring], False), 'TaskRoleArn': (basestring, False), 'Volumes': ([Volume], False), + 'ProxyConfiguration': (ProxyConfiguration, False) } diff --git a/troposphere/validators.py b/troposphere/validators.py index cf7d35f12..b0e0594d1 100644 --- a/troposphere/validators.py +++ b/troposphere/validators.py @@ -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)