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

BREAKFIX: Only generate AccountIDEndpointMode config for services that use it #2795

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

lucix-aws
Copy link
Contributor

@lucix-aws lucix-aws commented Sep 17, 2024

Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution.

Relevant commit here is fd86578

@lucix-aws lucix-aws requested a review from a team as a code owner September 17, 2024 15:04
}

var rules = service.expectTrait(EndpointRuleSetTrait.class).getEndpointRuleSet();
for (var param : rules.getParameters()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks perfect for a stream, but Parameters is not a collection so while doable it's very awkward to handle it as such, so I like this version better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no way to actually get a stream of Parameters that I could see. You can either iterate them, get() by string, or there's a forEach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again it's super awkward to do via streams and I like your version better, but just for completion sake, you could wrap the Parameters spliterator using StreamSupport

return StreamSupport.stream(rules.getParameters().spliterator(), false)
                .map(x -> x.getBuiltIn().orElse(""))
                .anyMatch(x -> x.equals("AWS::Auth::AccountId"));

@lucix-aws lucix-aws merged commit 6a28d22 into main Sep 17, 2024
12 checks passed
@lucix-aws lucix-aws deleted the fix-accountidendpointmode branch September 17, 2024 15:58
@lucix-aws lucix-aws self-assigned this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants