Skip to content

Commit

Permalink
Merge branch 'GoogleCloudPlatform:master' into feat/add-aws-apigavewa…
Browse files Browse the repository at this point in the history
…yv2-support
  • Loading branch information
shubhindia committed Sep 25, 2023
2 parents d83c2ab + e8b1dd7 commit aea2528
Show file tree
Hide file tree
Showing 33 changed files with 932 additions and 149 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- name: Test
run: go build -v && go test ./...
- name: Build for linux/amd64
Expand All @@ -26,8 +26,6 @@ jobs:
run: GOOS=darwin go build -o terraformer-all-darwin-amd64
- name: Build for mac Apple Silicon
run: GOOS=darwin GOARCH=arm64 go build -o terraformer-all-darwin-arm64
- name: Build for windows
run: GOOS=windows go build -o terraformer-all-windows-amd64
- name: Build for all providers
run: go run build/multi-build/main.go

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"
- name: Go Mod Tidy
run: go mod tidy
- name: Test
Expand Down
9 changes: 4 additions & 5 deletions build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand All @@ -17,7 +16,7 @@ const packageCmdPath = "cmd"
func main() {
provider := os.Args[1]
log.Println("Build terraformer with " + provider + " provider...")
files, err := ioutil.ReadDir(packageCmdPath)
files, err := os.ReadDir(packageCmdPath)
if err != nil {
log.Println(err)
}
Expand All @@ -44,7 +43,7 @@ func main() {
}

// comment deleted providers in code
rootCode, err := ioutil.ReadFile(packageCmdPath + "/root.go")
rootCode, err := os.ReadFile(packageCmdPath + "/root.go")
if err != nil {
log.Println(err)
}
Expand All @@ -62,7 +61,7 @@ func main() {
newRootCodeLines[i] = line
}
newRootCode := strings.Join(newRootCodeLines, "\n")
err = ioutil.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm)
err = os.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm)
if err != nil {
log.Println(err)
}
Expand All @@ -78,7 +77,7 @@ func main() {
fmt.Println(outb.String())

// revert code and files
err = ioutil.WriteFile(packageCmdPath+"/root.go", rootCode, os.ModePerm)
err = os.WriteFile(packageCmdPath+"/root.go", rootCode, os.ModePerm)
if err != nil {
log.Println(err)
}
Expand Down
9 changes: 4 additions & 5 deletions build/multi-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand All @@ -17,7 +16,7 @@ const packageCmdPath = "cmd"
func main() {
// provider := os.Args[1]
allProviders := []string{}
files, err := ioutil.ReadDir(packageCmdPath)
files, err := os.ReadDir(packageCmdPath)
if err != nil {
log.Println(err)
}
Expand Down Expand Up @@ -68,7 +67,7 @@ func main() {
}

// comment deleted providers in code
rootCode, err := ioutil.ReadFile(packageCmdPath + "/root.go")
rootCode, err := os.ReadFile(packageCmdPath + "/root.go")
if err != nil {
log.Fatal("err:", err)
}
Expand All @@ -86,7 +85,7 @@ func main() {
newRootCodeLines[i] = line
}
newRootCode := strings.Join(newRootCodeLines, "\n")
err = ioutil.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm)
err = os.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm)
if err != nil {
log.Fatal("err:", err)
}
Expand All @@ -106,7 +105,7 @@ func main() {
fmt.Println(outb.String())

// revert code and files
err = ioutil.WriteFile(packageCmdPath+"/root.go", rootCode, os.ModePerm)
err = os.WriteFile(packageCmdPath+"/root.go", rootCode, os.ModePerm)
if err != nil {
log.Fatal("err:", err)
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package cmd

import (
"fmt"
"io/ioutil"
"log"
"os"
"sort"
Expand Down Expand Up @@ -280,7 +279,7 @@ func printService(provider terraformutils.ProviderGenerator, serviceName string,
} else {
log.Println(provider.GetName() + " save tfstate for " + serviceName)
}
if err := ioutil.WriteFile(path+"/terraform.tfstate", tfStateFile, os.ModePerm); err != nil {
if err := os.WriteFile(path+"/terraform.tfstate", tfStateFile, os.ModePerm); err != nil {
return err
}
}
Expand Down
2 changes: 2 additions & 0 deletions docs/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ terraformer import aws --resources=sg --regions=us-east-1
* `aws_ec2_transit_gateway_vpc_attachment`
* `vpc`
* `aws_vpc`
* `vpc_endpoint`
* `aws_vpc_endpoint`
* `vpc_peering`
* `aws_vpc_peering_connection`
* `vpn_connection`
Expand Down
1 change: 1 addition & 0 deletions docs/gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ List of supported GCP services:
* `google_cloudbuild_trigger`
* `cloudFunctions`
* `google_cloudfunctions_function`
* `google_cloudfunctions2_function`
* `cloudsql`
* `google_sql_database_instance`
* `google_sql_database`
Expand Down
70 changes: 40 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/GoogleCloudPlatform/terraformer

go 1.20
go 1.21

require (
cloud.google.com/go v0.104.0 // indirect
cloud.google.com/go/logging v1.1.2
cloud.google.com/go/storage v1.27.0
cloud.google.com/go v0.110.2 // indirect
cloud.google.com/go/logging v1.7.0
cloud.google.com/go/storage v1.29.0
github.com/Azure/azure-sdk-for-go v63.4.0+incompatible
github.com/Azure/azure-storage-blob-go v0.10.0
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
Expand Down Expand Up @@ -142,11 +142,11 @@ require (
github.com/mrparkers/terraform-provider-keycloak v0.0.0-20221013232944-56f37a07590d
github.com/nicksnyder/go-i18n v1.10.1 // indirect
github.com/okta/okta-sdk-golang/v2 v2.12.2-0.20220602195034-d7ea6917663f
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.9
github.com/ory/dockertest v3.3.5+incompatible // indirect
github.com/packethost/packngo v0.9.0
github.com/packethost/packngo v0.30.0
github.com/pkg/errors v0.9.1
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/spf13/cobra v1.1.1
Expand All @@ -158,11 +158,11 @@ require (
github.com/yandex-cloud/go-sdk v0.0.0-20220314105123-d0c2a928feb6
github.com/zclconf/go-cty v1.11.0
github.com/zorkian/go-datadog-api v2.30.0+incompatible
golang.org/x/oauth2 v0.5.0
golang.org/x/text v0.7.0
golang.org/x/oauth2 v0.10.0
golang.org/x/text v0.11.0
gonum.org/v1/gonum v0.7.0
google.golang.org/api v0.100.0
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71
google.golang.org/api v0.131.0
google.golang.org/genproto v0.0.0-20230629202037-9506855d4529
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
k8s.io/apimachinery v0.24.2
k8s.io/client-go v0.24.2
Expand Down Expand Up @@ -242,14 +242,14 @@ require (
github.com/go-stack/stack v1.8.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/jsonapi v1.0.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.6.0 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-getter v1.7.0 // indirect
Expand Down Expand Up @@ -301,7 +301,7 @@ require (
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/stretchr/testify v1.8.1 // indirect
github.com/stretchr/testify v1.8.2 // indirect
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
Expand All @@ -311,19 +311,19 @@ require (
github.com/xdg-go/stringprep v1.0.2 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
go.mongodb.org/mongo-driver v1.7.5 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/grpc v1.56.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/auth0.v5 v5.21.1
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
Expand All @@ -342,10 +342,10 @@ require (
require github.com/PuerkitoBio/rehttp v1.0.0 // indirect

require (
cloud.google.com/go/cloudbuild v1.2.0
cloud.google.com/go/cloudtasks v1.6.0
cloud.google.com/go/iam v0.5.0
cloud.google.com/go/monitoring v1.4.0
cloud.google.com/go/cloudbuild v1.9.0
cloud.google.com/go/cloudtasks v1.10.0
cloud.google.com/go/iam v0.13.0
cloud.google.com/go/monitoring v1.13.0
github.com/DataDog/datadog-api-client-go/v2 v2.11.0
github.com/Myra-Security-GmbH/myrasec-go/v2 v2.28.0
github.com/manicminer/hamilton v0.44.0
Expand All @@ -354,7 +354,9 @@ require (
)

require (
cloud.google.com/go/compute v1.10.0 // indirect
cloud.google.com/go/compute v1.20.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/longrunning v0.4.1 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Myra-Security-GmbH/signature v1.0.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
Expand All @@ -366,12 +368,16 @@ require (
github.com/go-openapi/swag v0.19.14 // indirect
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/manicminer/hamilton-autorest v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
)
Expand All @@ -386,14 +392,18 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.694
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/pts v1.0.694
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tat v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcaplusdb v1.0.392
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.392
)
Expand Down
Loading

0 comments on commit aea2528

Please sign in to comment.