Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into CLOUDP-283044
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBettati committed Dec 9, 2024
2 parents 71010a5 + 7d2edf8 commit efce54f
Show file tree
Hide file tree
Showing 415 changed files with 10,549 additions and 4,828 deletions.
3 changes: 3 additions & 0 deletions .changelog/2716.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
mongodbatlas_flex_cluster
```
3 changes: 3 additions & 0 deletions .changelog/2738.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-datasource
mongodbatlas_flex_cluster
```
39 changes: 39 additions & 0 deletions .changelog/2742.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
```release-note:note
resource/mongodbatlas_serverless_instance: Deprecates `continuous_backup_enabled` attribute
```

```release-note:note
resource/mongodbatlas_serverless_instance: Deprecates `auto_indexing` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instance: Deprecates `continuous_backup_enabled` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instance: Deprecates `auto_indexing` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instances: Deprecates `continuous_backup_enabled` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instances: Deprecates `auto_indexing` attribute
```

```release-note:note
resource/mongodbatlas_privatelink_endpoint_serverless: Deprecates resource
```

```release-note:note
resource/mongodbatlas_privatelink_endpoint_service_serverless: Deprecates resource
```

```release-note:note
data-source/mongodbatlas_privatelink_endpoint_service_serverless: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_privatelink_endpoints_service_serverless: Deprecates data source
```
3 changes: 3 additions & 0 deletions .changelog/2767.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-datasource
mongodbatlas_flex_clusters
```
3 changes: 3 additions & 0 deletions .changelog/2819.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/mongodbatlas_privatelink_endpoint_service: Decreases delay time when creating or deleting a resource
```
74 changes: 72 additions & 2 deletions .github/workflows/acceptance-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_call:
inputs:
terraform_version:
description: 'Terraform version to use, e.g. 1.6.x, empty for latest'
description: 'Terraform version to use, e.g. 1.6.x'
type: string
required: true
provider_version:
Expand Down Expand Up @@ -95,6 +95,9 @@ on:
azure_private_endpoint_region:
type: string
required: true
mongodb_atlas_flex_project_id:
type: string
required: true
secrets: # all secrets are passed explicitly in this workflow
mongodb_atlas_public_key:
required: true
Expand Down Expand Up @@ -213,6 +216,7 @@ jobs:
encryption: ${{ steps.filter.outputs.encryption == 'true' || env.mustTrigger == 'true' }}
event_trigger: ${{ steps.filter.outputs.event_trigger == 'true' || env.mustTrigger == 'true' }}
federated: ${{ steps.filter.outputs.federated == 'true' || env.mustTrigger == 'true' }}
flex_cluster: ${{ steps.filter.outputs.flex_cluster == 'true' || env.mustTrigger == 'true' }}
generic: ${{ steps.filter.outputs.generic == 'true' || env.mustTrigger == 'true' }}
global_cluster_config: ${{ steps.filter.outputs.global_cluster_config == 'true' || env.mustTrigger == 'true' }}
ldap: ${{ steps.filter.outputs.ldap == 'true' || env.mustTrigger == 'true' }}
Expand Down Expand Up @@ -278,6 +282,8 @@ jobs:
- 'internal/service/federatedsettingsidentityprovider/*.go'
- 'internal/service/federatedsettingsorgconfig/*.go'
- 'internal/service/federatedsettingsorgrolemapping/*.go'
flex_cluster:
- 'internal/service/flexcluster/*.go'
generic:
- 'internal/service/auditing/*.go'
- 'internal/service/backupcompliancepolicy/*.go'
Expand Down Expand Up @@ -344,6 +350,8 @@ jobs:
advanced_cluster_tpf:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.advanced_cluster_tpf == 'true' || inputs.test_group == 'advanced_cluster_tpf' }}
env:
MONGODB_ATLAS_ADVANCED_CLUSTER_V2_SCHEMA: 'true'
runs-on: ubuntu-latest
permissions: {}
steps:
Expand All @@ -359,15 +367,53 @@ jobs:
terraform_wrapper: false
- name: Prepare new advanced_cluster
run: make tools enable-advancedclustertpf
- name: Unit tests # delete after allowAdvancedClusterV2Schema is removed
run: go test -v ./internal/testutil/acc/advanced_cluster_schema_v2_test.go
- name: Mocked Acceptance Tests
env:
ACCTEST_REGEX_RUN: '^TestMock'
ACCTEST_PACKAGES: ./internal/service/advancedclustertpf
run: make testacc
- name: Acceptance Tests
env:
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
MONGODB_ATLAS_TPF_ADV_CLUSTER_TESTS: "true"
ACCTEST_PACKAGES: |
./internal/service/advancedcluster
./internal/service/advancedclustertpf
run: make testacc

advanced_cluster_tpf_move:
needs: [ change-detection, get-provider-version ]
if: ${{ (needs.change-detection.outputs.advanced_cluster_tpf == 'true' || inputs.test_group == 'advanced_cluster_tpf') && inputs.terraform_version == '1.10.x' }}
env:
MONGODB_ATLAS_ADVANCED_CLUSTER_V2_SCHEMA: 'true'
strategy:
max-parallel: 2
fail-fast: false
matrix:
terraform_version: ['1.8.x', '1.9.x'] # TF supported versions for MoveState apart from latest one, 1.10.x
name: advanced_cluster_tpf_move-${{ matrix.terraform_version }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false
- name: Prepare new advanced_cluster
run: make tools enable-advancedclustertpf
- name: Acceptance Tests
env:
ACCTEST_REGEX_RUN: '^TestAccAdvancedCluster_move'
ACCTEST_PACKAGES: ./internal/service/advancedclustertpf
run: make testacc

assume_role:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.assume_role == 'true' || inputs.test_group == 'assume_role' }}
Expand Down Expand Up @@ -654,6 +700,30 @@ jobs:
./internal/service/federatedsettingsorgrolemapping
run: make testacc

flex_cluster:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.flex_cluster == 'true' || inputs.test_group == 'flex_cluster' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
with:
terraform_version: ${{ inputs.terraform_version }}
terraform_wrapper: false
- name: Acceptance Tests
env:
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
MONGODB_ATLAS_FLEX_PROJECT_ID: ${{ inputs.mongodb_atlas_flex_project_id }}
MONGODB_ATLAS_ENABLE_PREVIEW: "true"
ACCTEST_PACKAGES: ./internal/service/flexcluster
run: make testacc

generic:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ jobs:
mongodb_atlas_enable_preview: ${{ vars.MONGODB_ATLAS_ENABLE_PREVIEW }}
azure_private_endpoint_region: ${{ vars.AZURE_PRIVATE_ENDPOINT_REGION }}
mongodb_atlas_rp_org_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.MONGODB_ATLAS_RP_ORG_ID_QA || vars.MONGODB_ATLAS_RP_ORG_ID_DEV }}
mongodb_atlas_flex_project_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.MONGODB_ATLAS_FLEX_PROJECT_ID_QA || vars.MONGODB_ATLAS_FLEX_PROJECT_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
with:
version: v1.61.0 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version
version: v1.62.2 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version
- name: actionlint
run: |
make tools
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs:
steps:
- name: Send Slack message
id: slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "Automatic Changelog update failed",
Expand All @@ -43,6 +45,3 @@ jobs:
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
7 changes: 3 additions & 4 deletions .github/workflows/notify-docs-team.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ jobs:
permissions:
pull-requests: write # Needed by sticky-pull-request-comment
steps:
- uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DOCS }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_DOCS }}
webhook-type: incoming-webhook
payload: |
{
"blocks": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
contents: read
pull-requests: write # Needed by labeler
steps:
- uses: srvaroa/labeler@29471ee1118fa4e10b011964e6e8fe2fd243e700
- uses: srvaroa/labeler@fe4b1c73bb8abf2f14a44a6912a8b4fee835d631
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/terraform-compatibility-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ jobs:
echo "slack_payload=${slack_message}" >> "${GITHUB_OUTPUT}"
- name: Send Slack message
id: slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: ${{ steps.slack-payload.outputs.slack_payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK


11 changes: 5 additions & 6 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
inputs:
terraform_matrix:
description: 'Terraform version matrix (JSON array)'
default: '["1.9.x","1.8.x","1.7.x","1.6.x","1.5.x","1.4.x"]'
default: '["1.10.x","1.9.x","1.8.x","1.7.x","1.6.x","1.5.x","1.4.x"]'
provider_matrix:
description: 'Previous MongoDB Atlas Provider version matrix for migration tests (JSON array)'
default: '[""]' # "" for latest version
Expand Down Expand Up @@ -43,7 +43,7 @@ concurrency:
jobs:
variables:
env:
schedule_terraform_matrix: '["1.9.x"]'
schedule_terraform_matrix: '["1.10.x"]'
schedule_provider_matrix: '[""]' # "" for latest version
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -91,8 +91,10 @@ jobs:
steps:
- name: Send Slack message
id: slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": ":red_circle: Test Suite failed (reminder to log failures)",
Expand All @@ -119,6 +121,3 @@ jobs:
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
2 changes: 1 addition & 1 deletion .github/workflows/update-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Update files
run: make tools update-atlas-sdk
- name: Verify Changed files
uses: tj-actions/verify-changed-files@530d86d0a237225c87beaa000750988f8965ee31
uses: tj-actions/verify-changed-files@dc57d4518c9e75995e0fff59265333d19a684163
id: verify-changed-files
- name: Create PR
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-tf-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make update-tf-compatibility-matrix
- name: Verify Changed files
uses: tj-actions/verify-changed-files@530d86d0a237225c87beaa000750988f8965ee31
uses: tj-actions/verify-changed-files@dc57d4518c9e75995e0fff59265333d19a684163
id: verify-changed-files
- name: Create PR
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
Expand All @@ -44,7 +44,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make update-tf-version-in-repository
- name: Verify Changed files
uses: tj-actions/verify-changed-files@530d86d0a237225c87beaa000750988f8965ee31
uses: tj-actions/verify-changed-files@dc57d4518c9e75995e0fff59265333d19a684163
id: verify-changed-files
- name: Create PR
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
terraform 1.9.8
terraform 1.10.1
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
## (Unreleased)

## 1.22.0 (November 26, 2024)

NOTES:

* data-source/mongodbatlas_organization: Adds new `gen_ai_features_enabled` attribute ([#2724](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2724))
* data-source/mongodbatlas_organizations: Adds new `gen_ai_features_enabled` attribute ([#2724](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2724))
* data-source/mongodbatlas_privatelink_endpoint_service_serverless: Deprecates data source ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* data-source/mongodbatlas_privatelink_endpoints_service_serverless: Deprecates data source ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* data-source/mongodbatlas_serverless_instance: Deprecates `auto_indexing` attribute ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* data-source/mongodbatlas_serverless_instance: Deprecates `continuous_backup_enabled` attribute ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* data-source/mongodbatlas_serverless_instances: Deprecates `auto_indexing` attribute ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* data-source/mongodbatlas_serverless_instances: Deprecates `continuous_backup_enabled` attribute ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* resource/mongodbatlas_organization: Adds new `gen_ai_features_enabled` attribute ([#2724](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2724))
* resource/mongodbatlas_privatelink_endpoint_serverless: Deprecates resource ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* resource/mongodbatlas_privatelink_endpoint_service_serverless: Deprecates resource ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* resource/mongodbatlas_serverless_instance: Deprecates `auto_indexing` attribute ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))
* resource/mongodbatlas_serverless_instance: Deprecates `continuous_backup_enabled` attribute ([#2742](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2742))

FEATURES:

* **New Data Source:** `mongodbatlas_flex_cluster` ([#2738](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2738))
* **New Data Source:** `mongodbatlas_flex_clusters` ([#2767](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2767))
* **New Resource:** `mongodbatlas_flex_cluster` ([#2716](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2716))

ENHANCEMENTS:

Expand All @@ -13,6 +31,7 @@ ENHANCEMENTS:
* resource/mongodbatlas_cloud_backup_snapshot_restore_job: Adds `failed` attribute ([#2781](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2781))
* resource/mongodbatlas_network_peering: Improve error message when networking peering reaches a failed status ([#2766](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2766))
* resource/mongodbatlas_privatelink_endpoint: Improves error message when privatelink endpoint returns error after POST ([#2803](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2803))
* resource/mongodbatlas_privatelink_endpoint_service: Decreases delay time when creating or deleting a resource ([#2819](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2819))
* resource/mongodbatlas_privatelink_endpoint_service: Improves error message when privatelink endpoint service returns error after POST ([#2803](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2803))

## 1.21.4 (October 29, 2024)
Expand Down
14 changes: 9 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GITTAG=$(shell git describe --always --tags)
VERSION=$(GITTAG:v%=%)
LINKER_FLAGS=-s -w -X 'github.com/mongodb/terraform-provider-mongodbatlas/version.ProviderVersion=${VERSION}'

GOLANGCI_VERSION=v1.61.0 # Also update golangci-lint GH action in code-health.yml when updating this version
GOLANGCI_VERSION=v1.62.2 # Also update golangci-lint GH action in code-health.yml when updating this version

export PATH := $(shell go env GOPATH)/bin:$(PATH)
export SHELL := env PATH=$(PATH) /bin/bash
Expand Down Expand Up @@ -167,10 +167,7 @@ jira-release-version:

.PHONY: enable-advancedclustertpf
enable-advancedclustertpf:
make delete-lines filename="./internal/provider/provider_sdk2.go" delete="mongodbatlas_advanced_cluster"
make add-lines filename=./internal/provider/provider.go find="project.Resource," add="advancedclustertpf.Resource,"
make add-lines filename=./internal/provider/provider.go find="project.DataSource," add="advancedclustertpf.DataSource,"
make add-lines filename=./internal/provider/provider.go find="project.PluralDataSource," add="advancedclustertpf.PluralDataSource,"
make change-lines filename=./internal/config/advanced_cluster_v2_schema.go find="allowAdvancedClusterV2Schema = false" new="allowAdvancedClusterV2Schema = true"

.PHONY: delete-lines ${filename} ${delete}
delete-lines:
Expand All @@ -185,3 +182,10 @@ add-lines:
sed 's/${find}/${find}${add}/' "${filename}" > "file.tmp"
mv file.tmp ${filename}
goimports -w ${filename}

.PHONY: change-lines ${filename} ${find} ${new}
change-lines:
rm -f file.tmp
sed 's/${find}/${new}/' "${filename}" > "file.tmp"
mv file.tmp ${filename}
goimports -w ${filename}
Loading

0 comments on commit efce54f

Please sign in to comment.