Skip to content

Commit

Permalink
Resource updates for 2016-10-06 changes (Fixes #584)
Browse files Browse the repository at this point in the history
  • Loading branch information
markpeek committed Oct 8, 2016
1 parent 51cf7f4 commit f80b1c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion troposphere/apigateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Authorizer(AWSObject):
"IdentitySource": (basestring, True),
"IdentityValidationExpression": (basestring, False),
"Name": (basestring, True),
"ProviderARNs": ([basestring], False),
"RestApiId": (basestring, False),
"Type": (basestring, True)
}
Expand Down Expand Up @@ -118,7 +119,7 @@ class Deployment(AWSObject):
"Description": (basestring, False),
"RestApiId": (basestring, True),
"StageDescription": (StageDescription, False),
"StageName": (basestring, True)
"StageName": (basestring, False)
}


Expand Down
12 changes: 12 additions & 0 deletions troposphere/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class SecurityGroupEgress(AWSObject):

props = {
'CidrIp': (basestring, False),
'DestinationPrefixListId': (basestring, False),
'DestinationSecurityGroupId': (basestring, False),
'FromPort': (network_port, True),
'GroupId': (basestring, True),
Expand All @@ -317,6 +318,17 @@ class SecurityGroupEgress(AWSObject):
'SourceSecurityGroupId': (basestring, False),
}

def validate(self):
conds = [
'CidrIp',
'DestinationPrefixListId',
'DestinationSecurityGroupId',
]
seen = set([c for c in conds if c in self.properties])
if len(seen) > 1:
raise ValueError(('SecurityGroupEgress: only one of the following'
' can be specified: %s') % ', '.join(conds))


class SecurityGroupIngress(AWSObject):
resource_type = "AWS::EC2::SecurityGroupIngress"
Expand Down
2 changes: 2 additions & 0 deletions troposphere/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ class DBInstance(AWSObject):
'DBSecurityGroups': (list, False),
'DBSnapshotIdentifier': (basestring, False),
'DBSubnetGroupName': (basestring, False),
'Domain': (basestring, False),
'DomainIAMRoleName': (basestring, False),
'Engine': (validate_engine, False),
'EngineVersion': (basestring, False),
'Iops': (validate_iops, False),
Expand Down

0 comments on commit f80b1c9

Please sign in to comment.