Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_aws_objects(self):
result = []
modules = self._import_all_modules()
for module in modules:
for name in dir(module):
obj = getattr(module, name)
if (
isinstance(obj, type) and
obj != AWSObject and
issubclass(obj, AWSObject)
):
result.append(obj)
return result
'StartingPosition': (starting_position_validator, True),
'BatchSize': (positive_integer, False)
}
class ApiEvent(AWSObject):
resource_type = 'Api'
props = {
'Path': (basestring, True),
'Method': (basestring, True),
'RestApiId': (basestring, False)
}
class ScheduleEvent(AWSObject):
resource_type = 'Schedule'
props = {
'Schedule': (basestring, True),
'Input': (basestring, False)
}
class CloudWatchEvent(AWSObject):
resource_type = 'CloudWatchEvent'
props = {
'Pattern': (dict, True),
'Input': (basestring, False),
'InputPath': (basestring, False)
}
class Connector(AWSProperty):
props = {
'ConnectorArn': (basestring, True),
'Id': (basestring, True),
'Parameters': (dict, False),
}
class ConnectorDefinitionVersion(AWSProperty):
props = {
'Connectors': ([Connector], True),
}
class ConnectorDefinition(AWSObject):
resource_type = "AWS::Greengrass::ConnectorDefinition"
props = {
'InitialVersion': (ConnectorDefinitionVersion, False),
'Name': (basestring, True),
'Tags': (dict, False),
}
class ConnectorDefinitionVersion(AWSObject):
resource_type = "AWS::Greengrass::ConnectorDefinitionVersion"
props = {
'ConnectorDefinitionId': (basestring, True),
'Connectors': ([Connector], True),
}
#
# See LICENSE file for full license.
import re
from . import AWSObject, AWSProperty, Tags
from .validators import boolean, integer, network_port
def validate_node_group_id(node_group_id):
if re.match(r'\d{1,4}', node_group_id):
return node_group_id
raise ValueError("Invalid NodeGroupId: %s" % node_group_id)
class CacheCluster(AWSObject):
resource_type = "AWS::ElastiCache::CacheCluster"
props = {
'AutoMinorVersionUpgrade': (boolean, False),
'AZMode': (basestring, False),
'CacheNodeType': (basestring, True),
'CacheParameterGroupName': (basestring, False),
'CacheSecurityGroupNames': ([basestring], False),
'CacheSubnetGroupName': (basestring, False),
'ClusterName': (basestring, False),
'Engine': (basestring, True),
'EngineVersion': (basestring, False),
'NotificationTopicArn': (basestring, False),
'NumCacheNodes': (integer, True),
'Port': (integer, False),
'PreferredAvailabilityZone': (basestring, False),
'ParameterGroupFamily': (basestring, True),
'Parameters': ([AmazonRedshiftParameter], False),
'Tags': (Tags, False),
}
class ClusterSecurityGroup(AWSObject):
resource_type = "AWS::Redshift::ClusterSecurityGroup"
props = {
'Description': (basestring, True),
'Tags': (Tags, False),
}
class ClusterSecurityGroupIngress(AWSObject):
resource_type = "AWS::Redshift::ClusterSecurityGroupIngress"
props = {
'ClusterSecurityGroupName': (basestring, True),
'CIDRIP': (basestring, False),
'EC2SecurityGroupName': (basestring, False),
'EC2SecurityGroupOwnerId': (basestring, False),
}
class ClusterSubnetGroup(AWSObject):
resource_type = "AWS::Redshift::ClusterSubnetGroup"
props = {
'Description': (basestring, True),
'SubnetIds': (list, True),
'PrincipalType': (basestring, True),
}
class PortfolioProductAssociation(AWSObject):
resource_type = "AWS::ServiceCatalog::PortfolioProductAssociation"
props = {
'AcceptLanguage': (basestring, False),
'PortfolioId': (basestring, True),
'ProductId': (basestring, True),
'SourcePortfolioId': (basestring, False),
}
class PortfolioShare(AWSObject):
resource_type = "AWS::ServiceCatalog::PortfolioShare"
props = {
'AcceptLanguage': (basestring, False),
'AccountId': (basestring, True),
'PortfolioId': (basestring, True),
}
def validate_tag_update(update):
valid_tag_update_values = [
"ALLOWED",
"NOT_ALLOWED",
]
if update not in valid_tag_update_values:
raise ValueError(
resource_type = "AWS::Glue::Trigger"
props = {
'Actions': ([Action], True),
'Description': (basestring, False),
'Name': (basestring, False),
'Predicate': (Predicate, False),
'Schedule': (basestring, False),
'StartOnCreation': (boolean, False),
'Tags': (dict, False),
'Type': (basestring, True),
'WorkflowName': (basestring, False),
}
class Workflow(AWSObject):
resource_type = "AWS::Glue::Workflow"
props = {
'DefaultRunProperties': (dict, False),
'Description': (basestring, False),
'Name': (basestring, False),
'Tags': (dict, False),
}
}
class OptionGroup(AWSObject):
resource_type = "AWS::RDS::OptionGroup"
props = {
'EngineName': (basestring, True),
'MajorEngineVersion': (basestring, True),
'OptionGroupDescription': (basestring, True),
'OptionConfigurations': ([OptionConfiguration], True),
'Tags': ((Tags, list), False),
}
class DBClusterParameterGroup(AWSObject):
resource_type = "AWS::RDS::DBClusterParameterGroup"
props = {
'Description': (basestring, True),
'Family': (basestring, True),
'Parameters': (dict, False),
'Tags': ((Tags, list), False),
}
class DBClusterRole(AWSProperty):
props = {
'FeatureName': (basestring, False),
'RoleArn': (basestring, True),
'Status': (basestring, False),
}
if ip_version not in ['4', '6']:
raise ValueError(
"The ip_version attribute must be "
"either 4 or 6")
if 'protocol' in self.resource:
protocol = self.resource['protocol']
if protocol not in ['tcp', 'udp', 'icmp', None]:
raise ValueError(
"The protocol attribute must be "
"either tcp, udp, icmp or None")
return True
class FloatingIP(AWSObject):
resource_type = "OS::Neutron::FloatingIP"
props = {
'fixed_ip_address': (basestring, False),
'floating_network_id': (basestring, True),
'port_id': (basestring, False),
'value_specs': (dict, False),
}
class FloatingIPAssociation(AWSObject):
resource_type = "OS::Neutron::FloatingIPAssociation"
props = {
'fixed_ip_address': (basestring, False),
'floatingip_id': (basestring, True),
'EnvironmentVariables': ([EnvironmentVariable], False),
'PullRequestEnvironmentName': (basestring, False),
'Stage': (basestring, False),
}
class CustomRule(AWSProperty):
props = {
'Condition': (basestring, False),
'Source': (basestring, True),
'Status': (basestring, False),
'Target': (basestring, True),
}
class App(AWSObject):
resource_type = "AWS::Amplify::App"
props = {
'AccessToken': (basestring, False),
'AutoBranchCreationConfig': (AutoBranchCreationConfig, False),
'BasicAuthConfig': (BasicAuthConfig, False),
'BuildSpec': (basestring, False),
'CustomRules': ([CustomRule], False),
'Description': (basestring, False),
'EnvironmentVariables': ([EnvironmentVariable], False),
'IAMServiceRole': (basestring, False),
'Name': (basestring, True),
'OauthToken': (basestring, False),
'Repository': (basestring, False),
'Tags': (Tags, False),
}