Skip to content

Commit

Permalink
Merge pull request #1235 from erhancagirici/aws-credentials-cache
Browse files Browse the repository at this point in the history
Cache AWS Config's CredentialsProvider to reduce STS calls
  • Loading branch information
ulucinar authored Mar 28, 2024
2 parents aaad019 + 0fbbf02 commit 80644da
Show file tree
Hide file tree
Showing 164 changed files with 960 additions and 333 deletions.
6 changes: 4 additions & 2 deletions cmd/provider/accessanalyzer/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/account/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/acm/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/acmpca/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/amp/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/amplify/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/apigateway/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/apigatewayv2/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/appautoscaling/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/appconfig/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/appflow/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/appintegrations/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/applicationinsights/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/appmesh/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/apprunner/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
6 changes: 4 additions & 2 deletions cmd/provider/appstream/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func main() {
_ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String()
_ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String()
)
setupConfig := &clients.SetupConfig{}
kingpin.MustParse(app.Parse(os.Args[1:]))
log.Default().SetOutput(io.Discard)
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
Expand Down Expand Up @@ -149,7 +148,10 @@ func main() {
ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
setupConfig.TerraformProvider = provider.TerraformProvider
setupConfig := &clients.SetupConfig{
Logger: logr,
TerraformProvider: provider.TerraformProvider,
}
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: logr,
Expand Down
Loading

0 comments on commit 80644da

Please sign in to comment.