def get_required_capabilities(data: dict):
    """
    Get capabilities for a given cloud formation template for the
    "create_stack" call
    """
    capabilities = []
    for _, config in data.get('Resources', {}).items():
        if config.get('Type').startswith('AWS::IAM'):
            if config.get('Properties', {}).get('RoleName'):
                capabilities.append('CAPABILITY_NAMED_IAM')
            else:
                capabilities.append('CAPABILITY_IAM')
    return capabilities
