moto icon indicating copy to clipboard operation
moto copied to clipboard

FEATURE REQUEST: Amazon Managed Prometheus (AMP) Coverage

Open amp5208 opened this issue 2 years ago • 0 comments

Currently, AMP is not covered by Moto. For mock unit testing of boto-managed units/specs, as an automation engineer, I want to be able to unit test Amazon Managed Prometheus (AMP) services, specifically the following, to ensure independent unit test coverage of scripts / automation that use AMP:

Expected behavior (in PyTest):

conftest.py

from moto import mock_amp

@pytest.fixture
def aws_credentials():
    """Mocked AWS Credentials for moto."""
    os.environ["AWS_ACCESS_KEY_ID"] = "testing"
    os.environ["AWS_SECRET_ACCESS_KEY"] = "testing"
    os.environ["AWS_SECURITY_TOKEN"] = "testing"
    os.environ["AWS_SESSION_TOKEN"] = "testing"

@pytest.fixture
def amp_client(aws_credentials):
    with mock_amp():
        conn = boto3.client("amp")
        yield conn

... and in test file:

import pytest
import boto3.amp

@pytest.fixture()
def mock_amp_workspace(amp_client):
    workspace = amp_client.create_workspace(
         alias='fake_amp_workspace'
    )
    yield workspace

amp5208 avatar Aug 05 '22 19:08 amp5208