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:



38
39
40
# File 'lib/aws/ec2/has_permissions.rb', line 38

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).



27
28
29
# File 'lib/aws/ec2/has_permissions.rb', line 27

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)


32
33
34
# File 'lib/aws/ec2/has_permissions.rb', line 32

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

#public?Boolean

Returns True if the resource is public.

Returns:

  • (Boolean)

    True if the resource is public.



22
23
24
# File 'lib/aws/ec2/has_permissions.rb', line 22

def public?
  permissions.public?
end