diff --git a/troposphere/datapipeline.py b/troposphere/datapipeline.py new file mode 100644 index 000000000..c79bc04f2 --- /dev/null +++ b/troposphere/datapipeline.py @@ -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), + } diff --git a/troposphere/ecs.py b/troposphere/ecs.py new file mode 100644 index 000000000..e8fedb144 --- /dev/null +++ b/troposphere/ecs.py @@ -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), + } diff --git a/troposphere/elasticache.py b/troposphere/elasticache.py index ca744d9f8..9d2ac99e3 100644 --- a/troposphere/elasticache.py +++ b/troposphere/elasticache.py @@ -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): @@ -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), + } diff --git a/troposphere/iam.py b/troposphere/iam.py index 8a4b2f360..2f21f6da1 100644 --- a/troposphere/iam.py +++ b/troposphere/iam.py @@ -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), + } diff --git a/troposphere/lambda.py b/troposphere/lambda.py new file mode 100644 index 000000000..fb8e54e7d --- /dev/null +++ b/troposphere/lambda.py @@ -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), + } diff --git a/troposphere/rds.py b/troposphere/rds.py index 72c91e9bb..fa143b863 100644 --- a/troposphere/rds.py +++ b/troposphere/rds.py @@ -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), + } diff --git a/troposphere/s3.py b/troposphere/s3.py index 80f51994e..2da51cd43 100644 --- a/troposphere/s3.py +++ b/troposphere/s3.py @@ -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),