Skip to content

Error creating MongoDB Project IP Whitelist: MongoDB Atlas: 401 You are not authorized for this resource #102

@cnguyenp

Description

@cnguyenp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions