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 creating MongoDB Project IP Whitelist: MongoDB Atlas: 401 You are not authorized for this resource #102

Open
cnguyenp opened this issue Aug 14, 2019 · 0 comments

Comments

@cnguyenp
Copy link

Note: This is not an issue. This is a request for help.

I am trying to add outbound_ip_addresses from Azure to MongoDB Atlas.
And I am having issue with authorization.
I have added my IP to whitelist.

I am not sure where do I get username and api_key for the provider.

provider "mongodbatlas" {
  username = "${var.mongodb_atlas_username}"
  api_key = "${var.mongodb_atlas_api_key}"
}

Here is my resources

resource "mongodbatlas_ip_whitelist" "staging-app-service" {
  group = "xxxxx"

  for_each = toset(split(",", "${azurerm_app_service.jamboree_as.outbound_ip_addresses}"))

  cidr_block = "${each.value}/32"
  comment = "staging outbound ip ${each.key}"

  depends_on = [
	  "azurerm_app_service.jamboree_as"
  ]
}

I am getting api_key from here
2019-08-14 16_09_23-Edit API Key _ Atlas_ MongoDB Atlas

and I am getting username from here
2019-08-14 16_16_29-Access Management _ Atlas_ MongoDB Atlas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant