Skip to content

Commit

Permalink
Merge pull request #1585 from axelpavageau/feature/20200213-transfer
Browse files Browse the repository at this point in the history
adding new Transfer properties, per 2020 Feb 13 update
  • Loading branch information
markpeek committed Feb 22, 2020
2 parents 469a567 + d108930 commit f1c9394
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion troposphere/transfer.py
Original file line number Diff line number Diff line change
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

0 comments on commit f1c9394

Please sign in to comment.