-
Notifications
You must be signed in to change notification settings - Fork 106
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
Adding attributes for ELB resource #623
Adding attributes for ELB resource #623
Conversation
Signed-off-by: Rohit Joshi <rohit.prasad.joshi@sap.com>
libraries/aws_elb.rb
Outdated
@@ -43,6 +43,10 @@ def initialize(opts = {}) | |||
policies_in_use = resp.listener_descriptions.map(&:policy_names).flatten.uniq | |||
@ssl_policies = @aws.elb_client.describe_load_balancer_policies(load_balancer_name: opts[:load_balancer_name]) | |||
.policy_descriptions.select { |p| policies_in_use.include?(p.policy_name) } | |||
@cross_zone_load_balancing = @aws.elb_client.describe_load_balancer_attributes(load_balancer_name: opts[:load_balancer_name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rohit1509 , Could we please do the n/w call to describe_load_balancer_attributes
only once and set both the attributes using the attributes received ?
Also a couple of recommendations would be to
- lazy load this only when the method is called
- since this returns boolean flag, please try using matchers syntax for this ..
for example,
you can implement methods
cross_zone_load_balancing_enabled?
& access_log_enabled?
which will be available in inspec controls as
it { should be_cross_zone_load_balancing_enabled }
it { should be_access_log_enabled }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: Rohit Joshi <rohit.prasad.joshi@sap.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
docs/resources/aws_elb.md
Outdated
|listeners | A collection of the listeners for the load balancer. | | ||
|ssl_policies | A collection of the SSL Policies configured in-use for the load balancer (and their policy attributes). | | ||
|protocols | A list of the protocols configured for the listeners of the load balancer. | | ||
|cross\_zone\_load\_balancing\_enabled? | The cross zone load balancing status for ELB. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|cross\_zone\_load\_balancing\_enabled? | The cross zone load balancing status for ELB. | | |
|cross\_zone\_load\_balancing\_enabled? | The cross-zone load balancing status for ELB. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
docs/resources/aws_elb.md
Outdated
|
||
## Examples | ||
|
||
##### Test that cross zone load balancing for ELB is enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
##### Test that cross zone load balancing for ELB is enabled | |
##### Test that cross-zone load balancing for ELB is enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
docs/resources/aws_elb.md
Outdated
it { should be_cross_zone_load_balancing_enabled } | ||
end | ||
|
||
##### Test that access log for ELB is enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
##### Test that access log for ELB is enabled | |
##### Test that access logs for ELB are enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: Rohit Joshi <rohit.prasad.joshi@sap.com>
…ohit1509/inspec-aws into adding_attributes_elb_resource
@IanMadd Can you please approve if the review is done? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Signed-off-by: Rohit Joshi rohit.prasad.joshi@sap.com
Description
Adding new attributes for ELB resource
Issues Resolved
None
Check List
Please fill box or appropriate ([x]) or mark N/A.
rake lint
passes