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

adding new Transfer properties, per 2020 Feb 13 update #1585

Merged
merged 1 commit into from Feb 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 25 additions & 1 deletion troposphere/transfer.py
Expand Up @@ -12,9 +12,24 @@
from troposphere import Tags


VALID_HOMEDIRECTORY_TYPE = ('LOGICAL', 'PATH')


def validate_homedirectory_type(homedirectory_type):
"""Validate HomeDirectoryType for User"""

if homedirectory_type not in VALID_HOMEDIRECTORY_TYPE: # NOQA
raise ValueError("User HomeDirectoryType must be one of: %s" % # NOQA
", ".join(VALID_HOMEDIRECTORY_TYPE))
return homedirectory_type


class EndpointDetails(AWSProperty):
props = {
'VpcEndpointId': (basestring, True),
'AddressAllocationIds': ([basestring], False),
'SubnetIds': ([basestring], False),
'VpcEndpointId': (basestring, False),
'VpcId': (basestring, False),
}


Expand All @@ -38,11 +53,20 @@ class Server(AWSObject):
}


class HomeDirectoryMapEntry(AWSProperty):
props = {
'Entry': (basestring, True),
'Target': (basestring, True),
}


class User(AWSObject):
resource_type = "AWS::Transfer::User"

props = {
'HomeDirectory': (basestring, False),
'HomeDirectoryMappings': ([HomeDirectoryMapEntry], False),
'HomeDirectoryType': (validate_homedirectory_type, False),
'Policy': (basestring, False),
'Role': (basestring, True),
'ServerId': (basestring, True),
Expand Down