def test_secure_ssm_parameter_delete():
    lambda_custom_resource.create(event, context)

    response = ssm.get_parameter('/parameter/store/test/key')
    assert (response['Parameter']) is not None

    lambda_custom_resource.delete(event, context)

    # testing the exception after the parameter is deleted and we try _get_ function
    try:
        ssm.get_parameter('/parameter/store/test/key')
        raise RuntimeError(
            'As this parameter has been deleted, this should fail')
    except botocore.exceptions.ClientError as err:
        assert err.operation_name == 'GetParameter'
def test_delete_get_prefix_list_arns():
    response = delete(event, context)
    assert response is None
def test_create_delete_org_id_as_principal():
    lambda_custom_resource.create(event_with_org_arn, context)
    lambda_custom_resource.delete(event_with_org_arn, context)
def test_create_delete_both_as_principal():
    lambda_custom_resource.create(event_with_org_arn_and_account, context)
    lambda_custom_resource.delete(event_with_org_arn_and_account, context)
def test_create_delete_account_as_principal():
    lambda_custom_resource.create(event_with_accounts, context)
    lambda_custom_resource.delete(event_with_accounts, context)