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

Cloud map service discovery target per environment #1929

Closed
sekamaneka opened this issue Feb 15, 2021 · 11 comments
Closed

Cloud map service discovery target per environment #1929

sekamaneka opened this issue Feb 15, 2021 · 11 comments
Labels
guidance Issue requesting guidance or information about usage

Comments

@sekamaneka
Copy link

Hello again,

as mentioned in another issue im trying to create an API GW with copilot authorization. It should have 2 environments. prod and test. But only 1 of them works at any given time (the one created first). I think the issue is that these two service discovery endpoints have the same name.

copilot svc show

Service Discovery

  Environment       Namespace
  -----------       ---------
  prod, test        api.ens.local:443
  
@efekarakus
Copy link
Contributor

Hi @swilso793 :)

Assuming that you're not importing an existing VPC, Copilot should create for each environment's VPC:

ServiceDiscoveryNamespace:
Type: AWS::ServiceDiscovery::PrivateDnsNamespace
Properties:
Name: !Sub ${AppName}.local
{{- if .ImportVPC}}
Vpc: {{.ImportVPC.ID}}
{{- else}}
Vpc: !Ref VPC
{{- end}}

Are you importing an existing VPC?

@efekarakus efekarakus added the guidance Issue requesting guidance or information about usage label Feb 15, 2021
@sekamaneka
Copy link
Author

Hey,

Yes it creates two private dns namespaces. With exactly the same name.
Since it's dns i assume the name matters and not some unique id behind it.

Even if selecting the cloudmap manually (from the web console) as an integration target of the API GW it doensn't work.
I will try changing the local namespace to have the env in the name and report back if it works.

     Properties: 
         Name: !Sub ${Env}.${AppName}.local 

@sekamaneka
Copy link
Author

When adding the environment name to the cloudmap namespace it works as expected.

@efekarakus
Copy link
Contributor

Wow okay! this is surprising to me, do you have a VPC link for your HTTP API? Does APIGW still pick up the "test" environment's namespace if your VPC link points to the "prod" environment?

@sekamaneka
Copy link
Author

yes and yes.. It just leads to a service unavailable message. when in doubt blame DNS 💯

@efekarakus
Copy link
Contributor

😂 thanks for letting us know! I'll reach out to someone on the APIGW team to see if this is expected behavior or if it's a bug that they can fix!

@efekarakus
Copy link
Contributor

Hi @swilso793 I contacted the API GW team to let them know of this behavior, I'll update this issue if we get any updates!

@efekarakus
Copy link
Contributor

efekarakus commented Apr 13, 2021

Hi @swilso793 would you mind emailing me karakuse@amazon.com with your account ID and VPC IDs where this issue was occurring, I'll relay this information to help us troubleshoot with the APIGW team.

Thanks!

@efekarakus
Copy link
Contributor

@swilso793 I just head back from the APIGW team that this issue should be fixed now for new CloudMap integrations!

So if we start from new environments hopefully this behavior should be gone.

@sekamaneka
Copy link
Author

thank you! i will test at a later date but im closing this for now.

@efekarakus
Copy link
Contributor

Yay I just tried this out and can confirm that APIGW has fixed this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Issue requesting guidance or information about usage
Projects
None yet
Development

No branches or pull requests

2 participants