-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElasticLoadBalancingV2: ApplicationLoadBalancer http2.enabled from false to true is ignored in cloudformation #31609
ElasticLoadBalancingV2: ApplicationLoadBalancer http2.enabled from false to true is ignored in cloudformation #31609
Comments
Reproducible using code below: import * as cdk from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
export class CdktestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = ec2.Vpc.fromLookup(this, 'DefaultVpc', { isDefault: true });
new elbv2.ApplicationLoadBalancer(this, "TestALB", {
vpc,
http2Enabled: false
});
}
} This creates an ALB with Setting Resources
[~] AWS::ElasticLoadBalancingV2::LoadBalancer TestALB TestALB70A5B1F2
└─ [~] LoadBalancerAttributes
└─ @@ -2,9 +2,5 @@
[ ] {
[ ] "Key": "deletion_protection.enabled",
[ ] "Value": "false"
[-] },
[-] {
[-] "Key": "routing.http2.enabled",
[-] "Value": "false"
[ ] }
[ ] ] So it removes the attribute, which is due to check here only sets Running import * as cdk from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
export class CdktestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = ec2.Vpc.fromLookup(this, 'DefaultVpc', { isDefault: true });
const alb = new elbv2.ApplicationLoadBalancer(this, "TestALB", {
vpc,
http2Enabled: true
});
const cfnLb = alb.node.defaultChild as elbv2.CfnLoadBalancer;
cfnLb.addPropertyOverride('LoadBalancerAttributes.1.Key', 'routing.http2.enabled');
cfnLb.addPropertyOverride('LoadBalancerAttributes.1.Value', 'true');
}
} Running Resources
[~] AWS::ElasticLoadBalancingV2::LoadBalancer TestALB TestALB70A5B1F2
└─ [~] LoadBalancerAttributes
└─ @@ -2,5 +2,9 @@
[ ] {
[ ] "Key": "deletion_protection.enabled",
[ ] "Value": "false"
[+] },
[+] {
[+] "Key": "routing.http2.enabled",
[+] "Value": "true"
[ ] }
[ ] ]
✨ Number of stacks with differences: 1 Deploying it now sets |
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
When an ApplicationLoadBalancer routing.http2.enabled attribute is modified from "false" to "true" CDK will remove the attribute with the expectation that "true" will be the default. CloudFormation does not remove the attribute nor does it set the attribute value back to default.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
Modifying the attribute value from "false" to "true" modifies the load balancer attribute from "false" to "true"
Current Behavior
Value remains "false" despite the attribute being removed.
Reproduction Steps
New instance of load balancer, http2.enabled set to false; deploy
Modify http2 from false to true; deploy
Possible Solution
When http2 is not undefined, reflect string value
Additional Information/Context
No response
CDK CLI Version
2.160.0 (build 7a8ae02)
Framework Version
No response
Node.js Version
v18.19.1
OS
Ubuntu 24.04.1 LTS
Language
.NET
Language Version
.Net 8.0.108
Other information
No response
The text was updated successfully, but these errors were encountered: