Repository navigation
feat(#844): deploy a classic load balancer from CloudFormation - #1318
Merged
Merged
Conversation
AWS::ElasticLoadBalancing::LoadBalancer had no arm in dispatchResource, so a stack declaring one reached the generic stub: CREATE_COMPLETE for a load balancer no DescribeLoadBalancers of either generation could find. It now deploys through the 2012-06-01 CreateLoadBalancer. The whole of what makes that call classic is the Query Version member — the action name is published by both generations — so a helper omitting it would have created an Application Load Balancer that still answered a Ref and a plausible DNS name. The negative control for that is the one test that fails when Version is dropped from the params. Ref needed no arm: AWS publishes it as "the name of the load balancer", which is the physical ID the default already answers, so the docs/services.md entry recording a DNS-name divergence is deleted rather than implemented. DNSName is GetAtt, answered from recorded metadata; the four other published attributes answer empty, which is the honest answer for a hosted zone and a source security group substrate mints nothing for. Closes #844
9 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS::ElasticLoadBalancing::LoadBalancer— noV2— had no arm indispatchResourceat all, soa stack declaring one reached the generic stub: it reported
CREATE_COMPLETEfor a load balancer noDescribeLoadBalancersof either generation could find. This is #844's Tier 2, the last of its nineacceptance rows, and it completes the issue.
What it does
deployELBClassicLoadBalancerdispatches the 2012-06-01CreateLoadBalancer. Seven propertiesare forwarded:
LoadBalancerName(defaulting to the logical ID),Scheme,Listeners,AvailabilityZones,Subnets,SecurityGroupsandTags. The stack sweep deletes it through theclassic
DeleteLoadBalancer, and the classic type joinscfnELBStampableTypesso theaws:cloudformation:*stamp and the stack's own tags reach the record.Versionis the whole of the routing.CreateLoadBalanceris one of the six action names bothgenerations publish, so the same params without it reach the ELBv2 handler and quietly create an
Application Load Balancer — which would still answer a
Refand a plausible DNS name. Dropping itfrom the deploy helper fails all six tests; dropping it from the deleter fails the sweep test. Both
controls were run.
The classic delete could not reuse
queryDeleter, which emits exactly one parameter: it needsLoadBalancerNameandVersion, so it is an inline deleter likeAWS::EC2::EIP's.The acceptance criterion that was wrong
AC8 ends "and
!Refon the type resolves to it [the DNS name]", anddocs/services.mdrecorded thesame claim among the divergences substrate cannot fix. AWS documents the opposite:
The DNS name is
Fn::GetAtt DNSName, one of five published attributes. So there was never aRefdivergence — the entry is deleted rather than amended, and the helper needed no
Refarm,because the name is the physical ID the default already answers. Per #671, substrate models what the
published page states; the correction is also posted on the issue.
cfn_intrinsics.gois therefore untouched.DNSNameresolves through step 2 ofcfnGetAttValue(recorded metadata), and
CanonicalHostedZoneName,CanonicalHostedZoneNameID,SourceSecurityGroup.GroupNameandSourceSecurityGroup.OwnerAliasanswer empty already,because
cfnGetAttNamesAnARNrefuses an attribute containing a.or not ending inArn. Those fourare #1013 absences stated as such: a plausible-looking hosted-zone ID in a stack
Outputis worsethan a missing one, because a consumer asserts against it happily.
Deliberately dropped
PolicyNames(the sixth listener member) and the nine remaining CFN properties —AccessLoggingPolicy,AppCookieStickinessPolicy,ConnectionDrainingPolicy,ConnectionSettings,CrossZone,HealthCheck,Instances,LBCookieStickinessPolicy,Policies. Each needs aLoadBalancerDescriptionmember the record does not hold, and reporting ahealth check or a registered instance no describe could show is a worse answer than omitting it. That
is the same boundary the unrouted classic operations sit behind, and
docs/services.mdnow statesthe reason rather than just the list.
Tests
emulator/cfn_elb_classic_test.go, eleven tests and subtests, every one reading the result backthrough the classic API rather than off the returned
DeployedResource— a test satisfied by thephysical ID and the ARN would have passed against the stub, which is how the stub survived:
InstanceProtocolstays omitted;Refis the name,GetAtt DNSNameequals what the API itself reports, the two differ, and theother four attributes are empty;
DescribeTags, plus theclassic ARN arity;
CREATE_FAILEDfor a template omittingListeners;Listeners, a listener missing itsProtocol(ends the list), anon-object listener (leaves a gap the API refuses), malformed tag entries (skipped, the rest stay
contiguous), and a scalar
Tags.100% patch coverage on all three new functions.
make lint0 issues;make testgreen; the sevencheck targets pass with the #756 ratchet byte-identical at 319 declared, 133 projected across 50
records, 186 still reachable.
Closes #844