diff --git a/.changes/next-release/37309442039-enhancement-SQS-77311.json b/.changes/next-release/37309442039-enhancement-SQS-77311.json
new file mode 100644
index 0000000..9201f24
--- /dev/null
+++ b/.changes/next-release/37309442039-enhancement-SQS-77311.json
@@ -0,0 +1,5 @@
+{
+  "type": "enhancement",
+  "category": "SQS",
+  "description": "Validate queue name is used and not queue URL or ARN (#1388)"
+}
diff --git a/chalice/deploy/validate.py b/chalice/deploy/validate.py
index fcc974d..afbfff5 100644
--- a/chalice/deploy/validate.py
+++ b/chalice/deploy/validate.py
@@ -47,6 +47,7 @@ def validate_configuration(config):
     validate_feature_flags(config.chalice_app)
     validate_endpoint_type(config)
     validate_resource_policy(config)
+    validate_sqs_configuration(config.chalice_app)
 
 
 def validate_resource_policy(config):
@@ -231,3 +232,26 @@ def _get_all_function_names(chalice_app):
         yield event.name
     for function in chalice_app.pure_lambda_functions:
         yield function.name
+
+
+def validate_sqs_configuration(chalice_app):
+    # type: (app.Chalice) -> None
+    for event in chalice_app.event_sources:
+        if not isinstance(event, app.SQSEventConfig):
+            continue
+        if not _is_valid_queue_name(event.queue):
+            raise ValueError("The 'queue' parameter for the "
+                             "'@app.on_sqs_message()' handler must be the "
+                             "name of the queue, not the queue URL or the "
+                             "queue ARN.  Invalid value: %s" % event.queue)
+
+
+def _is_valid_queue_name(queue_name):
+    # type: (str) -> bool
+    if queue_name.startswith(('https:', 'arn:')):
+        return False
+    # We're not validating that the queue has only valid chars because SQS
+    # won't let you create a queue with that name in the first place.  We just
+    # want to detect the case where a user puts the queue URL/ARN instead of
+    # the name.
+    return True

misleading error message when queue name in @app.on_sqs_message has invalid chars
When using @app.on_sqs_message, I'm unexpectedly receiving "The provided execution role does not have permissions to call ReceiveMessage on SQS".

After a lengthy investigation I determined the error occurred because I had specified the full queueUrl instead of just the queue name.

Chalice framework should validate the queue name in order to avoid generating this incorrect error message.
diff --git a/tests/unit/deploy/test_validate.py b/tests/unit/deploy/test_validate.py
index 8e9ab08..0ea1466 100644
--- a/tests/unit/deploy/test_validate.py
+++ b/tests/unit/deploy/test_validate.py
@@ -319,3 +319,15 @@ def test_valid_minimum_compression_size(sample_app):
     config = Config.create(chalice_app=sample_app,
                            minimum_compression_size=1)
     assert validate_configuration(config) is None
+
+
+def test_validate_sqs_queue_name(sample_app):
+
+    @sample_app.on_sqs_message(
+        queue='https://sqs.us-west-2.amazonaws.com/12345/myqueue')
+    def handler(event):
+        pass
+
+    config = Config.create(chalice_app=sample_app)
+    with pytest.raises(ValueError):
+        validate_configuration(config)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.9
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==2.3.3
attrs==19.3.0
boto3==1.9.188
botocore==1.12.253
certifi==2025.1.31
-e git+https://github.com/aws/chalice.git@4516ceae5de96076200296fab9fd53336439b677#egg=chalice
chardet==3.0.4
click==7.1.2
coverage==4.5.4
distlib==0.3.9
doc8==0.8.0
docutils==0.15.2
entrypoints==0.3
enum-compat==0.0.3
exceptiongroup==1.2.2
execnet==2.1.1
filelock==3.18.0
flake8==3.7.9
hypothesis==4.43.1
idna==2.7
importlib-metadata==8.6.1
iniconfig==2.1.0
isort==4.3.21
jmespath==0.10.0
lazy-object-proxy==1.4.3
mccabe==0.6.1
mock==2.0.0
more-itertools==10.6.0
mypy==0.740
mypy-extensions==0.4.4
packaging==24.2
pbr==6.1.1
platformdirs==4.3.7
pluggy==1.5.0
py==1.5.3
pycodestyle==2.5.0
pydocstyle==2.0.0
pyflakes==2.1.1
Pygments==2.1.3
pylint==2.4.4
pytest==8.3.5
pytest-asyncio==0.26.0
pytest-cov==2.8.1
pytest-mock==3.14.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
requests==2.20.0
restructuredtext-lint==1.4.0
s3transfer==0.2.1
six==1.17.0
snowballstemmer==2.2.0
stevedore==5.4.1
tomli==2.2.1
tox==3.0.0
typed-ast==1.4.3
typing-extensions==4.13.0
urllib3==1.24.3
virtualenv==20.29.3
wcwidth==0.2.13
websocket-client==0.54.0
wrapt==1.11.2
zipp==3.21.0

name: chalice
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==2.3.3
      - attrs==19.3.0
      - boto3==1.9.188
      - botocore==1.12.253
      - certifi==2025.1.31
      - chardet==3.0.4
      - click==7.1.2
      - coverage==4.5.4
      - distlib==0.3.9
      - doc8==0.8.0
      - docutils==0.15.2
      - entrypoints==0.3
      - enum-compat==0.0.3
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - filelock==3.18.0
      - flake8==3.7.9
      - hypothesis==4.43.1
      - idna==2.7
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - isort==4.3.21
      - jmespath==0.10.0
      - lazy-object-proxy==1.4.3
      - mccabe==0.6.1
      - mock==2.0.0
      - more-itertools==10.6.0
      - mypy==0.740
      - mypy-extensions==0.4.4
      - packaging==24.2
      - pbr==6.1.1
      - pip==20.0.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - py==1.5.3
      - pycodestyle==2.5.0
      - pydocstyle==2.0.0
      - pyflakes==2.1.1
      - pygments==2.1.3
      - pylint==2.4.4
      - pytest==8.3.5
      - pytest-asyncio==0.26.0
      - pytest-cov==2.8.1
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - requests==2.20.0
      - restructuredtext-lint==1.4.0
      - s3transfer==0.2.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - stevedore==5.4.1
      - tomli==2.2.1
      - tox==3.0.0
      - typed-ast==1.4.3
      - typing-extensions==4.13.0
      - urllib3==1.24.3
      - virtualenv==20.29.3
      - wcwidth==0.2.13
      - websocket-client==0.54.0
      - wheel==0.26.0
      - wrapt==1.11.2
      - zipp==3.21.0
prefix: /opt/conda/envs/chalice

tests/unit/deploy/test_validate.py::test_validate_sqs_queue_name
tests/unit/deploy/test_validate.py::test_python_version_is_valid
tests/unit/deploy/test_validate.py::test_trailing_slash_routes_result_in_error tests/unit/deploy/test_validate.py::test_empty_route_results_in_error tests/unit/deploy/test_validate.py::test_validate_python_version_invalid tests/unit/deploy/test_validate.py::test_python_version_invalid_from_real_config tests/unit/deploy/test_validate.py::test_manage_iam_role_false_requires_role_arn tests/unit/deploy/test_validate.py::test_validation_error_if_no_role_provided_when_manage_false tests/unit/deploy/test_validate.py::test_validate_unique_lambda_function_names tests/unit/deploy/test_validate.py::test_validate_names_across_function_types tests/unit/deploy/test_validate.py::test_validate_names_using_name_kwarg tests/unit/deploy/test_validate.py::TestValidateCORS::test_cant_have_options_with_cors tests/unit/deploy/test_validate.py::TestValidateCORS::test_cant_have_differing_cors_configurations tests/unit/deploy/test_validate.py::TestValidateCORS::test_can_have_same_cors_configurations tests/unit/deploy/test_validate.py::TestValidateCORS::test_can_have_same_custom_cors_configurations tests/unit/deploy/test_validate.py::TestValidateCORS::test_can_have_one_cors_configured_and_others_not tests/unit/deploy/test_validate.py::test_cant_have_mixed_content_types tests/unit/deploy/test_validate.py::test_can_validate_updated_custom_binary_types tests/unit/deploy/test_validate.py::test_can_validate_resource_policy tests/unit/deploy/test_validate.py::test_can_validate_endpoint_type tests/unit/deploy/test_validate.py::test_can_validate_feature_flags tests/unit/deploy/test_validate.py::test_validation_error_if_minimum_compression_size_not_int tests/unit/deploy/test_validate.py::test_validation_error_if_minimum_compression_size_invalid_int tests/unit/deploy/test_validate.py::test_valid_minimum_compression_size
chalice/deploy/validate.py .changes/next-release/37309442039-enhancement-SQS-77311.json
chalice/deploy/validate.py .changes/next-release/37309442039-enhancement-SQS-77311.json