Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache AWS Config's CredentialsProvider to reduce STS calls #1235

Merged
merged 7 commits into from
Mar 28, 2024
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
Loading