Method: Fog::Compute::AWS::Real#create_security_group

Defined in:
lib/fog/aws/requests/compute/create_security_group.rb

#create_security_group(name, description, vpc_id = nil) ⇒ Object

Create a new security group

Parameters

  • group_name<~String> - Name of the security group.

  • group_description<~String> - Description of group.

  • vpc_id<~String> - ID of the VPC

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘return’<~Boolean> - success?

      • ‘groupId’<~String> - Id of created group

Amazon API Reference

[View source]

23
24
25
26
27
28
29
30
31
# File 'lib/fog/aws/requests/compute/create_security_group.rb', line 23

def create_security_group(name, description, vpc_id=nil)
  request(
    'Action'            => 'CreateSecurityGroup',
    'GroupName'         => name,
    'GroupDescription'  => description,
    'VpcId'             => vpc_id,
    :parser             => Fog::Parsers::Compute::AWS::CreateSecurityGroup.new
  )
end