aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

AWS::ElasticLoadBalancingV2::LoadBalancer - [BUG] - Incorrect schema for EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic

Open
#2,431 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::ElasticLoadBalancingV2::LoadBalancer

### Resource Name

AWS::ElasticLoadBalancingV2::LoadBalancer

### Issue Description

Currently, the schema listed on CloudFormation reference page for parameter EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic is [incorrect](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-elasticloadbalancingv2-loadbalancer.html#cfn-elasticloadbalancingv2-loadbalancer-enforcesecuritygroupinboundrulesonprivatelinktraffic).
It lists that acceptable values are only `on` or `off`, however for ALB/GWLB this value can be set to the empty string.
This results in problems when Infrastructure as Code tools using AWS Cloud Control (which autogenerates from CloudFormation) try to update the load balancer attributes. Cloud Control blocks any values that are not `on` or `off`, however supplying `on` or `off` for the ALB will be also denied.
```
aws cloudcontrol get-resource \
--type-name AWS::ElasticLoadBalancingV2::LoadBalancer \
--identifier arn:aws:elasticloadbalancing:ap-southeast-2:751889379785:loadbalancer/app//994df89636aa68fd \
--region ap-southeast-2 \
| jq -r '.ResourceDescription.Properties | fromjson | .'
{
"IpAddressType": "dualstack",
"Scheme": "internet-facing",
"Type": "application",
"CanonicalHostedZoneID": "Z1GM3OXH4ZPM65",
"LoadBalancerArn": "arn:aws:elasticloadbalancing:ap-southeast-2:751889379785:loadbalancer/app//994df89636aa68fd",
"EnablePrefixForIpv6SourceNat": "off",
"EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic": "", # <<<<<<<<<<
}
```

### Expected Behavior

Terraform/Pulumi/Other infra as code tools that use code generation based on CloudFormation schema should work. This can be achieved via either:
a) changing schema to allow empty string for EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic parameter
b) allowing setting `EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic` to on or off even for ALB/GWLB

### Observed Behavior

when the setting is set to null for ALB
```
│ Waiting for Cloud Control API service UpdateResource operation completion
│ returned: waiter state transitioned to FAILED. StatusMessage: 1 validation
│ error detected: Value '' at
│ 'enforceSecurityGroupInboundRulesOnPrivateLinkTraffic' failed to satisfy
│ constraint: Member must satisfy enum value set: [off, on] (Service:
│ ElasticLoadBalancingV2, Status Code: 400, Request ID:
│ 9afcc962-0783-4a86-9df5-800a5f6eb8f7) (SDK Attempt Count: 1). ErrorCode:
│ InvalidRequest
```
when the setting is set to on/off for ALB
```
│ Waiting for Cloud Control API service UpdateResource operation completion
│ returned: waiter state transitioned to FAILED. StatusMessage: This security
│ group setting for PrivateLink traffic is only available for Network Load
│ Balancers with security groups (Service: ElasticLoadBalancingV2, Status
│ Code: 400, Request ID: 42b01c33-9c2d-4a51-b129-be4ccd9831fa) (SDK Attempt
│ Count: 1). ErrorCode: InvalidRequest
```

### Test Cases

This is a little complex as it requires IaC tool that uses Cloud Control. Here is the documentation for using this in Terraform https://registry.terraform.io/providers/hashicorp/awscc/latest/docs/resources/elasticloadbalancingv2_load_balancer#enforce_security_group_inbound_rules_on_private_link_traffic-1

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the AWS Cloud Control get-resource example and the Terraform AWS Cloud Control resource documentation linked in the issue. Reproduce the update behavior for an application or gateway load balancer and compare empty, on, and off values for EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic. Done means the CloudFormation schema and Cloud Control updates handle the documented ALB/GWLB behavior without validation failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, terraform
Domain
api, cloud, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.