Class: Aws::RDS::DBSecurityGroup
- Inherits:
-
Object
- Object
- Aws::RDS::DBSecurityGroup
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-rds/db_security_group.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#db_security_group_arn ⇒ String
The Amazon Resource Name (ARN) for the DB security group.
-
#db_security_group_description ⇒ String
Provides the description of the DB security group.
-
#ec2_security_groups ⇒ Array<Types::EC2SecurityGroup>
Contains a list of EC2SecurityGroup elements.
-
#ip_ranges ⇒ Array<Types::IPRange>
Contains a list of IPRange elements.
- #name ⇒ String (also: #db_security_group_name)
-
#owner_id ⇒ String
Provides the AWS ID of the owner of a specific DB security group.
-
#vpc_id ⇒ String
Provides the VpcId of the DB security group.
Actions collapse
- #authorize_ingress(options = {}) ⇒ DBSecurityGroup
- #create(options = {}) ⇒ DBSecurityGroup
- #delete(options = {}) ⇒ EmptyStructure
- #revoke_ingress(options = {}) ⇒ DBSecurityGroup
- #subscribe_to(options = {}) ⇒ EventSubscription
- #unsubscribe_from(options = {}) ⇒ EventSubscription
Associations collapse
- #events(options = {}) ⇒ Event::Collection
- #identifiers ⇒ Object deprecated private Deprecated.
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::DBSecurityGroup
Returns the data for this DBSecurityGroup.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ DBSecurityGroup
constructor
A new instance of DBSecurityGroup.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current DBSecurityGroup.
Constructor Details
#initialize(name, options = {}) ⇒ DBSecurityGroup #initialize(options = {}) ⇒ DBSecurityGroup
Returns a new instance of DBSecurityGroup.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @name = extract_name(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#authorize_ingress(options = {}) ⇒ DBSecurityGroup
135 136 137 138 139 140 141 142 143 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 135 def ( = {}) = .merge(db_security_group_name: @name) resp = @client.() DBSecurityGroup.new( name: resp.data.db_security_group.db_security_group_name, data: resp.data.db_security_group, client: @client ) end |
#client ⇒ Client
73 74 75 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 73 def client @client end |
#create(options = {}) ⇒ DBSecurityGroup
162 163 164 165 166 167 168 169 170 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 162 def create( = {}) = .merge(db_security_group_name: @name) resp = @client.create_db_security_group() DBSecurityGroup.new( name: resp.data.db_security_group.db_security_group_name, data: resp.data.db_security_group, client: @client ) end |
#data ⇒ Types::DBSecurityGroup
Returns the data for this Aws::RDS::DBSecurityGroup. Calls Client#describe_db_security_groups if #data_loaded? is ‘false`.
93 94 95 96 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 93 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
101 102 103 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 101 def data_loaded? !!@data end |
#db_security_group_arn ⇒ String
The Amazon Resource Name (ARN) for the DB security group.
66 67 68 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 66 def db_security_group_arn data.db_security_group_arn end |
#db_security_group_description ⇒ String
Provides the description of the DB security group.
42 43 44 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 42 def db_security_group_description data.db_security_group_description end |
#delete(options = {}) ⇒ EmptyStructure
177 178 179 180 181 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 177 def delete( = {}) = .merge(db_security_group_name: @name) resp = @client.delete_db_security_group() resp.data end |
#ec2_security_groups ⇒ Array<Types::EC2SecurityGroup>
Contains a list of EC2SecurityGroup elements.
54 55 56 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 54 def ec2_security_groups data.ec2_security_groups end |
#events(options = {}) ⇒ Event::Collection
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 311 def events( = {}) batches = Enumerator.new do |y| = .merge( source_type: "db-security-group", source_identifier: @name ) resp = @client.describe_events() resp.each_page do |page| batch = [] page.data.events.each do |e| batch << Event.new( source_id: e.source_identifier, date: e.date, data: e, client: @client ) end y.yield(batch) end end Event::Collection.new(batches) end |
#identifiers ⇒ Object
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.
336 337 338 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 336 def identifiers { name: @name } end |
#ip_ranges ⇒ Array<Types::IPRange>
Contains a list of IPRange elements.
60 61 62 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 60 def ip_ranges data.ip_ranges end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::RDS::DBSecurityGroup. Returns ‘self` making it possible to chain methods.
db_security_group.reload.data
83 84 85 86 87 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 83 def load resp = @client.describe_db_security_groups(db_security_group_name: @name) @data = resp.db_security_groups[0] self end |
#name ⇒ String Also known as: db_security_group_name
29 30 31 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 29 def name @name end |
#owner_id ⇒ String
Provides the AWS ID of the owner of a specific DB security group.
36 37 38 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 36 def owner_id data.owner_id end |
#revoke_ingress(options = {}) ⇒ DBSecurityGroup
214 215 216 217 218 219 220 221 222 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 214 def revoke_ingress( = {}) = .merge(db_security_group_name: @name) resp = @client.revoke_db_security_group_ingress() DBSecurityGroup.new( name: resp.data.db_security_group.db_security_group_name, data: resp.data.db_security_group, client: @client ) end |
#subscribe_to(options = {}) ⇒ EventSubscription
234 235 236 237 238 239 240 241 242 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 234 def subscribe_to( = {}) = .merge(source_identifier: @name) resp = @client.add_source_identifier_to_subscription() EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
254 255 256 257 258 259 260 261 262 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 254 def unsubscribe_from( = {}) = .merge(source_identifier: @name) resp = @client.remove_source_identifier_from_subscription() EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#vpc_id ⇒ String
Provides the VpcId of the DB security group.
48 49 50 |
# File 'lib/aws-sdk-rds/db_security_group.rb', line 48 def vpc_id data.vpc_id end |