How to use the troposphere.AWSProperty function in troposphere

To help you get started, we’ve selected a few troposphere examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudtools / troposphere / troposphere / kinesisanalyticsv2.py View on Github external
}


class LambdaOutput(AWSProperty):
    props = {
        'ResourceARN': (basestring, True),
    }


class KinesisFirehoseOutput(AWSProperty):
    props = {
        'ResourceARN': (basestring, True),
    }


class KinesisStreamsOutput(AWSProperty):
    props = {
        'ResourceARN': (basestring, True),
    }


class DestinationSchema(AWSProperty):
    props = {
        'RecordFormatType': (basestring, False),
    }


class Output(AWSProperty):
    props = {
        "DestinationSchema": (DestinationSchema, True),
        "LambdaOutput": (LambdaOutput, False),
        "KinesisFirehoseOutput": (KinesisFirehoseOutput, False),
github cloudtools / troposphere / troposphere / openstack / nova.py View on Github external
if 'disk_bus' in self.resource:
            disk_bus = self.resource['disk_bus']
            if disk_bus not in ['ide', 'lame_bus', 'scsi', 'usb', 'virtio']:
                raise ValueError(
                    "The device_bus attribute "
                    "must be one of ide, lame_bus, scsi, usb or virtio")

        if 'ephemeral_format' in self.resource:
            ephemeral_format = self.resource['ephemeral_format']
            if ephemeral_format not in ['ext2', 'ext3', 'ext4', 'xfs', 'ntfs']:
                raise ValueError(
                    "The device_type attribute "
                    "must be one of ext2, ext3, ext4, xfs, ntfs")


class Network(AWSProperty):
    props = {
        'fixed_ip': (basestring, False),
        'network': (basestring, False),
        'port': (network_port, False),
    }


class FloatingIP(AWSObject):
    resource_type = "OS::Nova::FloatingIP"

    props = {
        'pool': (basestring, False),
    }


class FloatingIPAssociation(AWSObject):
github cloudtools / troposphere / troposphere / appmesh.py View on Github external
'Prefix': (basestring, False),
        'Range': (MatchRange, False),
        'Regex': (basestring, False),
        'Suffix': (basestring, False),
    }


class GrpcRouteMetadata(AWSProperty):
    props = {
        'Invert': (boolean, False),
        'Match': (GrpcRouteMetadataMatchMethod, False),
        'Name': (basestring, True),
    }


class GrpcRouteMatch(AWSProperty):
    props = {
        'Metadata': ([GrpcRouteMetadata], False),
        'MethodName': (basestring, False),
        'ServiceName': (basestring, False),
    }


class GrpcRoute(AWSProperty):
    props = {
        'Action': (GrpcRouteAction, True),
        'Match': (GrpcRouteMatch, True),
        'RetryPolicy': (GrpcRetryPolicy, False),
    }


class HttpRetryPolicy(AWSProperty):
github cloudtools / troposphere / troposphere / ecs.py View on Github external
class HostEntry(AWSProperty):
    props = {
        'Hostname': (basestring, True),
        'IpAddress': (basestring, True),
    }


class Device(AWSProperty):
    props = {
        'ContainerPath': (basestring, False),
        'HostPath': (basestring, False),
        'Permissions': ([basestring], False),
    }


class FirelensConfiguration(AWSProperty):
    props = {
        'Options': (dict, False),
        'Type': (basestring, True),
    }


class HealthCheck(AWSProperty):
    props = {
        'Command': ([basestring], True),
        'Interval': (integer, False),
        'Retries': (integer, False),
        'StartPeriod': (integer, False),
        'Timeout': (integer, False),
    }
github cloudtools / troposphere / troposphere / dynamodb2.py View on Github external
def key_type_validator(x):
    valid_types = ["HASH", "RANGE"]
    if x not in valid_types:
        raise ValueError("KeyType must be one of: %s" % ", ".join(valid_types))
    return x


def projection_type_validator(x):
    valid_types = ["KEYS_ONLY", "INCLUDE", "ALL"]
    if x not in valid_types:
        raise ValueError("ProjectionType must be one of: %s" %
                         ", ".join(valid_types))
    return x


class AttributeDefinition(AWSProperty):
    props = {
        "AttributeName": (basestring, True),
        "AttributeType": (attribute_type_validator, True),
    }


class KeySchema(AWSProperty):
    props = {
        "AttributeName": (basestring, True),
        "KeyType": (key_type_validator, True)
    }


class Key(KeySchema):
    """ For backwards compatibility. """
    pass
github cloudtools / troposphere / troposphere / events.py View on Github external
'LaunchType': (basestring, False),
        'NetworkConfiguration': (NetworkConfiguration, False),
        'PlatformVersion': (basestring, False),
        'TaskCount': (integer, False),
        'TaskDefinitionArn': (basestring, True),
    }


class InputTransformer(AWSProperty):
    props = {
        'InputPathsMap': (dict, False),
        'InputTemplate': (basestring, True),
    }


class KinesisParameters(AWSProperty):
    props = {
        'PartitionKeyPath': (basestring, True),
    }


class RunCommandTarget(AWSProperty):
    props = {
        'Key': (basestring, True),
        'Values': ([basestring], True),
    }


class RunCommandParameters(AWSProperty):
    props = {
        'RunCommandTargets': ([RunCommandTarget], True),
    }
github cloudtools / troposphere / troposphere / firehose.py View on Github external
class ProcessorParameter(AWSProperty):
    props = {
        'ParameterName': (basestring, True),
        'ParameterValue': (basestring, True),
    }


class Processor(AWSProperty):
    props = {
        'Parameters': ([ProcessorParameter], True),
        'Type': (processor_type_validator, True),
    }


class ProcessingConfiguration(AWSProperty):
    props = {
        'Enabled': (boolean, True),
        'Processors': ([Processor], True),
    }


class ElasticsearchDestinationConfiguration(AWSProperty):
    props = {
        'BufferingHints': (BufferingHints, True),
        'CloudWatchLoggingOptions': (CloudWatchLoggingOptions, False),
        'DomainARN': (basestring, True),
        'IndexName': (basestring, True),
        'IndexRotationPeriod': (index_rotation_period_validator, True),
        'ProcessingConfiguration': (ProcessingConfiguration, False),
        'RetryOptions': (RetryOptions, False),
        'RoleARN': (basestring, True),
github cloudtools / troposphere / troposphere / dynamodb.py View on Github external
}


class PointInTimeRecoverySpecification(AWSProperty):
    props = {
        'PointInTimeRecoveryEnabled': (boolean, False),
    }


class StreamSpecification(AWSProperty):
    props = {
        'StreamViewType': (basestring, True),
    }


class TimeToLiveSpecification(AWSProperty):
    props = {
        'AttributeName': (basestring, True),
        'Enabled': (boolean, True),
    }


class Table(AWSObject):
    resource_type = "AWS::DynamoDB::Table"

    props = {
        'AttributeDefinitions': ([AttributeDefinition], True),
        'BillingMode': (billing_mode_validator, False),
        'GlobalSecondaryIndexes': ([GlobalSecondaryIndex], False),
        'KeySchema': ([KeySchema], True),
        'LocalSecondaryIndexes': ([LocalSecondaryIndex], False),
        'PointInTimeRecoverySpecification':
github cloudtools / troposphere / troposphere / greengrass.py View on Github external
props = {
        'CoreDefinitionId': (basestring, True),
        'Cores': ([Core], True),
    }


class Device(AWSProperty):
    props = {
        'CertificateArn': (basestring, True),
        'Id': (basestring, True),
        'SyncShadow': (boolean, False),
        'ThingArn': (basestring, True),
    }


class DeviceDefinitionVersion(AWSProperty):
    props = {
        'Devices': ([Device], True),
    }


class DeviceDefinition(AWSObject):
    resource_type = "AWS::Greengrass::DeviceDefinition"

    props = {
        'InitialVersion': (DeviceDefinitionVersion, False),
        'Name': (basestring, True),
        'Tags': (dict, False),
    }


class DeviceDefinitionVersion(AWSObject):
github cloudtools / troposphere / troposphere / cloudformation.py View on Github external
'context': (InitFileContext, False)
    }


class InitFiles(AWSHelperFn):
    def __init__(self, data):
        self.validate(data)
        self.data = data

    def validate(self, data):
        for k in data:
            if not isinstance(data[k], InitFile):
                raise ValueError("File '" + k + "' must be of type InitFile")


class InitService(AWSProperty):
    props = {
        'ensureRunning': (boolean, False),
        'enabled': (boolean, False),
        'files': (list, False),
        'packages': (dict, False),
        'sources': (list, False),
        'commands': (list, False)
    }


class InitServices(AWSHelperFn):
    def __init__(self, data):
        self.validate(data)
        self.data = data

    def validate(self, data):