localstack / localstack/serverless-localstack

Static API Gateway V1 Endpoints

Ouverte
#270 0 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

aws:apigateway status: backlog
Langage dominant
JavaScript
Étoiles
542
Forks
92
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi team 👋

### Context
My project is using localstack + severless.

I have my lambda function and I want to deploy to the localstack environment. After I deployed successfully, I find out that the endpoints (check screenshot below) is printing out in the stdout with a random rest-api-id (from the screenshot it is **q7yho9op8e**)
Screenshot 2024-11-08 at 11 24 14 AM

I cannot find a localstack-severless documentation to teach me how to have the static URL (since the above rest-api-id keep changing after each localstack deployment)

But I found this [localstack doc](https://docs.localstack.cloud/user-guide/aws/apigateway/), which provides a way to have the static URL by passing the tag '_custom_id_ ' to localstack api creation.
![Screenshot 2024-11-08 at 11 25 46 AM](https://github.com/user-attachments/assets/badaf1eb-c92b-4b30-bdb6-d49b23f10080)

I also found that there is a way to pass the tag to the Api Gateway V1 by following this [serverless doc](https://www.serverless.com/framework/docs/providers/aws/events/apigateway#tags--stack-tags)
![image](https://github.com/user-attachments/assets/cf4ced25-b193-4d9f-8c9d-f0a40eab4c7b)

### Test Process
1. spin up the localstack by run command `localstack start`
2. deploy the lambda to localstack by running `sls deploy --stage local --config serverless.local.yml`
3. check endpoints from sls deploy stdout

### Expected
I am expecting the api endpoint should looks like
http://localhost:4566/restapis/tagsMyId123/local/_user_request_ or http://localhost:4566/restapis/stackTagsMyId123/local/_user_request_

### Actual
As the result, the URL is still not static after deployment with tag set in the severless.yml (check screenshot below)
Screenshot 2024-11-08 at 11 30 13 AM

### Questions:
1. Does localstack-serverless plugin support the feature that mentioned in the localstack doc?
5. Is there a way I can have the static URL since I need the static URL to run my e2e testing.

Many thanks 🙏

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduisez le déploiement avec `localstack start` et `sls deploy --stage local --config serverless.local.yml`, en utilisant les tags affichés dans `serverless.yml`. Comparez le endpoint API Gateway V1 généré entre les déploiements et examinez les points d’entrée du plugin impliqués dans la création de l’API. Le travail est considéré comme terminé lorsqu’il a été déterminé si l’URL statique demandée est prise en charge et que le comportement requis a été documenté ou implémenté.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
api
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.