Giter VIP home page Giter VIP logo

Comments (6)

dlethin avatar dlethin commented on June 3, 2024

I started trying to try to fix this on my own and submit a PR, but I'm running in to some trouble. Following the instructions in the README, I get the following error on the make build step:

go: git.apache.org/[email protected]: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in <HOME>/bld/go/pkg/mod/cache/vcs/83dba939f95a790e497d565fc4418400145a1a514f955fa052f662d56e920c3e: exit status 128:
	fatal: unable to access 'https://git.apache.org/thrift.git/': Failed to connect to git.apache.org port 443: Operation timed out

not sure how deep in the dependency chain this is coming from and not a seasoned go-lang dev to immediate dive further into this.

In the meantime, this is the diff I think needs to change to resolve the issue I reported:

diff --git a/mongodbatlas/resource_mongodbatlas_project_ip_whitelist.go b/mongodbatlas/resource_mongodbatlas_project_ip_whitelist.go
index 56c91e7..d7d0dab 100644
--- a/mongodbatlas/resource_mongodbatlas_project_ip_whitelist.go
+++ b/mongodbatlas/resource_mongodbatlas_project_ip_whitelist.go
@@ -181,6 +181,11 @@ func resourceMongoDBAtlasProjectIPWhitelistImportState(d *schema.ResourceData, m
        }))

        if err := d.Set("whitelist", flattenProjectIPWhitelist(whitelist)); err != nil {
+               log.Printf("[WARN] Error setting whitelist for (%s): %s", d.Id(), err)
+               return []*schema.ResourceData{d}, err
+       }
+
+       if err := d.Set("project_id", d.Id()); err != nil {
                log.Printf("[WARN] Error setting project_id for (%s): %s", d.Id(), err)
                return []*schema.ResourceData{d}, err
        }

This is essentially mimicking what was done here for mongodbatlas_cluster
cheers.

from terraform-provider-mongodbatlas.

PacoDw avatar PacoDw commented on June 3, 2024

Hello, @dlethin thank you so much for your review 👍 , let us check to resolve the issue.

from terraform-provider-mongodbatlas.

PacoDw avatar PacoDw commented on June 3, 2024

Yeah! your changes are right, now you can test it on pr #23, thank you!

If you have any comments or another issue just let us know.

from terraform-provider-mongodbatlas.

dlethin avatar dlethin commented on June 3, 2024

Thanks for the quick response.

I'm not sure how to test it though, as I was running into problems building the plugin locally as mentioned above. Maybe I just don't have my go-lang environment set up correctly..

from terraform-provider-mongodbatlas.

PacoDw avatar PacoDw commented on June 3, 2024

Don't worry the changes are now in master, you could clone the repository and test it directly once you have the repository downloaded just make the following command inside of the folder:

$ go build
This will generate a binary program that it is the plugin that you could use with terraform directly, move this binary in your terraform project folder.

from terraform-provider-mongodbatlas.

dlethin avatar dlethin commented on June 3, 2024

I built it locally and confirmed it works for my project.

I did discover another problem where adding an additional whitelist ip entry then wants to destroy and rebuild the resource rather than incrementally changing which is not ideal as there will be a moment of time where existing atlas clients might get shut out until their whitelist entries are added again, but I can track a separate issue for that.

Thanks for sharing this plugin. Cheers.

from terraform-provider-mongodbatlas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.