@@ -483,7 +483,7 @@ func NewAWSSessionWithKeyV2(accessKey *iamtypes.AccessKey) *awsv2.Config {
483483}
484484
485485// createCloudFormationStack ensures the cloudformation stack is up to date.
486- func createCloudFormationStack (ctx context.Context , cfg awsv2.Config , prov client.ConfigProvider , t * cfn_bootstrap.Template , tags map [string ]string ) error {
486+ func createCloudFormationStack (ctx context.Context , cfg * awsv2.Config , prov client.ConfigProvider , t * cfn_bootstrap.Template , tags map [string ]string ) error {
487487 By (fmt .Sprintf ("Creating AWS CloudFormation stack for AWS IAM resources: stack-name=%s" , t .Spec .StackName ))
488488 cfnClient := cfn .New (prov )
489489 // CloudFormation stack will clean up on a failure, we don't need an Eventually here.
@@ -545,8 +545,8 @@ func SetMultitenancyEnvVars(prov client.ConfigProvider) error {
545545}
546546
547547// Delete resources that already exists.
548- func deleteResourcesInCloudFormation (ctx context.Context , cfg awsv2.Config , t * cfn_bootstrap.Template ) {
549- iamSvc := iam .NewFromConfig (cfg )
548+ func deleteResourcesInCloudFormation (ctx context.Context , cfg * awsv2.Config , t * cfn_bootstrap.Template ) {
549+ iamSvc := iam .NewFromConfig (* cfg )
550550 temp := * renderCustomCloudFormation (t )
551551 var (
552552 iamUsers []* cfn_iam.User
@@ -660,7 +660,7 @@ func deleteResourcesInCloudFormation(ctx context.Context, cfg awsv2.Config, t *c
660660}
661661
662662// TODO: remove once test infra accounts are fixed.
663- func deleteMultitenancyRoles (ctx context.Context , cfg awsv2.Config ) {
663+ func deleteMultitenancyRoles (ctx context.Context , cfg * awsv2.Config ) {
664664 if err := DeleteRole (ctx , cfg , "multi-tenancy-role" ); err != nil {
665665 By (fmt .Sprintf ("failed to delete role multi-tenancy-role %s" , err ))
666666 }
@@ -670,8 +670,8 @@ func deleteMultitenancyRoles(ctx context.Context, cfg awsv2.Config) {
670670}
671671
672672// detachAllPoliciesForRole detaches all policies for role.
673- func detachAllPoliciesForRole (ctx context.Context , cfg awsv2.Config , name string ) error {
674- iamSvc := iam .NewFromConfig (cfg )
673+ func detachAllPoliciesForRole (ctx context.Context , cfg * awsv2.Config , name string ) error {
674+ iamSvc := iam .NewFromConfig (* cfg )
675675
676676 input := & iam.ListAttachedRolePoliciesInput {
677677 RoleName : aws .String (name ),
@@ -697,8 +697,8 @@ func detachAllPoliciesForRole(ctx context.Context, cfg awsv2.Config, name string
697697}
698698
699699// DeleteUser deletes an IAM user in a best effort manner.
700- func DeleteUser (ctx context.Context , cfg awsv2.Config , name string ) error {
701- iamSvc := iam .NewFromConfig (cfg )
700+ func DeleteUser (ctx context.Context , cfg * awsv2.Config , name string ) error {
701+ iamSvc := iam .NewFromConfig (* cfg )
702702
703703 // if user does not exist, return.
704704 _ , err := iamSvc .GetUser (ctx , & iam.GetUserInput {UserName : aws .String (name )})
@@ -715,8 +715,8 @@ func DeleteUser(ctx context.Context, cfg awsv2.Config, name string) error {
715715}
716716
717717// DeleteRole deletes roles in a best effort manner.
718- func DeleteRole (ctx context.Context , cfg awsv2.Config , name string ) error {
719- iamSvc := iam .NewFromConfig (cfg )
718+ func DeleteRole (ctx context.Context , cfg * awsv2.Config , name string ) error {
719+ iamSvc := iam .NewFromConfig (* cfg )
720720
721721 // if role does not exist, return.
722722 _ , err := iamSvc .GetRole (ctx , & iam.GetRoleInput {RoleName : aws .String (name )})
@@ -868,8 +868,8 @@ func ensureTestImageUploaded(e2eCtx *E2EContext) error {
868868
869869// ensureNoServiceLinkedRoles removes an auto-created IAM role, and tests
870870// the controller's IAM permissions to use ELB and Spot instances successfully.
871- func ensureNoServiceLinkedRoles (ctx context.Context , cfg awsv2.Config ) {
872- iamSvc := iam .NewFromConfig (cfg )
871+ func ensureNoServiceLinkedRoles (ctx context.Context , cfg * awsv2.Config ) {
872+ iamSvc := iam .NewFromConfig (* cfg )
873873
874874 By ("Deleting AWS IAM Service Linked Role: role-name=AWSServiceRoleForElasticLoadBalancing" )
875875 _ , err := iamSvc .DeleteServiceLinkedRole (ctx , & iam.DeleteServiceLinkedRoleInput {
@@ -929,8 +929,8 @@ func encodeCredentials(accessKey *iamtypes.AccessKey, region string) string {
929929
930930// newUserAccessKey generates a new AWS Access Key pair based off of the
931931// bootstrap user. This tests that the CloudFormation policy is correct.
932- func newUserAccessKey (ctx context.Context , cfg awsv2.Config , userName string ) * iamtypes.AccessKey {
933- iamSvc := iam .NewFromConfig (cfg )
932+ func newUserAccessKey (ctx context.Context , cfg * awsv2.Config , userName string ) * iamtypes.AccessKey {
933+ iamSvc := iam .NewFromConfig (* cfg )
934934
935935 keyOuts , _ := iamSvc .ListAccessKeys (ctx , & iam.ListAccessKeysInput {
936936 UserName : aws .String (userName ),
0 commit comments