Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Update Terraform provider to 3.x #150

Closed
wants to merge 1 commit into from

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Jan 13, 2022

Description of your changes

This PR updates Terraform provider version to v3.71.0 which supports the aws_cloudfront_response_headers_policy resource. Some existing resources have API changes with this version. I have also tried the minimum required version of v3.64.0 but we still have some API changes in existing resources, so I went with the latest released version of the Terraform provider in this PR.

Note: I had to exclude aws_elasticache_user due to crossplane/terrajet#100, for which a fix is under way.

Note: I just regenerated the Terraformed (managed) resources. No reconfiguration or no adjustments on the examples have been performed.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Ran make generate & make build.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

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

LGTM, I only have a few small issues. Scanned and didn't see any breaking changes.

Please also make sure that make reviewable passes with the full set of resources.

@@ -101,7 +101,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports
run: cd /tmp/ && go get golang.org/x/tools/cmd/goimports
Copy link
Member

Choose a reason for hiding this comment

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

If the problem was making sure go get doesn't affect the go.mod, then the following should help.

Suggested change
run: cd /tmp/ && go get golang.org/x/tools/cmd/goimports
run: go install golang.org/x/tools/cmd/goimports@v0.1.8

I learned this trick yesterday from go help install.

If the arguments have version suffixes (like @latest or @v1.0.0), "go install"
builds packages in module-aware mode, ignoring the go.mod file in the current
directory or any parent directory, if there is one. This is useful for
installing executables without affecting the dependencies of the main module.

"gopkg.in/alecthomas/kingpin.v2"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/crossplane/terrajet/pkg/terraform"
tf "github.com/hashicorp/terraform-provider-aws/xpprovider"
Copy link
Member

Choose a reason for hiding this comment

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

Probably unintentional.

@@ -1,212 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
Copy link
Member

Choose a reason for hiding this comment

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

Did you intend to remove this as well?

@muvaf
Copy link
Member

muvaf commented Jan 31, 2022

Note: I had to exclude aws_elasticache_user due to crossplane/terrajet#100, for which a fix is under way.

That issue is fixed now, can we re-include it?

@maltejk
Copy link

maltejk commented Feb 24, 2022

Is this still active?

@muvaf
Copy link
Member

muvaf commented Mar 14, 2022

With #169 , we don't need to apply this hack to upgrade the provider anymore. @ulucinar you might want to do this in a clean PR rebased from main.

@haarchri
Copy link
Member

haarchri commented Jul 4, 2022

any progress here ? did we need only to bump https://github.com/crossplane-contrib/provider-jet-aws/blob/main/Makefile#L9 ? @ulucinar

make generate                        
23:22:32 [ .. ] generating provider schema for hashicorp/aws 3.62.0
make[1]: *** [config/schema.json] Error 1
make: *** [generate] Error 2

we need LBTargetGroup targetType alb which was added in v3.62.0

---
apiVersion: elbv2.aws.jet.crossplane.io/v1alpha2
kind: LBTargetGroup
metadata:
  name: sample-alb-targetgroup
spec:
  forProvider:
    region: us-west-1
    name: sample-alb-targetgroup
    targetType: alb
    port: 80
    protocol: "TCP"
    vpcIdRef: 
      name: sample-vpc
  providerConfigRef:
    name: default

we can add the example afterwards in #211

@ulucinar
Copy link
Collaborator Author

ulucinar commented Jul 6, 2022

Hi @haarchri,
Now that we generate the Crossplane provider from JSON schema instead of the native provider source, I think we can close this PR.

@ulucinar ulucinar closed this Jul 6, 2022
@haarchri
Copy link
Member

haarchri commented Jul 6, 2022

Yes but simpler Change im makefile to 3.62.0 for example is not working as you can See in my latest comment @ulucinar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants