-
Notifications
You must be signed in to change notification settings - Fork 440
feat: env manifest cdn.terminate_tls
#4017
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
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
164adc7
add option to manifest, redirect to https in cf, forward http to alb
dannyrandall 3f683bc
manifest validation
dannyrandall a7d9344
verify services will work with `terminate_tls`
dannyrandall 35eed74
testing in package elbv2
dannyrandall ef68646
gen mocks
dannyrandall eda434e
env_deploy tests
dannyrandall 410b803
export some CDN manifest types
dannyrandall 7241bdc
better error, Verify() tests cases
dannyrandall 97d9e21
add `Verify()` to `env package`
dannyrandall ce1cafe
function docs
dannyrandall 21a53ac
Merge branch 'mainline' into feat/cdn-tls
dannyrandall ff705ce
fix lint
dannyrandall d942ac5
change rule api
dannyrandall 0348066
Update internal/pkg/cli/deploy/env.go
dannyrandall d084e34
rename to validate
dannyrandall 8bae8a8
Update internal/pkg/cli/deploy/env.go
dannyrandall dc7bde0
Update internal/pkg/cli/deploy/env.go
dannyrandall 026df8c
Update internal/pkg/cli/deploy/env.go
dannyrandall 63650d6
don't leak manifest internals
dannyrandall b3c148d
change error to just be a warning
dannyrandall 1db2650
move constant
dannyrandall c52c836
warn sometimes, error sometimes
dannyrandall 4086a65
error testing
dannyrandall 9ac84d3
delete extra func
dannyrandall 6d7d336
Merge branch 'mainline' into feat/cdn-tls
dannyrandall 556fc96
fix interfaces
dannyrandall abfc832
fix elbv2 tests
dannyrandall 90a2126
fix lint
dannyrandall 5fc137a
typo
dannyrandall 544159b
use `elbv2.DescribeRulesWithContext`
dannyrandall 8c94bf2
address some feedback
dannyrandall d63d204
bye friend 🫡
dannyrandall a9e4c33
it was fun while it lasted
dannyrandall e78e4d4
Merge branch 'mainline' into feat/cdn-tls
dannyrandall dc8ba3d
address some fb
dannyrandall f9614b4
docstrings
dannyrandall b3eee7f
change error message to a single line
dannyrandall cfa0206
Merge branch 'mainline' into feat/cdn-tls
dannyrandall 5e13e94
docstring for `RecommendActions`
dannyrandall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,13 @@ | |
| package elbv2 | ||
|
|
||
| import ( | ||
| "context" | ||
| "errors" | ||
| "fmt" | ||
| "sort" | ||
|
|
||
| "github.com/aws/aws-sdk-go/aws" | ||
| "github.com/aws/aws-sdk-go/aws/request" | ||
| "github.com/aws/aws-sdk-go/aws/session" | ||
| "github.com/aws/aws-sdk-go/service/elbv2" | ||
| ) | ||
|
|
@@ -19,8 +22,9 @@ const ( | |
| ) | ||
|
|
||
| type api interface { | ||
| DescribeTargetHealth(input *elbv2.DescribeTargetHealthInput) (*elbv2.DescribeTargetHealthOutput, error) | ||
| DescribeRules(input *elbv2.DescribeRulesInput) (*elbv2.DescribeRulesOutput, error) | ||
| DescribeTargetHealth(*elbv2.DescribeTargetHealthInput) (*elbv2.DescribeTargetHealthOutput, error) | ||
| DescribeRules(*elbv2.DescribeRulesInput) (*elbv2.DescribeRulesOutput, error) | ||
| DescribeRulesWithContext(context.Context, *elbv2.DescribeRulesInput, ...request.Option) (*elbv2.DescribeRulesOutput, error) | ||
| } | ||
|
|
||
| // ELBV2 wraps an AWS ELBV2 client. | ||
|
|
@@ -73,6 +77,33 @@ func (e *ELBV2) ListenerRuleHostHeaders(ruleARN string) ([]string, error) { | |
| return hostHeaders, nil | ||
| } | ||
|
|
||
| // Rule wraps an elbv2.Rule to add some nice functionality to it. | ||
| type Rule elbv2.Rule | ||
|
|
||
| // DescribeRule returns the Rule with ruleARN. | ||
| func (e *ELBV2) DescribeRule(ctx context.Context, ruleARN string) (Rule, error) { | ||
| resp, err := e.client.DescribeRulesWithContext(ctx, &elbv2.DescribeRulesInput{ | ||
| RuleArns: aws.StringSlice([]string{ruleARN}), | ||
| }) | ||
| if err != nil { | ||
| return Rule{}, err | ||
| } else if len(resp.Rules) == 0 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: we don't need the else |
||
| return Rule{}, errors.New("not found") | ||
|
dannyrandall marked this conversation as resolved.
|
||
| } | ||
|
|
||
| return Rule(*resp.Rules[0]), nil | ||
| } | ||
|
|
||
| // HasRedirectAction returns true if the rule has a redirect action. | ||
| func (r *Rule) HasRedirectAction() bool { | ||
| for _, action := range r.Actions { | ||
| if aws.StringValue(action.Type) == elbv2.ActionTypeEnumRedirect { | ||
| return true | ||
| } | ||
| } | ||
| return false | ||
| } | ||
|
|
||
| // TargetHealth wraps up elbv2.TargetHealthDescription. | ||
| type TargetHealth elbv2.TargetHealthDescription | ||
|
|
||
|
|
||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.