Repository: kubernetes-sigs/aws-alb-ingress-controller
Pull request #1154 (2020-02-06 00:44:31)

Add back aws api cache
This commits reverts changes made on commit b5e33240ef6fe417fd9c09e43e87b0f2bf54f868
but gives the users the ability to enable the cache and set the cache TTL, by default
is turned off.

Related to: #1100

k8s-ci-robot: Hi @jescarri. Thanks for your PR.

I'm waiting for a [kubernetes-sigs](https://github.com/orgs/kubernetes-sigs/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://git.k8s.io/community/community-membership.md#member) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Faws-alb-ingress-controller).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller/pull/1154#" title="Author self-approved">jescarri</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **bigkraig**
You can assign the PR to them by writing `/assign @bigkraig` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Faws-alb-ingress-controller).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/aws-alb-ingress-controller/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["bigkraig"]} -->
jescarri: With cache enabled:

![image](https://user-images.githubusercontent.com/6692163/73988097-83e1f600-48f6-11ea-84c5-2780fe7eef5a.png)

![image](https://user-images.githubusercontent.com/6692163/73988111-92301200-48f6-11ea-863a-410b4e39e7da.png)


With cache disabled, no metrics for cache shown.
M00nF1sh: /ok-to-test
k8s-ci-robot: @jescarri: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-aws-alb-ingress-controller-e2e-test | bd17acd17a38b507d6d6e55f56e51f3edf32149f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_aws-alb-ingress-controller/1154/pull-aws-alb-ingress-controller-e2e-test/1225570977333645312) | `/test pull-aws-alb-ingress-controller-e2e-test`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=aws-alb-ingress-controller&pr=1154). [Your PR dashboard](https://gubernator.k8s.io/pr/jescarri). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @jescarri: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-aws-alb-ingress-controller-e2e-test | bd17acd17a38b507d6d6e55f56e51f3edf32149f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_aws-alb-ingress-controller/1154/pull-aws-alb-ingress-controller-e2e-test/1225570977325256704) | `/test pull-aws-alb-ingress-controller-e2e-test`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=aws-alb-ingress-controller&pr=1154). [Your PR dashboard](https://gubernator.k8s.io/pr/jescarri). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->

Patch:
diff --git a/cmd/main.go b/cmd/main.go
index cf61ef2d5..ae24a979b 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -26,9 +26,14 @@ import (
 	"syscall"
 	"time"
 
+	"github.com/aws/aws-sdk-go/service/ec2"
+	"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
+	"github.com/ticketmaster/aws-sdk-go-cache/cache"
+
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/aws"
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/controller"
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/metric"
+	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/metric/collectors"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"k8s.io/apiserver/pkg/server/healthz"
@@ -83,13 +88,18 @@ func main() {
 	reg.MustRegister(prometheus.NewGoCollector())
 	reg.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
 
+	cc := cache.NewConfig(options.SdkCacheDuration)
+	cc.SetCacheTTL(resourcegroupstaggingapi.ServiceName, "GetResources", time.Hour)
+	cc.SetCacheTTL(ec2.ServiceName, "DescribeInstanceStatus", time.Minute)
+	reg.MustRegister(cc.NewCacheCollector(collectors.PrometheusNamespace))
+
 	mc, err := metric.NewCollector(reg, options.ingressCTLConfig.IngressClass)
 	if err != nil {
 		glog.Fatal(err)
 	}
 	mc.Start()
 
-	cloud, err := aws.New(options.cloudConfig, options.ingressCTLConfig.ClusterName, mc)
+	cloud, err := aws.New(options.cloudConfig, options.ingressCTLConfig.ClusterName, mc, options.EnableSdkCache, cc)
 	if err != nil {
 		glog.Fatal(err)
 	}
diff --git a/cmd/options.go b/cmd/options.go
index 763712841..6abcc6814 100644
--- a/cmd/options.go
+++ b/cmd/options.go
@@ -42,6 +42,8 @@ const (
 	defaultHealthCheckPeriod       = 1 * time.Minute
 	defaultHealthzPort             = 10254
 	defaultProfilingEnabled        = true
+	defaultEnableSdkCache          = false
+	defaultSdkCacheDuration        = 5 * time.Minute
 )
 
 // Options defines the commandline interface of this binary
@@ -66,6 +68,10 @@ type Options struct {
 
 	// ingress controller specific configuration
 	ingressCTLConfig config.Configuration
+
+	// aws sdk cache options
+	EnableSdkCache   bool
+	SdkCacheDuration time.Duration
 }
 
 func (options *Options) BindFlags(fs *pflag.FlagSet) {
@@ -95,6 +101,8 @@ func (options *Options) BindFlags(fs *pflag.FlagSet) {
 		`Port to use for the healthz endpoint.`)
 	fs.BoolVar(&options.ProfilingEnabled, "profiling", defaultProfilingEnabled,
 		`Enable profiling via web interface host:port/debug/pprof/`)
+	fs.BoolVar(&options.EnableSdkCache, "aws-cache-enable", defaultEnableSdkCache, "Enables AWS SDK Caching")
+	fs.DurationVar(&options.SdkCacheDuration, "aws-cache-duration", defaultSdkCacheDuration, "Duration of AWS SDK Cache entries, default 5m")
 	options.cloudConfig.BindFlags(fs)
 	options.ingressCTLConfig.BindFlags(fs)
 
diff --git a/go.mod b/go.mod
index 6b8e06452..b8e40bc61 100644
--- a/go.mod
+++ b/go.mod
@@ -31,7 +31,7 @@ require (
 	github.com/prometheus/common v0.4.0
 	github.com/spf13/pflag v1.0.5
 	github.com/stretchr/testify v1.4.0
-	github.com/ticketmaster/aws-sdk-go-cache v0.0.0-20180926195306-58922816129c // indirect
+	github.com/ticketmaster/aws-sdk-go-cache v0.0.0-20200114210642-9a510f7c39db
 	golang.org/x/oauth2 v0.0.0-20190212230446-3e8b2be13635 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	k8s.io/api v0.0.0-20181213150558-05914d821849
diff --git a/go.sum b/go.sum
index 488386aec..a3da5bf82 100644
--- a/go.sum
+++ b/go.sum
@@ -175,6 +175,7 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
 github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
 github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/karlseguin/ccache v2.0.2+incompatible h1:MpSlLlHgG3vPWTAIJsSYlyAQsHwfQ2HzgUlbJFh9Ufk=
 github.com/karlseguin/ccache v2.0.2+incompatible/go.mod h1:CM9tNPzT6EdRh14+jiW8mEF9mkNZuuE51qmgGYUB93w=
 github.com/karlseguin/expect v1.0.1/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8=
 github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
@@ -295,6 +296,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
 github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 github.com/ticketmaster/aws-sdk-go-cache v0.0.0-20180926195306-58922816129c/go.mod h1:H9sbOivuFYIUAS9No3MxP7K6WXz8i8Xg4qRJ/nu3zM4=
+github.com/ticketmaster/aws-sdk-go-cache v0.0.0-20200114210642-9a510f7c39db h1:6Powh9OH1h71lc0723hF3TXX3GWoZpSg+DwPWarZDEI=
+github.com/ticketmaster/aws-sdk-go-cache v0.0.0-20200114210642-9a510f7c39db/go.mod h1:DrzEMzgFXDUd2FVZals3Pv9cvdE007ggKR1qnvWzTk8=
 github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q=
 github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
diff --git a/internal/alb/lb/attributes.go b/internal/alb/lb/attributes.go
index 170e17250..a11329022 100644
--- a/internal/alb/lb/attributes.go
+++ b/internal/alb/lb/attributes.go
@@ -13,21 +13,19 @@ import (
 )
 
 const (
-	DeletionProtectionEnabledKey      = "deletion_protection.enabled"
-	AccessLogsS3EnabledKey            = "access_logs.s3.enabled"
-	AccessLogsS3BucketKey             = "access_logs.s3.bucket"
-	AccessLogsS3PrefixKey             = "access_logs.s3.prefix"
-	IdleTimeoutTimeoutSecondsKey      = "idle_timeout.timeout_seconds"
-	RoutingHTTP2EnabledKey            = "routing.http2.enabled"
-	DropInvalidHeaderFieldsEnabledKey = "routing.http.drop_invalid_header_fields.enabled"
-
-	DeletionProtectionEnabled      = false
-	AccessLogsS3Enabled            = false
-	AccessLogsS3Bucket             = ""
-	AccessLogsS3Prefix             = ""
-	IdleTimeoutTimeoutSeconds      = 60
-	RoutingHTTP2Enabled            = true
-	DropInvalidHeaderFieldsEnabled = false
+	DeletionProtectionEnabledKey = "deletion_protection.enabled"
+	AccessLogsS3EnabledKey       = "access_logs.s3.enabled"
+	AccessLogsS3BucketKey        = "access_logs.s3.bucket"
+	AccessLogsS3PrefixKey        = "access_logs.s3.prefix"
+	IdleTimeoutTimeoutSecondsKey = "idle_timeout.timeout_seconds"
+	RoutingHTTP2EnabledKey       = "routing.http2.enabled"
+
+	DeletionProtectionEnabled = false
+	AccessLogsS3Enabled       = false
+	AccessLogsS3Bucket        = ""
+	AccessLogsS3Prefix        = ""
+	IdleTimeoutTimeoutSeconds = 60
+	RoutingHTTP2Enabled       = true
 )
 
 // Attributes represents the desired state of attributes for a load balancer.
@@ -57,21 +55,16 @@ type Attributes struct {
 	// RoutingHTTP2Enabled: routing.http2.enabled - Indicates whether HTTP/2 is enabled. The value
 	// is true or false. The default is true.
 	RoutingHTTP2Enabled bool
-
-	// DropInvalidHeaderFieldsEnabled: routing.http.drop_invalid_header_fields.enabled - Indicates if
-	// invalid headers will be dropped. The default is false.
-	DropInvalidHeaderFieldsEnabled bool
 }
 
 func NewAttributes(attrs []*elbv2.LoadBalancerAttribute) (a *Attributes, err error) {
 	a = &Attributes{
-		DeletionProtectionEnabled:      DeletionProtectionEnabled,
-		AccessLogsS3Enabled:            AccessLogsS3Enabled,
-		AccessLogsS3Bucket:             AccessLogsS3Bucket,
-		AccessLogsS3Prefix:             AccessLogsS3Prefix,
-		IdleTimeoutTimeoutSeconds:      IdleTimeoutTimeoutSeconds,
-		RoutingHTTP2Enabled:            RoutingHTTP2Enabled,
-		DropInvalidHeaderFieldsEnabled: DropInvalidHeaderFieldsEnabled,
+		DeletionProtectionEnabled: DeletionProtectionEnabled,
+		AccessLogsS3Enabled:       AccessLogsS3Enabled,
+		AccessLogsS3Bucket:        AccessLogsS3Bucket,
+		AccessLogsS3Prefix:        AccessLogsS3Prefix,
+		IdleTimeoutTimeoutSeconds: IdleTimeoutTimeoutSeconds,
+		RoutingHTTP2Enabled:       RoutingHTTP2Enabled,
 	}
 	var e error
 	for _, attr := range attrs {
@@ -104,11 +97,6 @@ func NewAttributes(attrs []*elbv2.LoadBalancerAttribute) (a *Attributes, err err
 			if err != nil {
 				return a, fmt.Errorf("invalid load balancer attribute value %s=%s", attrKey, attrValue)
 			}
-		case DropInvalidHeaderFieldsEnabledKey:
-			a.DropInvalidHeaderFieldsEnabled, err = strconv.ParseBool(attrValue)
-			if err != nil {
-				return a, fmt.Errorf("invalid load balancer attribute value %s=%s", attrKey, attrValue)
-			}
 		default:
 			e = NewInvalidAttribute(attrKey)
 		}
@@ -196,10 +184,6 @@ func attributesChangeSet(current, desired *Attributes) (changeSet []*elbv2.LoadB
 		changeSet = append(changeSet, lbAttribute(RoutingHTTP2EnabledKey, fmt.Sprintf("%v", desired.RoutingHTTP2Enabled)))
 	}
 
-	if current.DropInvalidHeaderFieldsEnabled != desired.DropInvalidHeaderFieldsEnabled {
-		changeSet = append(changeSet, lbAttribute(DropInvalidHeaderFieldsEnabledKey, fmt.Sprintf("%v", desired.DropInvalidHeaderFieldsEnabled)))
-	}
-
 	return
 }
 
diff --git a/internal/aws/cloud.go b/internal/aws/cloud.go
index 943a2f9db..32c8f4e82 100644
--- a/internal/aws/cloud.go
+++ b/internal/aws/cloud.go
@@ -18,6 +18,7 @@ import (
 	"github.com/aws/aws-sdk-go/service/wafregional"
 	"github.com/aws/aws-sdk-go/service/wafregional/wafregionaliface"
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/metric"
+	"github.com/ticketmaster/aws-sdk-go-cache/cache"
 )
 
 type CloudAPI interface {
@@ -49,8 +50,8 @@ type Cloud struct {
 // But due to huge number of aws clients, it's best to have one container AWS client that embed these aws clients.
 // TODO: remove clusterName dependency
 // TODO: remove mc dependency like https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/aws/aws_metrics.go
-func New(cfg CloudConfig, clusterName string, mc metric.Collector) (CloudAPI, error) {
-	awsSession := NewSession(&aws.Config{MaxRetries: aws.Int(cfg.APIMaxRetries)}, cfg.APIDebug, mc)
+func New(cfg CloudConfig, clusterName string, mc metric.Collector, ce bool, cc *cache.Config) (CloudAPI, error) {
+	awsSession := NewSession(&aws.Config{MaxRetries: aws.Int(cfg.APIMaxRetries)}, cfg.APIDebug, mc, ce, cc)
 	metadata := ec2metadata.New(awsSession)
 
 	if len(cfg.VpcID) == 0 {
diff --git a/internal/aws/session.go b/internal/aws/session.go
index b8753e39b..f8653e2f8 100644
--- a/internal/aws/session.go
+++ b/internal/aws/session.go
@@ -10,17 +10,21 @@ import (
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/metric"
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/pkg/util/log"
 	"github.com/prometheus/client_golang/prometheus"
+	"github.com/ticketmaster/aws-sdk-go-cache/cache"
 )
 
 // NewSession returns an AWS session based off of the provided AWS config
-func NewSession(awsconfig *aws.Config, AWSDebug bool, mc metric.Collector) *session.Session {
+func NewSession(awsconfig *aws.Config, AWSDebug bool, mc metric.Collector, ce bool, cc *cache.Config) *session.Session {
 	session, err := session.NewSession(awsconfig)
 	if err != nil {
 		mc.IncAPIErrorCount(prometheus.Labels{"service": "AWS", "request": "NewSession"})
 		glog.ErrorDepth(4, fmt.Sprintf("Failed to create AWS session: %s", err.Error()))
 		return nil
 	}
-
+	if ce {
+		// Adds caching to session if cache is enabled
+		cache.AddCaching(session, cc)
+	}
 	session.Handlers.Retry.PushFront(func(r *request.Request) {
 		mc.IncAPIRetryCount(prometheus.Labels{"service": r.ClientInfo.ServiceName, "operation": r.Operation.Name})
 	})


Test patch:
diff --git a/internal/alb/lb/attributes_test.go b/internal/alb/lb/attributes_test.go
index 9c7d7f67d..a4074989e 100644
--- a/internal/alb/lb/attributes_test.go
+++ b/internal/alb/lb/attributes_test.go
@@ -63,11 +63,6 @@ func Test_NewAttributes(t *testing.T) {
 			ok:         false,
 			attributes: []*elbv2.LoadBalancerAttribute{lbAttribute(RoutingHTTP2EnabledKey, "falfadssdfdsse")},
 		},
-		{
-			name:       fmt.Sprintf("%v is invalid", DropInvalidHeaderFieldsEnabledKey),
-			ok:         false,
-			attributes: []*elbv2.LoadBalancerAttribute{lbAttribute(DropInvalidHeaderFieldsEnabledKey, "falfadssdfdsse")},
-		},
 		{
 			name:       fmt.Sprintf("undefined attribute"),
 			ok:         false,
@@ -83,16 +78,14 @@ func Test_NewAttributes(t *testing.T) {
 				lbAttribute(AccessLogsS3PrefixKey, "prefix"),
 				lbAttribute(IdleTimeoutTimeoutSecondsKey, "45"),
 				lbAttribute(RoutingHTTP2EnabledKey, "false"),
-				lbAttribute(DropInvalidHeaderFieldsEnabledKey, "true"),
 			},
 			output: &Attributes{
-				DeletionProtectionEnabled:      true,
-				AccessLogsS3Enabled:            true,
-				AccessLogsS3Bucket:             "bucket name",
-				AccessLogsS3Prefix:             "prefix",
-				IdleTimeoutTimeoutSeconds:      45,
-				RoutingHTTP2Enabled:            false,
-				DropInvalidHeaderFieldsEnabled: true,
+				DeletionProtectionEnabled: true,
+				AccessLogsS3Enabled:       true,
+				AccessLogsS3Bucket:        "bucket name",
+				AccessLogsS3Prefix:        "prefix",
+				IdleTimeoutTimeoutSeconds: 45,
+				RoutingHTTP2Enabled:       false,
 			},
 		},
 	} {
@@ -162,12 +155,6 @@ func Test_attributesChangeSet(t *testing.T) {
 			b:         MustNewAttributes([]*elbv2.LoadBalancerAttribute{lbAttribute(RoutingHTTP2EnabledKey, "false")}),
 			changeSet: []*elbv2.LoadBalancerAttribute{lbAttribute(RoutingHTTP2EnabledKey, "false")},
 		},
-		{
-			name:      fmt.Sprintf("a contains default, b contains non-default DropInvalidHeaderFieldsEnabledKey, make a change"),
-			a:         MustNewAttributes(nil),
-			b:         MustNewAttributes([]*elbv2.LoadBalancerAttribute{lbAttribute(DropInvalidHeaderFieldsEnabledKey, "true")}),
-			changeSet: []*elbv2.LoadBalancerAttribute{lbAttribute(DropInvalidHeaderFieldsEnabledKey, "true")},
-		},
 	} {
 		t.Run(tc.name, func(t *testing.T) {
 			changeSet := attributesChangeSet(tc.a, tc.b)
@@ -201,7 +188,6 @@ func defaultAttributes() []*elbv2.LoadBalancerAttribute {
 		lbAttribute(AccessLogsS3PrefixKey, ""),
 		lbAttribute(IdleTimeoutTimeoutSecondsKey, "60"),
 		lbAttribute(RoutingHTTP2EnabledKey, "true"),
-		lbAttribute(DropInvalidHeaderFieldsEnabledKey, "false"),
 	}
 }
 
diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go
index 6ff9b3ff7..1d6d97543 100644
--- a/test/e2e/framework/framework.go
+++ b/test/e2e/framework/framework.go
@@ -2,6 +2,7 @@ package framework
 
 import (
 	"context"
+	"time"
 
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/aws"
 	"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/metric"
@@ -10,6 +11,7 @@ import (
 	"github.com/onsi/ginkgo"
 	"github.com/onsi/gomega"
 	"github.com/prometheus/client_golang/prometheus"
+	"github.com/ticketmaster/aws-sdk-go-cache/cache"
 	clientset "k8s.io/client-go/kubernetes"
 	"k8s.io/client-go/rest"
 	"k8s.io/client-go/tools/clientcmd"
@@ -54,10 +56,11 @@ func (f *Framework) BeforeEach() {
 		gomega.Expect(err).NotTo(gomega.HaveOccurred())
 	}
 	if f.Cloud == nil {
+		cc := cache.NewConfig(0 * time.Millisecond)
 		reg := prometheus.NewRegistry()
 		mc, _ := metric.NewCollector(reg, "alb")
 		var err error
-		f.Cloud, err = aws.New(aws.CloudConfig{Region: f.Options.AWSRegion, VpcID: f.Options.AWSVPCID}, f.Options.ClusterName, mc)
+		f.Cloud, err = aws.New(aws.CloudConfig{Region: f.Options.AWSRegion, VpcID: f.Options.AWSVPCID}, f.Options.ClusterName, mc, false, cc)
 		gomega.Expect(err).NotTo(gomega.HaveOccurred())
 	}