Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release June 11, 2015 #259

Merged
merged 7 commits into from
Jun 12, 2015
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
60 changes: 60 additions & 0 deletions troposphere/datapipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from . import AWSObject, AWSProperty, Ref
from .validators import boolean


class ParameterObjectAttribute(AWSProperty):
props = {
'Key': (basestring, True),
'StringValue': (basestring, False),
}


class ParameterObject(AWSProperty):
props = {
'Attributes': ([ParameterObjectAttribute], True),
'Id': (basestring, True),
}


class ParameterValue(AWSProperty):
props = {
'Id': (basestring, True),
'StringValue': (basestring, True),
}


class ObjectField(AWSProperty):
props = {
'Key': (basestring, True),
'RefValue': ([basestring, Ref], False),
'StringValue': (basestring, False),
}


class PipelineObject(AWSProperty):
props = {
'Fields': ([ObjectField], True),
'Id': (basestring, True),
'Name': (basestring, True),
}


class PipelineTag(AWSProperty):
props = {
'Key': (basestring, True),
'Value': (basestring, True),
}


class Pipeline(AWSObject):
resource_type = "AWS::DataPipeline::Pipeline"

props = {
'Activate': (boolean, False),
'Description': (basestring, False),
'Name': (basestring, True),
'ParameterObjects': ([ParameterObject], False),
'ParameterValues': ([ParameterValue], False),
'PipelineObjects': ([PipelineObject], True),
'PipelineTags': ([PipelineTag], False),
}
96 changes: 96 additions & 0 deletions troposphere/ecs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
from . import AWSObject, AWSProperty
from .validators import boolean, network_port, integer


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

props = {}


class LoadBalancer(AWSProperty):
props = {
'ContainerName': (basestring, False),
'ContainerPort': (network_port, False),
'LoadBalancerName': (basestring, False),
}


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

props = {
'Cluster': (basestring, False),
'DesiredCount': (integer, False),
'LoadBalancers': ([LoadBalancer], False),
'Role': (basestring, False),
'TaskDefinition': (basestring, False),
}


class Environment(AWSProperty):
props = {
'Name': (basestring, True),
'Value': (basestring, True),
}


class MountPoint(AWSProperty):
props = {
'ContainerPath': (basestring, True),
'SourceVolume': (basestring, True),
'ReadOnly': (boolean, False),
}


class PortMapping(AWSProperty):
props = {
'ContainerPort': (network_port, True),
'HostPort': (network_port, False),
}


class VolumesFrom(AWSProperty):
props = {
'SourceContainer': (basestring, True),
'ReadOnly': (boolean, False),
}


class ContainerDefinition(AWSProperty):
props = {
'Command': ([basestring], False),
'Cpu': (integer, False),
'EntryPoint': ([basestring], False),
'Environment': ([Environment], False),
'Essential': (boolean, False),
'Image': (basestring, True),
'Links': ([basestring], False),
'Memory': (integer, True),
'MountPoints': ([MountPoint], False),
'Name': (basestring, True),
'PortMappings': ([PortMapping], False),
'VolumesFrom': ([VolumesFrom], False),
}


class Host(AWSProperty):
props = {
'SourcePath': (basestring, False),
}


class Volume(AWSProperty):
props = {
'Name': (basestring, True),
'Host': (Host, False),
}


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

props = {
'ContainerDefinitions': ([ContainerDefinition], True),
'Volumes': ([Volume], True),
}
27 changes: 26 additions & 1 deletion troposphere/elasticache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# See LICENSE file for full license.

from . import AWSObject, Ref, GetAtt
from .validators import boolean, integer
from .validators import boolean, integer, network_port


class CacheCluster(AWSObject):
Expand Down Expand Up @@ -83,3 +83,28 @@ class SubnetGroup(AWSObject):
'Description': (basestring, True),
'SubnetIds': (list, True),
}


class ReplicationGroup(AWSObject):
resource_type = "AWS::ElastiCache::ReplicationGroup"

props = {
'AutomaticFailoverEnabled': (boolean, False),
'AutoMinorVersionUpgrade': (boolean, False),
'CacheNodeType': (basestring, True),
'CacheParameterGroupName': (basestring, False),
'CacheSecurityGroupNames': ([basestring], False),
'CacheSubnetGroupName': (basestring, False),
'Engine': (basestring, True),
'EngineVersion': (basestring, False),
'NotificationTopicArn': ([basestring, Ref], False),
'NumCacheClusters': (integer, True),
'Port': (network_port, False),
'PreferredCacheClusterAZs': ([basestring], False),
'PreferredMaintenanceWindow': (basestring, False),
'ReplicationGroupDescription': (basestring, True),
'SecurityGroupIds': ([basestring, Ref], False),
'SnapshotArns': ([basestring], False),
'SnapshotRetentionLimit': (integer, False),
'SnapshotWindow': (basestring, False),
}
13 changes: 13 additions & 0 deletions troposphere/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,16 @@ class UserToGroupAddition(AWSObject):
'GroupName': (basestring, True),
'Users': (list, True),
}


class ManagedPolicy(AWSObject):
resource_type = "AWS::IAM::ManagedPolicy"

props = {
'Description': (basestring, False),
'Groups': ([basestring, Ref], False),
'Path': (basestring, False),
'PolicyDocument': (policytypes, True),
'Roles': ([basestring, Ref], False),
'Users': ([basestring, Ref], False),
}
24 changes: 24 additions & 0 deletions troposphere/lambda.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from . import AWSObject, AWSProperty
from .validators import integer


class Code(AWSProperty):
props = {
'S3Bucket': (basestring, True),
'S3Key': (basestring, True),
'S3ObjectVersion': (basestring, False),
}


class Function(AWSObject):
resource_type = "AWS::Lambda::Function"

props = {
'Code': (Code, True),
'Description': (basestring, False),
'Handler': (basestring, True),
'MemorySize': (integer, False),
'Role': (basestring, True),
'Runtime': (basestring, True),
'Timeout': (integer, False),
}
29 changes: 29 additions & 0 deletions troposphere/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,32 @@ class EventSubscription(AWSObject):
'SourceIds': ([basestring, Ref], False),
'SourceType': (basestring, False),
}


class OptionSetting(AWSProperty):
props = {
'Name': (basestring, False),
'Value': (basestring, False),
}


class OptionGroupConfiguration(AWSProperty):
props = {
'DBSecurityGroupMemberships': ([basestring, Ref], False),
'OptionName': (basestring, True),
'OptionSettings': ([OptionSetting], False),
'Port': (network_port, False),
'VpcSecurityGroupMemberships': ([basestring, Ref], False),
}


class OptionGroup(AWSObject):
resource_type = "AWS::RDS::OptionGroup"

props = {
'EngineName': (basestring, True),
'MajorEngineVersion': (basestring, True),
'OptionGroupDescription': (basestring, True),
'OptionGroupConfigurations': ([OptionGroupConfiguration], True),
'Tags': (list, False),
}
9 changes: 9 additions & 0 deletions troposphere/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,20 @@ class LifecycleRuleTransition(AWSProperty):
}


class NoncurrentVersionTransition(AWSProperty):
props = {
'StorageClass': (basestring, True),
'TransitionInDays': (positive_integer, True),
}


class LifecycleRule(AWSProperty):
props = {
'ExpirationDate': (basestring, False),
'ExpirationInDays': (positive_integer, False),
'Id': (basestring, False),
'NoncurrentVersionExpirationInDays': (positive_integer, False),
'NoncurrentVersionTransition': (NoncurrentVersionTransition, False),
'Prefix': (basestring, False),
'Status': (basestring, True),
'Transition': (LifecycleRuleTransition, False),
Expand Down