fix: Env manifest UX fix for http config #4068
Conversation
|
Just making sure I'm understanding correctly (also for other reviewers' reference!) http:
public:
security_groups:
ingress: # This doesn't make sense because `ingress` is for one sg, not sgs
restrict_to: # This is redundant because `ingress` implies "restrict_to".
cdn: true
private:
security_groups:
ingress: # This doesn't make sense because `ingress` is for one sg, not sgs
from_vpc: trueAfter the fix, we want to have: http:
public:
ingress:
cdn: true
private:
ingress:
from_vpc: truewhile still accepting the old manifest. |
Yes you are right @Lou1415926 |
| ImportCertARNs []string `json:"importCertARNs,omitempty"` | ||
| InternalALBSubnets []string `json:"internalALBSubnets,omitempty"` | ||
| EnableInternalALBVPCIngress bool `json:"enableInternalALBVPCIngress,omitempty"` | ||
| EnableInternalALBVPCIngress *bool `json:"enableInternalALBVPCIngress,omitempty"` |
There was a problem hiding this comment.
Same question here. Why do we need a pointer?
There was a problem hiding this comment.
Is it because you want to differentiate between nil and &false? I feel like if this field is false then it still means CustomizeEnv is empty
There was a problem hiding this comment.
The reason why made this change because if we do not keep EnableInternalALBVPCIngress as pointer then this will always be false and in that case if customer imports vpc config with private subnet without --internal-alb-allow-vpc-ingress flag then also manifest has following config specified.
# Configure the load balancers in your environment, once created.
http:
private:
ingress:
from_vpc: false
In order to get rid of this part I made changes related to pointer. Does that make sense?
But right now I have removed pointer logic and kept the existing logic as it is.
There was a problem hiding this comment.
Could we just not write to the manifest if the field is false? 🤔
There was a problem hiding this comment.
I was not sure how right it is to not write that field to the manifest when it is false. But now I have made changes in the new commit, let me know if that works.
| ImportCertARNs []string `json:"importCertARNs,omitempty"` | ||
| InternalALBSubnets []string `json:"internalALBSubnets,omitempty"` | ||
| EnableInternalALBVPCIngress bool `json:"enableInternalALBVPCIngress,omitempty"` | ||
| EnableInternalALBVPCIngress *bool `json:"enableInternalALBVPCIngress,omitempty"` |
There was a problem hiding this comment.
Is it because you want to differentiate between nil and &false? I feel like if this field is false then it still means CustomizeEnv is empty
0a965e8 to
0243284
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## mainline #4068 +/- ##
============================================
- Coverage 69.17% 69.14% -0.03%
============================================
Files 248 249 +1
Lines 35608 35656 +48
Branches 264 264
============================================
+ Hits 24631 24654 +23
- Misses 9782 9805 +23
- Partials 1195 1197 +2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Lou1415926
left a comment
There was a problem hiding this comment.
Do you think this sort of manifest UX fix is worth testing in a regression test? Like we can test a manifest that looks like:
http:
public:
ingress:
from_cdn: true
works the same before & after?
efekarakus
left a comment
There was a problem hiding this comment.
Looks good, just tiny nits. Feel free to remove the label afterwards!
This PR fix multiple problems - 1. This PR fix the env manifest fields that were organized in incorrect manner. 2. Also resolves aws#4032 3. `copilot env init` with private subnets create env manifest with following field ``` http: private: ``` This should only be created when there is at least one parameter inside private is enabled. This PR fix this nit as well. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
This PR fix multiple problems -
copilot env initwith private subnets create env manifest with following fieldThis should only be created when there is at least one parameter inside private is enabled. This PR fix this nit as well.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.