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

doc: Adds examples and docs for mongodbatlas_stream_privatelink_endpoint resource and data sources #2923

Merged
merged 16 commits into from
Dec 23, 2024

Conversation

oarbusi
Copy link
Collaborator

@oarbusi oarbusi commented Dec 20, 2024

Description

Adds examples and docs for mongodbatlas_stream_privatelink_endpoint resource and data sources

Link to any related issue(s): CLOUDP-290833

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@oarbusi oarbusi changed the base branch from master to CLOUDP-288973-stream-privatelink December 20, 2024 16:11
@oarbusi oarbusi marked this pull request as ready for review December 20, 2024 16:12
@oarbusi oarbusi requested review from a team as code owners December 20, 2024 16:12
Copy link
Contributor

APIx bot: a message has been sent to Docs Slack channel

Copy link
Contributor

@kanchana-mongodb kanchana-mongodb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % copy

docs/data-sources/stream_privatelink_endpoint.md Outdated Show resolved Hide resolved
docs/data-sources/stream_privatelink_endpoint.md Outdated Show resolved Hide resolved
docs/data-sources/stream_privatelink_endpoint.md Outdated Show resolved Hide resolved
docs/data-sources/stream_privatelink_endpoints.md Outdated Show resolved Hide resolved
docs/data-sources/stream_privatelink_endpoints.md Outdated Show resolved Hide resolved
docs/data-sources/stream_privatelink_endpoints.md Outdated Show resolved Hide resolved
docs/data-sources/stream_privatelink_endpoints.md Outdated Show resolved Hide resolved
docs/resources/stream_privatelink_endpoint.md Outdated Show resolved Hide resolved
docs/resources/stream_privatelink_endpoint.md Outdated Show resolved Hide resolved
@oarbusi
Copy link
Collaborator Author

oarbusi commented Dec 23, 2024

failing tests is TestAccStreamProcessor_withOptions which is failing for reasons unrelated to this PR

required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "1.24.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.25? Or did we decide not to include these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to remeber that if we put a version that does not exist yet it fails, might be wrong though

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change it to >~ to use latest 1.x by default

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided not to include the TF version which is the required_version below

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For our provider TF version I think we can try >~ as suggested by @EspenAlbert . I think we have a backlog ticket to fix this in the job at some point

@@ -0,0 +1,59 @@
resource "confluent_environment" "staging" {
display_name = "Staging"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion on this, but I think there's no need for this to be a variable. Users that already use the Confluent TF provider will have their environment already set up. I think the important part of this example is the new mongodb resource part

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO: Staging is a bit strange. I would prefer a placeholder (e.g., my-env) value to make it more obvious for the users to change it.

}
}

module "privatelink" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we are using a module here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason apart from the fact that it makes the main.tf smaller

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move it to a top level file privatelink.tf instead of the module then.

@@ -0,0 +1,59 @@
resource "confluent_environment" "staging" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a serverless instance in this example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serverless products in this case would be for example AWS Lambda, not Confluent serveless products/instance

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the purpose of this example.
We create a private link between confluence and Atlas accounts, but no service/products is using it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example purpose is to show how to use & create this resource (mongodbatlas_stream_privatelink_endpoint), in this case no products or services are using it, but this is like all our other examples( for example mongodbatlas_advanced_cluster example creates the cluster, we don't show services/products using the cluster)

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments. Still left a few follow-ups 😅

required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "1.24.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided not to include the TF version which is the required_version below

oarbusi and others added 2 commits December 23, 2024 16:36
…dicated_cluster/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
…dicated_cluster/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
oarbusi and others added 3 commits December 23, 2024 16:38
…rverless/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
…rverless/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
@oarbusi oarbusi merged commit b2fe118 into CLOUDP-288973-stream-privatelink Dec 23, 2024
39 of 40 checks passed
@oarbusi oarbusi deleted the CLOUDP-290833 branch December 23, 2024 16:02
oarbusi added a commit that referenced this pull request Jan 22, 2025
…ta sources (#2924)

* chore: Generate `mongodbatlas_stream_privatelink_endpoint` file structure and resource schema (#2878)

* initial scaffolding and generation of schema

* schema adjustments

* temporary nolint:gocritic for commented out code

* comment out test

* chore: Generate `mongodbatlas_stream_privatelink_endpoint` data sources schema (#2884)

* data source schema

* comment out implementation

* feat: Implements `mongodbatlas_stream_privatelink_endpoint` resource (#2890)

* initial implementation of resource

* implement resource & model conversion necessary for resource

* handle nil/empty dnssubdomain

* refresh function for the deletion of the resource

* empty list for dnsSubDomain attribute

* retry strategy for creation

* changelog

* adjust latest SDK

* fix unit test after dnssubdomain fix

* fix generate docs all check

* feat: Implements `mongodbatlas_stream_privatelink_endpoint` data sources (#2897)

* singular data source

* plural data source

* changelog

* example check fix

* pr

* use correct states for creation

* test: Add tests for `mongodbatlas_stream_privatelink_endpoint` resource and data source (#2910)

* wip: tests

* set up confluent provider in tests

* test fixes

* run tests in CI

* adjust migration test to use confluent external provider

* change detection

* depends on

* specific project for tests

* failedonupdate fix

* test improvement

* changes to tests

* remove config in import step

* externalprovider for failed update test case

* error on update

* chore: Changes Confluent specific attributes from Required to Optional to easily support future vendors (#2921)

* change required and validate in model conversion

* test required

* doc: Adds examples and docs for `mongodbatlas_stream_privatelink_endpoint` resource and data sources (#2923)

* examples

* generate docs

* fix example

* pr docs copy

* versions

* format

* fix

* pr comments

* docs update for example update

* docs generation

* Update examples/mongodbatlas_stream_privatelink_endpoint/confluent_dedicated_cluster/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>

* Update examples/mongodbatlas_stream_privatelink_endpoint/confluent_dedicated_cluster/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>

* Update examples/mongodbatlas_stream_privatelink_endpoint/confluent_serverless/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>

* Update examples/mongodbatlas_stream_privatelink_endpoint/confluent_serverless/README.md

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>

* version constraint

---------

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>

* merge from master

* remove unnecessary CI var

* chore: Correct dnsSubDomain value sent in the API request when empty in the configuration (#2925)

* skip tests in CI

* feat: Supports `PRIVATE_LINK` networking type in `mongodbatlas_stream_connection` resource and data sources (#2940)

* wip: networking attributes for private link connection

* changelog

* changelog fix

* final adjustments

* ajustments

* final adjustment

* fix conversion

* test privatelink in stream connection

* skip test

* skip mig test

* add reason on skipped mig test

* clean up leftover from wrong api

---------

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

4 participants