Skip to content
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

[AWS::ElasticLoadBalancingV2::LoadBalancer] - [BUG] - False-positive drift for SubnetMappings #1464

Closed
r-heimann opened this issue Dec 29, 2022 · 3 comments
Labels

Comments

@r-heimann
Copy link

r-heimann commented Dec 29, 2022

Name of the resource

AWS::ElasticLoadBalancingV2::LoadBalancer

Issue Description

When creating a AWS::ElasticLoadBalancingV2::LoadBalancer in eu-central-1 using

      SubnetMappings:
        - SubnetId: !ImportValue VPC1-AZ1Subnet1
        - SubnetId: !ImportValue VPC1-AZ2Subnet1
        - SubnetId: !ImportValue VPC1-AZ3Subnet1

it will cause a drift:

Property Change Expected value Current value
SubnetMappings.0.SubnetId  REMOVE subnet-XXXXXXX -
SubnetMappings.1.SubnetId  REMOVE subnet-XXXXXXX -
SubnetMappings.2.SubnetId  REMOVE subnet-XXXXXXX -

Expected Behavior

Drift is recognizing SubnetMappings.

Observed Behavior

Is it showing up as a false positive drift in CloudFormation.

Test Cases

  NLB:
    Type: AWS::ElasticLoadBalancingV2::LoadBalancer
    Properties:
      Name: "NLB"
      IpAddressType: ipv4
      Scheme: internal
      Type: network
      SubnetMappings:
        - SubnetId: !ImportValue VPC1-AZ1Subnet1
        - SubnetId: !ImportValue VPC1-AZ2Subnet1
        - SubnetId: !ImportValue VPC1-AZ3Subnet1

Other Details

May be related to #458

@r-heimann r-heimann added the bug label Dec 29, 2022
@r-heimann r-heimann changed the title AWS::ElasticLoadBalancingV2::LoadBalancer False-positive drift for SubnetMappings AWS::ElasticLoadBalancingV2::LoadBalancer False-positive drift for SubnetMappings Jan 3, 2023
@greg5123334
Copy link

Confirmed.

        elb = elbv2.CfnLoadBalancer(self, "MyCfnLoadBalancer",
                                    ip_address_type="ipv4",
                                    name="NLB",
                                    scheme="internal",
                                    subnet_mappings=[elbv2.CfnLoadBalancer.SubnetMappingProperty(
                                        subnet_id=vpc.private_subnets[0].subnet_id,
                                    ), elbv2.CfnLoadBalancer.SubnetMappingProperty(
                                        subnet_id=vpc.private_subnets[1].subnet_id,
                                    )],
                                    type="network"
                                    )

Expected:

{
  "IpAddressType": "ipv4",
  "Name": "NLB",
  "Scheme": "internal",
  "SubnetMappings": [
    {
      "SubnetId": "subnet-xxxxxxxx"
    }
  ],
  "Type": "network"
}

Actual:

{
  "IpAddressType": "ipv4",
  "Name": "NLB",
  "Scheme": "internal",
  "SubnetMappings": [
    {}
  ],
  "Type": "network"
}

@r-heimann r-heimann changed the title AWS::ElasticLoadBalancingV2::LoadBalancer False-positive drift for SubnetMappings (AWS::ElasticLoadBalancingV2::LoadBalancer) False-positive drift for SubnetMappings Feb 8, 2023
@FarrOut
Copy link

FarrOut commented Aug 23, 2023

Just retested. Issue partially persists. False-positive drift remains, but only in some regions.

Some that I have tested:

  • eu-central-1 (FRA) - Good
  • eu-west-1 (DUB) - Bad
  • ap-southeast-2 (SYD) - Bad
  • us-east-1 (IAD) - Bad
        elb = elbv2.CfnLoadBalancer(self, "MyCfnLoadBalancer",
                                    ip_address_type="ipv4",
                                    name="NLB",
                                    scheme="internal",
                                    subnet_mappings=[elbv2.CfnLoadBalancer.SubnetMappingProperty(
                                        subnet_id=vpc.private_subnets[0].subnet_id,
                                    ), elbv2.CfnLoadBalancer.SubnetMappingProperty(
                                        subnet_id=vpc.private_subnets[1].subnet_id,
                                    )],
                                    type="network"
                                    )

Expected

{
  "IpAddressType": "ipv4",
  "Name": "NLB",
  "Scheme": "internal",
  "SubnetMappings": [
    {
      "SubnetId": "subnet-xxxxxxxx"
    },
    {
      "SubnetId": "subnet-xxxxxxxxxx"
    }
  ],
  "Type": "network"
}

Actual

{
  "IpAddressType": "ipv4",
  "Name": "NLB",
  "Scheme": "internal",
  "SubnetMappings": [
    {},
    {}
  ],
  "Type": "network"
}

@r-heimann
Copy link
Author

I can confirm that the issue is fixed in eu-central-1

@r-heimann r-heimann changed the title (AWS::ElasticLoadBalancingV2::LoadBalancer) False-positive drift for SubnetMappings [AWS::ElasticLoadBalancingV2::LoadBalancer] - [BUG] - False-positive drift for SubnetMappings Apr 17, 2024
@github-project-automation github-project-automation bot moved this to Coming Soon in coverage-roadmap Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Coming Soon
Development

No branches or pull requests

3 participants