Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in get-apis command #8009

Closed
acuas opened this issue Jun 28, 2023 · 4 comments
Closed

Error in get-apis command #8009

acuas opened this issue Jun 28, 2023 · 4 comments
Assignees
Labels
apigatewayv2 bug This issue is a bug. p3 This is a minor priority issue

Comments

@acuas
Copy link

acuas commented Jun 28, 2023

Describe the bug

I encountered an error while using the get-apis command in the AWS CLI. The command was executed with the following arguments:

$ aws apigatewayv2 get-apis --region=eu-south-2

An error occurred (BadRequestException) when calling the GetApis operation: {"message": "1 validation error detected: Value \'arn:aws:lambda:eu-south-2:359345898052:function:\' at \'functionName\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_\\.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"}

I encountered the error specifically in the eu-south-2 region. However, when I switched to the eu-west-1 region, everything worked fine.

Expected Behavior

I expected the get-apis command to retrieve the APIs from the specified region without any errors.

Current Behavior

I received a validation error related to the functionName parameter, which seems to be failing the regular expression pattern check. However, I didn't provide any functionName parameter in the command.

~ aws apigatewayv2 get-apis --region=eu-south-2 --debug
2023-06-28 16:07:19,638 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.12.3 Python/3.11.4 Darwin/22.5.0 exe/x86_64
2023-06-28 16:07:19,638 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['apigatewayv2', 'get-apis', '--region=eu-south-2', '--debug']
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x11028b7e0>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x1100d1080>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x110037100>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x110050720>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x11029e2a0>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x110107a60>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x11029e160>
2023-06-28 16:07:19,675 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x11034ab10>>
2023-06-28 16:07:19,676 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/awscli/data/cli.json
2023-06-28 16:07:19,677 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x1101dd440>
2023-06-28 16:07:19,677 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x1101dd760>
2023-06-28 16:07:19,677 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x1101dd6c0>
2023-06-28 16:07:19,677 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x1101dd8a0>
2023-06-28 16:07:19,677 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x1101dd800>
2023-06-28 16:07:19,677 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x110347d00>
2023-06-28 16:07:19,677 - MainThread - botocore.session - DEBUG - Setting config variable for region to 'eu-south-2'
2023-06-28 16:07:19,677 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.12.3 Python/3.11.4 Darwin/22.5.0 exe/x86_64 prompt/off
2023-06-28 16:07:19,678 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['apigatewayv2', 'get-apis', '--region=eu-south-2', '--debug']
2023-06-28 16:07:19,678 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x11029c180>
2023-06-28 16:07:19,678 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x10f945c60>
2023-06-28 16:07:19,678 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x11030b6a0>
2023-06-28 16:07:19,678 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x10f80ff60>
2023-06-28 16:07:19,678 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x10f95d580>
2023-06-28 16:07:19,679 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2023-06-28 16:07:19,682 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x110104220>
2023-06-28 16:07:19,682 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x1100c5300>
2023-06-28 16:07:19,694 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/awscli/botocore/data/apigatewayv2/2018-11-29/service-2.json
2023-06-28 16:07:19,700 - MainThread - botocore.hooks - DEBUG - Event building-command-table.apigatewayv2: calling handler <function add_waiters at 0x11029e160>
2023-06-28 16:07:19,711 - MainThread - botocore.hooks - DEBUG - Event building-command-table.apigatewayv2: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x11034ab10>>
2023-06-28 16:07:19,712 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('max-results', <awscli.arguments.CLIArgument object at 0x11056b890>), ('next-token', <awscli.arguments.CLIArgument object at 0x11056ba10>)])
2023-06-28 16:07:19,712 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.apigatewayv2.get-apis: calling handler <function add_streaming_output_arg at 0x11029c680>
2023-06-28 16:07:19,712 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.apigatewayv2.get-apis: calling handler <function add_cli_input_json at 0x10f95dee0>
2023-06-28 16:07:19,712 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.apigatewayv2.get-apis: calling handler <function add_cli_input_yaml at 0x10f95df80>
2023-06-28 16:07:19,712 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.apigatewayv2.get-apis: calling handler <function unify_paging_params at 0x1100d16c0>
2023-06-28 16:07:19,723 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/awscli/botocore/data/apigatewayv2/2018-11-29/paginators-1.json
2023-06-28 16:07:19,724 - MainThread - awscli.customizations.paginate - DEBUG - Modifying paging parameters for operation: GetApis
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.apigatewayv2.get-apis: calling handler <function add_generate_skeleton at 0x1101bbc40>
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.apigatewayv2.get-apis: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x11056bdd0>>
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.apigatewayv2.get-apis: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x11056bed0>>
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.apigatewayv2.get-apis: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x110573250>>
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event building-command-table.apigatewayv2_get-apis: calling handler <function add_waiters at 0x11029e160>
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event building-command-table.apigatewayv2_get-apis: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x11034ab10>>
2023-06-28 16:07:19,724 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.apigatewayv2.get-apis: calling handler functools.partial(<function check_should_enable_pagination at 0x1100d1800>, ['next-token', 'max-results'], {}, OrderedDict([('max-results', <awscli.arguments.CLIArgument object at 0x11056b890>), ('next-token', <awscli.arguments.CLIArgument object at 0x11056ba10>), ('cli-input-json', <awscli.customizations.cliinput.CliInputJSONArgument object at 0x11056bdd0>), ('cli-input-yaml', <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x11056bed0>), ('starting-token', <awscli.customizations.paginate.PageArgument object at 0x110565dd0>), ('page-size', <awscli.customizations.paginate.PageArgument object at 0x11052c910>), ('max-items', <awscli.customizations.paginate.PageArgument object at 0x11056b8d0>), ('generate-cli-skeleton', <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x110573250>)]))
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.max-results: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.next-token: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.cli-input-json: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.cli-input-yaml: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.starting-token: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.page-size: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.max-items: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.apigateway.get-apis.generate-cli-skeleton: calling handler <awscli.paramfile.URIArgumentHandler object at 0x11037ca10>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event calling-command.apigatewayv2.get-apis: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x11056bdd0>>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event calling-command.apigatewayv2.get-apis: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x11056bed0>>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event calling-command.apigatewayv2.get-apis: calling handler <bound method GenerateCliSkeletonArgument.generate_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x110573250>>
2023-06-28 16:07:19,725 - MainThread - botocore.hooks - DEBUG - Event calling-command.apigatewayv2.get-apis: calling handler functools.partial(<function check_should_enable_pagination_call_parameters at 0x1100d1c60>, ['NextToken', 'MaxResults'])
2023-06-28 16:07:19,725 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2023-06-28 16:07:19,725 - MainThread - botocore.credentials - INFO - Found credentials in environment variables.
2023-06-28 16:07:19,726 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/awscli/botocore/data/endpoints.json
2023-06-28 16:07:19,735 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x10e5962a0>
2023-06-28 16:07:19,747 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/awscli/botocore/data/apigatewayv2/2018-11-29/endpoint-rule-set-1.json
2023-06-28 16:07:19,748 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/awscli/botocore/data/partitions.json
2023-06-28 16:07:19,748 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.apigatewayv2: calling handler <function add_generate_presigned_url at 0x10e4ee980>
2023-06-28 16:07:19,751 - MainThread - botocore.endpoint - DEBUG - Setting apigateway timeout as (60, 60)
2023-06-28 16:07:19,752 - MainThread - botocore.regions - DEBUG - Calling endpoint provider with parameters: {'Region': 'eu-south-2', 'UseDualStack': False, 'UseFIPS': False}
2023-06-28 16:07:19,752 - MainThread - botocore.regions - DEBUG - Endpoint provider result: https://apigateway.eu-south-2.amazonaws.com
2023-06-28 16:07:19,752 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.apigatewayv2.GetApis: calling handler <function base64_decode_input_blobs at 0x11030b740>
2023-06-28 16:07:19,752 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.apigatewayv2.GetApis: calling handler <function generate_idempotent_uuid at 0x10e5b0540>
2023-06-28 16:07:19,752 - MainThread - botocore.hooks - DEBUG - Event before-call.apigatewayv2.GetApis: calling handler <function inject_api_version_header_if_needed at 0x10e5b2020>
2023-06-28 16:07:19,752 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=GetApis) with params: {'url_path': '/v2/apis', 'query_string': {}, 'method': 'GET', 'headers': {'User-Agent': 'aws-cli/2.12.3 Python/3.11.4 Darwin/22.5.0 exe/x86_64 prompt/off command/apigatewayv2.get-apis'}, 'body': b'', 'url': 'https://apigateway.eu-south-2.amazonaws.com/v2/apis', 'context': {'client_region': 'eu-south-2', 'client_config': <botocore.config.Config object at 0x1109cc990>, 'has_streaming_input': False, 'auth_type': None}}
2023-06-28 16:07:19,753 - MainThread - botocore.hooks - DEBUG - Event request-created.apigatewayv2.GetApis: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x10eff2a10>>
2023-06-28 16:07:19,753 - MainThread - botocore.hooks - DEBUG - Event choose-signer.apigatewayv2.GetApis: calling handler <function set_operation_specific_signer at 0x10e5b0400>
2023-06-28 16:07:19,753 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2023-06-28 16:07:19,753 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
GET
/v2/apis

host:apigateway.eu-south-2.amazonaws.com
x-amz-date:20230628T130719Z
x-amz-security-token:IQoJb3JpZ2luX2VjEA0aCWV1LXdlc3QtMSJHMEUCIQCyQ+t7DOyxEgYVI8C3QuHCKGuOwzBg9n/bvX6qiqbFpQIgSY72TzSsZo1YHUQ7NIdqFKJf9urQk8K1q6sdEvys1z8qmgIIdhACGgwwNDQxMDI5NzEzNDMiDANeoKNnEqc2n8eEkyr3AWpJuwfwKbUjlsfC/gKJQq8Br3uY9MA8STPM2QHfyoOtXqG5ckImb0XJpf70zTHHhhUjFHvn5Fax7FqCKT8GzUWOKNILjC4NEZ+20fUimJ92noibcgd8KK6JxvG0TyC1XgyG7+INDAmEZMcp+5s9tJ83Mzw54qxJoZZ8V3K21snCNA2nnECcnH3nJrQkn6OhAVWLT6b9FAyhB/weN9WfLztp0TuRtRRzL3atv+Z/hRHS9I4z+tPluNFvtc+Ve8mIwmgOcCk2HORuIRsdApe9aVszGo1IiD6TJxRwUJti2QCXUVvA/hvnWIPSq8WvNlnfVjZGS1zcN3Iwx+DwpAY6nQFZr89GHXtOdL40PznMPFVLQK/GvgA/KdTIYUL9bIc6kFoBgGKV5fuVjQUdUVdI7yRseDfeU2DOvPzZ0ai5602nzqhZMh4Sl1JhiPKG5ry46rh1Gi6zqdujap2V2ZzBbveF6BdleUVfx1gnJ31ujze6mwJfe3dRM/ZzlEbFjvlkesP8/RQpi4L7y2YO/DIoUF0LW+dAd/1bRTh2sjNf

host;x-amz-date;x-amz-security-token
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2023-06-28 16:07:19,753 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20230628T130719Z
20230628/eu-south-2/apigateway/aws4_request
c165031044fa127077e840e091465a3c593495fef9e3d67c819a5e8199980e13
2023-06-28 16:07:19,753 - MainThread - botocore.auth - DEBUG - Signature:
30bc305cabaa0506665ad79ed17ca4c6bc11fa6f926544570c2c749905053c4e
2023-06-28 16:07:19,753 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=https://apigateway.eu-south-2.amazonaws.com/v2/apis, headers={'User-Agent': b'aws-cli/2.12.3 Python/3.11.4 Darwin/22.5.0 exe/x86_64 prompt/off command/apigatewayv2.get-apis', 'X-Amz-Date': b'20230628T130719Z', 'X-Amz-Security-Token': b'IQoJb3JpZ2luX2VjEA0aCWV1LXdlc3QtMSJHMEUCIQCyQ+t7DOyxEgYVI8C3QuHCKGuOwzBg9n/bvX6qiqbFpQIgSY72TzSsZo1YHUQ7NIdqFKJf9urQk8K1q6sdEvys1z8qmgIIdhACGgwwNDQxMDI5NzEzNDMiDANeoKNnEqc2n8eEkyr3AWpJuwfwKbUjlsfC/gKJQq8Br3uY9MA8STPM2QHfyoOtXqG5ckImb0XJpf70zTHHhhUjFHvn5Fax7FqCKT8GzUWOKNILjC4NEZ+20fUimJ92noibcgd8KK6JxvG0TyC1XgyG7+INDAmEZMcp+5s9tJ83Mzw54qxJoZZ8V3K21snCNA2nnECcnH3nJrQkn6OhAVWLT6b9FAyhB/weN9WfLztp0TuRtRRzL3atv+Z/hRHS9I4z+tPluNFvtc+Ve8mIwmgOcCk2HORuIRsdApe9aVszGo1IiD6TJxRwUJti2QCXUVvA/hvnWIPSq8WvNlnfVjZGS1zcN3Iwx+DwpAY6nQFZr89GHXtOdL40PznMPFVLQK/GvgA/KdTIYUL9bIc6kFoBgGKV5fuVjQUdUVdI7yRseDfeU2DOvPzZ0ai5602nzqhZMh4Sl1JhiPKG5ry46rh1Gi6zqdujap2V2ZzBbveF6BdleUVfx1gnJ31ujze6mwJfe3dRM/ZzlEbFjvlkesP8/RQpi4L7y2YO/DIoUF0LW+dAd/1bRTh2sjNf', 'Authorization': b'AWS4-HMAC-SHA256 Credential=ASIAQURF557H3JDVTGH7/20230628/eu-south-2/apigateway/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=30bc305cabaa0506665ad79ed17ca4c6bc11fa6f926544570c2c749905053c4e'}>
2023-06-28 16:07:19,754 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/awscli/botocore/cacert.pem
2023-06-28 16:07:19,754 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): apigateway.eu-south-2.amazonaws.com:443
2023-06-28 16:07:19,978 - MainThread - urllib3.connectionpool - DEBUG - https://apigateway.eu-south-2.amazonaws.com:443 "GET /v2/apis HTTP/1.1" 400 350
2023-06-28 16:07:19,978 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Wed, 28 Jun 2023 13:07:20 GMT', 'Content-Type': 'application/json', 'Content-Length': '350', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'b4ae94c4-600d-4357-a91b-c2cc9b6d1e0b', 'Access-Control-Allow-Origin': '*', 'x-amzn-ErrorType': 'BadRequestException', 'x-amz-apigw-id': 'HOyFTHD3ZBkF3nw='}
2023-06-28 16:07:19,979 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"message": "1 validation error detected: Value \\\'arn:aws:lambda:eu-south-2:359345898052:function:\\\' at \\\'functionName\\\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\\\d{1}:)?(\\\\d{12}:)?(function:)?([a-zA-Z0-9-_\\\\.]+)(:(\\\\$LATEST|[a-zA-Z0-9-_]+))?"}'
2023-06-28 16:07:19,980 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Wed, 28 Jun 2023 13:07:20 GMT', 'Content-Type': 'application/json', 'Content-Length': '350', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'b4ae94c4-600d-4357-a91b-c2cc9b6d1e0b', 'Access-Control-Allow-Origin': '*', 'x-amzn-ErrorType': 'BadRequestException', 'x-amz-apigw-id': 'HOyFTHD3ZBkF3nw='}
2023-06-28 16:07:19,981 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"message": "1 validation error detected: Value \\\'arn:aws:lambda:eu-south-2:359345898052:function:\\\' at \\\'functionName\\\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\\\d{1}:)?(\\\\d{12}:)?(function:)?([a-zA-Z0-9-_\\\\.]+)(:(\\\\$LATEST|[a-zA-Z0-9-_]+))?"}'
2023-06-28 16:07:19,981 - MainThread - botocore.hooks - DEBUG - Event needs-retry.apigatewayv2.GetApis: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x1109ce610>>
2023-06-28 16:07:19,981 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-06-28 16:07:19,981 - MainThread - botocore.hooks - DEBUG - Event after-call.apigatewayv2.GetApis: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x1109cdf50>>
2023-06-28 16:07:19,981 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "awscli/clidriver.py", line 460, in main
  File "awscli/clidriver.py", line 595, in __call__
  File "awscli/clidriver.py", line 798, in __call__
  File "awscli/clidriver.py", line 931, in invoke
  File "awscli/clidriver.py", line 953, in _display_response
  File "awscli/formatter.py", line 77, in __call__
  File "awscli/botocore/paginate.py", line 446, in build_full_result
  File "awscli/botocore/paginate.py", line 252, in __iter__
  File "awscli/botocore/paginate.py", line 329, in _make_request
  File "awscli/botocore/client.py", line 341, in _api_call
  File "awscli/botocore/client.py", line 697, in _make_api_call
botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the GetApis operation: {"message": "1 validation error detected: Value \'arn:aws:lambda:eu-south-2:359345898052:function:\' at \'functionName\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_\\.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"}

An error occurred (BadRequestException) when calling the GetApis operation: {"message": "1 validation error detected: Value \'arn:aws:lambda:eu-south-2:359345898052:function:\' at \'functionName\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_\\.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"}

Reproduction Steps

Execute the command aws apigatewayv2 get-apis --region=eu-south-2 --debug.

Possible Solution

No response

Additional Information/Context

The same thing is happening for get-domain-names and for get-vpc-links command:

~ aws apigatewayv2 get-domain-names --region=eu-south-2

An error occurred (BadRequestException) when calling the GetDomainNames operation: {"message": "1 validation error detected: Value \'arn:aws:lambda:eu-south-2:359345898052:function:\' at \'functionName\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_\\.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"}
~ aws apigatewayv2 get-vpc-links --region=eu-south-2

An error occurred (BadRequestException) when calling the GetVpcLinks operation: {"message": "1 validation error detected: Value \'arn:aws:lambda:eu-south-2:359345898052:function:\' at \'functionName\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_\\.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"}

CLI version used

2.12.3.

Environment details (OS name and version, etc.)

macOS Ventura, Version 13.4.1

@acuas acuas added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jun 29, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added apigatewayv2 p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jun 29, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @acuas, thanks for reaching out. Could you tell me the API type (HTTP, WebSocket, REST) of the resource that's throwing that error? I suspect this is an issue related to opt-in regions like eu-south-2 not supporting all API types.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. labels Jun 29, 2023
@acuas
Copy link
Author

acuas commented Jun 30, 2023

Hello @RyanFitzSimmonsAK, I opted in for that region. However, I don't have any resources created there, so I was expecting an empty array, similar to this one from the CLI:

{
    "Items": []
}

I suspect there might be a region-specific error for eu-south-2. When I tried with another opt-in region, eu-south-1, the response was as I expected, similar to the one above.

If it helps in any way, I have just observed that in the web console for eu-south-2, only the REST API types are displayed. I have attached a screenshot below:
image

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 30, 2023
@acuas
Copy link
Author

acuas commented Jun 30, 2023

I investigated a little further. The error message from the CLI misled me into thinking that it was an error caused by the client:

An error occurred (BadRequestException) when calling the GetApis operation: {"message": "1 validation error detected: Value \'arn:aws:lambda:eu-south-2:359345898052:function:\' at \'functionName\' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_\\.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"}

The actual issue is that the API Gateway V2 is not available in the "eu-south-2" region. Therefore, it's not a bug, and the issue can be closed. However, it is worth considering adding a more informative error response.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added the bug This issue is a bug. label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apigatewayv2 bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants