Method: Beaker::AwsSdk#ensure_ping_group

Defined in:
lib/beaker/hypervisor/aws_sdk.rb

#ensure_ping_group(vpc) ⇒ AWS::EC2::SecurityGroup

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return an existing group, or create new one

Accepts a VPC as input for checking & creation.

Parameters:

  • vpc (AWS::EC2::VPC)

    the AWS vpc control object

Returns:

  • (AWS::EC2::SecurityGroup)

    created security group



823
824
825
826
827
828
829
830
831
832
833
# File 'lib/beaker/hypervisor/aws_sdk.rb', line 823

def ensure_ping_group(vpc)
  @logger.notify("aws-sdk: Ensure security group exists that enables ping, create if not")

  group = vpc.security_groups.filter('group-name', PING_SECURITY_GROUP_NAME).first

  if group.nil?
    group = create_ping_group(vpc)
  end

  group
end