Skip to content

Instantly share code, notes, and snippets.

@dokipen
Created December 1, 2017 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dokipen/d04c0aac4c2b56ba5cecccd0aa1aba07 to your computer and use it in GitHub Desktop.
Save dokipen/d04c0aac4c2b56ba5cecccd0aa1aba07 to your computer and use it in GitHub Desktop.
"""
tropo.py implements resource types not yet supported by troposphere. This module
is ever changing and should be updated when troposphere is upgraded.
"""
from __future__ import print_function
from troposphere import AWSObject, AWSProperty
from troposphere.validators import positive_integer
from troposphere.ecs import (
ContainerDefinition,
DeploymentConfiguration,
LoadBalancer,
PlacementConstraint,
PlacementStrategy,
Volume)
class AwsvpcConfiguration(AWSProperty):
props = {
"AssignPublicIp": (basestring, False),
"SecurityGroups": ([basestring], False),
"Subnets": ([basestring], True)}
class NetworkConfiguration(AWSProperty):
props = {
"AwsvpcConfiguration": (AwsvpcConfiguration, True)}
class Service(AWSObject):
"""
Service implements Fargate in troposphere.
"""
resource_type = "AWS::ECS::Service"
props = {
"Cluster": (basestring, False),
"DeploymentConfiguration": (DeploymentConfiguration, False),
"DesiredCount": (positive_integer, False),
"LaunchType": (basestring, False),
"LoadBalancers": ([LoadBalancer], False),
"NetworkConfiguration": (NetworkConfiguration, False),
"Role": (basestring, False),
"PlacementConstraints": ([PlacementConstraint], False),
"PlacementStrategies": ([PlacementStrategy], False),
"ServiceName": (basestring, False),
"TaskDefinition": (basestring, True)}
class TaskDefinition(AWSObject):
resource_type = "AWS::ECS::TaskDefinition"
props = {
"ContainerDefinitions": ([ContainerDefinition], True),
"ExecutionRoleArn": (basestring, False),
"Family": (basestring, False),
"Memory": (basestring, False),
"Cpu": (basestring, False),
"NetworkMode": (basestring, False),
"PlacementConstraints": ([PlacementConstraints], False),
"RequiresCompatabilities": ([basestring], False),
"TaskRoleArn": (basestring, False),
"Volumes": ([Volume], False)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment