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

[Notice] Moving pre-built providers to the cdktf Github organization #2146

Open
mutahhir opened this issue Sep 29, 2022 · 4 comments
Open

[Notice] Moving pre-built providers to the cdktf Github organization #2146

mutahhir opened this issue Sep 29, 2022 · 4 comments
Labels
language/golang notice Internal use only. An issue being used by the maintainers to flag something for the community. pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager

Comments

@mutahhir
Copy link
Member

mutahhir commented Sep 29, 2022

All existing pre-built providers will be relocating to our new Github organization cdktf (see #2135).

For the vast majority of CDKTF users, this won’t affect how you reference the providers, as you’re consuming them through your language-specific package manager: NPM, PyPI, Maven, etc. However, for Golang users of CDKTF, this is something to be aware of. Soon, the module naming will switch from:

github.com/hashicorp/cdktf-provider-{provider name}-go 

to

github.com/cdktf/cdktf-provider-{provider name}-go 

There is no need for any immediate action, but over the course of the next few days if you see the Go CLI complain about:

go: github.com/hashicorp/cdktf-provider-hashicups-go/[email protected]: parsing go.mod:
        module declares its path as: github.com/cdktf/cdktf-provider-hashicups-go/hashicups
                but was required as: github.com/hashicorp/cdktf-provider-hashicups-go/hashicups

Regarding one or more of the pre-built providers, change the module path to the one with github.com/cdktf.

You could also use Go tools to do the replace for you (replace hashicups with your provider):

$ gofmt -w -r '"github.com/hashicorp/cdktf-provider-hashicups-go/hashicups" -> "github.com/cdktf/cdktf-provider-hashicups-go/hashicups"' ./
$ go get # Fetch the prebuilt provider from the new module path
$ go mod tidy # Remove old module path

As another example, if you were using the AWS provider, the first command above becomes:

$ gofmt -w -r '"github.com/hashicorp/cdktf-provider-aws-go/aws/v9" -> "github.com/cdktf/cdktf-provider-aws-go/aws/v9"' ./
@mutahhir mutahhir pinned this issue Sep 29, 2022
@mutahhir mutahhir changed the title Important notice: Moving pre-built providers to the cdktf Github organization Moving pre-built providers to the cdktf Github organization Sep 29, 2022
@RazaGR
Copy link

RazaGR commented Sep 30, 2022

docs need to be updated https://learn.hashicorp.com/tutorials/terraform/cdktf-install?in=terraform/cdktf

ps. I am also getting node error when running cdk-go with default example:

 $ go run main.go
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!                                                                            !!
!!  Node 17 has reached end-of-life on 2022-06-01 and is not supported.       !!
!!  Please upgrade to a supported node version as soon as possible.           !!
!!                                                                            !!
!!  This software is currently running on node v17.4.0.                       !!
!!  As of the current release of this software, supported node releases are:  !!
!!  - ^18.0.0 (Planned end-of-life: 2025-04-30)                               !!
!!  - ^16.3.0 (Planned end-of-life: 2023-09-11)                               !!
!!  - ^14.6.0 (Planned end-of-life: 2023-04-30)                               !!
!!                                                                            !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@xiehan xiehan changed the title Moving pre-built providers to the cdktf Github organization [Notice] Moving pre-built providers to the cdktf Github organization Oct 3, 2022
@xiehan xiehan added notice Internal use only. An issue being used by the maintainers to flag something for the community. pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager language/golang labels Oct 3, 2022
@dzeediscoveryzone
Copy link

dzeediscoveryzone commented Oct 4, 2022

Hi All,

I was hoping to get some assistance because I'm not able to get Go to work with 0.13.0 due to the provider organization change. I started from scratch with a vanilla project:

cdktf init --template=go --cdktf-version 0.13.0 --project-name ec2 --project-description "A demo cdktf project using Go which deploys an EC2 instance"

Then I went ahead and added the provider cdktf provider add "aws@~>4.0" which as expected adds the old provider:

cdktf provider add "aws@~>4.0"
Checking whether pre-built provider exists for the following constraints:
  provider: aws
  version : ~>4.0
  language: go
  cdktf   : 0.13.0

Found pre-built provider.
Adding package github.com/hashicorp/cdktf-provider-aws-go/aws @ 10.0.1
[2022-10-04T13:35:25.152] [ERROR] default - go: upgraded github.com/aws/constructs-go/constructs/v10 v10.1.113 => v10.1.121
go: upgraded github.com/aws/jsii-runtime-go v1.68.0 => v1.69.0
go: added github.com/hashicorp/cdktf-provider-aws-go/aws/v10 v10.0.1

go: upgraded github.com/aws/constructs-go/constructs/v10 v10.1.113 => v10.1.121
go: upgraded github.com/aws/jsii-runtime-go v1.68.0 => v1.69.0
go: added github.com/hashicorp/cdktf-provider-aws-go/aws/v10 v10.0.1
Package installed.

Everything looks good so far except when I try to replace the org from hashicorp -> cdktf (I have tried both via gofmt, manually, as well running go get -u github.com/cdktf/cdktf-provider-aws-go/aws/v10, see below following the above instructions:

All of the above results in nothing being changed and when manually changing and running go get it fails with the error you presented in your wiki. Maybe I am missing something but I have been unsuccessful.

I also attempted manually installing it:

go get -u github.com/cdktf/cdktf-provider-aws-go/aws/v10
go: github.com/cdktf/cdktf-provider-aws-go/aws/[email protected]: parsing go.mod:
        module declares its path as: github.com/hashicorp/cdktf-provider-aws-go/aws/v10
                but was required as: github.com/cdktf/cdktf-provider-aws-go/aws/v10

@mutahhir
Copy link
Member Author

mutahhir commented Oct 5, 2022

@dzeediscoveryzone Sorry, this was a bit of a timing issue on our part, but v10.0.2 of the AWS provider should work out of the box for your use case. v10.0.1 was still referencing the old Github repo path in it's go.mod file, which caused issues.

Can you try again with v10.0.2 and see if it works? I believe just running cdktf provider add "aws@~>4.0" would pull in the new version

@dzeediscoveryzone
Copy link

@mutahhir no problem at all and thank you for the quick turnaround! My issue is now resolved. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/golang notice Internal use only. An issue being used by the maintainers to flag something for the community. pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager
Projects
None yet
Development

No branches or pull requests

4 participants