<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY

In Ansible **2.8.2**, the [`aws_ec2` inventory plugin](https://docs.ansible.com/ansible/latest/plugins/inventory/aws_ec2.html)
changes hyphens (`-`) to underscores (`_`) in group names, breaking playbooks
that use hyphenated group names. This behavior is absent in Ansible 2.7.6.

This issue is particularly nasty because there is no sign about the name change in the **playbook** output, it just says that no host was found in the group and hence the group is going to be skipped.

I think that this may discourage people from upgrading from 2.7 to 2.8

The only way of seeing the issue, is using `ansible-inventory`.

I would expect at least a **warning** when running the **playbook**.

It may be possible that this was introduced when the `to_safe_group_name`
function in `ansible.plugins.inventory` has been changed from

``` python
_SAFE_GROUP = re.compile("[^A-Za-z0-9_]")


# Helper methods
def to_safe_group_name(name):
    ''' Converts 'bad' characters in a string to underscores so they can be used as Ansible hosts or groups '''
    return _SAFE_GROUP.sub("_", name)

```

in [2.7.6](https://github.com/ansible/ansible/blob/1594ccf5339ea5dfd675b76a0e7d015f49a3e8e5/lib/ansible/plugins/inventory/__init__.py#L47)

to


``` python
# <snip>

from ansible.inventory.group import to_safe_group_name as original_safe

# <snip>

# Helper methods
def to_safe_group_name(name):
    # placeholder for backwards compat
    return original_safe(name, force=True, silent=True)

```

in [2.8.2](https://github.com/ansible/ansible/blob/3affc30abef7a8e1af36a1b079f3a1fd7df363e2/lib/ansible/plugins/inventory/__init__.py#L43)

It might even be that the *expected behavior* is the one implemented in version
2.8.2, but I didn't see any warning in the official documentation about this.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME

aws_ec2 inventory plugin

lib/ansible/inventory/group.py

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.8.2
  config file = /home/user/ansiblebug/ansible.cfg
  configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /nix/store/mk0vlwm3fdnlvf162vnbxfv8ckfpgxni-python2.7-ansible-2.8.2/lib/python2.7/site-packages/ansible
  executable location = /nix/store/mk0vlwm3fdnlvf162vnbxfv8ckfpgxni-python2.7-ansible-2.8.2/bin/ansible
  python version = 2.7.16 (default, Mar  2 2019, 18:34:01) [GCC 7.4.0]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
ANSIBLE_NOCOWS(/home/user/ansiblebug/ansible.cfg) = True
DEFAULT_GATHERING(/home/user/ansiblebug/ansible.cfg) = explicit
DEFAULT_LOG_PATH(/home/user/ansiblebug/ansible.cfg) = /home/user/ansiblebug/ansible.log
DEFAULT_PRIVATE_ROLE_VARS(/home/user/ansiblebug/ansible.cfg) = True
DEFAULT_ROLES_PATH(/home/user/ansiblebug/ansible.cfg) = [u'/home/user/ansiblebug/roles']
DISPLAY_SKIPPED_HOSTS(/home/user/ansiblebug/ansible.cfg) = False
INVENTORY_ENABLED(/home/user/ansiblebug/ansible.cfg) = [u'aws_ec2', u'host_list']

```

##### OS / ENVIRONMENT

- NixOS
- Ubuntu 18.04 LTS

##### STEPS TO REPRODUCE

To reproduce the issue, I have built ansible using the [Nix package
manager](https://nixos.org/nix/) to ensure I have an environment as isolated as
possible. But I have noticed the same issue with [ansible from
conda-forge](https://anaconda.org/conda-forge/ansible).

Use the provided inventory (adapted to your AWS set up) and run `ansible-inventory` on it.

##### Ansible 2.8.2 (groups are changed)

Hyphenated groups are **modified** by the `aws_ec2` plugin: `hyphenated-group`
is changed to `hyphenated_group` in the below example.


``` shell
$ ./result-2/bin/ansible --version
ansible 2.8.2
  config file = /home/user/ansiblebug/ansible.cfg
  configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /nix/store/mk0vlwm3fdnlvf162vnbxfv8ckfpgxni-python2.7-ansible-2.8.2/lib/python2.7/site-packages/ansible
  executable location = /nix/store/mk0vlwm3fdnlvf162vnbxfv8ckfpgxni-python2.7-ansible-2.8.2/bin/ansible
  python version = 2.7.16 (default, Mar  2 2019, 18:34:01) [GCC 7.4.0]
```

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->

##### Ansible 2.7.6 (groups are unchanged)

Hyphenated groups are left intact by the `aws_ec2` plugin: `hyphenated-group`
is unchanged in the below example.

``` shell
$ ./result/bin/ansible --version
ansible 2.7.6
  config file = /home/user/ansiblebug/ansible.cfg
  configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /nix/store/bp2swv0nr5miz1h6f3r63zp0wmp0cd34-python2.7-ansible-2.7.6/lib/python2.7/site-packages/ansible
  executable location = /nix/store/bp2swv0nr5miz1h6f3r63zp0wmp0cd34-python2.7-ansible-2.7.6/bin/ansible
  python version = 2.7.16 (default, Mar  2 2019, 18:34:01) [GCC 7.4.0]


$ AWS_PROFILE=myProfile ./result/bin/ansible-inventory -i hosts_aws_ec2.yml --graph
@all:
  |--@aws_ec2:
  |  |--ExampleInstance
  |--@hyphenated-group:
  |  |--ExampleInstance
  |--@ungrouped:

```


##### ACTUAL RESULTS

In ansible 2.8.2, hyphenated groups have their hyphen changed into an underscore with no warning.

``` shell
$ AWS_PROFILE=myProfile ./result-2/bin/ansible-inventory -i hosts_aws_ec2.yml --graph
@all:
  |--@aws_ec2:
  |  |--ExampleInstance
  |--@hyphenated_group:
  |  |--ExampleInstance
  |--@ungrouped:

```


""" Parses an Inventory Source"""
    TYPE = 'generator'
    _sanitize_group_name = staticmethod(to_safe_group_name)
    def __init__(self):
        super(BaseInventoryPlugin, self).__init__()
        self._options = {}
        self.inventory = None
        self.display = display
    def parse(self, inventory, loader, path, cache=True):
        ''' Populates inventory from the given data. Raises an error on any parse failure
            :arg inventory: a copy of the previously accumulated inventory data,
                 to be updated with any new data this plugin provides.
                 The inventory can be empty if no other source/plugin ran successfully.
            :arg loader: a reference to the DataLoader, which can read in YAML and JSON files,
                 it also has Vault support to automatically decrypt files.
            :arg path: the string that represents the 'inventory source',
                 normally a path to a configuration file for this inventory,
                 but it can also be a raw string for this plugin to consume
            :arg cache: a boolean that indicates if the plugin should use the cache or not
                 you can ignore if this plugin does not implement caching.
        '''
        self.loader = loader
        self.inventory = inventory
        self.templar = Templar(loader=loader)
    def verify_file(self, path):