Skip to content

Instantly share code, notes, and snippets.

@pranavcode
Last active January 5, 2020 11:07
Show Gist options
  • Save pranavcode/8d9ac1d0728223378082a897c7e5b951 to your computer and use it in GitHub Desktop.
Save pranavcode/8d9ac1d0728223378082a897c7e5b951 to your computer and use it in GitHub Desktop.
Velotio - HashiCorp Consul Part 2 - Adding Consul intentions to allow or deny connection between services
# Allow connection from Django App (Web) to MongoDB Primary instance (DB)
$ consul intention create -allow web mongo-primary
Created: web => mongo-primary (allow)
# Allow connection from Django App (Web) to MongoDB Secondary instance (DB)
$ consul intention create -allow web mongo-secondary
Created: web => mongo-secondary (allow)
# Deny connection from Fabio (LB) to MongoDB Primary instance (DB)
$ consul intention create -deny fabio mongo-primary
Created: fabio => mongo-primary (deny)
# Deny connection from Fabio (LB) to MongoDB Secondary instance (DB)
$ consul intention create -deny fabio mongo-secondary
Created: fabio => mongo-secondary (deny)
@pranavcode
Copy link
Author

@ilkinmammadzada that's right, thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment