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

Consolidate go modules #4919

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PACK := aws
ORG := pulumi
PROJECT := github.com/$(ORG)/pulumi-$(PACK)
PROVIDER_PATH := provider/v6
PROVIDER_PATH := v6/provider
VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version
TFGEN := pulumi-tfgen-$(PACK)
PROVIDER := pulumi-resource-$(PACK)
Expand Down Expand Up @@ -258,7 +258,7 @@ tfgen_no_deps: .make/schema
(cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go)
@touch $@
tfgen_build_only: bin/$(TFGEN)
bin/$(TFGEN): provider/*.go provider/go.* .make/upstream
bin/$(TFGEN): provider/*.go go.* .make/upstream
(cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN))
.PHONY: tfgen schema tfgen_no_deps tfgen_build_only

Expand Down Expand Up @@ -289,7 +289,7 @@ ci-mgmt: .ci-mgmt.yaml
.PHONY: ci-mgmt

# Because some codegen depends on the version of the CLI used, we install a local CLI
# version pinned to the same version as `provider/go.mod`.
# version pinned to the same version as `go.mod`.
#
# This logic compares the version of .pulumi/bin/pulumi already installed. If it matches
# the desired version, we just print. Otherwise we (re)install pulumi at the desired
Expand All @@ -304,7 +304,7 @@ ci-mgmt: .ci-mgmt.yaml
fi

# Compute the version of Pulumi to use by inspecting the Go dependencies of the provider.
.pulumi/version: provider/go.mod
.pulumi/version: go.mod
cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@

# Start debug server for tfgen
Expand Down
2 changes: 1 addition & 1 deletion examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/aws/aws-sdk-go/service/s3"
"github.com/pulumi/providertest/pulumitest"
"github.com/pulumi/providertest/pulumitest/opttest"
"github.com/pulumi/pulumi-aws/provider/v6/pkg/elb"
"github.com/pulumi/pulumi-aws/v6/provider/pkg/elb"
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
Expand Down
4 changes: 2 additions & 2 deletions examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

aws "github.com/pulumi/pulumi-aws/provider/v6"
version "github.com/pulumi/pulumi-aws/provider/v6/pkg/version"
aws "github.com/pulumi/pulumi-aws/v6/provider"
version "github.com/pulumi/pulumi-aws/v6/provider/pkg/version"
)

func createEditDir(dir string) integration.EditDir {
Expand Down
9 changes: 4 additions & 5 deletions examples/examples_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func TestIMDSAuth(t *testing.T) {
t.Logf("Cross-compiling provider-resource-aws under test to %q", expected)
localProviderBuild = filepath.Join(os.TempDir(), "pulumi-resource-aws")
ldFlags := []string{
"-X", "github.com/pulumi/pulumi-aws/provider/v6/pkg/version.Version=6.0.0-alpha.0+dev",
"-X", "github.com/pulumi/pulumi-aws/v6/provider/pkg/version.Version=6.0.0-alpha.0+dev",
"-X", "github.com/hashicorp/terraform-provider-aws/version.ProviderVersion=6.0.0-alpha.0+dev",
}
args := []string{
Expand Down Expand Up @@ -967,7 +967,7 @@ outputs:
}, step.properties))

t.Logf("template for %s: \n%s", step.name, body)
require.NoError(t, os.WriteFile(testPath, []byte(body), 0600))
require.NoError(t, os.WriteFile(testPath, []byte(body), 0o600))
}

func loadAwsDefaultConfig() aws.Config {
Expand Down Expand Up @@ -1367,7 +1367,6 @@ outputs:
return expandMap(2, map[string]interface{}{
"properties": a,
})

}

for _, typ := range types {
Expand All @@ -1389,8 +1388,8 @@ outputs:

fpath := filepath.Join(path, "Pulumi.yaml")
if os.Getenv("PULUMI_ACCEPT") == "true" {
require.NoError(t, os.MkdirAll(path, 0700))
require.NoError(t, os.WriteFile(fpath, []byte(body), 0600))
require.NoError(t, os.MkdirAll(path, 0o700))
require.NoError(t, os.WriteFile(fpath, []byte(body), 0o600))
} else {
existing, err := os.ReadFile(fpath)
if assert.NoError(t, err) {
Expand Down
37 changes: 21 additions & 16 deletions examples/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
module github.com/pulumi/pulumi-aws/examples/v6
module github.com/pulumi/pulumi-aws/v6

go 1.23.3

// Disable experimental post-quantum key exchange mechanism X25519Kyber768Draft00
// This was causing errors with AWS Network Firewall
// https://github.com/pulumi/pulumi-aws/issues/4582
godebug tlskyber=0

require (
github.com/aws/aws-sdk-go v1.55.5
github.com/aws/aws-sdk-go-v2 v1.32.6
github.com/aws/aws-sdk-go-v2/config v1.28.6
github.com/aws/aws-sdk-go-v2/credentials v1.17.47
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21
github.com/aws/aws-sdk-go-v2/service/appconfig v1.36.1
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.1
github.com/aws/aws-sdk-go-v2/service/iam v1.38.2
github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.25.7
github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.59
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
github.com/hashicorp/terraform-provider-aws v1.60.1-0.20220923175450-ca71523cdc36
github.com/mitchellh/go-homedir v1.1.0
github.com/pulumi/providertest v0.1.3
github.com/pulumi/pulumi-aws/provider/v6 v6.0.0-00010101000000-000000000000
github.com/pulumi/pulumi-terraform-bridge/v3 v3.98.0
github.com/pulumi/pulumi/pkg/v3 v3.143.0
github.com/pulumi/pulumi/sdk/v3 v3.143.0
github.com/stretchr/testify v1.9.0
pgregory.net/rapid v0.6.1
)

// Replace to allow for correctly linking the aws provider.
// This replace is copied from upstream/go.mod, and should be maintained only as long as
// upstream maintains the same replace.
//
// We use this for gRPC based testing.
// There is an equivalent replace in examples/go.mod. It should be updated/removed inline
// with this replace.
replace github.com/hashicorp/terraform-plugin-log => github.com/gdavison/terraform-plugin-log v0.0.0-20230928191232-6c653d8ef8fb

replace (
github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20240520223432-0c0bf0d65f10

github.com/hashicorp/terraform-provider-aws => ../upstream
github.com/pulumi/pulumi-aws/provider/v6 => ../provider
github.com/hashicorp/terraform-provider-aws => ./upstream
github.com/hashicorp/vault => github.com/hashicorp/vault v1.2.0
)

// This replace is copied from upstream/go.mod, and should be maintained only as long as upstream maintains the same replace.
replace github.com/hashicorp/terraform-plugin-log => github.com/gdavison/terraform-plugin-log v0.0.0-20230928191232-6c653d8ef8fb

require (
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
Expand Down Expand Up @@ -63,7 +74,6 @@ require (
github.com/armon/go-radix v1.0.0 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect
Expand Down Expand Up @@ -161,7 +171,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.1 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.28.7 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.6 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.1 // indirect
github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.32.7 // indirect
github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.27.7 // indirect
github.com/aws/aws-sdk-go-v2/service/emr v1.47.1 // indirect
Expand Down Expand Up @@ -364,7 +373,6 @@ require (
github.com/gorilla/mux v1.8.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.23.0 // indirect
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.59 // indirect
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.60 // indirect
github.com/hashicorp/awspolicyequivalence v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down Expand Up @@ -398,9 +406,7 @@ require (
github.com/hashicorp/terraform-plugin-go v0.25.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-mux v0.17.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 // indirect
github.com/hashicorp/terraform-plugin-testing v1.11.0 // indirect
github.com/hashicorp/terraform-provider-aws v1.60.1-0.20220923175450-ca71523cdc36 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/vault/api v1.12.0 // indirect
Expand All @@ -422,7 +428,6 @@ require (
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-aws/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"os"
"strings"

"github.com/pulumi/pulumi-aws/provider/v6/pkg/minimalschema"
"github.com/pulumi/pulumi-aws/v6/provider/pkg/minimalschema"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/cmdutil"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
Expand Down Expand Up @@ -62,7 +62,7 @@ func compressAndVersionSchemaFile(opts compressAndVersionSchemaFileOptions) erro
packageSpec, err := readPackageSpecFile(opts.sourceFile)
packageSpec.Version = opts.version
// Open a file for writing, creating it if it doesn't exist, and truncating it if it does
file, err := os.OpenFile(opts.destFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
file, err := os.OpenFile(opts.destFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644)
if err != nil {
log.Fatalf("failed to open file: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-resource-aws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"io"
"os"

aws "github.com/pulumi/pulumi-aws/provider/v6"
aws "github.com/pulumi/pulumi-aws/v6/provider"
pf "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfbridge"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/cmdutil"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
Expand Down
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-tfgen-aws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"path/filepath"
"strings"

aws "github.com/pulumi/pulumi-aws/provider/v6"
aws "github.com/pulumi/pulumi-aws/v6/provider"
pftfgen "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfgen"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
Expand Down
2 changes: 1 addition & 1 deletion provider/configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
pfbridge "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfbridge"
"github.com/stretchr/testify/require"

version "github.com/pulumi/pulumi-aws/provider/v6/pkg/version"
version "github.com/pulumi/pulumi-aws/v6/provider/pkg/version"
)

func TestCheckConfigWithUnknownKeys(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion provider/fast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package provider
import (
"testing"

"github.com/pulumi/pulumi-aws/provider/v6/pkg/version"
"github.com/pulumi/pulumi-aws/v6/provider/pkg/version"
)

func init() {
Expand Down
Loading
Loading