Merge branch 'main' into issue_232_lotoussa

main
William BEUIL 2021-03-18 15:24:50 +01:00 committed by GitHub
commit 3da401a0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
117 changed files with 983 additions and 843 deletions

View File

@ -146,6 +146,24 @@
"contributions": [
"doc"
]
},
{
"login": "sundowndev",
"name": "Raphaël",
"avatar_url": "https://avatars.githubusercontent.com/u/16480203?v=4",
"profile": "https://crvx.fr/",
"contributions": [
"code"
]
},
{
"login": "vainkop",
"name": "vainkop",
"avatar_url": "https://avatars.githubusercontent.com/u/28118190?v=4",
"profile": "https://github.com/vainkop",
"contributions": [
"bug"
]
}
]
}

View File

@ -21,6 +21,8 @@ Thank you to all the people who have already contributed to driftctl.
<td align="center"><a href="https://github.com/herbygillot"><img src="https://avatars.githubusercontent.com/u/618376?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Herby Gillot</b></sub></a><br /><a href="#tool-herbygillot" title="Tools">🔧</a></td>
<td align="center"><a href="http://louistoussaint.fr"><img src="https://avatars.githubusercontent.com/u/66522867?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Toussaint Louis</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=lotoussa" title="Code">💻</a> <a href="https://github.com/cloudskiff/driftctl/commits?author=lotoussa" title="Documentation">📖</a></td>
<td align="center"><a href="https://dev.to/psedge"><img src="https://avatars.githubusercontent.com/u/5781397?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Peter Sedgewick</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=psedge" title="Documentation">📖</a></td>
<td align="center"><a href="https://crvx.fr/"><img src="https://avatars.githubusercontent.com/u/16480203?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Raphaël</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=sundowndev" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vainkop"><img src="https://avatars.githubusercontent.com/u/28118190?v=4?s=80" width="80px;" alt=""/><br /><sub><b>vainkop</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/issues?q=author%3Avainkop" title="Bug reports">🐛</a></td>
</tr>
</table>

View File

@ -66,7 +66,7 @@ deps:
.PHONY: install-tools
install-tools:
$(GOGET) gotest.tools/gotestsum
$(GOGET) github.com/vektra/mockery/.../
$(GOGET) github.com/vektra/mockery/v2/.../
go.mod: FORCE

View File

@ -14,7 +14,6 @@
<img src="https://codecov.io/gh/cloudskiff/driftctl/branch/main/graph/badge.svg?token=8C5R02G5S7"/>
</a>
<img src="https://img.shields.io/docker/pulls/cloudskiff/driftctl"/>
<img src="https://img.shields.io/microbadger/layers/cloudskiff/driftctl"/>
<img src="https://img.shields.io/docker/image-size/cloudskiff/driftctl"/>
<a href="https://discord.gg/NMCBxtD7Nd">
<img src="https://img.shields.io/discord/783720783469871124?color=%237289da&label=discord&logo=discord"/>
@ -63,3 +62,11 @@ To learn more about compiling driftctl and contributing, please refer to the [co
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification and is brought to you by these [awesome contributors](CONTRIBUTORS.md).
Build with ❤️️ from 🇫🇷 🇯🇵 🇬🇷 🇸🇪 🇺🇸
---
## Collecting users feedback
Have you launched driftctl ? Please take a moment to answer the [following questions](https://driftctl.typeform.com/to/fYUOOMj3) and help us improve the tool.
3 minutes, tops!

View File

@ -99,7 +99,7 @@ func TestDriftctlCmd_Scan(t *testing.T) {
env: map[string]string{
"DCTL_FROM": "test",
},
err: fmt.Errorf("Unable to parse from flag 'test': \nAccepted schemes are: tfstate://,tfstate+s3://"),
err: fmt.Errorf("Unable to parse from flag 'test': \nAccepted schemes are: tfstate://,tfstate+s3://,tfstate+http://,tfstate+https://"),
},
{
env: map[string]string{

View File

@ -20,22 +20,26 @@ import (
"github.com/cloudskiff/driftctl/pkg/iac/config"
"github.com/cloudskiff/driftctl/pkg/iac/supplier"
"github.com/cloudskiff/driftctl/pkg/iac/terraform/state/backend"
globaloutput "github.com/cloudskiff/driftctl/pkg/output"
"github.com/cloudskiff/driftctl/pkg/remote"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/terraform"
)
type ScanOptions struct {
Coverage bool
Detect bool
From []config.SupplierConfig
To string
Output output.OutputConfig
Filter *jmespath.JMESPath
Coverage bool
Detect bool
From []config.SupplierConfig
To string
Output output.OutputConfig
Filter *jmespath.JMESPath
Quiet bool
BackendOptions *backend.Options
}
func NewScanCmd() *cobra.Command {
opts := &ScanOptions{}
opts.BackendOptions = &backend.Options{}
cmd := &cobra.Command{
Use: "scan",
@ -77,6 +81,8 @@ func NewScanCmd() *cobra.Command {
opts.Filter = expr
}
opts.Quiet, _ = cmd.Flags().GetBool("quiet")
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
@ -85,6 +91,12 @@ func NewScanCmd() *cobra.Command {
}
fl := cmd.Flags()
fl.BoolP(
"quiet",
"",
false,
"Do not display anything but scan results",
)
fl.StringP(
"filter",
"",
@ -118,12 +130,19 @@ func NewScanCmd() *cobra.Command {
"Cloud provider source\n"+
"Accepted values are: "+strings.Join(supportedRemotes, ",")+"\n",
)
fl.StringToStringVarP(&opts.BackendOptions.Headers,
"headers",
"H",
map[string]string{},
"Use those HTTP headers to query the provided URL.\n"+
"Only used with tfstate+http(s) backend for now.\n",
)
return cmd
}
func scanRun(opts *ScanOptions) error {
selectedOutput := output.GetOutput(opts.Output)
selectedOutput := output.GetOutput(opts.Output, opts.Quiet)
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
@ -132,7 +151,9 @@ func scanRun(opts *ScanOptions) error {
providerLibrary := terraform.NewProviderLibrary()
supplierLibrary := resource.NewSupplierLibrary()
err := remote.Activate(opts.To, alerter, providerLibrary, supplierLibrary)
progress := globaloutput.NewProgress()
err := remote.Activate(opts.To, alerter, providerLibrary, supplierLibrary, progress)
if err != nil {
return err
}
@ -146,7 +167,7 @@ func scanRun(opts *ScanOptions) error {
scanner := pkg.NewScanner(supplierLibrary.Suppliers(), alerter)
iacSupplier, err := supplier.GetIACSupplier(opts.From, providerLibrary)
iacSupplier, err := supplier.GetIACSupplier(opts.From, providerLibrary, opts.BackendOptions)
if err != nil {
return err
}
@ -158,7 +179,9 @@ func scanRun(opts *ScanOptions) error {
ctl.Stop()
}()
progress.Start()
analysis, err := ctl.Run()
progress.Stop()
if err != nil {
return err

View File

@ -47,8 +47,8 @@ func IsSupported(key string) bool {
return false
}
func GetOutput(config OutputConfig) Output {
output.ChangePrinter(GetPrinter(config))
func GetOutput(config OutputConfig, quiet bool) Output {
output.ChangePrinter(GetPrinter(config, quiet))
switch config.Key {
case JSONOutputType:
@ -60,7 +60,11 @@ func GetOutput(config OutputConfig) Output {
}
}
func GetPrinter(config OutputConfig) output.Printer {
func GetPrinter(config OutputConfig, quiet bool) output.Printer {
if quiet {
return &output.VoidPrinter{}
}
switch config.Key {
case JSONOutputType:
if isStdOut(config.Options["path"]) {

View File

@ -267,10 +267,11 @@ func fakeAnalysisWithGithubEnumerationError() *analyser.Analysis {
func TestGetPrinter(t *testing.T) {
tests := []struct {
name string
path string
key string
want output.Printer
name string
path string
key string
quiet bool
want output.Printer
}{
{
name: "json file output",
@ -278,6 +279,13 @@ func TestGetPrinter(t *testing.T) {
key: JSONOutputType,
want: output.NewConsolePrinter(),
},
{
name: "json file output quiet",
path: "/path/to/file",
key: JSONOutputType,
quiet: true,
want: &output.VoidPrinter{},
},
{
name: "json stdout output",
path: "stdout",
@ -296,6 +304,13 @@ func TestGetPrinter(t *testing.T) {
key: ConsoleOutputType,
want: output.NewConsolePrinter(),
},
{
name: "quiet console stdout output",
path: "stdout",
quiet: true,
key: ConsoleOutputType,
want: &output.VoidPrinter{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -304,7 +319,7 @@ func TestGetPrinter(t *testing.T) {
Options: map[string]string{
"path": tt.path,
},
}); !reflect.DeepEqual(got, tt.want) {
}, tt.quiet); !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetPrinter() = %v, want %v", got, tt.want)
}
})

View File

@ -38,6 +38,7 @@ func TestScanCmd_Valid(t *testing.T) {
{args: []string{"scan", "--from", "tfstate://test", "--from", "tfstate://test2"}},
{args: []string{"scan", "-t", "aws+tf", "-f", "tfstate://test"}},
{args: []string{"scan", "--to", "aws+tf", "--from", "tfstate://test"}},
{args: []string{"scan", "--to", "aws+tf", "--from", "tfstate+https://github.com/state.tfstate"}},
{args: []string{"scan", "--filter", "Type=='aws_s3_bucket'"}},
}
@ -67,14 +68,14 @@ func TestScanCmd_Invalid(t *testing.T) {
{args: []string{"scan", "-f"}, expected: `flag needs an argument: 'f' in -f`},
{args: []string{"scan", "--from"}, expected: `flag needs an argument: --from`},
{args: []string{"scan", "--from"}, expected: `flag needs an argument: --from`},
{args: []string{"scan", "--from", "tosdgjhgsdhgkjs"}, expected: "Unable to parse from flag 'tosdgjhgsdhgkjs': \nAccepted schemes are: tfstate://,tfstate+s3://"},
{args: []string{"scan", "--from", "://"}, expected: "Unable to parse from flag '://': \nAccepted schemes are: tfstate://,tfstate+s3://"},
{args: []string{"scan", "--from", "://test"}, expected: "Unable to parse from flag '://test': \nAccepted schemes are: tfstate://,tfstate+s3://"},
{args: []string{"scan", "--from", "tosdgjhgsdhgkjs://"}, expected: "Unable to parse from flag 'tosdgjhgsdhgkjs://': \nAccepted schemes are: tfstate://,tfstate+s3://"},
{args: []string{"scan", "--from", "terraform+foo+bar://test"}, expected: "Unable to parse from scheme 'terraform+foo+bar': \nAccepted schemes are: tfstate://,tfstate+s3://"},
{args: []string{"scan", "--from", "tosdgjhgsdhgkjs"}, expected: "Unable to parse from flag 'tosdgjhgsdhgkjs': \nAccepted schemes are: tfstate://,tfstate+s3://,tfstate+http://,tfstate+https://"},
{args: []string{"scan", "--from", "://"}, expected: "Unable to parse from flag '://': \nAccepted schemes are: tfstate://,tfstate+s3://,tfstate+http://,tfstate+https://"},
{args: []string{"scan", "--from", "://test"}, expected: "Unable to parse from flag '://test': \nAccepted schemes are: tfstate://,tfstate+s3://,tfstate+http://,tfstate+https://"},
{args: []string{"scan", "--from", "tosdgjhgsdhgkjs://"}, expected: "Unable to parse from flag 'tosdgjhgsdhgkjs://': \nAccepted schemes are: tfstate://,tfstate+s3://,tfstate+http://,tfstate+https://"},
{args: []string{"scan", "--from", "terraform+foo+bar://test"}, expected: "Unable to parse from scheme 'terraform+foo+bar': \nAccepted schemes are: tfstate://,tfstate+s3://,tfstate+http://,tfstate+https://"},
{args: []string{"scan", "--from", "unsupported://test"}, expected: "Unsupported IaC source 'unsupported': \nAccepted values are: tfstate"},
{args: []string{"scan", "--from", "tfstate+foobar://test"}, expected: "Unsupported IaC backend 'foobar': \nAccepted values are: s3"},
{args: []string{"scan", "--from", "tfstate:///tmp/test", "--from", "tfstate+toto://test"}, expected: "Unsupported IaC backend 'toto': \nAccepted values are: s3"},
{args: []string{"scan", "--from", "tfstate+foobar://test"}, expected: "Unsupported IaC backend 'foobar': \nAccepted values are: s3,http,https"},
{args: []string{"scan", "--from", "tfstate:///tmp/test", "--from", "tfstate+toto://test"}, expected: "Unsupported IaC backend 'toto': \nAccepted values are: s3,http,https"},
{args: []string{"scan", "--filter", "Type='test'"}, expected: "unable to parse filter expression: SyntaxError: Expected tRbracket, received: tUnknown"},
}

View File

@ -28,7 +28,7 @@ func IsSupplierSupported(supplierKey string) bool {
return false
}
func GetIACSupplier(configs []config.SupplierConfig, library *terraform.ProviderLibrary) (resource.Supplier, error) {
func GetIACSupplier(configs []config.SupplierConfig, library *terraform.ProviderLibrary, backendOpts *backend.Options) (resource.Supplier, error) {
chainSupplier := resource.NewChainSupplier()
for _, config := range configs {
if !IsSupplierSupported(config.Key) {
@ -39,7 +39,7 @@ func GetIACSupplier(configs []config.SupplierConfig, library *terraform.Provider
var err error
switch config.Key {
case state.TerraformStateReaderSupplier:
supplier, err = state.NewReader(config, library)
supplier, err = state.NewReader(config, library, backendOpts)
default:
return nil, errors.Errorf("Unsupported supplier '%s'", config.Key)
}

View File

@ -6,12 +6,14 @@ import (
"testing"
"github.com/cloudskiff/driftctl/pkg/iac/config"
"github.com/cloudskiff/driftctl/pkg/iac/terraform/state/backend"
"github.com/cloudskiff/driftctl/pkg/terraform"
)
func TestGetIACSupplier(t *testing.T) {
type args struct {
config []config.SupplierConfig
config []config.SupplierConfig
options *backend.Options
}
tests := []struct {
name string
@ -26,6 +28,9 @@ func TestGetIACSupplier(t *testing.T) {
Key: "foobar",
},
},
options: &backend.Options{
Headers: map[string]string{},
},
},
wantErr: fmt.Errorf("Unsupported supplier 'foobar'"),
},
@ -42,6 +47,9 @@ func TestGetIACSupplier(t *testing.T) {
Path: "terraform.tfstate",
},
},
options: &backend.Options{
Headers: map[string]string{},
},
},
wantErr: fmt.Errorf("Unsupported supplier 'foobar'"),
},
@ -51,6 +59,9 @@ func TestGetIACSupplier(t *testing.T) {
config: []config.SupplierConfig{
{Key: "tfstate", Backend: "", Path: "terraform.tfstate"},
},
options: &backend.Options{
Headers: map[string]string{},
},
},
wantErr: nil,
},
@ -62,13 +73,16 @@ func TestGetIACSupplier(t *testing.T) {
{Key: "tfstate", Backend: "s3", Path: "terraform.tfstate"},
{Key: "tfstate", Backend: "", Path: "terraform2.tfstate"},
},
options: &backend.Options{
Headers: map[string]string{},
},
},
wantErr: nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := GetIACSupplier(tt.args.config, terraform.NewProviderLibrary())
_, err := GetIACSupplier(tt.args.config, terraform.NewProviderLibrary(), tt.args.options)
if tt.wantErr != nil && err.Error() != tt.wantErr.Error() {
t.Errorf("GetIACSupplier() error = %v, wantErr %v", err, tt.wantErr)
return
@ -82,6 +96,8 @@ func TestGetSupportedSchemes(t *testing.T) {
want := []string{
"tfstate://",
"tfstate+s3://",
"tfstate+http://",
"tfstate+https://",
}
if got := GetSupportedSchemes(); !reflect.DeepEqual(got, want) {

View File

@ -1,6 +1,7 @@
package backend
import (
"fmt"
"io"
"github.com/cloudskiff/driftctl/pkg/iac/config"
@ -10,10 +11,16 @@ import (
var supportedBackends = []string{
BackendKeyFile,
BackendKeyS3,
BackendKeyHTTP,
BackendKeyHTTPS,
}
type Backend io.ReadCloser
type Options struct {
Headers map[string]string
}
func IsSupported(backend string) bool {
for _, b := range supportedBackends {
if b == backend {
@ -24,8 +31,7 @@ func IsSupported(backend string) bool {
return false
}
func GetBackend(config config.SupplierConfig) (Backend, error) {
func GetBackend(config config.SupplierConfig, opts *Options) (Backend, error) {
backend := config.Backend
if !IsSupported(backend) {
@ -37,6 +43,10 @@ func GetBackend(config config.SupplierConfig) (Backend, error) {
return NewFileReader(config.Path)
case BackendKeyS3:
return NewS3Reader(config.Path)
case BackendKeyHTTP:
fallthrough
case BackendKeyHTTPS:
return NewHTTPReader(fmt.Sprintf("%s://%s", config.Backend, config.Path), opts)
default:
return nil, errors.Errorf("Unsupported backend '%s'", backend)
}

View File

@ -0,0 +1,49 @@
package backend
import (
"io"
"net/http"
"github.com/pkg/errors"
)
const BackendKeyHTTP = "http"
const BackendKeyHTTPS = "https"
type HTTPBackend struct {
url string
reader io.ReadCloser
}
func NewHTTPReader(rawURL string, opts *Options) (*HTTPBackend, error) {
req, err := http.NewRequest(http.MethodGet, rawURL, nil)
if err != nil {
return nil, err
}
for key, value := range opts.Headers {
req.Header.Add(key, value)
}
client := &http.Client{}
res, err := client.Do(req)
if err != nil {
return nil, err
}
return &HTTPBackend{rawURL, res.Body}, nil
}
func (h *HTTPBackend) Read(p []byte) (n int, err error) {
if h.reader == nil {
return 0, errors.New("Reader not initialized")
}
return h.reader.Read(p)
}
func (h *HTTPBackend) Close() error {
if h.reader != nil {
return h.reader.Close()
}
return errors.New("Unable to close reader as nothing was opened")
}

View File

@ -0,0 +1,177 @@
package backend
import (
"errors"
"io"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
func TestNewHTTPReader(t *testing.T) {
type args struct {
url string
options *Options
}
tests := []struct {
name string
args args
wantURL string
wantErr bool
}{
{
name: "Should fail with wrong URL",
args: args{
url: "wrong_url",
options: &Options{
Headers: map[string]string{},
},
},
wantURL: "",
wantErr: true,
},
{
name: "Should fetch URL with auth header",
args: args{
url: "https://raw.githubusercontent.com/cloudskiff/driftctl/main/.dockerignore",
options: &Options{
Headers: map[string]string{
"Authorization": "Basic Test",
},
},
},
wantURL: "https://raw.githubusercontent.com/cloudskiff/driftctl/main/.dockerignore",
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := NewHTTPReader(tt.args.url, tt.args.options)
if tt.wantErr {
assert.Error(t, err)
return
} else {
assert.NoError(t, err)
}
assert.NotNil(t, got)
assert.Equal(t, tt.wantURL, got.url)
})
}
}
func TestHTTPBackend_Close(t *testing.T) {
type fields struct {
url string
reader func() io.ReadCloser
}
tests := []struct {
name string
fields fields
wantErr bool
}{
{
name: "should fail to close reader",
fields: fields{
url: "",
reader: func() io.ReadCloser {
return nil
},
},
wantErr: true,
},
{
name: "should close reader",
fields: fields{
url: "",
reader: func() io.ReadCloser {
m := &MockReaderMock{}
m.On("Close").Return(nil)
return m
},
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
h := &HTTPBackend{
url: tt.fields.url,
reader: tt.fields.reader(),
}
if err := h.Close(); (err != nil) != tt.wantErr {
t.Errorf("Close() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestHTTPBackend_Read(t *testing.T) {
type fields struct {
url string
reader func() io.ReadCloser
}
type args struct {
p []byte
}
tests := []struct {
name string
fields fields
args args
wantN int
wantErr error
}{
{
name: "should fail to read because of nil reader",
fields: fields{
url: "",
reader: func() io.ReadCloser {
return nil
},
},
wantErr: errors.New("Reader not initialized"),
},
{
name: "should fail to read",
fields: fields{
url: "",
reader: func() io.ReadCloser {
m := &MockReaderMock{}
m.On("Read", mock.Anything).Return(0, errors.New("test"))
return m
},
},
wantErr: errors.New("test"),
},
{
name: "should read",
fields: fields{
url: "",
reader: func() io.ReadCloser {
m := &MockReaderMock{}
m.On("Read", mock.Anything).Return(0, nil)
return m
},
},
wantErr: nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
h := &HTTPBackend{
url: tt.fields.url,
reader: tt.fields.reader(),
}
gotN, err := h.Read(tt.args.p)
if tt.wantErr != nil {
assert.EqualError(t, err, tt.wantErr.Error())
} else {
assert.NoError(t, err)
}
if gotN != tt.wantN {
t.Errorf("Read() gotN = %v, want %v", gotN, tt.wantN)
}
})
}
}

View File

@ -0,0 +1,45 @@
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package backend
import mock "github.com/stretchr/testify/mock"
// MockReaderMock is an autogenerated mock type for the ReaderMock type
type MockReaderMock struct {
mock.Mock
}
// Close provides a mock function with given fields:
func (_m *MockReaderMock) Close() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// Read provides a mock function with given fields: p
func (_m *MockReaderMock) Read(p []byte) (int, error) {
ret := _m.Called(p)
var r0 int
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}

View File

@ -22,11 +22,12 @@ import (
const TerraformStateReaderSupplier = "tfstate"
type TerraformStateReader struct {
library *terraform.ProviderLibrary
config config.SupplierConfig
backend backend.Backend
enumerator enumerator.StateEnumerator
deserializers []deserializer.CTYDeserializer
library *terraform.ProviderLibrary
config config.SupplierConfig
backend backend.Backend
enumerator enumerator.StateEnumerator
deserializers []deserializer.CTYDeserializer
backendOptions *backend.Options
}
func (r *TerraformStateReader) initReader() error {
@ -34,8 +35,8 @@ func (r *TerraformStateReader) initReader() error {
return nil
}
func NewReader(config config.SupplierConfig, library *terraform.ProviderLibrary) (*TerraformStateReader, error) {
reader := TerraformStateReader{library: library, config: config, deserializers: iac.Deserializers()}
func NewReader(config config.SupplierConfig, library *terraform.ProviderLibrary, backendOpts *backend.Options) (*TerraformStateReader, error) {
reader := TerraformStateReader{library: library, config: config, deserializers: iac.Deserializers(), backendOptions: backendOpts}
err := reader.initReader()
if err != nil {
return nil, err
@ -44,8 +45,7 @@ func NewReader(config config.SupplierConfig, library *terraform.ProviderLibrary)
}
func (r *TerraformStateReader) retrieve() (map[string][]cty.Value, error) {
b, err := backend.GetBackend(r.config)
b, err := backend.GetBackend(r.config, r.backendOptions)
if err != nil {
return nil, err
}

View File

@ -7,6 +7,8 @@ import (
"strings"
"testing"
"github.com/cloudskiff/driftctl/pkg/output"
"github.com/cloudskiff/driftctl/pkg/iac"
"github.com/cloudskiff/driftctl/pkg/iac/config"
"github.com/cloudskiff/driftctl/pkg/remote/aws"
@ -96,7 +98,9 @@ func TestTerraformStateReader_AWS_Resources(t *testing.T) {
if shouldUpdate {
var err error
realProvider, err = aws.NewAWSTerraformProvider()
progress := &output.MockProgress{}
progress.On("Inc").Return()
realProvider, err = aws.NewAWSTerraformProvider(progress)
if err != nil {
t.Fatal(err)
}
@ -171,7 +175,9 @@ func TestTerraformStateReader_Github_Resources(t *testing.T) {
if shouldUpdate {
var err error
realProvider, err = github.NewGithubTerraformProvider()
progress := &output.MockProgress{}
progress.On("Inc").Return()
realProvider, err = github.NewGithubTerraformProvider(progress)
if err != nil {
t.Fatal(err)
}

View File

@ -0,0 +1,39 @@
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package output
import mock "github.com/stretchr/testify/mock"
// MockProgress is an autogenerated mock type for the Progress type
type MockProgress struct {
mock.Mock
}
// Inc provides a mock function with given fields:
func (_m *MockProgress) Inc() {
_m.Called()
}
// Start provides a mock function with given fields:
func (_m *MockProgress) Start() {
_m.Called()
}
// Stop provides a mock function with given fields:
func (_m *MockProgress) Stop() {
_m.Called()
}
// Val provides a mock function with given fields:
func (_m *MockProgress) Val() uint64 {
ret := _m.Called()
var r0 uint64
if rf, ok := ret.Get(0).(func() uint64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}

100
pkg/output/progress.go Normal file
View File

@ -0,0 +1,100 @@
package output
import (
"time"
"go.uber.org/atomic"
"github.com/sirupsen/logrus"
)
var spinner = []string{"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}
const (
progressTimeout = 10 * time.Second
progressRefreshRate = 200 * time.Millisecond
)
type Progress interface {
Start()
Stop()
Inc()
Val() uint64
}
type progress struct {
endChan chan struct{}
started *atomic.Bool
count *atomic.Uint64
}
func NewProgress() *progress {
return &progress{
nil,
atomic.NewBool(false),
atomic.NewUint64(0),
}
}
func (p *progress) Start() {
if !p.started.Swap(true) {
p.count.Store(0)
p.endChan = make(chan struct{})
go p.watch()
go p.render()
}
}
func (p *progress) Stop() {
if p.started.Swap(false) {
close(p.endChan)
Printf("\n")
}
}
func (p *progress) Inc() {
if p.started.Load() {
p.count.Inc()
}
}
func (p *progress) Val() uint64 {
return p.count.Load()
}
func (p *progress) render() {
i := -1
Printf("Scanning resources:\r")
for {
select {
case <-p.endChan:
return
case <-time.After(progressRefreshRate):
i++
if i >= len(spinner) {
i = 0
}
Printf("Scanning resources: %s (%d)\r", spinner[i], p.count.Load())
}
}
}
func (p *progress) watch() {
Loop:
for {
lastVal := p.count.Load()
select {
case <-time.After(progressTimeout):
if p.count.Load() != lastVal {
continue
}
if p.started.Swap(false) {
close(p.endChan)
break Loop
}
case <-p.endChan:
return
}
}
logrus.Debug("Progress did not receive any tic. Stopping...")
}

View File

@ -0,0 +1,38 @@
package output
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestProgressTimeoutDoesNotInc(t *testing.T) {
progress := NewProgress()
progress.Start()
progress.Stop() // should not hang
progress.Inc() // should not hang or inc
assert.Equal(t, uint64(0), progress.Val())
}
func TestProgressTimeoutDoesNotHang(t *testing.T) {
progress := NewProgress()
progress.Start()
time.Sleep(progressTimeout)
for progress.started.Load() == true {
}
progress.Inc() // should not hang or inc
progress.Stop() // should not hang
assert.Equal(t, uint64(0), progress.Val())
}
func TestProgress(t *testing.T) {
progress := NewProgress()
progress.Start()
progress.Inc()
progress.Inc()
progress.Inc()
progress.Stop()
assert.Equal(t, uint64(3), progress.Val())
}

View File

@ -29,7 +29,7 @@ func NewCloudfrontDistributionSupplier(provider *AWSTerraformProvider) *Cloudfro
}
}
func (s CloudfrontDistributionSupplier) Resources() ([]resource.Resource, error) {
func (s *CloudfrontDistributionSupplier) Resources() ([]resource.Resource, error) {
distributions, err := s.client.ListAllDistributions()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsCloudfrontDistributionResourceType)
@ -50,7 +50,7 @@ func (s CloudfrontDistributionSupplier) Resources() ([]resource.Resource, error)
return s.deserializer.Deserialize(resources)
}
func (s CloudfrontDistributionSupplier) readCloudfrontDistribution(distribution cloudfront.DistributionSummary) (cty.Value, error) {
func (s *CloudfrontDistributionSupplier) readCloudfrontDistribution(distribution cloudfront.DistributionSummary) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *distribution.Id,
Ty: aws.AwsCloudfrontDistributionResourceType,

View File

@ -29,7 +29,7 @@ func NewDBInstanceSupplier(provider *AWSTerraformProvider) *DBInstanceSupplier {
}
}
func (s DBInstanceSupplier) Resources() ([]resource.Resource, error) {
func (s *DBInstanceSupplier) Resources() ([]resource.Resource, error) {
resourceList, err := s.client.ListAllDBInstances()

View File

@ -32,7 +32,7 @@ func NewDBSubnetGroupSupplier(provider *AWSTerraformProvider) *DBSubnetGroupSupp
}
}
func (s DBSubnetGroupSupplier) Resources() ([]resource.Resource, error) {
func (s *DBSubnetGroupSupplier) Resources() ([]resource.Resource, error) {
subnetGroups, err := s.client.ListAllDbSubnetGroups()
@ -53,7 +53,7 @@ func (s DBSubnetGroupSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(ctyValues)
}
func (s DBSubnetGroupSupplier) readSubnetGroup(subnetGroup rds.DBSubnetGroup) (cty.Value, error) {
func (s *DBSubnetGroupSupplier) readSubnetGroup(subnetGroup rds.DBSubnetGroup) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *subnetGroup.DBSubnetGroupName,
Ty: aws.AwsDbSubnetGroupResourceType,

View File

@ -29,7 +29,7 @@ func NewDynamoDBTableSupplier(provider *AWSTerraformProvider) *DynamoDBTableSupp
}
}
func (s DynamoDBTableSupplier) Resources() ([]resource.Resource, error) {
func (s *DynamoDBTableSupplier) Resources() ([]resource.Resource, error) {
tables, err := s.repository.ListAllTables()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsDynamodbTableResourceType)
@ -50,7 +50,7 @@ func (s DynamoDBTableSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s DynamoDBTableSupplier) readTable(tableName *string) (cty.Value, error) {
func (s *DynamoDBTableSupplier) readTable(tableName *string) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *tableName,
Ty: aws.AwsDynamodbTableResourceType,

View File

@ -31,7 +31,7 @@ func NewEC2AmiSupplier(provider *AWSTerraformProvider) *EC2AmiSupplier {
}
}
func (s EC2AmiSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2AmiSupplier) Resources() ([]resource.Resource, error) {
images, err := s.client.ListAllImages()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsAmiResourceType)
@ -52,7 +52,7 @@ func (s EC2AmiSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2AmiSupplier) readAMI(id string) (cty.Value, error) {
func (s *EC2AmiSupplier) readAMI(id string) (cty.Value, error) {
resImage, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsAmiResourceType,
ID: id,

View File

@ -32,7 +32,7 @@ func NewEC2EbsSnapshotSupplier(provider *AWSTerraformProvider) *EC2EbsSnapshotSu
}
}
func (s EC2EbsSnapshotSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2EbsSnapshotSupplier) Resources() ([]resource.Resource, error) {
snapshots, err := s.client.ListAllSnapshots()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsEbsSnapshotResourceType)
@ -53,7 +53,7 @@ func (s EC2EbsSnapshotSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2EbsSnapshotSupplier) readEbsSnapshot(snapshot ec2.Snapshot) (cty.Value, error) {
func (s *EC2EbsSnapshotSupplier) readEbsSnapshot(snapshot ec2.Snapshot) (cty.Value, error) {
id := aws.StringValue(snapshot.SnapshotId)
resSnapshot, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsEbsSnapshotResourceType,

View File

@ -32,7 +32,7 @@ func NewEC2EbsVolumeSupplier(provider *AWSTerraformProvider) *EC2EbsVolumeSuppli
}
}
func (s EC2EbsVolumeSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2EbsVolumeSupplier) Resources() ([]resource.Resource, error) {
volumes, err := s.client.ListAllVolumes()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsEbsVolumeResourceType)
@ -53,7 +53,7 @@ func (s EC2EbsVolumeSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2EbsVolumeSupplier) readEbsVolume(volume ec2.Volume) (cty.Value, error) {
func (s *EC2EbsVolumeSupplier) readEbsVolume(volume ec2.Volume) (cty.Value, error) {
id := aws.StringValue(volume.VolumeId)
resVolume, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsEbsVolumeResourceType,

View File

@ -29,7 +29,7 @@ func NewEC2EipAssociationSupplier(provider *AWSTerraformProvider) *EC2EipAssocia
terraform.NewParallelResourceReader(provider.Runner().SubRunner())}
}
func (s EC2EipAssociationSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2EipAssociationSupplier) Resources() ([]resource.Resource, error) {
associationIds, err := s.client.ListAllAddressesAssociation()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsEipAssociationResourceType)
@ -50,7 +50,7 @@ func (s EC2EipAssociationSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2EipAssociationSupplier) readEIPAssociation(assocId string) (cty.Value, error) {
func (s *EC2EipAssociationSupplier) readEIPAssociation(assocId string) (cty.Value, error) {
resAssoc, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsEipAssociationResourceType,
ID: assocId,

View File

@ -32,7 +32,7 @@ func NewEC2EipSupplier(provider *AWSTerraformProvider) *EC2EipSupplier {
}
}
func (s EC2EipSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2EipSupplier) Resources() ([]resource.Resource, error) {
addresses, err := s.client.ListAllAddresses()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsEipResourceType)
@ -53,7 +53,7 @@ func (s EC2EipSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2EipSupplier) readEIP(address ec2.Address) (cty.Value, error) {
func (s *EC2EipSupplier) readEIP(address ec2.Address) (cty.Value, error) {
id := aws.StringValue(address.AllocationId)
resAddress, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsEipResourceType,

View File

@ -31,7 +31,7 @@ func NewEC2InstanceSupplier(provider *AWSTerraformProvider) *EC2InstanceSupplier
}
}
func (s EC2InstanceSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2InstanceSupplier) Resources() ([]resource.Resource, error) {
instances, err := s.client.ListAllInstances()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsInstanceResourceType)
@ -53,7 +53,7 @@ func (s EC2InstanceSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2InstanceSupplier) readInstance(id string) (cty.Value, error) {
func (s *EC2InstanceSupplier) readInstance(id string) (cty.Value, error) {
resInstance, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsInstanceResourceType,
ID: id,

View File

@ -31,7 +31,7 @@ func NewEC2KeyPairSupplier(provider *AWSTerraformProvider) *EC2KeyPairSupplier {
}
}
func (s EC2KeyPairSupplier) Resources() ([]resource.Resource, error) {
func (s *EC2KeyPairSupplier) Resources() ([]resource.Resource, error) {
keyPairs, err := s.client.ListAllKeyPairs()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsKeyPairResourceType)
@ -52,7 +52,7 @@ func (s EC2KeyPairSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s EC2KeyPairSupplier) readKeyPair(name string) (cty.Value, error) {
func (s *EC2KeyPairSupplier) readKeyPair(name string) (cty.Value, error) {
resKp, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: resourceaws.AwsKeyPairResourceType,
ID: name,

View File

@ -30,7 +30,7 @@ func NewECRRepositorySupplier(provider *AWSTerraformProvider) *ECRRepositorySupp
}
}
func (r ECRRepositorySupplier) Resources() ([]resource.Resource, error) {
func (r *ECRRepositorySupplier) Resources() ([]resource.Resource, error) {
repositories, err := r.client.ListAllRepositories()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsEcrRepositoryResourceType)
@ -51,7 +51,7 @@ func (r ECRRepositorySupplier) Resources() ([]resource.Resource, error) {
return r.deserializer.Deserialize(retrieve)
}
func (r ECRRepositorySupplier) readRepository(repository *ecr.Repository) (cty.Value, error) {
func (r *ECRRepositorySupplier) readRepository(repository *ecr.Repository) (cty.Value, error) {
val, err := r.reader.ReadResource(terraform.ReadResourceArgs{
ID: *repository.RepositoryName,
Ty: aws.AwsEcrRepositoryResourceType,

View File

@ -31,7 +31,7 @@ func NewIamAccessKeySupplier(provider *AWSTerraformProvider) *IamAccessKeySuppli
}
}
func (s IamAccessKeySupplier) Resources() ([]resource.Resource, error) {
func (s *IamAccessKeySupplier) Resources() ([]resource.Resource, error) {
keys, err := listIamAccessKeys(s.client)
if err != nil {
return nil, err
@ -52,7 +52,7 @@ func (s IamAccessKeySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s IamAccessKeySupplier) readRes(key *iam.AccessKeyMetadata) (cty.Value, error) {
func (s *IamAccessKeySupplier) readRes(key *iam.AccessKeyMetadata) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamAccessKeyResourceType,

View File

@ -32,7 +32,7 @@ func NewIamPolicySupplier(provider *AWSTerraformProvider) *IamPolicySupplier {
}
}
func (s IamPolicySupplier) Resources() ([]resource.Resource, error) {
func (s *IamPolicySupplier) Resources() ([]resource.Resource, error) {
policies, err := listIamPolicies(s.client)
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsIamPolicyResourceType)
@ -53,7 +53,7 @@ func (s IamPolicySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s IamPolicySupplier) readRes(resource *iam.Policy) (cty.Value, error) {
func (s *IamPolicySupplier) readRes(resource *iam.Policy) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamPolicyResourceType,

View File

@ -31,7 +31,7 @@ func NewIamRolePolicyAttachmentSupplier(provider *AWSTerraformProvider) *IamRole
}
}
func (s IamRolePolicyAttachmentSupplier) Resources() ([]resource.Resource, error) {
func (s *IamRolePolicyAttachmentSupplier) Resources() ([]resource.Resource, error) {
roles, err := listIamRoles(s.client, resourceaws.AwsIamRolePolicyAttachmentResourceType)
if err != nil {
return nil, err
@ -66,7 +66,7 @@ func (s IamRolePolicyAttachmentSupplier) Resources() ([]resource.Resource, error
return s.deserializer.Deserialize(results)
}
func (s IamRolePolicyAttachmentSupplier) readRes(attachedPol attachedRolePolicy) (cty.Value, error) {
func (s *IamRolePolicyAttachmentSupplier) readRes(attachedPol attachedRolePolicy) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamRolePolicyAttachmentResourceType,

View File

@ -33,7 +33,7 @@ func NewIamRolePolicySupplier(provider *AWSTerraformProvider) *IamRolePolicySupp
}
}
func (s IamRolePolicySupplier) Resources() ([]resource.Resource, error) {
func (s *IamRolePolicySupplier) Resources() ([]resource.Resource, error) {
policies, err := listIamRolePolicies(s.client, resourceaws.AwsIamRolePolicyResourceType)
if err != nil {
return nil, err
@ -52,7 +52,7 @@ func (s IamRolePolicySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s IamRolePolicySupplier) readRes(name string) (cty.Value, error) {
func (s *IamRolePolicySupplier) readRes(name string) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamRolePolicyResourceType,

View File

@ -45,7 +45,7 @@ func awsIamRoleShouldBeIgnored(roleName string) bool {
return ok
}
func (s IamRoleSupplier) Resources() ([]resource.Resource, error) {
func (s *IamRoleSupplier) Resources() ([]resource.Resource, error) {
roles, err := listIamRoles(s.client, resourceaws.AwsIamRoleResourceType)
if err != nil {
return nil, err
@ -69,7 +69,7 @@ func (s IamRoleSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s IamRoleSupplier) readRes(resource *iam.Role) (cty.Value, error) {
func (s *IamRoleSupplier) readRes(resource *iam.Role) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamRoleResourceType,

View File

@ -31,7 +31,7 @@ func NewIamUserPolicyAttachmentSupplier(provider *AWSTerraformProvider) *IamUser
}
}
func (s IamUserPolicyAttachmentSupplier) Resources() ([]resource.Resource, error) {
func (s *IamUserPolicyAttachmentSupplier) Resources() ([]resource.Resource, error) {
users, err := listIamUsers(s.client, resourceaws.AwsIamUserPolicyAttachmentResourceType)
if err != nil {
return nil, err
@ -63,7 +63,7 @@ func (s IamUserPolicyAttachmentSupplier) Resources() ([]resource.Resource, error
return s.deserializer.Deserialize(results)
}
func (s IamUserPolicyAttachmentSupplier) readRes(attachedPol attachedUserPolicy) (cty.Value, error) {
func (s *IamUserPolicyAttachmentSupplier) readRes(attachedPol attachedUserPolicy) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamUserPolicyAttachmentResourceType,

View File

@ -33,7 +33,7 @@ func NewIamUserPolicySupplier(provider *AWSTerraformProvider) *IamUserPolicySupp
}
}
func (s IamUserPolicySupplier) Resources() ([]resource.Resource, error) {
func (s *IamUserPolicySupplier) Resources() ([]resource.Resource, error) {
users, err := listIamUsers(s.client, resourceaws.AwsIamUserPolicyResourceType)
if err != nil {
return nil, err
@ -66,7 +66,7 @@ func (s IamUserPolicySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s IamUserPolicySupplier) readRes(policyName string) (cty.Value, error) {
func (s *IamUserPolicySupplier) readRes(policyName string) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamUserPolicyResourceType,

View File

@ -31,7 +31,7 @@ func NewIamUserSupplier(provider *AWSTerraformProvider) *IamUserSupplier {
}
}
func (s IamUserSupplier) Resources() ([]resource.Resource, error) {
func (s *IamUserSupplier) Resources() ([]resource.Resource, error) {
users, err := listIamUsers(s.client, resourceaws.AwsIamUserResourceType)
if err != nil {
return nil, err
@ -52,7 +52,7 @@ func (s IamUserSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s IamUserSupplier) readRes(user *iam.User) (cty.Value, error) {
func (s *IamUserSupplier) readRes(user *iam.User) (cty.Value, error) {
res, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsIamUserResourceType,

View File

@ -2,6 +2,7 @@ package aws
import (
"github.com/cloudskiff/driftctl/pkg/alerter"
"github.com/cloudskiff/driftctl/pkg/output"
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/resource"
@ -14,8 +15,8 @@ const RemoteAWSTerraform = "aws+tf"
* Initialize remote (configure credentials, launch tf providers and start gRPC clients)
* Required to use Scanner
*/
func Init(alerter *alerter.Alerter, providerLibrary *terraform.ProviderLibrary, supplierLibrary *resource.SupplierLibrary) error {
provider, err := NewAWSTerraformProvider()
func Init(alerter *alerter.Alerter, providerLibrary *terraform.ProviderLibrary, supplierLibrary *resource.SupplierLibrary, progress output.Progress) error {
provider, err := NewAWSTerraformProvider(progress)
if err != nil {
return err
}
@ -67,7 +68,7 @@ func Init(alerter *alerter.Alerter, providerLibrary *terraform.ProviderLibrary,
supplierLibrary.AddSupplier(NewSqsQueuePolicySupplier(provider))
supplierLibrary.AddSupplier(NewSNSTopicSupplier(provider))
supplierLibrary.AddSupplier(NewSNSTopicPolicySupplier(provider))
supplierLibrary.AddSupplier(NewSNSTopicSubscriptionSupplier(provider))
supplierLibrary.AddSupplier(NewSNSTopicSubscriptionSupplier(provider, alerter))
supplierLibrary.AddSupplier(NewDynamoDBTableSupplier(provider))
supplierLibrary.AddSupplier(NewRoute53HealthCheckSupplier(provider))
supplierLibrary.AddSupplier(NewCloudfrontDistributionSupplier(provider))

View File

@ -1,9 +1,14 @@
package aws
import "github.com/cloudskiff/driftctl/pkg/terraform"
import (
"github.com/cloudskiff/driftctl/pkg/output"
"github.com/cloudskiff/driftctl/pkg/terraform"
)
func InitTestAwsProvider(providerLibrary *terraform.ProviderLibrary) (*AWSTerraformProvider, error) {
provider, err := NewAWSTerraformProvider()
progress := &output.MockProgress{}
progress.On("Inc").Maybe().Return()
provider, err := NewAWSTerraformProvider(progress)
if err != nil {
return nil, err
}

View File

@ -29,7 +29,7 @@ func NewInternetGatewaySupplier(provider *AWSTerraformProvider) *InternetGateway
}
}
func (s InternetGatewaySupplier) Resources() ([]resource.Resource, error) {
func (s *InternetGatewaySupplier) Resources() ([]resource.Resource, error) {
internetGateways, err := listInternetGateways(s.client)
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsInternetGatewayResourceType)
@ -50,7 +50,7 @@ func (s InternetGatewaySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(resources)
}
func (s InternetGatewaySupplier) readInternetGateway(internetGateway ec2.InternetGateway) (cty.Value, error) {
func (s *InternetGatewaySupplier) readInternetGateway(internetGateway ec2.InternetGateway) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsInternetGatewayResourceType
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: Ty,

View File

@ -30,7 +30,7 @@ func NewKMSAliasSupplier(provider *AWSTerraformProvider) *KMSAliasSupplier {
}
}
func (s KMSAliasSupplier) Resources() ([]resource.Resource, error) {
func (s *KMSAliasSupplier) Resources() ([]resource.Resource, error) {
aliases, err := s.client.ListAllAliases()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsKmsAliasResourceType)
@ -51,7 +51,7 @@ func (s KMSAliasSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s KMSAliasSupplier) readAlias(alias *kms.AliasListEntry) (cty.Value, error) {
func (s *KMSAliasSupplier) readAlias(alias *kms.AliasListEntry) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *alias.AliasName,
Ty: aws.AwsKmsAliasResourceType,

View File

@ -30,7 +30,7 @@ func NewKMSKeySupplier(provider *AWSTerraformProvider) *KMSKeySupplier {
}
}
func (s KMSKeySupplier) Resources() ([]resource.Resource, error) {
func (s *KMSKeySupplier) Resources() ([]resource.Resource, error) {
keys, err := s.client.ListAllKeys()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsKmsKeyResourceType)
@ -51,7 +51,7 @@ func (s KMSKeySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s KMSKeySupplier) readKey(key *kms.KeyListEntry) (cty.Value, error) {
func (s *KMSKeySupplier) readKey(key *kms.KeyListEntry) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *key.KeyId,
Ty: aws.AwsKmsKeyResourceType,

View File

@ -29,7 +29,7 @@ func NewLambdaEventSourceMappingSupplier(provider *AWSTerraformProvider) *Lambda
}
}
func (s LambdaEventSourceMappingSupplier) Resources() ([]resource.Resource, error) {
func (s *LambdaEventSourceMappingSupplier) Resources() ([]resource.Resource, error) {
functions, err := s.client.ListAllLambdaEventSourceMappings()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsLambdaEventSourceMappingResourceType)
@ -49,7 +49,7 @@ func (s LambdaEventSourceMappingSupplier) Resources() ([]resource.Resource, erro
return s.deserializer.Deserialize(results)
}
func (s LambdaEventSourceMappingSupplier) readLambdaEventSourceMapping(sourceMappingConfig lambda.EventSourceMappingConfiguration) (cty.Value, error) {
func (s *LambdaEventSourceMappingSupplier) readLambdaEventSourceMapping(sourceMappingConfig lambda.EventSourceMappingConfiguration) (cty.Value, error) {
resFunction, err := s.reader.ReadResource(
terraform.ReadResourceArgs{
Ty: resourceaws.AwsLambdaEventSourceMappingResourceType,

View File

@ -29,7 +29,7 @@ func NewLambdaFunctionSupplier(provider *AWSTerraformProvider) *LambdaFunctionSu
}
}
func (s LambdaFunctionSupplier) Resources() ([]resource.Resource, error) {
func (s *LambdaFunctionSupplier) Resources() ([]resource.Resource, error) {
functions, err := s.client.ListAllLambdaFunctions()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsLambdaFunctionResourceType)
@ -50,7 +50,7 @@ func (s LambdaFunctionSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s LambdaFunctionSupplier) readLambda(function lambda.FunctionConfiguration) (cty.Value, error) {
func (s *LambdaFunctionSupplier) readLambda(function lambda.FunctionConfiguration) (cty.Value, error) {
name := *function.FunctionName
resFunction, err := s.reader.ReadResource(
terraform.ReadResourceArgs{

View File

@ -29,7 +29,7 @@ func NewNatGatewaySupplier(provider *AWSTerraformProvider) *NatGatewaySupplier {
}
}
func (s NatGatewaySupplier) Resources() ([]resource.Resource, error) {
func (s *NatGatewaySupplier) Resources() ([]resource.Resource, error) {
retrievedNatGateways, err := listNatGateways(s.client)
if err != nil {
@ -58,7 +58,7 @@ func (s NatGatewaySupplier) Resources() ([]resource.Resource, error) {
return resources, nil
}
func (s NatGatewaySupplier) readNatGateway(gateway ec2.NatGateway) (cty.Value, error) {
func (s *NatGatewaySupplier) readNatGateway(gateway ec2.NatGateway) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsNatGatewayResourceType
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *gateway.NatGatewayId,

View File

@ -3,6 +3,7 @@ package aws
import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/cloudskiff/driftctl/pkg/output"
"github.com/cloudskiff/driftctl/pkg/remote/terraform"
tf "github.com/cloudskiff/driftctl/pkg/terraform"
)
@ -41,7 +42,7 @@ type AWSTerraformProvider struct {
session *session.Session
}
func NewAWSTerraformProvider() (*AWSTerraformProvider, error) {
func NewAWSTerraformProvider(progress output.Progress) (*AWSTerraformProvider, error) {
p := &AWSTerraformProvider{}
providerKey := "aws"
installer, err := tf.NewProviderInstaller(tf.ProviderConfig{
@ -64,7 +65,7 @@ func NewAWSTerraformProvider() (*AWSTerraformProvider, error) {
MaxRetries: 10, // TODO make this configurable
}
},
})
}, progress)
if err != nil {
return nil, err
}

View File

@ -30,7 +30,7 @@ func NewRoute53HealthCheckSupplier(provider *AWSTerraformProvider) *Route53Healt
}
}
func (s Route53HealthCheckSupplier) Resources() ([]resource.Resource, error) {
func (s *Route53HealthCheckSupplier) Resources() ([]resource.Resource, error) {
healthChecks, err := s.client.ListAllHealthChecks()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsRoute53HealthCheckResourceType)
@ -51,7 +51,7 @@ func (s Route53HealthCheckSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s Route53HealthCheckSupplier) readHealthCheck(healthCheck *route53.HealthCheck) (cty.Value, error) {
func (s *Route53HealthCheckSupplier) readHealthCheck(healthCheck *route53.HealthCheck) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *healthCheck.Id,
Ty: aws.AwsRoute53HealthCheckResourceType,

View File

@ -32,7 +32,7 @@ func NewRoute53RecordSupplier(provider *AWSTerraformProvider) *Route53RecordSupp
terraform.NewParallelResourceReader(provider.Runner().SubRunner())}
}
func (s Route53RecordSupplier) Resources() ([]resource.Resource, error) {
func (s *Route53RecordSupplier) Resources() ([]resource.Resource, error) {
zones, err := s.listZones()
if err != nil {
@ -52,7 +52,7 @@ func (s Route53RecordSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s Route53RecordSupplier) listZones() ([][2]string, error) {
func (s *Route53RecordSupplier) listZones() ([][2]string, error) {
results := make([][2]string, 0)
zones, err := s.client.ListAllZones()
if err != nil {
@ -66,7 +66,7 @@ func (s Route53RecordSupplier) listZones() ([][2]string, error) {
return results, nil
}
func (s Route53RecordSupplier) listRecordsForZone(zoneId string, zoneName string) error {
func (s *Route53RecordSupplier) listRecordsForZone(zoneId string, zoneName string) error {
records, err := s.client.ListRecordsForZone(zoneId)

View File

@ -34,7 +34,7 @@ func NewRoute53ZoneSupplier(provider *AWSTerraformProvider) *Route53ZoneSupplier
}
}
func (s Route53ZoneSupplier) Resources() ([]resource.Resource, error) {
func (s *Route53ZoneSupplier) Resources() ([]resource.Resource, error) {
zones, err := s.client.ListAllZones()
if err != nil {
@ -55,7 +55,7 @@ func (s Route53ZoneSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(results)
}
func (s Route53ZoneSupplier) readZone(hostedZone route53.HostedZone) (cty.Value, error) {
func (s *Route53ZoneSupplier) readZone(hostedZone route53.HostedZone) (cty.Value, error) {
name := *hostedZone.Name
zone, err := s.reader.ReadResource(terraform.ReadResourceArgs{

View File

@ -29,7 +29,7 @@ func NewRouteSupplier(provider *AWSTerraformProvider) *RouteSupplier {
}
}
func (s RouteSupplier) Resources() ([]resource.Resource, error) {
func (s *RouteSupplier) Resources() ([]resource.Resource, error) {
routeTables, err := listRouteTables(s.client, aws.AwsRouteResourceType)
if err != nil {
@ -59,7 +59,7 @@ func (s RouteSupplier) Resources() ([]resource.Resource, error) {
return deserializedRoutes, nil
}
func (s RouteSupplier) readRoute(tableId string, route ec2.Route) (cty.Value, error) {
func (s *RouteSupplier) readRoute(tableId string, route ec2.Route) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsRouteResourceType
attributes := map[string]interface{}{

View File

@ -29,7 +29,7 @@ func NewRouteTableAssociationSupplier(provider *AWSTerraformProvider) *RouteTabl
}
}
func (s RouteTableAssociationSupplier) Resources() ([]resource.Resource, error) {
func (s *RouteTableAssociationSupplier) Resources() ([]resource.Resource, error) {
tables, err := listRouteTables(s.client, aws.AwsRouteTableAssociationResourceType)
if err != nil {
@ -64,7 +64,7 @@ func (s RouteTableAssociationSupplier) Resources() ([]resource.Resource, error)
return deserializedRouteTableAssociations, nil
}
func (s RouteTableAssociationSupplier) readRouteTableAssociation(assoc ec2.RouteTableAssociation) (cty.Value, error) {
func (s *RouteTableAssociationSupplier) readRouteTableAssociation(assoc ec2.RouteTableAssociation) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsRouteTableAssociationResourceType
attributes := map[string]interface{}{
"route_table_id": *assoc.RouteTableId,
@ -83,7 +83,7 @@ func (s RouteTableAssociationSupplier) readRouteTableAssociation(assoc ec2.Route
return *val, nil
}
func (s RouteTableAssociationSupplier) shouldBeIgnored(assoc *ec2.RouteTableAssociation) bool {
func (s *RouteTableAssociationSupplier) shouldBeIgnored(assoc *ec2.RouteTableAssociation) bool {
// Ignore when nothing is associated
if assoc.GatewayId == nil && assoc.SubnetId == nil {

View File

@ -37,14 +37,17 @@ func NewRouteTableSupplier(provider *AWSTerraformProvider) *RouteTableSupplier {
}
}
func (s RouteTableSupplier) Resources() ([]resource.Resource, error) {
func (s *RouteTableSupplier) Resources() ([]resource.Resource, error) {
retrievedRouteTables, err := listRouteTables(s.client, aws.AwsRouteTableResourceType)
results, err := listRouteTables(s.client, aws.AwsRouteTableResourceType)
if err != nil {
return nil, err
}
for _, routeTable := range retrievedRouteTables {
retrievedDefaultRouteTables := []*ec2.RouteTable{}
retrievedRouteTables := []*ec2.RouteTable{}
for _, routeTable := range results {
res := *routeTable
var isMain bool
for _, assoc := range res.Associations {
@ -54,13 +57,16 @@ func (s RouteTableSupplier) Resources() ([]resource.Resource, error) {
}
}
if isMain {
s.defaultRouteTableRunner.Run(func() (cty.Value, error) {
return s.readRouteTable(res, true)
})
retrievedDefaultRouteTables = append(retrievedDefaultRouteTables, &res)
continue
}
s.routeTableRunner.Run(func() (cty.Value, error) {
return s.readRouteTable(res, false)
retrievedRouteTables = append(retrievedRouteTables, &res)
}
for _, routeTable := range retrievedDefaultRouteTables {
res := *routeTable
s.defaultRouteTableRunner.Run(func() (cty.Value, error) {
return s.readRouteTable(res, true)
})
}
@ -69,6 +75,14 @@ func (s RouteTableSupplier) Resources() ([]resource.Resource, error) {
if err != nil {
return nil, err
}
for _, routeTable := range retrievedRouteTables {
res := *routeTable
s.routeTableRunner.Run(func() (cty.Value, error) {
return s.readRouteTable(res, false)
})
}
routeTableResources, err := s.routeTableRunner.Wait()
if err != nil {
return nil, err
@ -91,7 +105,7 @@ func (s RouteTableSupplier) Resources() ([]resource.Resource, error) {
return resources, nil
}
func (s RouteTableSupplier) readRouteTable(routeTable ec2.RouteTable, isMain bool) (cty.Value, error) {
func (s *RouteTableSupplier) readRouteTable(routeTable ec2.RouteTable, isMain bool) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsRouteTableResourceType
attributes := map[string]interface{}{}
if isMain {

View File

@ -7,6 +7,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -15,10 +16,11 @@ import (
)
type S3BucketAnalyticSupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
providerConfig tf.TerraformProviderConfig
}
func NewS3BucketAnalyticSupplier(provider *AWSTerraformProvider, repository repository.S3Repository) *S3BucketAnalyticSupplier {
@ -27,6 +29,7 @@ func NewS3BucketAnalyticSupplier(provider *AWSTerraformProvider, repository repo
awsdeserializer.NewS3BucketAnalyticDeserializer(),
repository,
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
provider.Config,
}
}
@ -42,7 +45,7 @@ func (s *S3BucketAnalyticSupplier) Resources() ([]resource.Resource, error) {
if err != nil {
return nil, err
}
if region == "" {
if region == "" || region != s.providerConfig.DefaultAlias {
continue
}
if err := s.listBucketAnalyticConfiguration(&bucket, region); err != nil {

View File

@ -11,6 +11,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -66,18 +67,6 @@ func TestS3BucketAnalyticSupplier_Resources(t *testing.T) {
nil,
)
repository.On(
"ListBucketAnalyticsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
"eu-west-1",
).Return(
[]*s3.AnalyticsConfiguration{
{Id: awssdk.String("Analytics_Bucket1")},
{Id: awssdk.String("Analytics2_Bucket1")},
},
nil,
)
repository.On(
"ListBucketAnalyticsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift2")},
@ -89,18 +78,6 @@ func TestS3BucketAnalyticSupplier_Resources(t *testing.T) {
},
nil,
)
repository.On(
"ListBucketAnalyticsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift3")},
"ap-northeast-1",
).Return(
[]*s3.AnalyticsConfiguration{
{Id: awssdk.String("Analytics_Bucket3")},
{Id: awssdk.String("Analytics2_Bucket3")},
},
nil,
)
},
},
@ -124,14 +101,14 @@ func TestS3BucketAnalyticSupplier_Resources(t *testing.T) {
"GetBucketLocation",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
).Return(
"eu-west-1",
"eu-west-3",
nil,
)
repository.On(
"ListBucketAnalyticsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
"eu-west-1",
"eu-west-3",
).Return(
nil,
awserr.NewRequestFailure(nil, 403, ""),
@ -169,6 +146,10 @@ func TestS3BucketAnalyticSupplier_Resources(t *testing.T) {
deserializer,
&mock,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
tf.TerraformProviderConfig{
Name: "test",
DefaultAlias: "eu-west-3",
},
}
got, err := s.Resources()
assert.Equal(t, err, tt.wantErr)

View File

@ -7,6 +7,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -15,10 +16,11 @@ import (
)
type S3BucketInventorySupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
providerConfig tf.TerraformProviderConfig
}
func NewS3BucketInventorySupplier(provider *AWSTerraformProvider, repository repository.S3Repository) *S3BucketInventorySupplier {
@ -27,6 +29,7 @@ func NewS3BucketInventorySupplier(provider *AWSTerraformProvider, repository rep
awsdeserializer.NewS3BucketInventoryDeserializer(),
repository,
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
provider.Config,
}
}
@ -42,7 +45,7 @@ func (s *S3BucketInventorySupplier) Resources() ([]resource.Resource, error) {
if err != nil {
return nil, err
}
if region == "" {
if region == "" || region != s.providerConfig.DefaultAlias {
continue
}
if err := s.listBucketInventoryConfiguration(&bucket, region); err != nil {

View File

@ -11,6 +11,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -64,18 +65,6 @@ func TestS3BucketInventorySupplier_Resources(t *testing.T) {
nil,
)
repository.On(
"ListBucketInventoryConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
"eu-west-1",
).Return(
[]*s3.InventoryConfiguration{
{Id: awssdk.String("Inventory_Bucket1")},
{Id: awssdk.String("Inventory2_Bucket1")},
},
nil,
)
repository.On(
"ListBucketInventoryConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift2")},
@ -87,18 +76,6 @@ func TestS3BucketInventorySupplier_Resources(t *testing.T) {
},
nil,
)
repository.On(
"ListBucketInventoryConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift3")},
"eu-west-1",
).Return(
[]*s3.InventoryConfiguration{
{Id: awssdk.String("Inventory_Bucket3")},
{Id: awssdk.String("Inventory2_Bucket3")},
},
nil,
)
},
},
{
@ -121,18 +98,17 @@ func TestS3BucketInventorySupplier_Resources(t *testing.T) {
"GetBucketLocation",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
).Return(
"eu-west-1",
"eu-west-3",
nil,
)
repository.On(
"ListBucketInventoryConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
"eu-west-1",
"eu-west-3",
).Return(
nil,
awserr.NewRequestFailure(nil, 403, ""),
)
},
wantErr: remoteerror.NewResourceEnumerationError(awserr.NewRequestFailure(nil, 403, ""), resourceaws.AwsS3BucketInventoryResourceType),
},
@ -165,6 +141,10 @@ func TestS3BucketInventorySupplier_Resources(t *testing.T) {
deserializer,
&mock,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
tf.TerraformProviderConfig{
Name: "test",
DefaultAlias: "eu-west-3",
},
}
got, err := s.Resources()
assert.Equal(t, err, tt.wantErr)

View File

@ -11,6 +11,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -64,18 +65,6 @@ func TestS3BucketMetricSupplier_Resources(t *testing.T) {
nil,
)
repository.On(
"ListBucketMetricsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
"eu-west-1",
).Return(
[]*s3.MetricsConfiguration{
{Id: awssdk.String("Metrics_Bucket1")},
{Id: awssdk.String("Metrics2_Bucket1")},
},
nil,
)
repository.On(
"ListBucketMetricsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift2")},
@ -87,18 +76,6 @@ func TestS3BucketMetricSupplier_Resources(t *testing.T) {
},
nil,
)
repository.On(
"ListBucketMetricsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift3")},
"ap-northeast-1",
).Return(
[]*s3.MetricsConfiguration{
{Id: awssdk.String("Metrics_Bucket3")},
{Id: awssdk.String("Metrics2_Bucket3")},
},
nil,
)
},
},
{
@ -121,14 +98,14 @@ func TestS3BucketMetricSupplier_Resources(t *testing.T) {
"GetBucketLocation",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
).Return(
"eu-west-1",
"eu-west-3",
nil,
)
repository.On(
"ListBucketMetricsConfigurations",
&s3.Bucket{Name: awssdk.String("bucket-martin-test-drift")},
"eu-west-1",
"eu-west-3",
).Return(
nil,
awserr.NewRequestFailure(nil, 403, ""),
@ -165,6 +142,10 @@ func TestS3BucketMetricSupplier_Resources(t *testing.T) {
deserializer,
&mock,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
tf.TerraformProviderConfig{
Name: "test",
DefaultAlias: "eu-west-3",
},
}
got, err := s.Resources()
assert.Equal(t, err, tt.wantErr)

View File

@ -7,6 +7,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -15,10 +16,11 @@ import (
)
type S3BucketMetricSupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
providerConfig tf.TerraformProviderConfig
}
func NewS3BucketMetricSupplier(provider *AWSTerraformProvider, repository repository.S3Repository) *S3BucketMetricSupplier {
@ -27,6 +29,7 @@ func NewS3BucketMetricSupplier(provider *AWSTerraformProvider, repository reposi
awsdeserializer.NewS3BucketMetricDeserializer(),
repository,
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
provider.Config,
}
}
@ -42,7 +45,7 @@ func (s *S3BucketMetricSupplier) Resources() ([]resource.Resource, error) {
if err != nil {
return nil, err
}
if region == "" {
if region == "" || region != s.providerConfig.DefaultAlias {
continue
}
if err := s.listBucketMetricConfiguration(&bucket, region); err != nil {

View File

@ -4,6 +4,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -12,10 +13,11 @@ import (
)
type S3BucketNotificationSupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
providerConfig tf.TerraformProviderConfig
}
func NewS3BucketNotificationSupplier(provider *AWSTerraformProvider, repository repository.S3Repository) *S3BucketNotificationSupplier {
@ -24,6 +26,7 @@ func NewS3BucketNotificationSupplier(provider *AWSTerraformProvider, repository
awsdeserializer.NewS3BucketNotificationDeserializer(),
repository,
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
provider.Config,
}
}
@ -39,7 +42,7 @@ func (s *S3BucketNotificationSupplier) Resources() ([]resource.Resource, error)
if err != nil {
return nil, err
}
if region == "" {
if region == "" || region != s.providerConfig.DefaultAlias {
continue
}
s.runner.Run(func() (cty.Value, error) {

View File

@ -11,6 +11,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -119,6 +120,10 @@ func TestS3BucketNotificationSupplier_Resources(t *testing.T) {
deserializer,
&mock,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
tf.TerraformProviderConfig{
Name: "test",
DefaultAlias: "eu-west-3",
},
}
got, err := s.Resources()
assert.Equal(t, err, tt.wantErr)

View File

@ -4,6 +4,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -12,10 +13,11 @@ import (
)
type S3BucketPolicySupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
providerConfig tf.TerraformProviderConfig
}
func NewS3BucketPolicySupplier(provider *AWSTerraformProvider, repository repository.S3Repository) *S3BucketPolicySupplier {
@ -24,6 +26,7 @@ func NewS3BucketPolicySupplier(provider *AWSTerraformProvider, repository reposi
awsdeserializer.NewS3BucketPolicyDeserializer(),
repository,
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
provider.Config,
}
}
@ -39,7 +42,7 @@ func (s *S3BucketPolicySupplier) Resources() ([]resource.Resource, error) {
if err != nil {
return nil, err
}
if region == "" {
if region == "" || region != s.providerConfig.DefaultAlias {
continue
}
s.runner.Run(func() (cty.Value, error) {

View File

@ -11,6 +11,7 @@ import (
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -120,6 +121,10 @@ func TestS3BucketPolicySupplier_Resources(t *testing.T) {
deserializer,
&mock,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
tf.TerraformProviderConfig{
Name: "test",
DefaultAlias: "eu-west-3",
},
}
got, err := s.Resources()
assert.Equal(t, err, tt.wantErr)

View File

@ -2,21 +2,25 @@ package aws
import (
"github.com/aws/aws-sdk-go/service/s3"
"github.com/zclconf/go-cty/cty"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
"github.com/cloudskiff/driftctl/pkg/terraform"
"github.com/zclconf/go-cty/cty"
)
type S3BucketSupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
repository repository.S3Repository
runner *terraform.ParallelResourceReader
providerConfig tf.TerraformProviderConfig
}
func NewS3BucketSupplier(provider *AWSTerraformProvider, repository repository.S3Repository) *S3BucketSupplier {
@ -25,10 +29,11 @@ func NewS3BucketSupplier(provider *AWSTerraformProvider, repository repository.S
awsdeserializer.NewS3BucketDeserializer(),
repository,
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
provider.Config,
}
}
func (s S3BucketSupplier) Resources() ([]resource.Resource, error) {
func (s *S3BucketSupplier) Resources() ([]resource.Resource, error) {
buckets, err := s.repository.ListAllBuckets()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsS3BucketResourceType)
@ -53,7 +58,7 @@ func (s *S3BucketSupplier) readBucket(bucket s3.Bucket) (cty.Value, error) {
if err != nil {
return cty.NilVal, err
}
if region == "" {
if region == "" || region != s.providerConfig.DefaultAlias {
return cty.NilVal, nil
}

View File

@ -7,10 +7,12 @@ import (
awssdk "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/cloudskiff/driftctl/pkg/parallel"
"github.com/cloudskiff/driftctl/pkg/remote/aws/client"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
tf "github.com/cloudskiff/driftctl/pkg/remote/terraform"
"github.com/cloudskiff/driftctl/pkg/resource"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
awsdeserializer "github.com/cloudskiff/driftctl/pkg/resource/aws/deserializer"
@ -100,6 +102,10 @@ func TestS3BucketSupplier_Resources(t *testing.T) {
deserializer,
&mock,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
tf.TerraformProviderConfig{
Name: "test",
DefaultAlias: "eu-west-3",
},
}
got, err := s.Resources()
assert.Equal(t, err, tt.wantErr)

View File

@ -30,7 +30,7 @@ func NewSNSTopicPolicySupplier(provider *AWSTerraformProvider) *SNSTopicPolicySu
}
}
func (s SNSTopicPolicySupplier) Resources() ([]resource.Resource, error) {
func (s *SNSTopicPolicySupplier) Resources() ([]resource.Resource, error) {
topics, err := s.client.ListAllTopics()
if err != nil {
return nil, remoteerror.NewResourceEnumerationErrorWithType(err, aws.AwsSnsTopicPolicyResourceType, aws.AwsSnsTopicResourceType)
@ -51,7 +51,7 @@ func (s SNSTopicPolicySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s SNSTopicPolicySupplier) readTopicPolicy(topic sns.Topic) (cty.Value, error) {
func (s *SNSTopicPolicySupplier) readTopicPolicy(topic sns.Topic) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *topic.TopicArn,
Ty: aws.AwsSnsTopicPolicyResourceType,

View File

@ -1,12 +1,17 @@
package aws
import (
"fmt"
awssdk "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/sns"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
"github.com/sirupsen/logrus"
"github.com/zclconf/go-cty/cty"
"github.com/cloudskiff/driftctl/pkg/alerter"
"github.com/cloudskiff/driftctl/pkg/remote/aws/repository"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
"github.com/cloudskiff/driftctl/pkg/remote/deserializer"
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/cloudskiff/driftctl/pkg/resource/aws"
@ -14,23 +19,39 @@ import (
"github.com/cloudskiff/driftctl/pkg/terraform"
)
type pendingTopicAlert struct {
endpoint *string
}
func (p *pendingTopicAlert) Message() string {
return fmt.Sprintf("%s with pending confirmation status for endpoint \"%s\" will be ignored",
aws.AwsSnsTopicSubscriptionResourceType,
awssdk.StringValue(p.endpoint))
}
func (p *pendingTopicAlert) ShouldIgnoreResource() bool {
return false
}
type SNSTopicSubscriptionSupplier struct {
reader terraform.ResourceReader
deserializer deserializer.CTYDeserializer
client repository.SNSRepository
runner *terraform.ParallelResourceReader
alerter alerter.AlerterInterface
}
func NewSNSTopicSubscriptionSupplier(provider *AWSTerraformProvider) *SNSTopicSubscriptionSupplier {
func NewSNSTopicSubscriptionSupplier(provider *AWSTerraformProvider, a alerter.AlerterInterface) *SNSTopicSubscriptionSupplier {
return &SNSTopicSubscriptionSupplier{
provider,
awsdeserializer.NewSNSTopicSubscriptionDeserializer(),
repository.NewSNSClient(provider.session),
terraform.NewParallelResourceReader(provider.Runner().SubRunner()),
a,
}
}
func (s SNSTopicSubscriptionSupplier) Resources() ([]resource.Resource, error) {
func (s *SNSTopicSubscriptionSupplier) Resources() ([]resource.Resource, error) {
subscriptions, err := s.client.ListAllSubscriptions()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsSnsTopicSubscriptionResourceType)
@ -38,7 +59,7 @@ func (s SNSTopicSubscriptionSupplier) Resources() ([]resource.Resource, error) {
for _, subscription := range subscriptions {
subscription := subscription
s.runner.Run(func() (cty.Value, error) {
return s.readTopicSubscription(subscription)
return s.readTopicSubscription(subscription, s.alerter)
})
}
@ -50,7 +71,15 @@ func (s SNSTopicSubscriptionSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s SNSTopicSubscriptionSupplier) readTopicSubscription(subscription *sns.Subscription) (cty.Value, error) {
func (s *SNSTopicSubscriptionSupplier) readTopicSubscription(subscription *sns.Subscription, alertr alerter.AlerterInterface) (cty.Value, error) {
if subscription.SubscriptionArn != nil && *subscription.SubscriptionArn == "PendingConfirmation" {
alertr.SendAlert(
fmt.Sprintf("%s.%s", aws.AwsSnsTopicSubscriptionResourceType, *subscription.SubscriptionArn),
&pendingTopicAlert{subscription.Endpoint},
)
return cty.NilVal, nil
}
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *subscription.SubscriptionArn,
Ty: aws.AwsSnsTopicSubscriptionResourceType,

View File

@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go/service/sns"
"github.com/cloudskiff/driftctl/pkg/alerter"
remoteerror "github.com/cloudskiff/driftctl/pkg/remote/error"
resourceaws "github.com/cloudskiff/driftctl/pkg/resource/aws"
@ -35,6 +36,7 @@ func TestSNSTopicSubscriptionSupplier_Resources(t *testing.T) {
test string
dirName string
mocks func(client *mocks.SNSRepository)
alerts alerter.Alerts
err error
}{
{
@ -56,6 +58,23 @@ func TestSNSTopicSubscriptionSupplier_Resources(t *testing.T) {
},
err: nil,
},
{
test: "Multiple SNSTopic Subscription with one pending",
dirName: "sns_topic_subscription_multiple",
mocks: func(client *mocks.SNSRepository) {
client.On("ListAllSubscriptions").Return([]*sns.Subscription{
{SubscriptionArn: aws.String("PendingConfirmation"), Endpoint: aws.String("TEST")},
{SubscriptionArn: aws.String("arn:aws:sns:us-east-1:526954929923:user-updates-topic2:c0f794c5-a009-4db4-9147-4c55959787fa")},
{SubscriptionArn: aws.String("arn:aws:sns:us-east-1:526954929923:user-updates-topic:b6e66147-2b31-4486-8d4b-2a2272264c8e")},
}, nil)
},
alerts: map[string][]alerter.Alert{
"aws_sns_topic_subscription.PendingConfirmation": []alerter.Alert{
&pendingTopicAlert{aws.String("TEST")},
},
},
err: nil,
},
{
test: "cannot list SNSTopic subscription",
dirName: "sns_topic_subscription_list",
@ -72,14 +91,16 @@ func TestSNSTopicSubscriptionSupplier_Resources(t *testing.T) {
supplierLibrary := resource.NewSupplierLibrary()
if shouldUpdate {
a := alerter.NewAlerter()
provider, err := InitTestAwsProvider(providerLibrary)
if err != nil {
t.Fatal(err)
}
supplierLibrary.AddSupplier(NewSNSTopicSubscriptionSupplier(provider))
supplierLibrary.AddSupplier(NewSNSTopicSubscriptionSupplier(provider, a))
}
t.Run(c.test, func(tt *testing.T) {
a := alerter.NewAlerter()
fakeClient := mocks.SNSRepository{}
c.mocks(&fakeClient)
provider := mocks2.NewMockedGoldenTFProvider(c.dirName, providerLibrary.Provider(terraform.AWS), shouldUpdate)
@ -89,10 +110,15 @@ func TestSNSTopicSubscriptionSupplier_Resources(t *testing.T) {
topicSubscriptionDeserializer,
&fakeClient,
terraform.NewParallelResourceReader(parallel.NewParallelRunner(context.TODO(), 10)),
a,
}
got, err := s.Resources()
assert.Equal(tt, c.err, err)
if c.alerts == nil {
c.alerts = map[string][]alerter.Alert{}
}
assert.Equal(tt, c.alerts, a.Retrieve())
mock.AssertExpectationsForObjects(tt)
test.CtyTestDiff(got, c.dirName, provider, topicSubscriptionDeserializer, shouldUpdate, tt)
})

View File

@ -30,7 +30,7 @@ func NewSNSTopicSupplier(provider *AWSTerraformProvider) *SNSTopicSupplier {
}
}
func (s SNSTopicSupplier) Resources() ([]resource.Resource, error) {
func (s *SNSTopicSupplier) Resources() ([]resource.Resource, error) {
topics, err := s.client.ListAllTopics()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsSnsTopicResourceType)
@ -51,7 +51,7 @@ func (s SNSTopicSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(retrieve)
}
func (s SNSTopicSupplier) readTopic(topic sns.Topic) (cty.Value, error) {
func (s *SNSTopicSupplier) readTopic(topic sns.Topic) (cty.Value, error) {
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
ID: *topic.TopicArn,
Ty: aws.AwsSnsTopicResourceType,

View File

@ -28,7 +28,7 @@ func NewSqsQueuePolicySupplier(provider *AWSTerraformProvider) *SqsQueuePolicySu
}
}
func (s SqsQueuePolicySupplier) Resources() ([]resource.Resource, error) {
func (s *SqsQueuePolicySupplier) Resources() ([]resource.Resource, error) {
queues, err := s.client.ListAllQueues()
if err != nil {
return nil, remoteerror.NewResourceEnumerationErrorWithType(err, aws.AwsSqsQueuePolicyResourceType, aws.AwsSqsQueueResourceType)
@ -49,7 +49,7 @@ func (s SqsQueuePolicySupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(resources)
}
func (s SqsQueuePolicySupplier) readSqsQueuePolicy(queueURL string) (cty.Value, error) {
func (s *SqsQueuePolicySupplier) readSqsQueuePolicy(queueURL string) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsSqsQueuePolicyResourceType
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: Ty,

View File

@ -28,7 +28,7 @@ func NewSqsQueueSupplier(provider *AWSTerraformProvider) *SqsQueueSupplier {
}
}
func (s SqsQueueSupplier) Resources() ([]resource.Resource, error) {
func (s *SqsQueueSupplier) Resources() ([]resource.Resource, error) {
queues, err := s.client.ListAllQueues()
if err != nil {
return nil, remoteerror.NewResourceEnumerationError(err, aws.AwsSqsQueueResourceType)
@ -49,7 +49,7 @@ func (s SqsQueueSupplier) Resources() ([]resource.Resource, error) {
return s.deserializer.Deserialize(resources)
}
func (s SqsQueueSupplier) readSqsQueue(queueURL string) (cty.Value, error) {
func (s *SqsQueueSupplier) readSqsQueue(queueURL string) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsSqsQueueResourceType
val, err := s.reader.ReadResource(terraform.ReadResourceArgs{
Ty: Ty,

View File

@ -36,7 +36,7 @@ func NewSubnetSupplier(provider *AWSTerraformProvider) *SubnetSupplier {
}
}
func (s SubnetSupplier) Resources() ([]resource.Resource, error) {
func (s *SubnetSupplier) Resources() ([]resource.Resource, error) {
input := ec2.DescribeSubnetsInput{}
var subnets []*ec2.Subnet
var defaultSubnets []*ec2.Subnet
@ -64,6 +64,11 @@ func (s SubnetSupplier) Resources() ([]resource.Resource, error) {
})
}
subnetResources, err := s.subnetRunner.Wait()
if err != nil {
return nil, err
}
for _, item := range defaultSubnets {
res := *item
s.defaultSubnetRunner.Run(func() (cty.Value, error) {
@ -76,10 +81,6 @@ func (s SubnetSupplier) Resources() ([]resource.Resource, error) {
if err != nil {
return nil, err
}
subnetResources, err := s.subnetRunner.Wait()
if err != nil {
return nil, err
}
// Deserialize
deserializedDefaultSubnets, err := s.defaultSubnetDeserializer.Deserialize(defaultSubnetResources)
@ -98,7 +99,7 @@ func (s SubnetSupplier) Resources() ([]resource.Resource, error) {
return resources, nil
}
func (s SubnetSupplier) readSubnet(subnet ec2.Subnet) (cty.Value, error) {
func (s *SubnetSupplier) readSubnet(subnet ec2.Subnet) (cty.Value, error) {
var Ty resource.ResourceType = aws.AwsSubnetResourceType
if subnet.DefaultForAz != nil && *subnet.DefaultForAz {
Ty = aws.AwsDefaultSubnetResourceType

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyIsInN0b3JhZ2VfY2xhc3NfYW5hbHlzaXMiOlsibGlzdCIsWyJvYmplY3QiLHsiZGF0YV9leHBvcnQiOlsibGlzdCIsWyJvYmplY3QiLHsiZGVzdGluYXRpb24iOlsibGlzdCIsWyJvYmplY3QiLHsiczNfYnVja2V0X2Rlc3RpbmF0aW9uIjpbImxpc3QiLFsib2JqZWN0Iix7ImJ1Y2tldF9hY2NvdW50X2lkIjoic3RyaW5nIiwiYnVja2V0X2FybiI6InN0cmluZyIsImZvcm1hdCI6InN0cmluZyIsInByZWZpeCI6InN0cmluZyJ9XV19XV0sIm91dHB1dF9zY2hlbWFfdmVyc2lvbiI6InN0cmluZyJ9XV19XV19XQ==",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQzIiwiZmlsdGVyIjpbXSwiaWQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQzOkFuYWx5dGljczJfQnVja2V0MyIsIm5hbWUiOiJBbmFseXRpY3MyX0J1Y2tldDMiLCJzdG9yYWdlX2NsYXNzX2FuYWx5c2lzIjpbeyJkYXRhX2V4cG9ydCI6W3siZGVzdGluYXRpb24iOlt7InMzX2J1Y2tldF9kZXN0aW5hdGl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Y2NvdW50X2lkIjoiIiwiYnVja2V0X2FybiI6ImFybjphd3M6czM6OjpidWNrZXQtbWFydGluLXRlc3QtZHJpZnQzIiwiZm9ybWF0IjoiQ1NWIiwicHJlZml4IjoiIn1dfV0sIm91dHB1dF9zY2hlbWFfdmVyc2lvbiI6IlZfMSJ9XX1dfQ==",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyIsInN0b3JhZ2VfY2xhc3NfYW5hbHlzaXMiOlsibGlzdCIsWyJvYmplY3QiLHsiZGF0YV9leHBvcnQiOlsibGlzdCIsWyJvYmplY3QiLHsiZGVzdGluYXRpb24iOlsibGlzdCIsWyJvYmplY3QiLHsiczNfYnVja2V0X2Rlc3RpbmF0aW9uIjpbImxpc3QiLFsib2JqZWN0Iix7ImJ1Y2tldF9hY2NvdW50X2lkIjoic3RyaW5nIiwiYnVja2V0X2FybiI6InN0cmluZyIsImZvcm1hdCI6InN0cmluZyIsInByZWZpeCI6InN0cmluZyJ9XV19XV0sIm91dHB1dF9zY2hlbWFfdmVyc2lvbiI6InN0cmluZyJ9XV19XV19XQ==",
"Val": "bnVsbA==",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyIsInN0b3JhZ2VfY2xhc3NfYW5hbHlzaXMiOlsibGlzdCIsWyJvYmplY3QiLHsiZGF0YV9leHBvcnQiOlsibGlzdCIsWyJvYmplY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FfZXhwb3J0IjpbeyJkZXN0aW5hdGlvbiI6W3siczNfYnVja2V0X2Rlc3RpbmF0aW9uIjpbeyJidWNrZXRfYWNjb3VudF9pZCI6IiIsImJ1Y2tldF9hcm4iOiJhcm46YXdzOnMzOjo6YnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0IiwiZm9ybWF0IjoiQ1NWIiwicHJlZml4IjoiIn1dfV0sIm91dHB1dF9zY2hlbWFfdmVyc2lvbiI6IlZfMSJ9XX1dfQ==",
"Err": null
}

View File

@ -52,113 +52,5 @@
]
}
]
},
{
"bucket": "bucket-martin-test-drift",
"filter": [],
"id": "bucket-martin-test-drift:Analytics_Bucket1",
"name": "Analytics_Bucket1",
"storage_class_analysis": [
{
"data_export": [
{
"destination": [
{
"s3_bucket_destination": [
{
"bucket_account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift",
"format": "CSV",
"prefix": ""
}
]
}
],
"output_schema_version": "V_1"
}
]
}
]
},
{
"bucket": "bucket-martin-test-drift",
"filter": [],
"id": "bucket-martin-test-drift:Analytics2_Bucket1",
"name": "Analytics2_Bucket1",
"storage_class_analysis": [
{
"data_export": [
{
"destination": [
{
"s3_bucket_destination": [
{
"bucket_account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift",
"format": "CSV",
"prefix": ""
}
]
}
],
"output_schema_version": "V_1"
}
]
}
]
},
{
"bucket": "bucket-martin-test-drift3",
"filter": [],
"id": "bucket-martin-test-drift3:Analytics2_Bucket3",
"name": "Analytics2_Bucket3",
"storage_class_analysis": [
{
"data_export": [
{
"destination": [
{
"s3_bucket_destination": [
{
"bucket_account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift3",
"format": "CSV",
"prefix": ""
}
]
}
],
"output_schema_version": "V_1"
}
]
}
]
},
{
"bucket": "bucket-martin-test-drift3",
"filter": [],
"id": "bucket-martin-test-drift3:Analytics_Bucket3",
"name": "Analytics_Bucket3",
"storage_class_analysis": [
{
"data_export": [
{
"destination": [
{
"s3_bucket_destination": [
{
"bucket_account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift3",
"format": "CSV",
"prefix": ""
}
]
}
],
"output_schema_version": "V_1"
}
]
}
]
}
]

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZGVzdGluYXRpb24iOlsibGlzdCIsWyJvYmplY3QiLHsiYnVja2V0IjpbImxpc3QiLFsib2JqZWN0Iix7ImFjY291bnRfaWQiOiJzdHJpbmciLCJidWNrZXRfYXJuIjoic3RyaW5nIiwiZW5jcnlwdGlvbiI6WyJsaXN0IixbIm9iamVjdCIseyJzc2Vfa21zIjpbImxpc3QiLFsib2JqZWN0Iix7ImtleV9pZCI6InN0cmluZyJ9XV0sInNzZV9zMyI6WyJsaXN0IixbIm9iamVjdCIse31dXX1dXSwiZm9ybWF0Ijoic3RyaW5nIiwicHJlZml4Ijoic3RyaW5nIn1dXX1dXSwiZW5hYmxlZCI6ImJvb2wiLCJmaWx0ZXIiOlsibGlzdCIsWyJvYmplY3QiLHsicHJlZml4Ijoic3RyaW5nIn1dXSwiaWQiOiJzdHJpbmciLCJpbmNsdWRlZF9vYmplY3RfdmVyc2lvbnMiOiJzdHJpbmciLCJuYW1lIjoic3RyaW5nIiwib3B0aW9uYWxfZmllbGRzIjpbInNldCIsInN0cmluZyJdLCJzY2hlZHVsZSI6WyJsaXN0IixbIm9iamVjdCIseyJmcmVxdWVuY3kiOiJzdHJpbmcifV1dfV0=",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQzIiwiZGVzdGluYXRpb24iOlt7ImJ1Y2tldCI6W3siYWNjb3VudF9pZCI6IiIsImJ1Y2tldF9hcm4iOiJhcm46YXdzOnMzOjo6YnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0MyIsImVuY3J5cHRpb24iOltdLCJmb3JtYXQiOiJPUkMiLCJwcmVmaXgiOiI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pbmNsdWRlZF9vYmplY3RfdmVyc2lvbnMiOiJzdHJpbmciLCJuYW1lIjoic3RyaW5nIiwib3B0aW9uYWxfZmllbGRzIjpbInNldCIsInN0cmluZyJdLCJzY2hlZHVsZSI6WyJsaXN0IixbIm9iamVjdCIseyJmcmVxdWVuY3kiOiJzdHJpbmcifV1dfV0=",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQiLCJkZXN0aW5hdGlvbiI6W3siYnVja2V0IjpbeyJhY2NvdW50X2lkIjoiIiwiYnVja2V0X2FybiI6ImFybjphd3M6czM6OjpidWNrZXQtbWFydGluLXRlc3QtZHJpZnQiLCJlbmNyeXB0aW9uIjpbXSwiZm9ybWF0IjoiT1JDIiwicHJlZml4IjoiIn1dfV0sImVuYWJsZWQiOnRydWUsImZpbHRlciI6W10sImlkIjoiYnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0OkludmVudG9yeV9CdWNrZXQxIiwiaW5jbHVkZWRfb2JqZWN0X3ZlcnNpb25zIjoiQWxsIiwibmFtZSI6IkludmVudG9yeV9CdWNrZXQxIiwib3B0aW9uYWxfZmllbGRzIjpbXSwic2NoZWR1bGUiOlt7ImZyZXF1ZW5jeSI6IkRhaWx5In1dfQ==",
"Err": null
}

View File

@ -52,113 +52,5 @@
"frequency": "Daily"
}
]
},
{
"bucket": "bucket-martin-test-drift",
"destination": [
{
"bucket": [
{
"account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift",
"encryption": [],
"format": "ORC",
"prefix": ""
}
]
}
],
"enabled": true,
"filter": [],
"id": "bucket-martin-test-drift:Inventory2_Bucket1",
"included_object_versions": "All",
"name": "Inventory2_Bucket1",
"optional_fields": [],
"schedule": [
{
"frequency": "Daily"
}
]
},
{
"bucket": "bucket-martin-test-drift",
"destination": [
{
"bucket": [
{
"account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift",
"encryption": [],
"format": "ORC",
"prefix": ""
}
]
}
],
"enabled": true,
"filter": [],
"id": "bucket-martin-test-drift:Inventory_Bucket1",
"included_object_versions": "All",
"name": "Inventory_Bucket1",
"optional_fields": [],
"schedule": [
{
"frequency": "Daily"
}
]
},
{
"bucket": "bucket-martin-test-drift3",
"destination": [
{
"bucket": [
{
"account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift3",
"encryption": [],
"format": "ORC",
"prefix": ""
}
]
}
],
"enabled": true,
"filter": [],
"id": "bucket-martin-test-drift3:Inventory_Bucket3",
"included_object_versions": "All",
"name": "Inventory_Bucket3",
"optional_fields": [],
"schedule": [
{
"frequency": "Daily"
}
]
},
{
"bucket": "bucket-martin-test-drift3",
"destination": [
{
"bucket": [
{
"account_id": "",
"bucket_arn": "arn:aws:s3:::bucket-martin-test-drift3",
"encryption": [],
"format": "ORC",
"prefix": ""
}
]
}
],
"enabled": true,
"filter": [],
"id": "bucket-martin-test-drift3:Inventory2_Bucket3",
"included_object_versions": "All",
"name": "Inventory2_Bucket3",
"optional_fields": [],
"schedule": [
{
"frequency": "Daily"
}
]
}
]

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "bnVsbA==",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "bnVsbA==",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQzIiwiZmlsdGVyIjpudWxsLCJpZCI6ImJ1Y2tldC1tYXJ0aW4tdGVzdC1kcmlmdDM6TWV0cmljczJfQnVja2V0MyIsIm5hbWUiOiJNZXRyaWNzMl9CdWNrZXQzIn0=",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQzIiwiZmlsdGVyIjpudWxsLCJpZCI6ImJ1Y2tldC1tYXJ0aW4tdGVzdC1kcmlmdDM6TWV0cmljc19CdWNrZXQzIiwibmFtZSI6Ik1ldHJpY3NfQnVja2V0MyJ9",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "bnVsbA==",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "bnVsbA==",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQiLCJmaWx0ZXIiOm51bGwsImlkIjoiYnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0Ok1ldHJpY3MyX0J1Y2tldDEiLCJuYW1lIjoiTWV0cmljczJfQnVja2V0MSJ9",
"Err": null
}

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiZmlsdGVyIjpbImxpc3QiLFsib2JqZWN0Iix7InByZWZpeCI6InN0cmluZyIsInRhZ3MiOlsibWFwIiwic3RyaW5nIl19XV0sImlkIjoic3RyaW5nIiwibmFtZSI6InN0cmluZyJ9XQ==",
"Val": "eyJidWNrZXQiOiJidWNrZXQtbWFydGluLXRlc3QtZHJpZnQiLCJmaWx0ZXIiOm51bGwsImlkIjoiYnVja2V0LW1hcnRpbi10ZXN0LWRyaWZ0Ok1ldHJpY3NfQnVja2V0MSIsIm5hbWUiOiJNZXRyaWNzX0J1Y2tldDEifQ==",
"Err": null
}

View File

@ -5,34 +5,10 @@
"id": "bucket-martin-test-drift2:Metrics2_Bucket2",
"name": "Metrics2_Bucket2"
},
{
"bucket": "bucket-martin-test-drift",
"filter": null,
"id": "bucket-martin-test-drift:Metrics_Bucket1",
"name": "Metrics_Bucket1"
},
{
"bucket": "bucket-martin-test-drift2",
"filter": null,
"id": "bucket-martin-test-drift2:Metrics_Bucket2",
"name": "Metrics_Bucket2"
},
{
"bucket": "bucket-martin-test-drift",
"filter": null,
"id": "bucket-martin-test-drift:Metrics2_Bucket1",
"name": "Metrics2_Bucket1"
},
{
"bucket": "bucket-martin-test-drift3",
"filter": null,
"id": "bucket-martin-test-drift3:Metrics2_Bucket3",
"name": "Metrics2_Bucket3"
},
{
"bucket": "bucket-martin-test-drift3",
"filter": null,
"id": "bucket-martin-test-drift3:Metrics_Bucket3",
"name": "Metrics_Bucket3"
}
]

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYWNjZWxlcmF0aW9uX3N0YXR1cyI6InN0cmluZyIsImFjbCI6InN0cmluZyIsImFybiI6InN0cmluZyIsImJ1Y2tldCI6InN0cmluZyIsImJ1Y2tldF9kb21haW5fbmFtZSI6InN0cmluZyIsImJ1Y2tldF9wcmVmaXgiOiJzdHJpbmciLCJidWNrZXRfcmVnaW9uYWxfZG9tYWluX25hbWUiOiJzdHJpbmciLCJjb3JzX3J1bGUiOlsibGlzdCIsWyJvYmplY3QiLHsiYWxsb3dlZF9oZWFkZXJzIjpbImxpc3QiLCJzdHJpbmciXSwiYWxsb3dlZF9tZXRob2RzIjpbImxpc3QiLCJzdHJpbmciXSwiYWxsb3dlZF9vcmlnaW5zIjpbImxpc3QiLCJzdHJpbmciXSwiZXhwb3NlX2hlYWRlcnMiOlsibGlzdCIsInN0cmluZyJdLCJtYXhfYWdlX3NlY29uZHMiOiJudW1iZXIifV1dLCJmb3JjZV9kZXN0cm95IjoiYm9vbCIsImdyYW50IjpbInNldCIsWyJvYmplY3QiLHsiaWQiOiJzdHJpbmciLCJwZXJtaXNzaW9ucyI6WyJzZXQiLCJzdHJpbmciXSwidHlwZSI6InN0cmluZyIsInVyaSI6InN0cmluZyJ9XV0sImhvc3RlZF96b25lX2lkIjoic3RyaW5nIiwiaWQiOiJzdHJpbmciLCJsaWZlY3ljbGVfcnVsZSI6WyJsaXN0Iixb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lbmNyeXB0aW9uX2NvbmZpZ3VyYXRpb24iOltdLCJ0YWdzIjp7fSwidmVyc2lvbmluZyI6W3siZW5hYmxlZCI6ZmFsc2UsIm1mYV9kZWxldGUiOmZhbHNlfV0sIndlYnNpdGUiOltdLCJ3ZWJzaXRlX2RvbWFpbiI6bnVsbCwid2Vic2l0ZV9lbmRwb2ludCI6bnVsbH0=",
"Err": null
}

View File

@ -1,98 +1,34 @@
[
{
"acceleration_status": "",
"acl": null,
"arn": "arn:aws:s3:::bucket-martin-test-drift2",
"bucket": "bucket-martin-test-drift2",
"bucket_domain_name": "bucket-martin-test-drift2.s3.amazonaws.com",
"bucket_prefix": null,
"bucket_regional_domain_name": "bucket-martin-test-drift2.s3.eu-west-3.amazonaws.com",
"cors_rule": [],
"force_destroy": null,
"grant": [],
"hosted_zone_id": "Z3R1K369G5AVDG",
"id": "bucket-martin-test-drift2",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"policy": null,
"region": "eu-west-3",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [],
"tags": {},
"versioning": [
{
"enabled": false,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
},
{
"acceleration_status": "",
"acl": null,
"arn": "arn:aws:s3:::bucket-martin-test-drift",
"bucket": "bucket-martin-test-drift",
"bucket_domain_name": "bucket-martin-test-drift.s3.amazonaws.com",
"bucket_prefix": null,
"bucket_regional_domain_name": "bucket-martin-test-drift.s3.eu-west-1.amazonaws.com",
"cors_rule": [],
"force_destroy": null,
"grant": [],
"hosted_zone_id": "Z1BKCTXD74EZPE",
"id": "bucket-martin-test-drift",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"policy": null,
"region": "eu-west-1",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [],
"tags": {},
"versioning": [
{
"enabled": false,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
},
{
"acceleration_status": "",
"acl": null,
"arn": "arn:aws:s3:::bucket-martin-test-drift3",
"bucket": "bucket-martin-test-drift3",
"bucket_domain_name": "bucket-martin-test-drift3.s3.amazonaws.com",
"bucket_prefix": null,
"bucket_regional_domain_name": "bucket-martin-test-drift3.s3.ap-northeast-1.amazonaws.com",
"cors_rule": [],
"force_destroy": null,
"grant": [],
"hosted_zone_id": "Z2M4EHUR26P7ZW",
"id": "bucket-martin-test-drift3",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"policy": null,
"region": "ap-northeast-1",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [],
"tags": {},
"versioning": [
{
"enabled": false,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
}
{
"acceleration_status": "",
"acl": null,
"arn": "arn:aws:s3:::bucket-martin-test-drift2",
"bucket": "bucket-martin-test-drift2",
"bucket_domain_name": "bucket-martin-test-drift2.s3.amazonaws.com",
"bucket_prefix": null,
"bucket_regional_domain_name": "bucket-martin-test-drift2.s3.eu-west-3.amazonaws.com",
"cors_rule": [],
"force_destroy": null,
"grant": [],
"hosted_zone_id": "Z3R1K369G5AVDG",
"id": "bucket-martin-test-drift2",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"policy": null,
"region": "eu-west-3",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [],
"tags": {},
"versioning": [
{
"enabled": false,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
}
]

View File

@ -1,5 +0,0 @@
{
"Typ": "WyJvYmplY3QiLHsiYnVja2V0Ijoic3RyaW5nIiwiaWQiOiJzdHJpbmciLCJsYW1iZGFfZnVuY3Rpb24iOlsibGlzdCIsWyJvYmplY3QiLHsiZXZlbnRzIjpbInNldCIsInN0cmluZyJdLCJmaWx0ZXJfcHJlZml4Ijoic3RyaW5nIiwiZmlsdGVyX3N1ZmZpeCI6InN0cmluZyIsImlkIjoic3RyaW5nIiwibGFt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TgzMDAwMDAwMDEiLCJsYW1iZGFfZnVuY3Rpb25fYXJuIjoiYXJuOmF3czpsYW1iZGE6YXAtbm9ydGhlYXN0LTE6NTI2OTU0OTI5OTIzOmZ1bmN0aW9uOmV4YW1wbGVfbGFtYmRhX25hbWUxIn0seyJldmVudHMiOlsiczM6T2JqZWN0Q3JlYXRlZDoqIl0sImZpbHRlcl9wcmVmaXgiOiJPdGhlckxvZ3MvIiwiZmlsdGVyX3N1ZmZpeCI6Ii5sb2ciLCJpZCI6InRmLXMzLWxhbWJkYS0yMDIwMTEwMzE2NTA1Mjk1ODQwMDAwMDAwMiIsImxhbWJkYV9mdW5jdGlvbl9hcm4iOiJhcm46YXdzOmxhbWJkYTphcC1ub3J0aGVhc3QtMTo1MjY5NTQ5Mjk5MjM6ZnVuY3Rpb246ZXhhbXBsZV9sYW1iZGFfbmFtZTIifV0sInF1ZXVlIjpbXSwidG9waWMiOltdfQ==",
"Err": null
}

Some files were not shown because too many files have changed in this diff Show More