Beispiel #1
0
        EnumDyField.data_source('IPv6 Support',
                                'data.is_ipv6_enabled',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                }),
        DateTimeDyField.data_source('Last Modified', 'data.last_modified_time')
    ])

alias_icp_recordals = SimpleTableDynamicLayout.set_fields(
    'Alias ICP Recordals',
    'data.alias_icp_recordals',
    fields=[
        TextDyField.data_source('CNAME', 'cname'),
        EnumDyField.data_source('Status',
                                'icp_recordal_status',
                                default_state={
                                    'safe': ['APPROVED'],
                                    'alert': ['SUSPENDED'],
                                    'warning': ['PENDING']
                                }),
    ])

origin = TableDynamicLayout.set_fields(
    'Origins',
    'data.origins.items',
    fields=[
        TextDyField.data_source('Id', 'id'),
        TextDyField.data_source('DomainName', 'domain_name'),
        TextDyField.data_source('OriginPath', 'origin_path'),
        TextDyField.data_source('Origin Shield Region',
Beispiel #2
0
sign_in_credentials = ItemDynamicLayout.set_fields('Sign-in Credentials', root_path='data.sign_in_credential',
                                                   fields=[
                                                       ListDyField.data_source('Summary', 'summary'),
                                                       EnumDyField.data_source('Console Password', 'console_password',
                                                                               default_badge={
                                                                                   'indigo.500': ['Enabled'],
                                                                                   'coral.600': ['Disabled'],
                                                                               }),
                                                       TextDyField.data_source('Assigned MFA device',
                                                                               'assigned_mfa_device'),
                                                   ])


access_key = SimpleTableDynamicLayout.set_fields('Access Keys', root_path='data.access_key', fields=[
    TextDyField.data_source('Access Key ID', 'key_id'),
    DateTimeDyField.data_source('Created At', 'create_date'),
    TextDyField.data_source('Last Used', 'last_update_date_display'),
])

ssh_codecommit = SimpleTableDynamicLayout.set_fields('SSH Keys for AWS CodeCommit', root_path='data.ssh_public_key'
                                                     , fields=[
        TextDyField.data_source('SSH Key ID', 'key_id'),
        DateTimeDyField.data_source('Uploaded At', 'upload_date'),
        EnumDyField.data_source('Status', 'status',
                                default_badge={'indigo.500': ['Active'], 'coral.600': ['Inactive']}),
    ])

https_codecommit = SimpleTableDynamicLayout.set_fields('HTTPS Git Credentials for AWS CodeCommit',
                                                       root_path='data.code_commit_credential',
                                                       fields=[
                                                           TextDyField.data_source('User Name', 'service_user_name'),
                                 fields=[
                                     EnumDyField.data_source('Enabled', 'enabled',
                                                             default_badge={
                                                                 'indigo.500': ['true'],
                                                                 'coral.600': ['false'],
                                                             }),
                                     TextDyField.data_source('Bucket', 'bucket'),
                                     TextDyField.data_source('Prefix', 'prefix'),
                                 ])

cluster_logging_meta = ListDynamicLayout.set_layouts('Cluster Logging', [cluster_broker_cloudwatchlogs,
                                                     cluster_broker_firehose, cluster_broker_s3])


cluster_tag = SimpleTableDynamicLayout.set_fields('Tags', root_path='data.tags', fields=[
    TextDyField.data_source('Key', 'key'),
    TextDyField.data_source('Value', 'value'),
])

cluster_operations = \
    TableDynamicLayout.set_fields('Operations', root_path='data.cluster_operation_info', fields=[
        TextDyField.data_source('Operation ARN', 'operation_arn'),
        TextDyField.data_source('Cluster ARN', 'cluster_arn'),
        TextDyField.data_source('Operation Type', 'operation_type'),
        TextDyField.data_source('Error Code', 'error_info.error_code'),
        TextDyField.data_source('Error', 'error_info.error_string'),
        DateTimeDyField.data_source('Creation Time', 'Creation Time'),
        DateTimeDyField.data_source('End Time', 'end_time'),
    ])


cluster_metadata = CloudServiceMeta.set_layouts([ cluster_base,
Beispiel #4
0
    TextDyField.data_source('RAM Disk ID', 'data.ramdisk_id'),
    EnumDyField.data_source('EBS Optimized', 'data.ebs_optimized', default_badge={
        'indigo.500': ['true'], 'coral.600': ['false']
    }),
    DateTimeDyField.data_source('Creation Time', 'data.created_time'),
])

# TAB - BASE - Block Devices
lc_meta_base_bd = SimpleTableDynamicLayout.set_fields('Block Devices', 'data.block_device_mappings', fields=[
    TextDyField.data_source('Device Name', 'device_name'),
    EnumDyField.data_source('Type', 'ebs.volume_type',
                            default_outline_badge=['standard', 'io1', 'gp2', 'gp3', 'st1', 'sc1']),
    SizeField.data_source('Size', 'ebs.volume_size', options={
        'source_unit': 'GB',
        'display_unit': 'GB'
    }),
    TextDyField.data_source('IOPS', 'ebs.iops'),
    EnumDyField.data_source('Delete on Termination', 'data.delete_on_termination', default_badge={
        'indigo.500': ['true'], 'coral.600': ['false']
    }),
    EnumDyField.data_source('Encrypted', 'data.encrypted', default_badge={
        'indigo.500': ['true'], 'coral.600': ['false']
    }),
])

lc_meta = CloudServiceMeta.set_layouts([lc_meta_base_lc, lc_meta_base_bd, ])


'''
LAUNCH TEMPLATE
'''
# TAB - BASE - Launch Template
    fields=[
        TextDyField.data_source('VPC Id', 'data.vpc_config.vpc_id'),
        ListDyField.data_source('Subnet IDs',
                                'data.vpc_config.subnet_ids',
                                options={'delimiter': '<br>'}),
        ListDyField.data_source('Security Group IDs',
                                'data.vpc_config.security_group_ids',
                                options={
                                    'delimiter': '<br>',
                                })
    ])

function_env = SimpleTableDynamicLayout.set_fields(
    'Environment Variables',
    'data.environment.variables',
    fields=[
        TextDyField.data_source('Key', 'key'),
        TextDyField.data_source('Value', 'value'),
    ])

function_layers = TableDynamicLayout.set_fields(
    'Layers',
    'data.layers',
    fields=[
        TextDyField.data_source('ARN', 'arn'),
        TextDyField.data_source('Name', 'name'),
        TextDyField.data_source('Code Size', 'code_size'),
    ])

function_metadata = CloudServiceMeta.set_layouts(
    layouts=[function, function_vpc, function_env, function_layers])
insight_table = ItemDynamicLayout.set_fields(
    'Insight Selectors',
    fields=[
        TextDyField.data_source('Insight Events',
                                'data.insight_selectors.insight_type')
    ])

event_selector_table = SimpleTableDynamicLayout.set_fields(
    'Event Selectors',
    'data.event_selectors',
    fields=[
        EnumDyField.data_source(
            'Read/Write Type',
            'read_write_type',
            default_outline_badge=['ReadOnly', 'WriteOnly', 'All']),
        EnumDyField.data_source('Include Management Events',
                                'include_management_events',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                })
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(
    [meta_base, insight_table, event_selector_table, tags])


class CloudTrailResource(CloudServiceResource):
    cloud_service_group = StringType(default='CloudTrail')