Zum Inhalt springen

Manage MongoDB Flex with Cloud Foundry

Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen

You have the opportunity to create an instance directly in cf to bind your application to the service.

  1. Login with the cf CLI.

    Terminal window
    cf login -a https://api.system.01.cf.eu01.stackit.cloud --sso
  2. Select the org and space (if not already selected by default). You can check the available orgs and spaces with cf orgs and cf spaces.

  3. Describe your service.

    You describe the service properties with a JSON object. Here is an example for a minimum set of configuration elements. For further reference on how to configure the parameters, consult Create and manage instances for MongoDB Flex and Backup, restore and clone MongoDB Flex.

    {
    "acl": {
    "items": ["193.148.160.0/19", "45.129.40.0/21"]
    },
    "backupSchedule": "0 10/8 * * *",
    "storage": {
    "class": "premium-perf2-mongodb",
    "size": 10
    },
    "version": "8.0"
    }
  4. Create your service with cf create-service.

    Execute the cf create-service with the JSON object created in step 3.

    Terminal window
    cf create-service stackit-mongodb-flex stackit-mongodb-flex-single-1.2 my-test-instance -c '{ "acl": { "items": [ "193.148.160.0/19", "45.129.40.0/21" ] },"backupSchedule": "0 10/8 * * *", "storage": { "class": "premium-perf2-mongodb", "size": 10 }, "version": "8.0" }'
  5. Create a service key (user). If you bind your application to the service, you create the service key during the binding.

    Terminal window
    cf create-service-key my-test-instance my-service-key -c '{"database":"default","roles":["read"],"username":"myuser"}'
  6. Get the service key.

    Terminal window
    cf service-key my-test-instance my-service-key
  7. Copy the URI and test the connection. To get a detailed description on how to connect to a MonoDB Flex instance, visit Connect to MongoDB Flex.

  8. Reach out to the support for migrating your services. If the connection is possible, you can contact us on the Help Center.

To delete a MongoDB instance, you need to execute the cf delete-service command.

Terminal window
cf delete-service <instance-name>