@pytest.mark.parametrize('attr,should', {
    'ami': 'ami-fe100a96',
    'availability_zone': 'us-east-1e',
    'ebs_block_device': [{
        'delete_on_termination': 'false',
        'device_name': 'xvdh',
        'encrypted': 'false',
        'iops': '300',
        'snapshot_id': '',
        'volume_size': '100',
        'volume_type': 'gp2',
    }],
    'ebs_optimized': False,
    'ephemeral_block_device': [],
    'id': 'i-c99f6f60',
    'key_name': 'key-mi',
    'private': {'ip': '10.0.152.191', 'dns': 'ip-10-0-152-191.ec2.internal'},
    'public': {
        'ip': '52.7.74.115', 'dns': 'ec2-52-7-74-115.compute-1.amazonaws.com'
    },
    'role': 'control',
    'root_block_device': [{
        'volume_size': '6', 'iops': '18', 'delete_on_termination': 'true',
        'volume_type': 'gp2'
    }],
    'security_groups': [],
    'subnet': {'id': 'subnet-1155c03a'},
    'tags': {
        'sshUser': 'ec2-user', 'role': 'control', 'dc': 'aws', 'Name':
        'mi-control-01'
    },
    'tenancy': 'default',
    'vpc_security_group_ids': ['sg-9c360cf8', 'sg-9d360cf9'],
    # ansible
    'ansible_ssh_host': '52.7.74.115',
    'ansible_ssh_port': 22,
    'ansible_ssh_user': 'ec2-user',
    # mi
    'consul_dc': 'aws',
    # generic
    'private_ipv4': '10.0.152.191',
    'public_ipv4': '52.7.74.115',
    'provider': 'aws',
}.items())
def test_attrs(aws_resource, aws_host, attr, should):
    _, attrs, _ = aws_host(aws_resource, 'module_name')
    assert attr in attrs
    assert attrs[attr] == should
dataset/ETHPy150Open CiscoCloud/terraform.py/tests/test_aws.py/test_attrs/original