示例#1
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_instance":
         raise InvalidResource("AwsInstanceResource must be of 'aws_instance' type")
     attributes = self.primary_data['attributes']
     self.ami = attributes.get('ami', None)
     self.availability_zone = attributes.get('availability_zone', None)
     self.iam_instance_profile = attributes.get('iam_instance_profile', None)
     self.instance_type = attributes.get('instance_type', None)
     self.key_name = attributes.get('key_name', None)
     self.private_dns = attributes.get('private_dns', None)
     self.private_ip = attributes.get('private_ip', None)
     self.public_dns = attributes.get('public_dns', None)
     self.public_ip = attributes.get('public_ip', None)
     self.subnet_id = attributes.get('subnet_id', None)
     self.tenancy = attributes.get('tenancy', None)
     self.associate_public_ip_address = self.get_boolean_attribute('associate_public_ip_address')
     self.ebs_optimized = self.get_boolean_attribute('ebs_optimized')
     self.monitoring = self.get_boolean_attribute('monitoring')
     self.source_dest_check = self.get_boolean_attribute('source_dest_check')
     self.tags = self.compound_attributes.get('tags', {})
     self.ebs_block_device = self.compound_attributes.get('ebs_block_device', {})
     self.ephemeral_block_device = self.compound_attributes.get('ephemeral_block_device', {})
     self.root_block_device = self.compound_attributes.get('root_block_device', {})
     self.security_groups = self.compound_attributes.get('security_groups', {})
     self.vpc_security_group_ids = self.compound_attributes.get('vpc_security_group_ids', {})
     self.metadata = self.primary_data['meta']
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_autoscaling_group":
         raise InvalidResource("AwsAutoScalingGroupResource must be of 'aws_autoscaling_group' type")
     attributes = self.primary_data['attributes']
     self.arn = attributes.get('arn', None)
     self.availability_zones = self.compound_attributes.get('availability_zones', {})
     self.default_cooldown = attributes.get('default_cooldown', None)
     self.desired_capacity = attributes.get('desired_capacity', None)
     self.force_delete = attributes.get('force_delete', None)
     self.health_check_grace_period = attributes.get('health_check_grace_period', None)
     self.health_check_type = attributes.get('health_check_type', None)
     self.id = attributes.get('id', None)
     self.launch_configuration = attributes.get('launch_configuration', None)
     self.load_balancers = self.compound_attributes.get('load_balancers', {})
     self.max_size = attributes.get('max_size', None)
     self.metrics_granularity = attributes.get('metrics_granularity', None)
     self.min_size = attributes.get('min_size', None)
     self.name = attributes.get('name', None)
     self.placement_group = attributes.get('placement_group', None)
     self.protect_from_scale_in = attributes.get('protect_from_scale_in', None)
     self.tags = self.compound_attributes.get('tags', {})
     self.vpc_zone_identifier = self.compound_attributes.get('vpc_zone_identifier', {})
     self.wait_for_capacity_timeout = attributes.get('wait_for_capacity_timeout', None)
     self.wait_for_elb_capacity = attributes.get('wait_for_elb_capacity', None)
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_lambda_function":
         raise InvalidResource(
             "AwsLambdaFunctionResource must be of 'aws_lambda_function' type"
         )
     attributes = self.primary_data['attributes']
     self.arn = attributes.get('arn', None)
     self.description = attributes.get('description', None)
     self.environment = self.compound_attributes.get('environment', {})
     self.filename = attributes.get('filename', None)
     self.function_name = attributes.get('function_name', None)
     self.handler = attributes.get('handler', None)
     self.id = attributes.get('id', None)
     self.kms_key_arn = attributes.get('kms_key_arn', None)
     self.last_modified = attributes.get('last_modified', None)
     self.memory_size = attributes.get('memory_size', None)
     self.publish = attributes.get('publish', None)
     self.qualified_arn = attributes.get('qualified_arn', None)
     self.role = attributes.get('role', None)
     self.runtime = attributes.get('runtime', None)
     self.source_code_hash = attributes.get('source_code_hash', None)
     self.timeout = attributes.get('timeout', None)
     self.version = attributes.get('version', None)
     self.vpc_config = self.compound_attributes.get('vpc_config', {})
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_elasticache_replication_group":
         raise InvalidResource(
             "AwsElasticCacheReplicationGroupResource must be of 'aws_elasticache_replication_group' type"
         )
     attributes = self.primary_data['attributes']
     self.auto_minor_version_upgrade = attributes.get(
         'auto_minor_version_upgrade', None)
     self.automatic_failover_enabled = attributes.get(
         'automatic_failover_enabled', None)
     self.engine = attributes.get('engine', None)
     self.engine_version = attributes.get('engine_version', None)
     self.id = attributes.get('id', None)
     self.maintenance_window = attributes.get('maintenance_window', None)
     self.node_type = attributes.get('node_type', None)
     self.number_cache_clusters = attributes.get('number_cache_clusters',
                                                 None)
     self.parameter_group_name = attributes.get('parameter_group_name',
                                                None)
     self.port = attributes.get('port', None)
     self.primary_endpoint_address = attributes.get(
         'primary_endpoint_address', None)
     self.replication_group_description = attributes.get(
         'replication_group_description', None)
     self.replication_group_id = attributes.get('replication_group_id',
                                                None)
     self.security_group_ids = self.compound_attributes.get(
         'security_group_ids', {})
     self.snapshot_retention_limit = attributes.get(
         'snapshot_retention_limit', None)
     self.snapshot_window = attributes.get('snapshot_window', None)
     self.tags = self.compound_attributes.get('tags', {})
示例#5
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_elb":
         raise InvalidResource("AwsElbResource must be of 'aws_elb' type")
     attributes = self.primary_data['attributes']
     self.connection_draining = self.get_boolean_attribute(
         'connection_draining')
     self.connection_draining_timeout = attributes.get(
         'connection_draining_timeout', None)
     self.cross_zone_load_balancing = self.get_boolean_attribute(
         'cross_zone_load_balancing')
     self.dns_name = attributes.get('dns_name', None)
     self.health_check = self.compound_attributes.get('health_check', {})
     self.idle_timeout = attributes.get('idle_timeout', None)
     self.instances = self.compound_attributes.get('instances', {})
     self.internal = self.get_boolean_attribute('internal')
     self.listener = self.compound_attributes.get('listener', {})
     self.name = attributes.get('name', None)
     self.security_groups = self.compound_attributes.get(
         'security_groups', {})
     self.source_security_group = attributes.get('source_security_group',
                                                 None)
     self.subnets = self.compound_attributes.get('subnets', {})
     self.tags = self.compound_attributes.get('tags', {})
     self.zone_id = attributes.get('zone_id', None)
示例#6
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "local_file":
         raise InvalidResource(
             "LocalFileResource must be of 'local_file' type")
     attributes = self.primary_data['attributes']
     self.filename = attributes.get('content', None)
     self.content = attributes.get('filename', None)
示例#7
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_route_table_association":
         raise InvalidResource(
             "AwsRouteTableAssociationResource must be of 'aws_route_table_association' type"
         )
     attributes = self.primary_data['attributes']
     self.route_table_id = attributes.get('route_table_id', None)
     self.subnet_id = attributes.get('subnet_id', None)
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_elasticache_subnet_group":
         raise InvalidResource("AwsElasticCacheSubnetGroupResource must be of 'aws_elasticache_subnet_group' type")
     attributes = self.primary_data['attributes']
     self.description = attributes.get('description', None)
     self.id = attributes.get('id', None)
     self.name = attributes.get('name', None)
     self.subnet_ids = self.compound_attributes.get('subnet_ids', {})
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "openstack_networking_router_interface_v2":
         raise InvalidResource(
             "OSNetworkingRouterInterfaceV2 must be of 'openstack_networking_router_interface_v2' type"
         )
     attributes = self.primary_data['attributes']
     self.router_id = attributes.get('router_id', None)
     self.subnet_id = attributes.get('subnet_id', None)
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_caller_identity":
         raise InvalidResource(
             "DataAwsCallerIdentityResource must be of 'aws_caller_identity' type"
         )
     attributes = self.primary_data['attributes']
     self.account_id = attributes.get('account_id', None)
     self.id = attributes.get('id', None)
示例#11
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "template_file":
         raise InvalidResource(
             "DataTemplateFileResource must be of 'template_file' type")
     attributes = self.primary_data['attributes']
     self.template = attributes.get('template', None)
     self.rendered = attributes.get('rendered', None)
     self.vars = self.compound_attributes.get('vars', {})
    def __init__(self, resource_name, native_data):
        super().__init__(resource_name, native_data)
        if self.resource_type != "aws_internet_gateway":
            raise InvalidResource(
                "AwsInternetGatewayResource must be of 'aws_internet_gateway' type"
            )
        attributes = self.primary_data['attributes']
        self.vpc_id = attributes.get('vpc_id', None)

        self.tags = self.compound_attributes.get('tags', {})
示例#13
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "openstack_networking_secgroup_v2":
         raise InvalidResource(
             "OSNetworkingSecgroupV2 must be of 'openstack_networking_secgroup_v2' type"
         )
     attributes = self.primary_data['attributes']
     self.description = attributes.get('description', None)
     self.name = attributes.get('name', None)
     self.tenant_id = attributes.get('tenant_id', None)
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_lb_ssl_negotiation_policy":
         raise InvalidResource("AwsLBSSLNegotiationPolicyResource must be of 'aws_lb_ssl_negotiation_policy' type")
     attributes = self.primary_data['attributes']
     self.attribute = self.compound_attributes.get('attribute', {})
     self.id = attributes.get('id', None)
     self.lb_port = attributes.get('lb_port', None)
     self.load_balancer = attributes.get('load_balancer', None)
     self.name = attributes.get('name', None)
示例#15
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_proxy_protocol_policy":
         raise InvalidResource(
             "AwsProxyProtocolPolicyResource must be of 'aws_proxy_protocol_policy' type"
         )
     attributes = self.primary_data['attributes']
     self.id = attributes.get('id', None)
     self.instance_ports = self.compound_attributes.get(
         'instance_ports', {})
     self.load_balancer = attributes.get('load_balancer', None)
示例#16
0
    def __init__(self, resource_name, native_data):
        super().__init__(resource_name, native_data)
        if self.resource_type != "aws_nat_gateway":
            raise InvalidResource("AwsNatGatewayResource must be of 'aws_nat_gateway' type")

        attributes = self.primary_data['attributes']
        self.allocation_id = attributes.get('allocation_id', None)
        self.network_interface_id = attributes.get('network_interface_id', None)
        self.private_ip = attributes.get('private_ip', None)
        self.public_ip = attributes.get('public_ip', None)
        self.subnet_id = attributes.get('subnet_id', None)
示例#17
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "openstack_networking_network_v2":
         raise InvalidResource(
             "OSNetworkingNetworkV2 must be of 'openstack_networking_network_v2' type"
         )
     attributes = self.primary_data['attributes']
     self.name = attributes.get('name', None)
     self.tenant_id = attributes.get('tenant_id', None)
     self.admin_state_up = self.get_boolean_attribute('admin_state_up')
     self.shared = self.get_boolean_attribute('shared')
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "openstack_compute_floatingip_v2":
         raise InvalidResource(
             "OSComputeFloatingIPV2 must be of 'openstack_compute_floatingip_v2' type"
         )
     attributes = self.primary_data['attributes']
     self.address = attributes.get('address', None)
     self.fixed_ip = attributes.get('fixed_ip', None)
     self.instance_id = attributes.get('instance_id', None)
     self.pool = attributes.get('pool', None)
示例#19
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_sns_topic":
         raise InvalidResource(
             "AwsSnsTopicResource must be of 'aws_sns_topic' type")
     attributes = self.primary_data['attributes']
     self.arn = attributes.get('arn', None)
     self.display_name = attributes.get('display_name', None)
     self.id = attributes.get('id', None)
     self.name = attributes.get('name', None)
     self.policy = attributes.get('policy', None)
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_lambda_permission":
         raise InvalidResource("AwsLambdaPermissionResource must be of 'aws_lambda_permission' type")
     attributes = self.primary_data['attributes']
     self.action = attributes.get('action', None)
     self.function_name = attributes.get('function_name', None)
     self.id = attributes.get('id', None)
     self.principal = attributes.get('principal', None)
     self.source_arn = attributes.get('source_arn', None)
     self.statement_id = attributes.get('statement_id', None)
示例#21
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_autoscaling_notification":
         raise InvalidResource(
             "AwsAutoscalingNotificationResource must be of 'aws_autoscaling_notification' type"
         )
     attributes = self.primary_data['attributes']
     self.id = attributes.get('id', None)
     self.topic_arn = attributes.get('topic_arn', None)
     self.notifications = self.compound_attributes.get('notifications', {})
     self.group_names = self.compound_attributes.get('group_names', {})
示例#22
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_subnet":
         raise InvalidResource(
             "AwsSubnetResource must be of 'aws_subnet' type")
     attributes = self.primary_data['attributes']
     self.availability_zone = attributes.get('availability_zone', None)
     self.cidr_block = attributes.get('cidr_block', None)
     self.vpc_id = attributes.get('vpc_id', None)
     self.map_public_ip_on_launch = self.get_boolean_attribute(
         'map_public_ip_on_launch')
     self.tags = self.compound_attributes.get('tags', {})
示例#23
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_vpc_peering_connection":
         raise InvalidResource(
             "AwsVpcPeeringConnectionResource must be of 'aws_vpc_peering_connection' type"
         )
     attributes = self.primary_data['attributes']
     self.accept_status = attributes.get('accept_status', None)
     self.peer_owner_id = attributes.get('peer_owner_id', None)
     self.peer_vpc_id = attributes.get('peer_vpc_id', None)
     self.vpc_id = attributes.get('vpc_id', None)
     self.tags = self.compound_attributes.get('tags', {})
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_eip_association":
         raise InvalidResource(
             "AwsEipAssociation must be of 'aws_eip_association' type")
     attributes = self.primary_data['attributes']
     self.allocation_id = attributes.get('allocation_id', None)
     self.instance_id = attributes.get('instance_id', None)
     self.network_interface_id = attributes.get('network_interface_id',
                                                None)
     self.private_ip_address = attributes.get('private_ip_address', None)
     self.public_ip = attributes.get('public_ip', None)
示例#25
0
    def __init__(self, resource_name, native_data):
        super().__init__(resource_name, native_data)
        if self.resource_type != "aws_route_table":
            raise InvalidResource(
                "AwsRouteTableResource must be of 'aws_route_table' type")
        attributes = self.primary_data['attributes']
        self.vpc_id = attributes.get('vpc_id', None)

        self.tags = self.compound_attributes.get('tags', {})
        self.routes = self.compound_attributes.get('route', {})
        self.propagating_vgws = self.compound_attributes.get(
            'propagating_vgws', {})
示例#26
0
    def __init__(self, resource_name, native_data):
        super().__init__(resource_name, native_data)
        if self.resource_type != "aws_eip":
            raise InvalidResource("AwsEipResource must be of 'aws_eip' type")

        attributes = self.primary_data['attributes']
        self.association_id = attributes.get('association_id', None)
        self.domain = attributes.get('domain', None)
        self.instance = attributes.get('instance', None)
        self.network_interface = attributes.get('network_interface', None)
        self.private_ip = attributes.get('private_ip', None)
        self.public_ip = attributes.get('public_ip', None)
        self.vpc = attributes.get('vpc', None)
    def __init__(self, resource_name, native_data):
        super().__init__(resource_name, native_data)
        if self.resource_type != "aws_iam_server_certificate":
            raise InvalidResource(
                "AwsIamServerCertificateResource must be of 'aws_iam_server_certificate' type"
            )

        attributes = self.primary_data['attributes']
        self.arn = attributes.get('arn', None)
        self.certificate_body = attributes.get('certificate_body', None)
        self.name = attributes.get('name', None)
        self.path = attributes.get('path', None)
        self.private_key = attributes.get('private_key', None)
示例#28
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_security_group":
         raise InvalidResource(
             "DataAwsSecurityGroupResource must be of 'aws_security_group' type"
         )
     attributes = self.primary_data['attributes']
     self.arn = attributes.get('arn', None)
     self.description = attributes.get('description', None)
     self.id = attributes.get('id', None)
     self.name = attributes.get('name', None)
     self.tags = self.compound_attributes.get('tags', {})
     self.vpc_id = attributes.get('vpc_id', {})
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "aws_route53_record":
         raise InvalidResource(
             "AwsRoute53RecordResource must be of 'aws_route53_record' type"
         )
     attributes = self.primary_data['attributes']
     self.fqdn = attributes.get('fqdn', None)
     self.health_check_id = attributes.get('health_check_id', None)
     self.id = attributes.get('id', None)
     self.name = attributes.get('name', None)
     self.set_identifier = attributes.get('set_identifier', None)
     self.ttl = attributes.get('ttl', None)
     self.type = attributes.get('type', None)
     self.zone_id = attributes.get('zone_id', None)
示例#30
0
 def __init__(self, resource_name, native_data):
     super().__init__(resource_name, native_data)
     if self.resource_type != "archive_file":
         raise InvalidResource(
             "ArchiveFileResource must be of 'archive_file' type")
     attributes = self.primary_data['attributes']
     self.id = attributes.get('id', None)
     self.output_base64sha256 = attributes.get('output_base64sha256', None)
     self.output_path = attributes.get('output_path', None)
     self.output_sha = attributes.get('output_sha', None)
     self.output_size = attributes.get('output_size', None)
     self.source_content = attributes.get('source_content', None)
     self.source_content_filename = attributes.get(
         'source_content_filename', None)
     self.type = attributes.get('type', None)