Skip to content

Commit

Permalink
Automated migration
Browse files Browse the repository at this point in the history
  • Loading branch information
blampe committed Dec 18, 2024
1 parent f9da959 commit bc5be14
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 4,095 deletions.
6 changes: 3 additions & 3 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 @@ -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

0 comments on commit bc5be14

Please sign in to comment.