Skip to content

Release staging v.1.8.2 #1115

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

Merged
merged 12 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions examples/third-party-integration/datadog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Example - DataDog third party integration with MongoDB Atlas Cluster

## Dependencies

* Terraform v0.13
* A [DataDog](https://www.datadoghq.com/) API Key.
* As of March 2023, worth noting that this is *not* an Application Key. API Keys can be created and accessed via Organization Settings from DataDog UI (not from MongoDB Atlas).
* A MongoDB Atlas account - provider.mongodbatlas: version = "~> 1.8"

## Usage

**1\. Ensure your AWS and MongoDB Atlas credentials are set up.**

This can be done using environment variables:

```bash
export MONGODB_ATLAS_PUBLIC_KEY="xxxx"
export MONGODB_ATLAS_PRIVATE_KEY="xxxx"
```

... or follow as in the `variables.tf` file and create **terraform.tfvars** file with all the variable values, ex:
```
public_key = "<MONGODB_ATLAS_PUBLIC_KEY>"
private_key = "<MONGODB_ATLAS_PRIVATE_KEY>"
project_id = "<MONGODB_ATLAS_PROJECT_ID>"
datadog_api_key = "<DATADOG_API_KEY>"
```

**2\. Review the Terraform plan.**

Execute the below command and ensure you are happy with the plan.

``` bash
$ terraform plan
```
This project currently does the below deployments:

- MongoDB cluster - M10
- Third Party Integration

**4\. Execute the Terraform apply.**

Now execute the plan to provision the AWS and Atlas resources.

``` bash
$ terraform apply
```

**5\. Destroy the resources.**

Once you are finished your testing, ensure you destroy the resources to avoid unnecessary charges.

``` bash
$ terraform destroy
```
21 changes: 21 additions & 0 deletions examples/third-party-integration/datadog/instance.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "mongodbatlas_advanced_cluster" "my_cluster" {
project_id = var.project_id
name = var.cluster_name
cluster_type = "REPLICASET"

replication_specs {
zone_name = "Zone 1"
num_shards = 1

region_configs {
provider_name = "AWS"
region_name = "US_EAST_1"
priority = 7

electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
}
6 changes: 6 additions & 0 deletions examples/third-party-integration/datadog/integration.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "mongodbatlas_third_party_integration" "test-datadog" {
project_id = var.project_id
type = "DATADOG"
api_key = var.datadog_api_key
region = var.datadog_region
}
20 changes: 20 additions & 0 deletions examples/third-party-integration/datadog/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
variable "public_key" {
description = "MongoDB Atlas authentication Public API key"
}
variable "private_key" {
description = "MongoDB Atlas authentication Private API key"
}
variable "project_id" {
description = "MongoDB Atlas project id"
}
variable "datadog_api_key" {
description = "Datadog api key"
}
variable "datadog_region" {
description = "Datadog region"
default = "US5"
}
variable "cluster_name" {
description = "Cluster to test regional mode"
default = "datadog-test-cluster"
}
11 changes: 11 additions & 0 deletions examples/third-party-integration/datadog/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
}
google = {
source = "hashicorp/google"
}
}
required_version = ">= 0.13"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
provider "mongodbatlas" {
public_key = var.public_key
private_key = var.private_key
}
22 changes: 3 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,31 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/hcl/v2 v2.16.2
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
github.com/hashicorp/terraform-provider-google v1.20.1-0.20210625223728-379bcb41c06b
github.com/mongodb-forks/digest v1.0.4
github.com/mwielbut/pointy v1.1.0
github.com/spf13/cast v1.5.0
github.com/terraform-providers/terraform-provider-aws v1.60.1-0.20210625132053-af2d5c0ad54f
github.com/zclconf/go-cty v1.13.1
go.mongodb.org/atlas v0.23.1
go.mongodb.org/atlas v0.24.0
go.mongodb.org/realm v0.1.0
golang.org/x/exp v0.0.0-20221208152030-732eee02a75a
)

require (
bitbucket.org/creachadair/stringset v0.0.8 // indirect
cloud.google.com/go v0.83.0 // indirect
cloud.google.com/go/bigtable v1.10.1 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20210623224421-7f5af5003bbb // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/beevik/etree v1.1.0 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gammazero/deque v0.0.0-20180920172122-f6adf94963e4 // indirect
github.com/gammazero/workerpool v0.0.0-20181230203049-86a96b5d5d92 // indirect
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
github.com/go-logr/logr v0.2.0 // indirect
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
Expand All @@ -56,7 +44,6 @@ require (
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/googleapis/gnostic v0.4.1 // indirect
github.com/gruntwork-io/go-commons v0.8.0 // indirect
github.com/hashicorp/aws-sdk-go-base v0.7.1 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -77,31 +64,28 @@ require (
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jen20/awspolicyequivalence v1.1.0 // indirect
github.com/jhump/protoreflect v1.6.1 // indirect
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba // indirect
github.com/klauspost/compress v1.13.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/openlyinc/pointy v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/otp v1.3.0 // indirect
github.com/rogpeppe/go-internal v1.6.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.7.2 // indirect
Expand Down
Loading