From 7caa3a9e134e8d0f06f0fc61a4eae121a219e1ca Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Wed, 6 Mar 2024 12:25:21 +0300 Subject: [PATCH 1/3] unify TF AWS provider configuration logic Signed-off-by: Erhan Cagirici --- Makefile | 2 +- go.mod | 2 +- internal/clients/aws.go | 220 ++++++------------ internal/clients/provider_config.go | 59 ++--- .../controller/eks/clusterauth/controller.go | 2 +- 5 files changed, 93 insertions(+), 192 deletions(-) diff --git a/Makefile b/Makefile index a824cf93bb..f398e7cecd 100644 --- a/Makefile +++ b/Makefile @@ -336,7 +336,7 @@ kustomize-crds: output.init $(KUSTOMIZE) $(YQ) @rm -fr $(OUTPUT_DIR)/package || $(FAIL) @cp -R package $(OUTPUT_DIR) && \ cd $(OUTPUT_DIR)/package/crds && \ - kustomize create --autodetect || $(FAIL) + $(KUSTOMIZE) create --autodetect || $(FAIL) @export YQ=$(YQ) && \ XDG_CONFIG_HOME=$(PWD)/package $(KUSTOMIZE) build --enable-alpha-plugins $(OUTPUT_DIR)/package/kustomize -o $(OUTPUT_DIR)/package/crds.yaml || $(FAIL) @$(OK) Kustomizing CRDs. diff --git a/go.mod b/go.mod index a8711981a7..9a3c7b2b61 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.24.0 github.com/aws/aws-sdk-go-v2/config v1.26.1 github.com/aws/aws-sdk-go-v2/credentials v1.16.12 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 github.com/aws/aws-sdk-go-v2/service/eks v1.35.5 github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 github.com/aws/smithy-go v1.19.0 @@ -41,7 +42,6 @@ require ( github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/aws/aws-sdk-go v1.49.2 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.7 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 // indirect diff --git a/internal/clients/aws.go b/internal/clients/aws.go index 368cd28258..d00cb3c499 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -6,16 +6,14 @@ package clients import ( "context" - "os" "reflect" "unsafe" "github.com/aws/aws-sdk-go-v2/aws" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/upjet/pkg/terraform" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - tfsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-aws/xpprovider" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/types" @@ -25,23 +23,7 @@ import ( ) const ( - // Terraform provider configuration keys for AWS credentials. - keyRegion = "region" - keyAccountId = "account_id" - keySessionToken = "token" - keyAccessKeyID = "access_key" - keySecretAccessKey = "secret_key" - keyAssumeRoleWithWebIdentity = "assume_role_with_web_identity" - keyRoleArn = "role_arn" - keySessionName = "session_name" - keyWebIdentityTokenFile = "web_identity_token_file" - keyWebIdentityToken = "web_identity_token" - keySkipCredsValidation = "skip_credentials_validation" - keyS3UsePathStyle = "s3_use_path_style" - keySkipMetadataApiCheck = "skip_metadata_api_check" - keySkipRegionValidation = "skip_region_validation" - keySkipReqAccountId = "skip_requesting_account_id" - keyEndpoints = "endpoints" + keyAccountId = "account_id" ) type SetupConfig struct { @@ -52,12 +34,16 @@ type SetupConfig struct { func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:gocyclo return func(ctx context.Context, c client.Client, mg resource.Managed) (terraform.Setup, error) { pc := &v1beta1.ProviderConfig{} - var err error - if err = c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { + if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { return terraform.Setup{}, errors.Wrapf(err, "cannot get referenced Provider: %s", mg.GetProviderConfigReference().Name) } + t := resource.NewProviderConfigUsageTracker(c, &v1beta1.ProviderConfigUsage{}) + if err := t.Track(ctx, mg); err != nil { + return terraform.Setup{}, errors.Wrap(err, "cannot track ProviderConfig usage") + } + ps := terraform.Setup{} - awsCfg, err := getAWSConfig(ctx, c, mg) + awsCfg, err := GetAWSConfigWithDefaultRegion(ctx, c, mg, pc) if err != nil { return terraform.Setup{}, errors.Wrap(err, "cannot get aws config") } else if awsCfg == nil { @@ -67,6 +53,7 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc if err != nil { return terraform.Setup{}, errors.Wrap(err, "failed to retrieve aws credentials from aws config") } + account := "000000000" if !pc.Spec.SkipCredsValidation { account, err = getAccountId(ctx, awsCfg, creds) @@ -74,135 +61,18 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc return terraform.Setup{}, errors.Wrap(err, "cannot get account id") } } - ps.ClientMetadata = map[string]string{ keyAccountId: account, } - - if len(pc.Spec.AssumeRoleChain) > 0 || pc.Spec.Endpoint != nil { - err = DefaultTerraformSetupBuilder(ctx, pc, &ps, awsCfg, creds) - if err != nil { - return terraform.Setup{}, errors.Wrap(err, "cannot build terraform configuration") - } - } else { - err = pushDownTerraformSetupBuilder(ctx, c, pc, &ps, awsCfg) - if err != nil { - return terraform.Setup{}, errors.Wrap(err, "cannot build terraform configuration") - } - } - if config.TerraformProvider == nil { return terraform.Setup{}, errors.New("terraform provider cannot be nil") } - - return ps, errors.Wrap(configureNoForkAWSClient(ctx, &ps, config), "could not configure the no-fork AWS client") + return ps, errors.Wrap(configureNoForkAWSClient(ctx, &ps, config, awsCfg, creds, pc), "could not configure the no-fork AWS client") } } -func pushDownTerraformSetupBuilder(ctx context.Context, c client.Client, pc *v1beta1.ProviderConfig, ps *terraform.Setup, cfg *aws.Config) error { //nolint:gocyclo - if len(pc.Spec.AssumeRoleChain) > 0 || pc.Spec.Endpoint != nil { - return errors.New("shared scheduler cannot be used because the length of assume role chain array " + - "is more than 0 or endpoint configuration is not nil") - } - - ps.Configuration = map[string]any{ - keyRegion: cfg.Region, - } - - switch s := pc.Spec.Credentials.Source; s { //nolint:exhaustive - case authKeyWebIdentity: - if pc.Spec.Credentials.WebIdentity == nil { - return errors.New(`spec.credentials.webIdentity of ProviderConfig cannot be nil when the credential source is "WebIdentity"`) - } - webIdentityConfig := map[string]any{ - keyRoleArn: aws.ToString(pc.Spec.Credentials.WebIdentity.RoleARN), - } - if pc.Spec.Credentials.WebIdentity.TokenConfig != nil { - tokenSelector := xpv1.CommonCredentialSelectors{ - Fs: pc.Spec.Credentials.WebIdentity.TokenConfig.Fs, - SecretRef: pc.Spec.Credentials.WebIdentity.TokenConfig.SecretRef, - } - creds, err := resource.CommonCredentialExtractor(ctx, pc.Spec.Credentials.WebIdentity.TokenConfig.Source, c, tokenSelector) - if err != nil { - return errors.Wrap(err, "cannot extract token") - } - webIdentityConfig[keyWebIdentityToken] = string(creds) - } else { - // fallback to deprecated behavior with environment variables - webIdentityConfig[keyWebIdentityTokenFile] = os.Getenv(envWebIdentityTokenFile) - } - if pc.Spec.Credentials.WebIdentity.RoleSessionName != "" { - webIdentityConfig[keySessionName] = pc.Spec.Credentials.WebIdentity.RoleSessionName - } - ps.Configuration[keyAssumeRoleWithWebIdentity] = []any{ - webIdentityConfig, - } - case authKeyUpbound: - if pc.Spec.Credentials.Upbound == nil || pc.Spec.Credentials.Upbound.WebIdentity == nil { - return errors.New(`spec.credentials.upbound.webIdentity of ProviderConfig cannot be nil when the credential source is "Upbound"`) - } - webIdentityConfig := map[string]any{ - keyRoleArn: aws.ToString(pc.Spec.Credentials.Upbound.WebIdentity.RoleARN), - keyWebIdentityTokenFile: upboundProviderIdentityTokenFile, - } - if pc.Spec.Credentials.Upbound.WebIdentity.RoleSessionName != "" { - webIdentityConfig[keySessionName] = pc.Spec.Credentials.Upbound.WebIdentity.RoleSessionName - } - ps.Configuration[keyAssumeRoleWithWebIdentity] = []any{ - webIdentityConfig, - } - case authKeySecret: - data, err := resource.CommonCredentialExtractor(ctx, s, c, pc.Spec.Credentials.CommonCredentialSelectors) - if err != nil { - return errors.Wrap(err, "cannot get credentials") - } - cfg, err = UseProviderSecret(ctx, data, DefaultSection, cfg.Region) - if err != nil { - return errors.Wrap(err, errAWSConfig) - } - creds, err := cfg.Credentials.Retrieve(ctx) - if err != nil { - return errors.Wrap(err, "failed to retrieve aws credentials from aws config") - } - ps.Configuration = map[string]any{ - keyRegion: cfg.Region, - keyAccessKeyID: creds.AccessKeyID, - keySecretAccessKey: creds.SecretAccessKey, - keySessionToken: creds.SessionToken, - } - } - return nil -} - -func DefaultTerraformSetupBuilder(_ context.Context, pc *v1beta1.ProviderConfig, ps *terraform.Setup, cfg *aws.Config, creds aws.Credentials) error { - ps.Configuration = map[string]any{ - keyRegion: cfg.Region, - keyAccessKeyID: creds.AccessKeyID, - keySecretAccessKey: creds.SecretAccessKey, - keySessionToken: creds.SessionToken, - keySkipCredsValidation: pc.Spec.SkipCredsValidation, - keyS3UsePathStyle: pc.Spec.S3UsePathStyle, - keySkipRegionValidation: pc.Spec.SkipRegionValidation, - keySkipMetadataApiCheck: pc.Spec.SkipMetadataApiCheck, - keySkipReqAccountId: pc.Spec.SkipReqAccountId, - } - - if pc.Spec.Endpoint != nil { - if pc.Spec.Endpoint.URL.Static != nil { - if len(pc.Spec.Endpoint.Services) > 0 && *pc.Spec.Endpoint.URL.Static == "" { - return errors.New("endpoint.url.static cannot be empty") - } else { - endpoints := make(map[string]string) - for _, service := range pc.Spec.Endpoint.Services { - endpoints[service] = aws.ToString(pc.Spec.Endpoint.URL.Static) - } - ps.Configuration[keyEndpoints] = []any{endpoints} - } - } - } - return nil -} - +// getAccountId retrieves the account ID associated with the given credentials. +// Results are cached. func getAccountId(ctx context.Context, cfg *aws.Config, creds aws.Credentials) (string, error) { identity, err := GlobalCallerIdentityCache.GetCallerIdentity(ctx, *cfg, creds) if err != nil { @@ -211,8 +81,8 @@ func getAccountId(ctx context.Context, cfg *aws.Config, creds aws.Credentials) ( return *identity.Account, nil } -func getAWSConfig(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { - cfg, err := GetAWSConfig(ctx, c, mg) +func GetAWSConfigWithDefaultRegion(ctx context.Context, c client.Client, mg resource.Managed, pc *v1beta1.ProviderConfig) (*aws.Config, error) { + cfg, err := GetAWSConfigViaProviderConfig(ctx, c, mg, pc) if err != nil { return nil, errors.Wrap(err, "cannot get AWS config") } @@ -230,18 +100,58 @@ func (m *metaOnlyPrimary) Meta() any { return m.meta } -func configureNoForkAWSClient(ctx context.Context, ps *terraform.Setup, config *SetupConfig) error { //nolint:gocyclo - p := *config.TerraformProvider - diag := p.Configure(context.WithoutCancel(ctx), &tfsdk.ResourceConfig{ - Config: ps.Configuration, - }) - if diag != nil && diag.HasError() { - return errors.Errorf("failed to configure the provider: %v", diag) +// configureNoForkAWSClient populates the supplied *terraform.Setup with +// Terraform Plugin SDK style AWS client (Meta) and Terraform Plugin Framework +// style FrameworkProvider +func configureNoForkAWSClient(ctx context.Context, ps *terraform.Setup, config *SetupConfig, awsCfg *aws.Config, creds aws.Credentials, pc *v1beta1.ProviderConfig) error { //nolint:gocyclo + tfAwsConnsCfg := xpprovider.AWSConfig{ + AccessKey: creds.AccessKeyID, + EC2MetadataServiceEnableState: imds.ClientDefaultEnableState, + Endpoints: map[string]string{}, + Region: awsCfg.Region, + S3UsePathStyle: pc.Spec.S3UsePathStyle, + SecretKey: creds.SecretAccessKey, + SkipCredsValidation: true, // disabled to prevent extra AWS STS call + SkipRegionValidation: pc.Spec.SkipRegionValidation, + SkipRequestingAccountId: true, // disabled to prevent extra AWS STS call + Token: creds.SessionToken, + } + + if pc.Spec.SkipMetadataApiCheck { + tfAwsConnsCfg.EC2MetadataServiceEnableState = imds.ClientEnabled } - ps.Meta = p.Meta() + + if pc.Spec.Endpoint != nil { + if pc.Spec.Endpoint.URL.Static != nil { + if len(pc.Spec.Endpoint.Services) > 0 && *pc.Spec.Endpoint.URL.Static == "" { + return errors.New("endpoint.url.static cannot be empty") + } else { + for _, service := range pc.Spec.Endpoint.Services { + tfAwsConnsCfg.Endpoints[service] = aws.ToString(pc.Spec.Endpoint.URL.Static) + } + } + } + } + + // only used for retrieving the ServicePackages from the singleton provider instance + // sharedMeta := config.AWSClient.ServicePackages // #nosec G103 - (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(ps.Meta).Pointer())).ServicePackages = (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(config.AWSClient).Pointer())).ServicePackages - fwProvider := xpprovider.GetFrameworkProviderWithMeta(&metaOnlyPrimary{meta: p.Meta()}) + tfAwsConnsClient, diags := tfAwsConnsCfg.GetClient(ctx, &xpprovider.AWSClient{ + ServicePackages: config.AWSClient.ServicePackages, + // ServicePackages: (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(sharedMeta).Pointer())).ServicePackages, + }) + if diags.HasError() { + return errors.Errorf("cannot construct TF AWS Client from TF AWS Config, %v", diags) + } + // accountID is already calculated/retrieved from Caller ID cache while + // obtaining AWS config. The terraform config is explicitly constructed + // to skip requesting account ID to prevent the extra STS call. Therefore, + // the resulting TF AWS Client has empty account ID. + // Fill with previously calculated account ID. + // No need for nil check on ps.ClientMetadata per golang spec. + tfAwsConnsClient.AccountID = ps.ClientMetadata[keyAccountId] + ps.Meta = tfAwsConnsClient + fwProvider := xpprovider.GetFrameworkProviderWithMeta(&metaOnlyPrimary{meta: tfAwsConnsClient}) ps.FrameworkProvider = fwProvider return nil } diff --git a/internal/clients/provider_config.go b/internal/clients/provider_config.go index a0888c8d5a..31356dab9a 100644 --- a/internal/clients/provider_config.go +++ b/internal/clients/provider_config.go @@ -42,7 +42,7 @@ const ( authKeyWebIdentity = "WebIdentity" authKeyUpbound = "Upbound" // authKeySAML = "SAML" - authKeySecret = "Secret" + // authKeySecret = "Secret" envWebIdentityTokenFile = "AWS_WEB_IDENTITY_TOKEN_FILE" envWebIdentityRoleARN = "AWS_ROLE_ARN" @@ -85,25 +85,13 @@ func getRegion(obj runtime.Object) (string, error) { return r, err } -// GetAWSConfig to produce a config that can be used to authenticate to AWS. -func GetAWSConfig(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { // nolint:gocyclo - if mg.GetProviderConfigReference() == nil { - return nil, errors.New("no providerConfigRef provided") - } +// GetAWSConfigViaProviderConfig produces an AWS config from the specified +// v1beta1.ProviderConfig that can be used to authenticate to AWS +func GetAWSConfigViaProviderConfig(ctx context.Context, c client.Client, mg resource.Managed, pc *v1beta1.ProviderConfig) (*aws.Config, error) { // nolint:gocyclo region, err := getRegion(mg) if err != nil { return nil, errors.Wrap(err, "cannot get region") } - pc := &v1beta1.ProviderConfig{} - if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { - return nil, errors.Wrap(err, "cannot get referenced Provider") - } - - t := resource.NewProviderConfigUsageTracker(c, &v1beta1.ProviderConfigUsage{}) - if err := t.Track(ctx, mg); err != nil { - return nil, errors.Wrap(err, "cannot track ProviderConfig usage") - } - var cfg *aws.Config switch s := pc.Spec.Credentials.Source; s { //nolint:exhaustive case authKeyIRSA: @@ -139,6 +127,26 @@ func GetAWSConfig(ctx context.Context, c client.Client, mg resource.Managed) (*a return SetResolver(pc, cfg), nil } +// GetAWSConfigWithProviderUsage obtains the provider config referenced by the +// specified managed resource and produces a config that can be used to +// authenticate to AWS and tracks the ProviderConfigUsage. Useful for obtaining +// AWS config for non-upjet based MR controllers. +func GetAWSConfigWithProviderUsage(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { // nolint:gocyclo + if mg.GetProviderConfigReference() == nil { + return nil, errors.New("no providerConfigRef provided") + } + pc := &v1beta1.ProviderConfig{} + if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { + return nil, errors.Wrap(err, "cannot get referenced Provider") + } + + t := resource.NewProviderConfigUsageTracker(c, &v1beta1.ProviderConfigUsage{}) + if err := t.Track(ctx, mg); err != nil { + return nil, errors.Wrap(err, "cannot track ProviderConfig usage") + } + return GetAWSConfigViaProviderConfig(ctx, c, mg, pc) +} + type awsEndpointResolverAdaptorWithOptions func(service, region string, options interface{}) (aws.Endpoint, error) func (a awsEndpointResolverAdaptorWithOptions) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { @@ -300,24 +308,7 @@ func GetRoleChainConfig(ctx context.Context, pcs *v1beta1.ProviderConfigSpec, cf // GetAssumeRoleWithWebIdentityConfig returns an aws.Config capable of doing // AssumeRoleWithWebIdentity. func GetAssumeRoleWithWebIdentityConfig(ctx context.Context, cfg *aws.Config, webID v1beta1.AssumeRoleWithWebIdentityOptions, tokenFile string) (*aws.Config, error) { - stsclient := sts.NewFromConfig(*cfg, stsRegionOrDefault(cfg.Region)) //nolint:contextcheck - awsConfig, err := config.LoadDefaultConfig( - ctx, - userAgentV2, - config.WithRegion(cfg.Region), - config.WithCredentialsProvider(aws.NewCredentialsCache( - stscreds.NewWebIdentityRoleProvider( - stsclient, - aws.ToString(webID.RoleARN), - stscreds.IdentityTokenFile(filepath.Clean(tokenFile)), - SetWebIdentityRoleOptions(webID), - )), - ), - ) - if err != nil { - return nil, errors.Wrap(err, "failed to load assumed role with web identity AWS config") - } - return &awsConfig, nil + return GetAssumeRoleWithWebIdentityConfigViaTokenRetriever(ctx, cfg, webID, stscreds.IdentityTokenFile(filepath.Clean(tokenFile))) } // GetAssumeRoleWithWebIdentityConfigViaTokenRetriever returns an aws.Config capable of doing diff --git a/internal/controller/eks/clusterauth/controller.go b/internal/controller/eks/clusterauth/controller.go index 0eb7c3006f..6a8b708025 100644 --- a/internal/controller/eks/clusterauth/controller.go +++ b/internal/controller/eks/clusterauth/controller.go @@ -75,7 +75,7 @@ type connector struct { } func (c *connector) Connect(ctx context.Context, mg resource.Managed) (managed.ExternalClient, error) { - cfg, err := clients.GetAWSConfig(ctx, c.kube, mg) + cfg, err := clients.GetAWSConfigWithProviderUsage(ctx, c.kube, mg) if err != nil { return nil, err } From 1fabbe60e57d4c9040a15ac6f1b080a24d803c50 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Tue, 12 Mar 2024 13:31:16 +0300 Subject: [PATCH 2/3] remove AWS TF Meta client copies from tf setup These copies are not needed anymore after refactoring the AWS configuration logic to not use native provider Configure() Signed-off-by: Erhan Cagirici --- cmd/generator/main.go | 2 +- cmd/provider/accessanalyzer/zz_main.go | 3 +-- cmd/provider/account/zz_main.go | 3 +-- cmd/provider/acm/zz_main.go | 3 +-- cmd/provider/acmpca/zz_main.go | 3 +-- cmd/provider/amp/zz_main.go | 3 +-- cmd/provider/amplify/zz_main.go | 3 +-- cmd/provider/apigateway/zz_main.go | 3 +-- cmd/provider/apigatewayv2/zz_main.go | 3 +-- cmd/provider/appautoscaling/zz_main.go | 3 +-- cmd/provider/appconfig/zz_main.go | 3 +-- cmd/provider/appflow/zz_main.go | 3 +-- cmd/provider/appintegrations/zz_main.go | 3 +-- cmd/provider/applicationinsights/zz_main.go | 3 +-- cmd/provider/appmesh/zz_main.go | 3 +-- cmd/provider/apprunner/zz_main.go | 3 +-- cmd/provider/appstream/zz_main.go | 3 +-- cmd/provider/appsync/zz_main.go | 3 +-- cmd/provider/athena/zz_main.go | 3 +-- cmd/provider/autoscaling/zz_main.go | 3 +-- cmd/provider/autoscalingplans/zz_main.go | 3 +-- cmd/provider/backup/zz_main.go | 3 +-- cmd/provider/batch/zz_main.go | 3 +-- cmd/provider/budgets/zz_main.go | 3 +-- cmd/provider/ce/zz_main.go | 3 +-- cmd/provider/chime/zz_main.go | 3 +-- cmd/provider/cloud9/zz_main.go | 3 +-- cmd/provider/cloudcontrol/zz_main.go | 3 +-- cmd/provider/cloudformation/zz_main.go | 3 +-- cmd/provider/cloudfront/zz_main.go | 3 +-- cmd/provider/cloudsearch/zz_main.go | 3 +-- cmd/provider/cloudtrail/zz_main.go | 3 +-- cmd/provider/cloudwatch/zz_main.go | 3 +-- cmd/provider/cloudwatchevents/zz_main.go | 3 +-- cmd/provider/cloudwatchlogs/zz_main.go | 3 +-- cmd/provider/codecommit/zz_main.go | 3 +-- cmd/provider/codepipeline/zz_main.go | 3 +-- cmd/provider/codestarconnections/zz_main.go | 3 +-- cmd/provider/codestarnotifications/zz_main.go | 3 +-- cmd/provider/cognitoidentity/zz_main.go | 3 +-- cmd/provider/cognitoidp/zz_main.go | 3 +-- cmd/provider/config/zz_main.go | 3 +-- cmd/provider/configservice/zz_main.go | 3 +-- cmd/provider/connect/zz_main.go | 3 +-- cmd/provider/cur/zz_main.go | 3 +-- cmd/provider/dataexchange/zz_main.go | 3 +-- cmd/provider/datapipeline/zz_main.go | 3 +-- cmd/provider/datasync/zz_main.go | 3 +-- cmd/provider/dax/zz_main.go | 3 +-- cmd/provider/deploy/zz_main.go | 3 +-- cmd/provider/detective/zz_main.go | 3 +-- cmd/provider/devicefarm/zz_main.go | 3 +-- cmd/provider/directconnect/zz_main.go | 3 +-- cmd/provider/dlm/zz_main.go | 3 +-- cmd/provider/dms/zz_main.go | 3 +-- cmd/provider/docdb/zz_main.go | 3 +-- cmd/provider/ds/zz_main.go | 3 +-- cmd/provider/dynamodb/zz_main.go | 3 +-- cmd/provider/ec2/zz_main.go | 3 +-- cmd/provider/ecr/zz_main.go | 3 +-- cmd/provider/ecrpublic/zz_main.go | 3 +-- cmd/provider/ecs/zz_main.go | 3 +-- cmd/provider/efs/zz_main.go | 3 +-- cmd/provider/eks/zz_main.go | 3 +-- cmd/provider/elasticache/zz_main.go | 3 +-- cmd/provider/elasticbeanstalk/zz_main.go | 3 +-- cmd/provider/elasticsearch/zz_main.go | 3 +-- cmd/provider/elastictranscoder/zz_main.go | 3 +-- cmd/provider/elb/zz_main.go | 3 +-- cmd/provider/elbv2/zz_main.go | 3 +-- cmd/provider/emr/zz_main.go | 3 +-- cmd/provider/emrserverless/zz_main.go | 3 +-- cmd/provider/evidently/zz_main.go | 3 +-- cmd/provider/firehose/zz_main.go | 3 +-- cmd/provider/fis/zz_main.go | 3 +-- cmd/provider/fsx/zz_main.go | 3 +-- cmd/provider/gamelift/zz_main.go | 3 +-- cmd/provider/glacier/zz_main.go | 3 +-- cmd/provider/globalaccelerator/zz_main.go | 3 +-- cmd/provider/glue/zz_main.go | 3 +-- cmd/provider/grafana/zz_main.go | 3 +-- cmd/provider/guardduty/zz_main.go | 3 +-- cmd/provider/iam/zz_main.go | 3 +-- cmd/provider/identitystore/zz_main.go | 3 +-- cmd/provider/imagebuilder/zz_main.go | 3 +-- cmd/provider/inspector/zz_main.go | 3 +-- cmd/provider/inspector2/zz_main.go | 3 +-- cmd/provider/iot/zz_main.go | 3 +-- cmd/provider/ivs/zz_main.go | 3 +-- cmd/provider/kafka/zz_main.go | 3 +-- cmd/provider/kendra/zz_main.go | 3 +-- cmd/provider/keyspaces/zz_main.go | 3 +-- cmd/provider/kinesis/zz_main.go | 3 +-- cmd/provider/kinesisanalytics/zz_main.go | 3 +-- cmd/provider/kinesisanalyticsv2/zz_main.go | 3 +-- cmd/provider/kinesisvideo/zz_main.go | 3 +-- cmd/provider/kms/zz_main.go | 3 +-- cmd/provider/lakeformation/zz_main.go | 3 +-- cmd/provider/lambda/zz_main.go | 3 +-- cmd/provider/lexmodels/zz_main.go | 3 +-- cmd/provider/licensemanager/zz_main.go | 3 +-- cmd/provider/lightsail/zz_main.go | 3 +-- cmd/provider/location/zz_main.go | 3 +-- cmd/provider/macie2/zz_main.go | 3 +-- cmd/provider/mediaconvert/zz_main.go | 3 +-- cmd/provider/medialive/zz_main.go | 3 +-- cmd/provider/mediapackage/zz_main.go | 3 +-- cmd/provider/mediastore/zz_main.go | 3 +-- cmd/provider/memorydb/zz_main.go | 3 +-- cmd/provider/monolith/zz_main.go | 3 +-- cmd/provider/mq/zz_main.go | 3 +-- cmd/provider/neptune/zz_main.go | 3 +-- cmd/provider/networkfirewall/zz_main.go | 3 +-- cmd/provider/networkmanager/zz_main.go | 3 +-- cmd/provider/opensearch/zz_main.go | 3 +-- cmd/provider/opensearchserverless/zz_main.go | 3 +-- cmd/provider/opsworks/zz_main.go | 3 +-- cmd/provider/organizations/zz_main.go | 3 +-- cmd/provider/pinpoint/zz_main.go | 3 +-- cmd/provider/qldb/zz_main.go | 3 +-- cmd/provider/quicksight/zz_main.go | 3 +-- cmd/provider/ram/zz_main.go | 3 +-- cmd/provider/rds/zz_main.go | 3 +-- cmd/provider/redshift/zz_main.go | 3 +-- cmd/provider/redshiftserverless/zz_main.go | 3 +-- cmd/provider/resourcegroups/zz_main.go | 3 +-- cmd/provider/rolesanywhere/zz_main.go | 3 +-- cmd/provider/route53/zz_main.go | 3 +-- .../route53recoverycontrolconfig/zz_main.go | 3 +-- .../route53recoveryreadiness/zz_main.go | 3 +-- cmd/provider/route53resolver/zz_main.go | 3 +-- cmd/provider/rum/zz_main.go | 3 +-- cmd/provider/s3/zz_main.go | 3 +-- cmd/provider/s3control/zz_main.go | 3 +-- cmd/provider/sagemaker/zz_main.go | 3 +-- cmd/provider/scheduler/zz_main.go | 3 +-- cmd/provider/schemas/zz_main.go | 3 +-- cmd/provider/secretsmanager/zz_main.go | 3 +-- cmd/provider/securityhub/zz_main.go | 3 +-- cmd/provider/serverlessrepo/zz_main.go | 3 +-- cmd/provider/servicecatalog/zz_main.go | 3 +-- cmd/provider/servicediscovery/zz_main.go | 3 +-- cmd/provider/servicequotas/zz_main.go | 3 +-- cmd/provider/ses/zz_main.go | 3 +-- cmd/provider/sesv2/zz_main.go | 3 +-- cmd/provider/sfn/zz_main.go | 3 +-- cmd/provider/signer/zz_main.go | 3 +-- cmd/provider/simpledb/zz_main.go | 3 +-- cmd/provider/sns/zz_main.go | 3 +-- cmd/provider/sqs/zz_main.go | 3 +-- cmd/provider/ssm/zz_main.go | 3 +-- cmd/provider/ssoadmin/zz_main.go | 3 +-- cmd/provider/swf/zz_main.go | 3 +-- cmd/provider/timestreamwrite/zz_main.go | 3 +-- cmd/provider/transcribe/zz_main.go | 3 +-- cmd/provider/transfer/zz_main.go | 3 +-- cmd/provider/vpc/zz_main.go | 3 +-- cmd/provider/waf/zz_main.go | 3 +-- cmd/provider/wafregional/zz_main.go | 3 +-- cmd/provider/wafv2/zz_main.go | 3 +-- cmd/provider/workspaces/zz_main.go | 3 +-- cmd/provider/xray/zz_main.go | 3 +-- config/registry.go | 19 +++---------------- hack/main.go.tmpl | 3 +-- internal/clients/aws.go | 8 +++----- 165 files changed, 169 insertions(+), 346 deletions(-) diff --git a/cmd/generator/main.go b/cmd/generator/main.go index b712269082..19356de918 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -43,7 +43,7 @@ func main() { if err != nil { panic(fmt.Sprintf("cannot calculate the absolute path with %s", *repoRoot)) } - p, _, err := config.GetProvider(context.Background(), true) + p, err := config.GetProvider(context.Background(), true) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") dumpGeneratedResourceList(p, generatedResourceList) dumpSkippedResourcesCSV(p, skippedResourcesCSV) diff --git a/cmd/provider/accessanalyzer/zz_main.go b/cmd/provider/accessanalyzer/zz_main.go index 4ba1891bb9..6e30372d66 100644 --- a/cmd/provider/accessanalyzer/zz_main.go +++ b/cmd/provider/accessanalyzer/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/account/zz_main.go b/cmd/provider/account/zz_main.go index 533118d326..f809409824 100644 --- a/cmd/provider/account/zz_main.go +++ b/cmd/provider/account/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/acm/zz_main.go b/cmd/provider/acm/zz_main.go index 252d909f65..f73502681a 100644 --- a/cmd/provider/acm/zz_main.go +++ b/cmd/provider/acm/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/acmpca/zz_main.go b/cmd/provider/acmpca/zz_main.go index 931f4efce1..88a021e255 100644 --- a/cmd/provider/acmpca/zz_main.go +++ b/cmd/provider/acmpca/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/amp/zz_main.go b/cmd/provider/amp/zz_main.go index b9c3a367a8..31ddd0ba83 100644 --- a/cmd/provider/amp/zz_main.go +++ b/cmd/provider/amp/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/amplify/zz_main.go b/cmd/provider/amplify/zz_main.go index 821cb5f295..e21b04d13b 100644 --- a/cmd/provider/amplify/zz_main.go +++ b/cmd/provider/amplify/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/apigateway/zz_main.go b/cmd/provider/apigateway/zz_main.go index 0d4191b11b..38bb29379a 100644 --- a/cmd/provider/apigateway/zz_main.go +++ b/cmd/provider/apigateway/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/apigatewayv2/zz_main.go b/cmd/provider/apigatewayv2/zz_main.go index 0f07395bf0..e78e22779f 100644 --- a/cmd/provider/apigatewayv2/zz_main.go +++ b/cmd/provider/apigatewayv2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appautoscaling/zz_main.go b/cmd/provider/appautoscaling/zz_main.go index 9f30a7ce90..f54ce89e3f 100644 --- a/cmd/provider/appautoscaling/zz_main.go +++ b/cmd/provider/appautoscaling/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appconfig/zz_main.go b/cmd/provider/appconfig/zz_main.go index 026d1d32d4..0827423f11 100644 --- a/cmd/provider/appconfig/zz_main.go +++ b/cmd/provider/appconfig/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appflow/zz_main.go b/cmd/provider/appflow/zz_main.go index 89eff8eaaa..8c2d89b946 100644 --- a/cmd/provider/appflow/zz_main.go +++ b/cmd/provider/appflow/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appintegrations/zz_main.go b/cmd/provider/appintegrations/zz_main.go index ab188623ad..a707d276aa 100644 --- a/cmd/provider/appintegrations/zz_main.go +++ b/cmd/provider/appintegrations/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/applicationinsights/zz_main.go b/cmd/provider/applicationinsights/zz_main.go index aeb8d59c2b..f67e3fa63e 100644 --- a/cmd/provider/applicationinsights/zz_main.go +++ b/cmd/provider/applicationinsights/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appmesh/zz_main.go b/cmd/provider/appmesh/zz_main.go index 64c6b140b2..f3188a1fa4 100644 --- a/cmd/provider/appmesh/zz_main.go +++ b/cmd/provider/appmesh/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/apprunner/zz_main.go b/cmd/provider/apprunner/zz_main.go index 87182d94c8..38de428ba1 100644 --- a/cmd/provider/apprunner/zz_main.go +++ b/cmd/provider/apprunner/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appstream/zz_main.go b/cmd/provider/appstream/zz_main.go index dac9002b3e..37a7236c33 100644 --- a/cmd/provider/appstream/zz_main.go +++ b/cmd/provider/appstream/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/appsync/zz_main.go b/cmd/provider/appsync/zz_main.go index c6de718aee..8d0ecf5dc1 100644 --- a/cmd/provider/appsync/zz_main.go +++ b/cmd/provider/appsync/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/athena/zz_main.go b/cmd/provider/athena/zz_main.go index 57d227824a..1ad46a5ca0 100644 --- a/cmd/provider/athena/zz_main.go +++ b/cmd/provider/athena/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/autoscaling/zz_main.go b/cmd/provider/autoscaling/zz_main.go index b7aff87f49..864c1bb420 100644 --- a/cmd/provider/autoscaling/zz_main.go +++ b/cmd/provider/autoscaling/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/autoscalingplans/zz_main.go b/cmd/provider/autoscalingplans/zz_main.go index b40fbf69d7..19ded881c0 100644 --- a/cmd/provider/autoscalingplans/zz_main.go +++ b/cmd/provider/autoscalingplans/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/backup/zz_main.go b/cmd/provider/backup/zz_main.go index 4e853a6bf6..d35a13af96 100644 --- a/cmd/provider/backup/zz_main.go +++ b/cmd/provider/backup/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/batch/zz_main.go b/cmd/provider/batch/zz_main.go index efc27c5287..cbdaeb23d1 100644 --- a/cmd/provider/batch/zz_main.go +++ b/cmd/provider/batch/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/budgets/zz_main.go b/cmd/provider/budgets/zz_main.go index 9370692eeb..bb6fed7a7b 100644 --- a/cmd/provider/budgets/zz_main.go +++ b/cmd/provider/budgets/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ce/zz_main.go b/cmd/provider/ce/zz_main.go index 9490bbb988..baa8d51930 100644 --- a/cmd/provider/ce/zz_main.go +++ b/cmd/provider/ce/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/chime/zz_main.go b/cmd/provider/chime/zz_main.go index fa0c7752a1..b9690a2380 100644 --- a/cmd/provider/chime/zz_main.go +++ b/cmd/provider/chime/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloud9/zz_main.go b/cmd/provider/cloud9/zz_main.go index 144cf7d1dd..bca879094e 100644 --- a/cmd/provider/cloud9/zz_main.go +++ b/cmd/provider/cloud9/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudcontrol/zz_main.go b/cmd/provider/cloudcontrol/zz_main.go index 4aeac4bc19..dd095d9683 100644 --- a/cmd/provider/cloudcontrol/zz_main.go +++ b/cmd/provider/cloudcontrol/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudformation/zz_main.go b/cmd/provider/cloudformation/zz_main.go index f78c2c4529..5cd2c79858 100644 --- a/cmd/provider/cloudformation/zz_main.go +++ b/cmd/provider/cloudformation/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudfront/zz_main.go b/cmd/provider/cloudfront/zz_main.go index dd87be5830..aa4e443b17 100644 --- a/cmd/provider/cloudfront/zz_main.go +++ b/cmd/provider/cloudfront/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudsearch/zz_main.go b/cmd/provider/cloudsearch/zz_main.go index c9427a4fbc..d59749fa31 100644 --- a/cmd/provider/cloudsearch/zz_main.go +++ b/cmd/provider/cloudsearch/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudtrail/zz_main.go b/cmd/provider/cloudtrail/zz_main.go index b866130a02..55f938817f 100644 --- a/cmd/provider/cloudtrail/zz_main.go +++ b/cmd/provider/cloudtrail/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudwatch/zz_main.go b/cmd/provider/cloudwatch/zz_main.go index bc25595002..f830fd7766 100644 --- a/cmd/provider/cloudwatch/zz_main.go +++ b/cmd/provider/cloudwatch/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudwatchevents/zz_main.go b/cmd/provider/cloudwatchevents/zz_main.go index 1f7055903e..c825fe3750 100644 --- a/cmd/provider/cloudwatchevents/zz_main.go +++ b/cmd/provider/cloudwatchevents/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cloudwatchlogs/zz_main.go b/cmd/provider/cloudwatchlogs/zz_main.go index d20ed8979c..b1ce0742df 100644 --- a/cmd/provider/cloudwatchlogs/zz_main.go +++ b/cmd/provider/cloudwatchlogs/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/codecommit/zz_main.go b/cmd/provider/codecommit/zz_main.go index ef687f1d22..ca5ddf785a 100644 --- a/cmd/provider/codecommit/zz_main.go +++ b/cmd/provider/codecommit/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/codepipeline/zz_main.go b/cmd/provider/codepipeline/zz_main.go index 3d7a18b905..9414996d19 100644 --- a/cmd/provider/codepipeline/zz_main.go +++ b/cmd/provider/codepipeline/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/codestarconnections/zz_main.go b/cmd/provider/codestarconnections/zz_main.go index 3dedf71a53..961d0b25c4 100644 --- a/cmd/provider/codestarconnections/zz_main.go +++ b/cmd/provider/codestarconnections/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/codestarnotifications/zz_main.go b/cmd/provider/codestarnotifications/zz_main.go index 979fd16467..d6b6c074d6 100644 --- a/cmd/provider/codestarnotifications/zz_main.go +++ b/cmd/provider/codestarnotifications/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cognitoidentity/zz_main.go b/cmd/provider/cognitoidentity/zz_main.go index 2a1251b570..3f7b84648a 100644 --- a/cmd/provider/cognitoidentity/zz_main.go +++ b/cmd/provider/cognitoidentity/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cognitoidp/zz_main.go b/cmd/provider/cognitoidp/zz_main.go index cefd0bc728..3e2355ded5 100644 --- a/cmd/provider/cognitoidp/zz_main.go +++ b/cmd/provider/cognitoidp/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/config/zz_main.go b/cmd/provider/config/zz_main.go index c49d2e0493..9ab3ed8f53 100644 --- a/cmd/provider/config/zz_main.go +++ b/cmd/provider/config/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/configservice/zz_main.go b/cmd/provider/configservice/zz_main.go index 21c4f07e13..42f7da9dff 100644 --- a/cmd/provider/configservice/zz_main.go +++ b/cmd/provider/configservice/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/connect/zz_main.go b/cmd/provider/connect/zz_main.go index cecdf399c4..927d7ebb50 100644 --- a/cmd/provider/connect/zz_main.go +++ b/cmd/provider/connect/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/cur/zz_main.go b/cmd/provider/cur/zz_main.go index a49ee730ae..879a32af8d 100644 --- a/cmd/provider/cur/zz_main.go +++ b/cmd/provider/cur/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/dataexchange/zz_main.go b/cmd/provider/dataexchange/zz_main.go index c7863f13be..9dc75c2e3c 100644 --- a/cmd/provider/dataexchange/zz_main.go +++ b/cmd/provider/dataexchange/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/datapipeline/zz_main.go b/cmd/provider/datapipeline/zz_main.go index 52c6ebca6d..8fb3f9a34e 100644 --- a/cmd/provider/datapipeline/zz_main.go +++ b/cmd/provider/datapipeline/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/datasync/zz_main.go b/cmd/provider/datasync/zz_main.go index 617609cba2..22babe52ba 100644 --- a/cmd/provider/datasync/zz_main.go +++ b/cmd/provider/datasync/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/dax/zz_main.go b/cmd/provider/dax/zz_main.go index d844cf0bff..1e94200e54 100644 --- a/cmd/provider/dax/zz_main.go +++ b/cmd/provider/dax/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/deploy/zz_main.go b/cmd/provider/deploy/zz_main.go index 69279bb20f..5a3408b263 100644 --- a/cmd/provider/deploy/zz_main.go +++ b/cmd/provider/deploy/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/detective/zz_main.go b/cmd/provider/detective/zz_main.go index d7e235fd77..6cca90f037 100644 --- a/cmd/provider/detective/zz_main.go +++ b/cmd/provider/detective/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/devicefarm/zz_main.go b/cmd/provider/devicefarm/zz_main.go index 6359365a08..85c9f961c0 100644 --- a/cmd/provider/devicefarm/zz_main.go +++ b/cmd/provider/devicefarm/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/directconnect/zz_main.go b/cmd/provider/directconnect/zz_main.go index 75b63a7bc5..6f79675f36 100644 --- a/cmd/provider/directconnect/zz_main.go +++ b/cmd/provider/directconnect/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/dlm/zz_main.go b/cmd/provider/dlm/zz_main.go index 6a6dc0cb48..9692dd2567 100644 --- a/cmd/provider/dlm/zz_main.go +++ b/cmd/provider/dlm/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/dms/zz_main.go b/cmd/provider/dms/zz_main.go index 934a2ce79b..965e158f28 100644 --- a/cmd/provider/dms/zz_main.go +++ b/cmd/provider/dms/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/docdb/zz_main.go b/cmd/provider/docdb/zz_main.go index 92f8b9f71a..2f01d5a6b2 100644 --- a/cmd/provider/docdb/zz_main.go +++ b/cmd/provider/docdb/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ds/zz_main.go b/cmd/provider/ds/zz_main.go index 26582f8753..71a300972b 100644 --- a/cmd/provider/ds/zz_main.go +++ b/cmd/provider/ds/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/dynamodb/zz_main.go b/cmd/provider/dynamodb/zz_main.go index db9aa4f3c2..159d42ffb5 100644 --- a/cmd/provider/dynamodb/zz_main.go +++ b/cmd/provider/dynamodb/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ec2/zz_main.go b/cmd/provider/ec2/zz_main.go index e77a504d6b..cac7c795a2 100644 --- a/cmd/provider/ec2/zz_main.go +++ b/cmd/provider/ec2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ecr/zz_main.go b/cmd/provider/ecr/zz_main.go index ddda31ba90..2319d83995 100644 --- a/cmd/provider/ecr/zz_main.go +++ b/cmd/provider/ecr/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ecrpublic/zz_main.go b/cmd/provider/ecrpublic/zz_main.go index b825ec1ca1..2bb5c18230 100644 --- a/cmd/provider/ecrpublic/zz_main.go +++ b/cmd/provider/ecrpublic/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ecs/zz_main.go b/cmd/provider/ecs/zz_main.go index b414f69cd6..f70f739a71 100644 --- a/cmd/provider/ecs/zz_main.go +++ b/cmd/provider/ecs/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/efs/zz_main.go b/cmd/provider/efs/zz_main.go index c8d1995c09..4655c71bb7 100644 --- a/cmd/provider/efs/zz_main.go +++ b/cmd/provider/efs/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/eks/zz_main.go b/cmd/provider/eks/zz_main.go index afc4428b6b..f5bebbfae6 100644 --- a/cmd/provider/eks/zz_main.go +++ b/cmd/provider/eks/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/elasticache/zz_main.go b/cmd/provider/elasticache/zz_main.go index bf74611c96..92ca8104d9 100644 --- a/cmd/provider/elasticache/zz_main.go +++ b/cmd/provider/elasticache/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/elasticbeanstalk/zz_main.go b/cmd/provider/elasticbeanstalk/zz_main.go index b021d68aee..dc9be4cff0 100644 --- a/cmd/provider/elasticbeanstalk/zz_main.go +++ b/cmd/provider/elasticbeanstalk/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/elasticsearch/zz_main.go b/cmd/provider/elasticsearch/zz_main.go index 732d9537ba..1122b2f164 100644 --- a/cmd/provider/elasticsearch/zz_main.go +++ b/cmd/provider/elasticsearch/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/elastictranscoder/zz_main.go b/cmd/provider/elastictranscoder/zz_main.go index 93654a784d..43919c325f 100644 --- a/cmd/provider/elastictranscoder/zz_main.go +++ b/cmd/provider/elastictranscoder/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/elb/zz_main.go b/cmd/provider/elb/zz_main.go index 34e165aa0d..edc1dd65f2 100644 --- a/cmd/provider/elb/zz_main.go +++ b/cmd/provider/elb/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/elbv2/zz_main.go b/cmd/provider/elbv2/zz_main.go index be0da62dee..ccc712098f 100644 --- a/cmd/provider/elbv2/zz_main.go +++ b/cmd/provider/elbv2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/emr/zz_main.go b/cmd/provider/emr/zz_main.go index d9fda9256f..20bc90ca25 100644 --- a/cmd/provider/emr/zz_main.go +++ b/cmd/provider/emr/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/emrserverless/zz_main.go b/cmd/provider/emrserverless/zz_main.go index b5f1776161..7b7cb50f34 100644 --- a/cmd/provider/emrserverless/zz_main.go +++ b/cmd/provider/emrserverless/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/evidently/zz_main.go b/cmd/provider/evidently/zz_main.go index 8337dcdded..49200c4324 100644 --- a/cmd/provider/evidently/zz_main.go +++ b/cmd/provider/evidently/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/firehose/zz_main.go b/cmd/provider/firehose/zz_main.go index cd4f47ff93..5dc0f2b13a 100644 --- a/cmd/provider/firehose/zz_main.go +++ b/cmd/provider/firehose/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/fis/zz_main.go b/cmd/provider/fis/zz_main.go index 7d369560d9..3847c7e6c9 100644 --- a/cmd/provider/fis/zz_main.go +++ b/cmd/provider/fis/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/fsx/zz_main.go b/cmd/provider/fsx/zz_main.go index bdcc82e041..ae195f1945 100644 --- a/cmd/provider/fsx/zz_main.go +++ b/cmd/provider/fsx/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/gamelift/zz_main.go b/cmd/provider/gamelift/zz_main.go index e10e9ed078..6a6a93c483 100644 --- a/cmd/provider/gamelift/zz_main.go +++ b/cmd/provider/gamelift/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/glacier/zz_main.go b/cmd/provider/glacier/zz_main.go index 9bc6687f2c..57e25b2489 100644 --- a/cmd/provider/glacier/zz_main.go +++ b/cmd/provider/glacier/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/globalaccelerator/zz_main.go b/cmd/provider/globalaccelerator/zz_main.go index c17c2d9571..eed2510585 100644 --- a/cmd/provider/globalaccelerator/zz_main.go +++ b/cmd/provider/globalaccelerator/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/glue/zz_main.go b/cmd/provider/glue/zz_main.go index cb2d76c441..e7a6722ef8 100644 --- a/cmd/provider/glue/zz_main.go +++ b/cmd/provider/glue/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/grafana/zz_main.go b/cmd/provider/grafana/zz_main.go index f12d4a29db..b6d654a924 100644 --- a/cmd/provider/grafana/zz_main.go +++ b/cmd/provider/grafana/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/guardduty/zz_main.go b/cmd/provider/guardduty/zz_main.go index e04ef87a99..7775d5da96 100644 --- a/cmd/provider/guardduty/zz_main.go +++ b/cmd/provider/guardduty/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/iam/zz_main.go b/cmd/provider/iam/zz_main.go index aef4a85e70..2a6f4fdef5 100644 --- a/cmd/provider/iam/zz_main.go +++ b/cmd/provider/iam/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/identitystore/zz_main.go b/cmd/provider/identitystore/zz_main.go index 5c2e4afa02..05c1132d09 100644 --- a/cmd/provider/identitystore/zz_main.go +++ b/cmd/provider/identitystore/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/imagebuilder/zz_main.go b/cmd/provider/imagebuilder/zz_main.go index 78b01484ee..3aee2bd62f 100644 --- a/cmd/provider/imagebuilder/zz_main.go +++ b/cmd/provider/imagebuilder/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/inspector/zz_main.go b/cmd/provider/inspector/zz_main.go index 1aba5136d7..38897ff80b 100644 --- a/cmd/provider/inspector/zz_main.go +++ b/cmd/provider/inspector/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/inspector2/zz_main.go b/cmd/provider/inspector2/zz_main.go index 13b7caba5f..c3303e8773 100644 --- a/cmd/provider/inspector2/zz_main.go +++ b/cmd/provider/inspector2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/iot/zz_main.go b/cmd/provider/iot/zz_main.go index 08529c43f4..db9363668d 100644 --- a/cmd/provider/iot/zz_main.go +++ b/cmd/provider/iot/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ivs/zz_main.go b/cmd/provider/ivs/zz_main.go index dea822426a..b21b47081f 100644 --- a/cmd/provider/ivs/zz_main.go +++ b/cmd/provider/ivs/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kafka/zz_main.go b/cmd/provider/kafka/zz_main.go index d3f0433b86..bc9e2278dd 100644 --- a/cmd/provider/kafka/zz_main.go +++ b/cmd/provider/kafka/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kendra/zz_main.go b/cmd/provider/kendra/zz_main.go index d18c5802a7..da665d48fc 100644 --- a/cmd/provider/kendra/zz_main.go +++ b/cmd/provider/kendra/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/keyspaces/zz_main.go b/cmd/provider/keyspaces/zz_main.go index 73b7255d15..530f1e1988 100644 --- a/cmd/provider/keyspaces/zz_main.go +++ b/cmd/provider/keyspaces/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kinesis/zz_main.go b/cmd/provider/kinesis/zz_main.go index ccb20d21ba..f21dedc16e 100644 --- a/cmd/provider/kinesis/zz_main.go +++ b/cmd/provider/kinesis/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kinesisanalytics/zz_main.go b/cmd/provider/kinesisanalytics/zz_main.go index c4b281aa8f..749a46ca44 100644 --- a/cmd/provider/kinesisanalytics/zz_main.go +++ b/cmd/provider/kinesisanalytics/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kinesisanalyticsv2/zz_main.go b/cmd/provider/kinesisanalyticsv2/zz_main.go index aa40a50fbf..32f21b2f09 100644 --- a/cmd/provider/kinesisanalyticsv2/zz_main.go +++ b/cmd/provider/kinesisanalyticsv2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kinesisvideo/zz_main.go b/cmd/provider/kinesisvideo/zz_main.go index a7c12c1999..df18d456d5 100644 --- a/cmd/provider/kinesisvideo/zz_main.go +++ b/cmd/provider/kinesisvideo/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/kms/zz_main.go b/cmd/provider/kms/zz_main.go index 314f3579bb..1c12d38771 100644 --- a/cmd/provider/kms/zz_main.go +++ b/cmd/provider/kms/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/lakeformation/zz_main.go b/cmd/provider/lakeformation/zz_main.go index 8d946068f5..81b7d7c819 100644 --- a/cmd/provider/lakeformation/zz_main.go +++ b/cmd/provider/lakeformation/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/lambda/zz_main.go b/cmd/provider/lambda/zz_main.go index c88412c30a..cccf82f291 100644 --- a/cmd/provider/lambda/zz_main.go +++ b/cmd/provider/lambda/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/lexmodels/zz_main.go b/cmd/provider/lexmodels/zz_main.go index c0d5156cbd..392c42fd66 100644 --- a/cmd/provider/lexmodels/zz_main.go +++ b/cmd/provider/lexmodels/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/licensemanager/zz_main.go b/cmd/provider/licensemanager/zz_main.go index 586e4e2981..76a899fcfe 100644 --- a/cmd/provider/licensemanager/zz_main.go +++ b/cmd/provider/licensemanager/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/lightsail/zz_main.go b/cmd/provider/lightsail/zz_main.go index 74b9660665..7231814f43 100644 --- a/cmd/provider/lightsail/zz_main.go +++ b/cmd/provider/lightsail/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/location/zz_main.go b/cmd/provider/location/zz_main.go index 204c0c6d1a..1b900c24d1 100644 --- a/cmd/provider/location/zz_main.go +++ b/cmd/provider/location/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/macie2/zz_main.go b/cmd/provider/macie2/zz_main.go index 61b68cc53a..30cd3371e6 100644 --- a/cmd/provider/macie2/zz_main.go +++ b/cmd/provider/macie2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/mediaconvert/zz_main.go b/cmd/provider/mediaconvert/zz_main.go index 3f4e435693..7c685985c9 100644 --- a/cmd/provider/mediaconvert/zz_main.go +++ b/cmd/provider/mediaconvert/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/medialive/zz_main.go b/cmd/provider/medialive/zz_main.go index b59d3bd8bf..78632dfa32 100644 --- a/cmd/provider/medialive/zz_main.go +++ b/cmd/provider/medialive/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/mediapackage/zz_main.go b/cmd/provider/mediapackage/zz_main.go index dc6158fe42..a9e4ce6abb 100644 --- a/cmd/provider/mediapackage/zz_main.go +++ b/cmd/provider/mediapackage/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/mediastore/zz_main.go b/cmd/provider/mediastore/zz_main.go index a12f1a3977..f4a06c7c91 100644 --- a/cmd/provider/mediastore/zz_main.go +++ b/cmd/provider/mediastore/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/memorydb/zz_main.go b/cmd/provider/memorydb/zz_main.go index 0ce8bf387e..a1091e0538 100644 --- a/cmd/provider/memorydb/zz_main.go +++ b/cmd/provider/memorydb/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/monolith/zz_main.go b/cmd/provider/monolith/zz_main.go index b2d95531df..35ace28ff6 100644 --- a/cmd/provider/monolith/zz_main.go +++ b/cmd/provider/monolith/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/mq/zz_main.go b/cmd/provider/mq/zz_main.go index feec5c81ab..726b3d2a4f 100644 --- a/cmd/provider/mq/zz_main.go +++ b/cmd/provider/mq/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/neptune/zz_main.go b/cmd/provider/neptune/zz_main.go index 6e83dd60c5..a3f86a02a3 100644 --- a/cmd/provider/neptune/zz_main.go +++ b/cmd/provider/neptune/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/networkfirewall/zz_main.go b/cmd/provider/networkfirewall/zz_main.go index 3f934a3cf6..16da65f93f 100644 --- a/cmd/provider/networkfirewall/zz_main.go +++ b/cmd/provider/networkfirewall/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/networkmanager/zz_main.go b/cmd/provider/networkmanager/zz_main.go index 2319e6f314..96ce3d1c12 100644 --- a/cmd/provider/networkmanager/zz_main.go +++ b/cmd/provider/networkmanager/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/opensearch/zz_main.go b/cmd/provider/opensearch/zz_main.go index 04aafb8f37..25a145a95b 100644 --- a/cmd/provider/opensearch/zz_main.go +++ b/cmd/provider/opensearch/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/opensearchserverless/zz_main.go b/cmd/provider/opensearchserverless/zz_main.go index a0489a8bef..3f98c1d509 100644 --- a/cmd/provider/opensearchserverless/zz_main.go +++ b/cmd/provider/opensearchserverless/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/opsworks/zz_main.go b/cmd/provider/opsworks/zz_main.go index 86ebca17af..dbc51a3fc4 100644 --- a/cmd/provider/opsworks/zz_main.go +++ b/cmd/provider/opsworks/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/organizations/zz_main.go b/cmd/provider/organizations/zz_main.go index b3ee6c0c05..da952133f3 100644 --- a/cmd/provider/organizations/zz_main.go +++ b/cmd/provider/organizations/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/pinpoint/zz_main.go b/cmd/provider/pinpoint/zz_main.go index 960a3904f9..ea73153f2e 100644 --- a/cmd/provider/pinpoint/zz_main.go +++ b/cmd/provider/pinpoint/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/qldb/zz_main.go b/cmd/provider/qldb/zz_main.go index f1293ce8a0..f8be266de8 100644 --- a/cmd/provider/qldb/zz_main.go +++ b/cmd/provider/qldb/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/quicksight/zz_main.go b/cmd/provider/quicksight/zz_main.go index f4e6ebdad1..1f4a9a93b4 100644 --- a/cmd/provider/quicksight/zz_main.go +++ b/cmd/provider/quicksight/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ram/zz_main.go b/cmd/provider/ram/zz_main.go index e9998c185b..9040624596 100644 --- a/cmd/provider/ram/zz_main.go +++ b/cmd/provider/ram/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/rds/zz_main.go b/cmd/provider/rds/zz_main.go index adb7f3bd5d..f84b29cbaf 100644 --- a/cmd/provider/rds/zz_main.go +++ b/cmd/provider/rds/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/redshift/zz_main.go b/cmd/provider/redshift/zz_main.go index 55362543df..07bc245b4e 100644 --- a/cmd/provider/redshift/zz_main.go +++ b/cmd/provider/redshift/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/redshiftserverless/zz_main.go b/cmd/provider/redshiftserverless/zz_main.go index fa1008f105..628e53a707 100644 --- a/cmd/provider/redshiftserverless/zz_main.go +++ b/cmd/provider/redshiftserverless/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/resourcegroups/zz_main.go b/cmd/provider/resourcegroups/zz_main.go index 6f74955d7a..97d5d335b2 100644 --- a/cmd/provider/resourcegroups/zz_main.go +++ b/cmd/provider/resourcegroups/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/rolesanywhere/zz_main.go b/cmd/provider/rolesanywhere/zz_main.go index d8792bf841..05ef81c6cb 100644 --- a/cmd/provider/rolesanywhere/zz_main.go +++ b/cmd/provider/rolesanywhere/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/route53/zz_main.go b/cmd/provider/route53/zz_main.go index 19647123de..2853174811 100644 --- a/cmd/provider/route53/zz_main.go +++ b/cmd/provider/route53/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/route53recoverycontrolconfig/zz_main.go b/cmd/provider/route53recoverycontrolconfig/zz_main.go index a8644179dd..7f7472458f 100644 --- a/cmd/provider/route53recoverycontrolconfig/zz_main.go +++ b/cmd/provider/route53recoverycontrolconfig/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/route53recoveryreadiness/zz_main.go b/cmd/provider/route53recoveryreadiness/zz_main.go index 944b9a3cae..b12d4551bc 100644 --- a/cmd/provider/route53recoveryreadiness/zz_main.go +++ b/cmd/provider/route53recoveryreadiness/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/route53resolver/zz_main.go b/cmd/provider/route53resolver/zz_main.go index 83eaf2c5ed..676590e178 100644 --- a/cmd/provider/route53resolver/zz_main.go +++ b/cmd/provider/route53resolver/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/rum/zz_main.go b/cmd/provider/rum/zz_main.go index b04738cba1..e055298b24 100644 --- a/cmd/provider/rum/zz_main.go +++ b/cmd/provider/rum/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/s3/zz_main.go b/cmd/provider/s3/zz_main.go index c4af1fb6a4..9dd540b8ea 100644 --- a/cmd/provider/s3/zz_main.go +++ b/cmd/provider/s3/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/s3control/zz_main.go b/cmd/provider/s3control/zz_main.go index 513ebbd3cb..184d94b2e0 100644 --- a/cmd/provider/s3control/zz_main.go +++ b/cmd/provider/s3control/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/sagemaker/zz_main.go b/cmd/provider/sagemaker/zz_main.go index 71e19b26c5..c08c7e241b 100644 --- a/cmd/provider/sagemaker/zz_main.go +++ b/cmd/provider/sagemaker/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/scheduler/zz_main.go b/cmd/provider/scheduler/zz_main.go index 34d57bb9dc..71023e4736 100644 --- a/cmd/provider/scheduler/zz_main.go +++ b/cmd/provider/scheduler/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/schemas/zz_main.go b/cmd/provider/schemas/zz_main.go index 83598aaf71..72a7d8a9d2 100644 --- a/cmd/provider/schemas/zz_main.go +++ b/cmd/provider/schemas/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/secretsmanager/zz_main.go b/cmd/provider/secretsmanager/zz_main.go index 15e83eb171..c57f3b46da 100644 --- a/cmd/provider/secretsmanager/zz_main.go +++ b/cmd/provider/secretsmanager/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/securityhub/zz_main.go b/cmd/provider/securityhub/zz_main.go index f5d32c6b61..38b2962669 100644 --- a/cmd/provider/securityhub/zz_main.go +++ b/cmd/provider/securityhub/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/serverlessrepo/zz_main.go b/cmd/provider/serverlessrepo/zz_main.go index 6055e9722d..c9c893886c 100644 --- a/cmd/provider/serverlessrepo/zz_main.go +++ b/cmd/provider/serverlessrepo/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/servicecatalog/zz_main.go b/cmd/provider/servicecatalog/zz_main.go index 545f9f321d..6bbe3df387 100644 --- a/cmd/provider/servicecatalog/zz_main.go +++ b/cmd/provider/servicecatalog/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/servicediscovery/zz_main.go b/cmd/provider/servicediscovery/zz_main.go index f942c150f0..a3d6cfba50 100644 --- a/cmd/provider/servicediscovery/zz_main.go +++ b/cmd/provider/servicediscovery/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/servicequotas/zz_main.go b/cmd/provider/servicequotas/zz_main.go index 01207d42c3..9d86aafa9a 100644 --- a/cmd/provider/servicequotas/zz_main.go +++ b/cmd/provider/servicequotas/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ses/zz_main.go b/cmd/provider/ses/zz_main.go index df7e9cf16e..e20f96f501 100644 --- a/cmd/provider/ses/zz_main.go +++ b/cmd/provider/ses/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/sesv2/zz_main.go b/cmd/provider/sesv2/zz_main.go index 92634a9b19..80a03d8c2e 100644 --- a/cmd/provider/sesv2/zz_main.go +++ b/cmd/provider/sesv2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/sfn/zz_main.go b/cmd/provider/sfn/zz_main.go index c0657987d0..05a94e59c5 100644 --- a/cmd/provider/sfn/zz_main.go +++ b/cmd/provider/sfn/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/signer/zz_main.go b/cmd/provider/signer/zz_main.go index b31134cb3b..efa0b5eafe 100644 --- a/cmd/provider/signer/zz_main.go +++ b/cmd/provider/signer/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/simpledb/zz_main.go b/cmd/provider/simpledb/zz_main.go index 7d01988f0d..5c75de0e35 100644 --- a/cmd/provider/simpledb/zz_main.go +++ b/cmd/provider/simpledb/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/sns/zz_main.go b/cmd/provider/sns/zz_main.go index 9fbf847cac..8ee17569f0 100644 --- a/cmd/provider/sns/zz_main.go +++ b/cmd/provider/sns/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/sqs/zz_main.go b/cmd/provider/sqs/zz_main.go index 4a9ee6fa4a..0e26083aab 100644 --- a/cmd/provider/sqs/zz_main.go +++ b/cmd/provider/sqs/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ssm/zz_main.go b/cmd/provider/ssm/zz_main.go index a81abfcb41..8f58d6ac45 100644 --- a/cmd/provider/ssm/zz_main.go +++ b/cmd/provider/ssm/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/ssoadmin/zz_main.go b/cmd/provider/ssoadmin/zz_main.go index 8c852d46c6..acc3dce851 100644 --- a/cmd/provider/ssoadmin/zz_main.go +++ b/cmd/provider/ssoadmin/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/swf/zz_main.go b/cmd/provider/swf/zz_main.go index 7eaac39c0b..6569f7f19c 100644 --- a/cmd/provider/swf/zz_main.go +++ b/cmd/provider/swf/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/timestreamwrite/zz_main.go b/cmd/provider/timestreamwrite/zz_main.go index 2a0483f5f5..2bf6e57c65 100644 --- a/cmd/provider/timestreamwrite/zz_main.go +++ b/cmd/provider/timestreamwrite/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/transcribe/zz_main.go b/cmd/provider/transcribe/zz_main.go index 0c922e5eb8..96f56c0756 100644 --- a/cmd/provider/transcribe/zz_main.go +++ b/cmd/provider/transcribe/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/transfer/zz_main.go b/cmd/provider/transfer/zz_main.go index 7d2234a929..1e97f65419 100644 --- a/cmd/provider/transfer/zz_main.go +++ b/cmd/provider/transfer/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/vpc/zz_main.go b/cmd/provider/vpc/zz_main.go index a11e5a3c85..8538a1cf07 100644 --- a/cmd/provider/vpc/zz_main.go +++ b/cmd/provider/vpc/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/waf/zz_main.go b/cmd/provider/waf/zz_main.go index 2e126c630b..b3c39c733a 100644 --- a/cmd/provider/waf/zz_main.go +++ b/cmd/provider/waf/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/wafregional/zz_main.go b/cmd/provider/wafregional/zz_main.go index 9618790583..d53ebf4dd2 100644 --- a/cmd/provider/wafregional/zz_main.go +++ b/cmd/provider/wafregional/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/wafv2/zz_main.go b/cmd/provider/wafv2/zz_main.go index a178d12d46..c742960f64 100644 --- a/cmd/provider/wafv2/zz_main.go +++ b/cmd/provider/wafv2/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/workspaces/zz_main.go b/cmd/provider/workspaces/zz_main.go index 6d708b6275..47a47499e5 100644 --- a/cmd/provider/workspaces/zz_main.go +++ b/cmd/provider/workspaces/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/cmd/provider/xray/zz_main.go b/cmd/provider/xray/zz_main.go index 49d16389bc..1e727eac2c 100644 --- a/cmd/provider/xray/zz_main.go +++ b/cmd/provider/xray/zz_main.go @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/config/registry.go b/config/registry.go index c0ac221d9e..b806818ddc 100644 --- a/config/registry.go +++ b/config/registry.go @@ -8,9 +8,6 @@ import ( "context" // Note(ezgidemirel): we are importing this to embed provider schema document _ "embed" - "reflect" - "unsafe" - "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/registry/reference" conversiontfjson "github.com/crossplane/upjet/pkg/types/conversion/tfjson" @@ -80,7 +77,7 @@ func getProviderSchema(s string) (*schema.Provider, error) { // configuration is being read for the code generation pipelines. // In that case, we will only use the JSON schema for generating // the CRDs. -func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider, *xpprovider.AWSClient, error) { +func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider, error) { var p *schema.Provider var fwProvider fwprovider.Provider var err error @@ -91,16 +88,7 @@ func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider fwProvider, p, err = xpprovider.GetProvider(ctx) } if err != nil { - return nil, nil, errors.Wrapf(err, "cannot get the Terraform provider schema with generation mode set to %t", generationProvider) - } - // we set schema.Provider's meta to nil because p.Configure modifies - // a singleton pointer. This further assumes that the - // schema.Provider.Configure calls do not modify the global state - // represented by the config.Provider.TerraformProvider. - var awsClient *xpprovider.AWSClient - if !generationProvider { - // #nosec G103 - awsClient = (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(p.Meta()).Pointer())) + return nil, errors.Wrapf(err, "cannot get the Terraform provider schema with generation mode set to %t", generationProvider) } modulePath := "github.com/upbound/provider-aws" @@ -131,7 +119,6 @@ func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider injectFieldRenamingConversionFunctions(), ), ) - p.SetMeta(nil) pc.BasePackages.ControllerMap["internal/controller/eks/clusterauth"] = "eks" for _, configure := range ProviderConfiguration { @@ -139,7 +126,7 @@ func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider } pc.ConfigureResources() - return pc, awsClient, nil + return pc, nil } // CLIReconciledResourceList returns the list of resources that have external diff --git a/hack/main.go.tmpl b/hack/main.go.tmpl index c4942ed041..6fceb77ac8 100644 --- a/hack/main.go.tmpl +++ b/hack/main.go.tmpl @@ -143,10 +143,9 @@ func main() { kingpin.FatalIfError(resolverapis.BuildScheme(apis.AddToSchemes), "Cannot register the AWS APIs with the API resolver's runtime scheme") ctx := context.Background() - provider, awsClient, err := config.GetProvider(ctx, false) + provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") setupConfig.TerraformProvider = provider.TerraformProvider - setupConfig.AWSClient = awsClient o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, diff --git a/internal/clients/aws.go b/internal/clients/aws.go index d00cb3c499..322b75aaca 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -28,7 +28,6 @@ const ( type SetupConfig struct { TerraformProvider *schema.Provider - AWSClient *xpprovider.AWSClient } func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:gocyclo @@ -134,11 +133,10 @@ func configureNoForkAWSClient(ctx context.Context, ps *terraform.Setup, config * } // only used for retrieving the ServicePackages from the singleton provider instance - // sharedMeta := config.AWSClient.ServicePackages - // #nosec G103 + p := config.TerraformProvider.Meta() tfAwsConnsClient, diags := tfAwsConnsCfg.GetClient(ctx, &xpprovider.AWSClient{ - ServicePackages: config.AWSClient.ServicePackages, - // ServicePackages: (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(sharedMeta).Pointer())).ServicePackages, + // #nosec G103 + ServicePackages: (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(p).Pointer())).ServicePackages, }) if diags.HasError() { return errors.Errorf("cannot construct TF AWS Client from TF AWS Config, %v", diags) From 481dde72f445201546321823d105e3632e4c173d Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Wed, 13 Mar 2024 17:40:57 +0300 Subject: [PATCH 3/3] fix linter issues and address reviews Signed-off-by: Erhan Cagirici --- config/registry.go | 1 + internal/clients/aws.go | 52 +++++++++++-------- internal/clients/provider_config.go | 17 +++--- .../controller/eks/clusterauth/controller.go | 2 +- 4 files changed, 40 insertions(+), 32 deletions(-) diff --git a/config/registry.go b/config/registry.go index b806818ddc..bed2261b2f 100644 --- a/config/registry.go +++ b/config/registry.go @@ -8,6 +8,7 @@ import ( "context" // Note(ezgidemirel): we are importing this to embed provider schema document _ "embed" + "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/registry/reference" conversiontfjson "github.com/crossplane/upjet/pkg/types/conversion/tfjson" diff --git a/internal/clients/aws.go b/internal/clients/aws.go index 322b75aaca..14aa606626 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/xpprovider" "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" @@ -23,7 +24,7 @@ import ( ) const ( - keyAccountId = "account_id" + keyAccountID = "account_id" ) type SetupConfig struct { @@ -34,15 +35,15 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc return func(ctx context.Context, c client.Client, mg resource.Managed) (terraform.Setup, error) { pc := &v1beta1.ProviderConfig{} if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { - return terraform.Setup{}, errors.Wrapf(err, "cannot get referenced Provider: %s", mg.GetProviderConfigReference().Name) + return terraform.Setup{}, errors.Wrapf(err, "cannot get referenced ProviderConfig: %q", mg.GetProviderConfigReference().Name) } t := resource.NewProviderConfigUsageTracker(c, &v1beta1.ProviderConfigUsage{}) if err := t.Track(ctx, mg); err != nil { - return terraform.Setup{}, errors.Wrap(err, "cannot track ProviderConfig usage") + return terraform.Setup{}, errors.Wrapf(err, "cannot track ProviderConfig usage for %q", mg.GetProviderConfigReference().Name) } ps := terraform.Setup{} - awsCfg, err := GetAWSConfigWithDefaultRegion(ctx, c, mg, pc) + awsCfg, err := getAWSConfigWithDefaultRegion(ctx, c, mg, pc) if err != nil { return terraform.Setup{}, errors.Wrap(err, "cannot get aws config") } else if awsCfg == nil { @@ -61,12 +62,12 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc } } ps.ClientMetadata = map[string]string{ - keyAccountId: account, + keyAccountID: account, } if config.TerraformProvider == nil { return terraform.Setup{}, errors.New("terraform provider cannot be nil") } - return ps, errors.Wrap(configureNoForkAWSClient(ctx, &ps, config, awsCfg, creds, pc), "could not configure the no-fork AWS client") + return ps, errors.Wrap(configureNoForkAWSClient(ctx, &ps, config, awsCfg.Region, creds, pc), "could not configure the no-fork AWS client") } } @@ -80,12 +81,18 @@ func getAccountId(ctx context.Context, cfg *aws.Config, creds aws.Credentials) ( return *identity.Account, nil } -func GetAWSConfigWithDefaultRegion(ctx context.Context, c client.Client, mg resource.Managed, pc *v1beta1.ProviderConfig) (*aws.Config, error) { - cfg, err := GetAWSConfigViaProviderConfig(ctx, c, mg, pc) +// getAWSConfigWithDefaultRegion is a utility function that wraps the +// GetAWSConfigWithoutTracking and fills empty region in the returned for +// "iam.aws.upbound.io" group with a default "us-east-1" region. Although +// this does not have an effect on the resource, as IAM group resources +// has no concept of region, this is done to conform with the TF AWS config +// which requires non-empty region +func getAWSConfigWithDefaultRegion(ctx context.Context, c client.Client, obj runtime.Object, pc *v1beta1.ProviderConfig) (*aws.Config, error) { + cfg, err := GetAWSConfigWithoutTracking(ctx, c, obj, pc) if err != nil { - return nil, errors.Wrap(err, "cannot get AWS config") + return nil, err } - if cfg.Region == "" && mg.GetObjectKind().GroupVersionKind().Group == "iam.aws.upbound.io" { + if cfg.Region == "" && obj.GetObjectKind().GroupVersionKind().Group == "iam.aws.upbound.io" { cfg.Region = "us-east-1" } return cfg, nil @@ -102,22 +109,21 @@ func (m *metaOnlyPrimary) Meta() any { // configureNoForkAWSClient populates the supplied *terraform.Setup with // Terraform Plugin SDK style AWS client (Meta) and Terraform Plugin Framework // style FrameworkProvider -func configureNoForkAWSClient(ctx context.Context, ps *terraform.Setup, config *SetupConfig, awsCfg *aws.Config, creds aws.Credentials, pc *v1beta1.ProviderConfig) error { //nolint:gocyclo +func configureNoForkAWSClient(ctx context.Context, ps *terraform.Setup, config *SetupConfig, region string, creds aws.Credentials, pc *v1beta1.ProviderConfig) error { //nolint:gocyclo tfAwsConnsCfg := xpprovider.AWSConfig{ - AccessKey: creds.AccessKeyID, - EC2MetadataServiceEnableState: imds.ClientDefaultEnableState, - Endpoints: map[string]string{}, - Region: awsCfg.Region, - S3UsePathStyle: pc.Spec.S3UsePathStyle, - SecretKey: creds.SecretAccessKey, - SkipCredsValidation: true, // disabled to prevent extra AWS STS call - SkipRegionValidation: pc.Spec.SkipRegionValidation, - SkipRequestingAccountId: true, // disabled to prevent extra AWS STS call - Token: creds.SessionToken, + AccessKey: creds.AccessKeyID, + Endpoints: map[string]string{}, + Region: region, + S3UsePathStyle: pc.Spec.S3UsePathStyle, + SecretKey: creds.SecretAccessKey, + SkipCredsValidation: true, // disabled to prevent extra AWS STS call + SkipRegionValidation: pc.Spec.SkipRegionValidation, + SkipRequestingAccountId: true, // disabled to prevent extra AWS STS call + Token: creds.SessionToken, } if pc.Spec.SkipMetadataApiCheck { - tfAwsConnsCfg.EC2MetadataServiceEnableState = imds.ClientEnabled + tfAwsConnsCfg.EC2MetadataServiceEnableState = imds.ClientDisabled } if pc.Spec.Endpoint != nil { @@ -147,7 +153,7 @@ func configureNoForkAWSClient(ctx context.Context, ps *terraform.Setup, config * // the resulting TF AWS Client has empty account ID. // Fill with previously calculated account ID. // No need for nil check on ps.ClientMetadata per golang spec. - tfAwsConnsClient.AccountID = ps.ClientMetadata[keyAccountId] + tfAwsConnsClient.AccountID = ps.ClientMetadata[keyAccountID] ps.Meta = tfAwsConnsClient fwProvider := xpprovider.GetFrameworkProviderWithMeta(&metaOnlyPrimary{meta: tfAwsConnsClient}) ps.FrameworkProvider = fwProvider diff --git a/internal/clients/provider_config.go b/internal/clients/provider_config.go index 31356dab9a..0f47ada1d5 100644 --- a/internal/clients/provider_config.go +++ b/internal/clients/provider_config.go @@ -42,7 +42,6 @@ const ( authKeyWebIdentity = "WebIdentity" authKeyUpbound = "Upbound" // authKeySAML = "SAML" - // authKeySecret = "Secret" envWebIdentityTokenFile = "AWS_WEB_IDENTITY_TOKEN_FILE" envWebIdentityRoleARN = "AWS_ROLE_ARN" @@ -85,10 +84,12 @@ func getRegion(obj runtime.Object) (string, error) { return r, err } -// GetAWSConfigViaProviderConfig produces an AWS config from the specified -// v1beta1.ProviderConfig that can be used to authenticate to AWS -func GetAWSConfigViaProviderConfig(ctx context.Context, c client.Client, mg resource.Managed, pc *v1beta1.ProviderConfig) (*aws.Config, error) { // nolint:gocyclo - region, err := getRegion(mg) +// GetAWSConfigWithoutTracking produces an AWS config from the specified +// v1beta1.ProviderConfig that can be used to authenticate to AWS. +// ProviderConfigUsage is not tracked when this function is called. +// The caller is responsible for tracking the usage if needed. +func GetAWSConfigWithoutTracking(ctx context.Context, c client.Client, obj runtime.Object, pc *v1beta1.ProviderConfig) (*aws.Config, error) { // nolint:gocyclo + region, err := getRegion(obj) if err != nil { return nil, errors.Wrap(err, "cannot get region") } @@ -127,11 +128,11 @@ func GetAWSConfigViaProviderConfig(ctx context.Context, c client.Client, mg reso return SetResolver(pc, cfg), nil } -// GetAWSConfigWithProviderUsage obtains the provider config referenced by the +// GetAWSConfigWithTracking obtains the provider config referenced by the // specified managed resource and produces a config that can be used to // authenticate to AWS and tracks the ProviderConfigUsage. Useful for obtaining // AWS config for non-upjet based MR controllers. -func GetAWSConfigWithProviderUsage(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { // nolint:gocyclo +func GetAWSConfigWithTracking(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { if mg.GetProviderConfigReference() == nil { return nil, errors.New("no providerConfigRef provided") } @@ -144,7 +145,7 @@ func GetAWSConfigWithProviderUsage(ctx context.Context, c client.Client, mg reso if err := t.Track(ctx, mg); err != nil { return nil, errors.Wrap(err, "cannot track ProviderConfig usage") } - return GetAWSConfigViaProviderConfig(ctx, c, mg, pc) + return GetAWSConfigWithoutTracking(ctx, c, mg, pc) } type awsEndpointResolverAdaptorWithOptions func(service, region string, options interface{}) (aws.Endpoint, error) diff --git a/internal/controller/eks/clusterauth/controller.go b/internal/controller/eks/clusterauth/controller.go index 6a8b708025..eed2778f31 100644 --- a/internal/controller/eks/clusterauth/controller.go +++ b/internal/controller/eks/clusterauth/controller.go @@ -75,7 +75,7 @@ type connector struct { } func (c *connector) Connect(ctx context.Context, mg resource.Managed) (managed.ExternalClient, error) { - cfg, err := clients.GetAWSConfigWithProviderUsage(ctx, c.kube, mg) + cfg, err := clients.GetAWSConfigWithTracking(ctx, c.kube, mg) if err != nil { return nil, err }