Module: AWS::EC2::HasPermissions

Included in:
Image, Snapshot
Defined in:
lib/aws/ec2/has_permissions.rb

Overview

Helper methods for managing EC2 resource permissions. See Image and Snapshot for usage examples.

Instance Method Summary collapse

Instance Method Details

#permissionsPermissionCollection

Returns An object to manage the collection of permissions for this resource.

Returns:



40
41
42
# File 'lib/aws/ec2/has_permissions.rb', line 40

def permissions
  PermissionCollection.new(self, :config => config)
end

#private?Boolean

Returns True if the resource is private (i.e. not public).

Returns:

  • (Boolean)

    True if the resource is private (i.e. not public).



29
30
31
# File 'lib/aws/ec2/has_permissions.rb', line 29

def private?
  permissions.private?
end

#public=(value) ⇒ nil

Sets whether the resource is public or not. This has no effect on the explicit AWS account IDs that may already have permissions to use the resource.

Parameters:

  • value (Boolean)

    If true, the resource is made public, otherwise the resource is made private.

Returns:

  • (nil)


34
35
36
# File 'lib/aws/ec2/has_permissions.rb', line 34

def public=(value)
  permissions.public = value
end

#public?Boolean

Returns True if the resource is public.

Returns:

  • (Boolean)

    True if the resource is public.



24
25
26
# File 'lib/aws/ec2/has_permissions.rb', line 24

def public?
  permissions.public?
end