aws-sdk-ec2 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/aws-sdk-ec2.rb +70 -0
- data/lib/aws-sdk-ec2/classic_address.rb +227 -0
- data/lib/aws-sdk-ec2/client.rb +14254 -0
- data/lib/aws-sdk-ec2/client_api.rb +6182 -0
- data/lib/aws-sdk-ec2/customizations.rb +21 -0
- data/lib/aws-sdk-ec2/customizations/instance.rb +29 -0
- data/lib/aws-sdk-ec2/customizations/resource.rb +18 -0
- data/lib/aws-sdk-ec2/dhcp_options.rb +183 -0
- data/lib/aws-sdk-ec2/errors.rb +23 -0
- data/lib/aws-sdk-ec2/image.rb +462 -0
- data/lib/aws-sdk-ec2/instance.rb +1570 -0
- data/lib/aws-sdk-ec2/internet_gateway.rb +204 -0
- data/lib/aws-sdk-ec2/key_pair.rb +120 -0
- data/lib/aws-sdk-ec2/key_pair_info.rb +122 -0
- data/lib/aws-sdk-ec2/network_acl.rb +341 -0
- data/lib/aws-sdk-ec2/network_interface.rb +474 -0
- data/lib/aws-sdk-ec2/network_interface_association.rb +151 -0
- data/lib/aws-sdk-ec2/placement_group.rb +426 -0
- data/lib/aws-sdk-ec2/plugins/copy_encrypted_snapshot.rb +59 -0
- data/lib/aws-sdk-ec2/plugins/region_validation.rb +19 -0
- data/lib/aws-sdk-ec2/resource.rb +2684 -0
- data/lib/aws-sdk-ec2/route.rb +243 -0
- data/lib/aws-sdk-ec2/route_table.rb +277 -0
- data/lib/aws-sdk-ec2/route_table_association.rb +177 -0
- data/lib/aws-sdk-ec2/security_group.rb +530 -0
- data/lib/aws-sdk-ec2/snapshot.rb +478 -0
- data/lib/aws-sdk-ec2/subnet.rb +972 -0
- data/lib/aws-sdk-ec2/tag.rb +223 -0
- data/lib/aws-sdk-ec2/types.rb +20124 -0
- data/lib/aws-sdk-ec2/volume.rb +555 -0
- data/lib/aws-sdk-ec2/vpc.rb +1698 -0
- data/lib/aws-sdk-ec2/vpc_address.rb +219 -0
- data/lib/aws-sdk-ec2/vpc_peering_connection.rb +265 -0
- data/lib/aws-sdk-ec2/waiters.rb +1334 -0
- metadata +107 -0
@@ -0,0 +1,177 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module EC2
|
10
|
+
class RouteTableAssociation
|
11
|
+
|
12
|
+
extend Aws::Deprecations
|
13
|
+
|
14
|
+
# @overload def initialize(id, options = {})
|
15
|
+
# @param [String] id
|
16
|
+
# @option options [Client] :client
|
17
|
+
# @overload def initialize(options = {})
|
18
|
+
# @option options [required, String] :id
|
19
|
+
# @option options [Client] :client
|
20
|
+
def initialize(*args)
|
21
|
+
options = Hash === args.last ? args.pop.dup : {}
|
22
|
+
@id = extract_id(args, options)
|
23
|
+
@data = options.delete(:data)
|
24
|
+
@client = options.delete(:client) || Client.new(options)
|
25
|
+
end
|
26
|
+
|
27
|
+
# @!group Read-Only Attributes
|
28
|
+
|
29
|
+
# @return [String]
|
30
|
+
def id
|
31
|
+
@id
|
32
|
+
end
|
33
|
+
alias :route_table_association_id :id
|
34
|
+
|
35
|
+
# The ID of the route table.
|
36
|
+
# @return [String]
|
37
|
+
def route_table_id
|
38
|
+
data.route_table_id
|
39
|
+
end
|
40
|
+
|
41
|
+
# The ID of the subnet. A subnet ID is not returned for an implicit
|
42
|
+
# association.
|
43
|
+
# @return [String]
|
44
|
+
def subnet_id
|
45
|
+
data.subnet_id
|
46
|
+
end
|
47
|
+
|
48
|
+
# Indicates whether this is the main route table.
|
49
|
+
# @return [Boolean]
|
50
|
+
def main
|
51
|
+
data.main
|
52
|
+
end
|
53
|
+
|
54
|
+
# @!endgroup
|
55
|
+
|
56
|
+
# @return [Client]
|
57
|
+
def client
|
58
|
+
@client
|
59
|
+
end
|
60
|
+
|
61
|
+
# @raise [Errors::ResourceNotLoadable]
|
62
|
+
# @api private
|
63
|
+
def load
|
64
|
+
msg = "#load is not implemented, data only available via enumeration"
|
65
|
+
raise Errors::ResourceNotLoadable, msg
|
66
|
+
end
|
67
|
+
alias :reload :load
|
68
|
+
|
69
|
+
# @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
|
70
|
+
# @return [Types::RouteTableAssociation]
|
71
|
+
# Returns the data for this {RouteTableAssociation}.
|
72
|
+
def data
|
73
|
+
load unless @data
|
74
|
+
@data
|
75
|
+
end
|
76
|
+
|
77
|
+
# @return [Boolean]
|
78
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
79
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
80
|
+
def data_loaded?
|
81
|
+
!!@data
|
82
|
+
end
|
83
|
+
|
84
|
+
# @!group Actions
|
85
|
+
|
86
|
+
# @example Request syntax with placeholder values
|
87
|
+
#
|
88
|
+
# route_table_association.delete({
|
89
|
+
# dry_run: false,
|
90
|
+
# })
|
91
|
+
# @param [Hash] options ({})
|
92
|
+
# @option options [Boolean] :dry_run
|
93
|
+
# Checks whether you have the required permissions for the action,
|
94
|
+
# without actually making the request, and provides an error response.
|
95
|
+
# If you have the required permissions, the error response is
|
96
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
97
|
+
# @return [EmptyStructure]
|
98
|
+
def delete(options = {})
|
99
|
+
options = options.merge(association_id: @id)
|
100
|
+
resp = @client.disassociate_route_table(options)
|
101
|
+
resp.data
|
102
|
+
end
|
103
|
+
|
104
|
+
# @example Request syntax with placeholder values
|
105
|
+
#
|
106
|
+
# routetableassociation = route_table_association.replace_subnet({
|
107
|
+
# dry_run: false,
|
108
|
+
# route_table_id: "String", # required
|
109
|
+
# })
|
110
|
+
# @param [Hash] options ({})
|
111
|
+
# @option options [Boolean] :dry_run
|
112
|
+
# Checks whether you have the required permissions for the action,
|
113
|
+
# without actually making the request, and provides an error response.
|
114
|
+
# If you have the required permissions, the error response is
|
115
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
116
|
+
# @option options [required, String] :route_table_id
|
117
|
+
# The ID of the new route table to associate with the subnet.
|
118
|
+
# @return [RouteTableAssociation]
|
119
|
+
def replace_subnet(options = {})
|
120
|
+
options = options.merge(association_id: @id)
|
121
|
+
resp = @client.replace_route_table_association(options)
|
122
|
+
RouteTableAssociation.new(
|
123
|
+
id: resp.data.new_association_id,
|
124
|
+
client: @client
|
125
|
+
)
|
126
|
+
end
|
127
|
+
|
128
|
+
# @!group Associations
|
129
|
+
|
130
|
+
# @return [RouteTable, nil]
|
131
|
+
def route_table
|
132
|
+
if data.route_table_id
|
133
|
+
RouteTable.new(
|
134
|
+
id: data.route_table_id,
|
135
|
+
client: @client
|
136
|
+
)
|
137
|
+
else
|
138
|
+
nil
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# @return [Subnet, nil]
|
143
|
+
def subnet
|
144
|
+
if data.subnet_id
|
145
|
+
Subnet.new(
|
146
|
+
id: data.subnet_id,
|
147
|
+
client: @client
|
148
|
+
)
|
149
|
+
else
|
150
|
+
nil
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# @deprecated
|
155
|
+
# @api private
|
156
|
+
def identifiers
|
157
|
+
{ id: @id }
|
158
|
+
end
|
159
|
+
deprecated(:identifiers)
|
160
|
+
|
161
|
+
private
|
162
|
+
|
163
|
+
def extract_id(args, options)
|
164
|
+
value = args[0] || options.delete(:id)
|
165
|
+
case value
|
166
|
+
when String then value
|
167
|
+
when nil then raise ArgumentError, "missing required option :id"
|
168
|
+
else
|
169
|
+
msg = "expected :id to be a String, got #{value.class}"
|
170
|
+
raise ArgumentError, msg
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
class Collection < Aws::Resources::Collection; end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
@@ -0,0 +1,530 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module EC2
|
10
|
+
class SecurityGroup
|
11
|
+
|
12
|
+
extend Aws::Deprecations
|
13
|
+
|
14
|
+
# @overload def initialize(id, options = {})
|
15
|
+
# @param [String] id
|
16
|
+
# @option options [Client] :client
|
17
|
+
# @overload def initialize(options = {})
|
18
|
+
# @option options [required, String] :id
|
19
|
+
# @option options [Client] :client
|
20
|
+
def initialize(*args)
|
21
|
+
options = Hash === args.last ? args.pop.dup : {}
|
22
|
+
@id = extract_id(args, options)
|
23
|
+
@data = options.delete(:data)
|
24
|
+
@client = options.delete(:client) || Client.new(options)
|
25
|
+
end
|
26
|
+
|
27
|
+
# @!group Read-Only Attributes
|
28
|
+
|
29
|
+
# @return [String]
|
30
|
+
def id
|
31
|
+
@id
|
32
|
+
end
|
33
|
+
alias :group_id :id
|
34
|
+
|
35
|
+
# The AWS account ID of the owner of the security group.
|
36
|
+
# @return [String]
|
37
|
+
def owner_id
|
38
|
+
data.owner_id
|
39
|
+
end
|
40
|
+
|
41
|
+
# The name of the security group.
|
42
|
+
# @return [String]
|
43
|
+
def group_name
|
44
|
+
data.group_name
|
45
|
+
end
|
46
|
+
|
47
|
+
# A description of the security group.
|
48
|
+
# @return [String]
|
49
|
+
def description
|
50
|
+
data.description
|
51
|
+
end
|
52
|
+
|
53
|
+
# One or more inbound rules associated with the security group.
|
54
|
+
# @return [Array<Types::IpPermission>]
|
55
|
+
def ip_permissions
|
56
|
+
data.ip_permissions
|
57
|
+
end
|
58
|
+
|
59
|
+
# \[EC2-VPC\] One or more outbound rules associated with the security
|
60
|
+
# group.
|
61
|
+
# @return [Array<Types::IpPermission>]
|
62
|
+
def ip_permissions_egress
|
63
|
+
data.ip_permissions_egress
|
64
|
+
end
|
65
|
+
|
66
|
+
# \[EC2-VPC\] The ID of the VPC for the security group.
|
67
|
+
# @return [String]
|
68
|
+
def vpc_id
|
69
|
+
data.vpc_id
|
70
|
+
end
|
71
|
+
|
72
|
+
# Any tags assigned to the security group.
|
73
|
+
# @return [Array<Types::Tag>]
|
74
|
+
def tags
|
75
|
+
data.tags
|
76
|
+
end
|
77
|
+
|
78
|
+
# @!endgroup
|
79
|
+
|
80
|
+
# @return [Client]
|
81
|
+
def client
|
82
|
+
@client
|
83
|
+
end
|
84
|
+
|
85
|
+
# Loads, or reloads {#data} for the current {SecurityGroup}.
|
86
|
+
# Returns `self` making it possible to chain methods.
|
87
|
+
#
|
88
|
+
# security_group.reload.data
|
89
|
+
#
|
90
|
+
# @return [self]
|
91
|
+
def load
|
92
|
+
resp = @client.describe_security_groups(group_ids: [@id])
|
93
|
+
@data = resp.securitygroups[0]
|
94
|
+
self
|
95
|
+
end
|
96
|
+
alias :reload :load
|
97
|
+
|
98
|
+
# @return [Types::SecurityGroup]
|
99
|
+
# Returns the data for this {SecurityGroup}. Calls
|
100
|
+
# {Client#describe_security_groups} if {#data_loaded?} is `false`.
|
101
|
+
def data
|
102
|
+
load unless @data
|
103
|
+
@data
|
104
|
+
end
|
105
|
+
|
106
|
+
# @return [Boolean]
|
107
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
108
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
109
|
+
def data_loaded?
|
110
|
+
!!@data
|
111
|
+
end
|
112
|
+
|
113
|
+
# @!group Actions
|
114
|
+
|
115
|
+
# @example Request syntax with placeholder values
|
116
|
+
#
|
117
|
+
# security_group.authorize_egress({
|
118
|
+
# dry_run: false,
|
119
|
+
# source_security_group_name: "String",
|
120
|
+
# source_security_group_owner_id: "String",
|
121
|
+
# ip_protocol: "String",
|
122
|
+
# from_port: 1,
|
123
|
+
# to_port: 1,
|
124
|
+
# cidr_ip: "String",
|
125
|
+
# ip_permissions: [
|
126
|
+
# {
|
127
|
+
# ip_protocol: "String",
|
128
|
+
# from_port: 1,
|
129
|
+
# to_port: 1,
|
130
|
+
# user_id_group_pairs: [
|
131
|
+
# {
|
132
|
+
# user_id: "String",
|
133
|
+
# group_name: "String",
|
134
|
+
# group_id: "String",
|
135
|
+
# vpc_id: "String",
|
136
|
+
# vpc_peering_connection_id: "String",
|
137
|
+
# peering_status: "String",
|
138
|
+
# },
|
139
|
+
# ],
|
140
|
+
# ip_ranges: [
|
141
|
+
# {
|
142
|
+
# cidr_ip: "String",
|
143
|
+
# },
|
144
|
+
# ],
|
145
|
+
# prefix_list_ids: [
|
146
|
+
# {
|
147
|
+
# prefix_list_id: "String",
|
148
|
+
# },
|
149
|
+
# ],
|
150
|
+
# },
|
151
|
+
# ],
|
152
|
+
# })
|
153
|
+
# @param [Hash] options ({})
|
154
|
+
# @option options [Boolean] :dry_run
|
155
|
+
# Checks whether you have the required permissions for the action,
|
156
|
+
# without actually making the request, and provides an error response.
|
157
|
+
# If you have the required permissions, the error response is
|
158
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
159
|
+
# @option options [String] :source_security_group_name
|
160
|
+
# The name of a destination security group. To authorize outbound access
|
161
|
+
# to a destination security group, we recommend that you use a set of IP
|
162
|
+
# permissions instead.
|
163
|
+
# @option options [String] :source_security_group_owner_id
|
164
|
+
# The AWS account number for a destination security group. To authorize
|
165
|
+
# outbound access to a destination security group, we recommend that you
|
166
|
+
# use a set of IP permissions instead.
|
167
|
+
# @option options [String] :ip_protocol
|
168
|
+
# The IP protocol name or number. We recommend that you specify the
|
169
|
+
# protocol in a set of IP permissions instead.
|
170
|
+
# @option options [Integer] :from_port
|
171
|
+
# The start of port range for the TCP and UDP protocols, or an ICMP type
|
172
|
+
# number. We recommend that you specify the port range in a set of IP
|
173
|
+
# permissions instead.
|
174
|
+
# @option options [Integer] :to_port
|
175
|
+
# The end of port range for the TCP and UDP protocols, or an ICMP type
|
176
|
+
# number. We recommend that you specify the port range in a set of IP
|
177
|
+
# permissions instead.
|
178
|
+
# @option options [String] :cidr_ip
|
179
|
+
# The CIDR IP address range. We recommend that you specify the CIDR
|
180
|
+
# range in a set of IP permissions instead.
|
181
|
+
# @option options [Array<Types::IpPermission>] :ip_permissions
|
182
|
+
# A set of IP permissions. You can't specify a destination security
|
183
|
+
# group and a CIDR IP address range.
|
184
|
+
# @return [EmptyStructure]
|
185
|
+
def authorize_egress(options = {})
|
186
|
+
options = options.merge(group_id: @id)
|
187
|
+
resp = @client.authorize_security_group_egress(options)
|
188
|
+
resp.data
|
189
|
+
end
|
190
|
+
|
191
|
+
# @example Request syntax with placeholder values
|
192
|
+
#
|
193
|
+
# security_group.authorize_ingress({
|
194
|
+
# dry_run: false,
|
195
|
+
# group_name: "String",
|
196
|
+
# source_security_group_name: "String",
|
197
|
+
# source_security_group_owner_id: "String",
|
198
|
+
# ip_protocol: "String",
|
199
|
+
# from_port: 1,
|
200
|
+
# to_port: 1,
|
201
|
+
# cidr_ip: "String",
|
202
|
+
# ip_permissions: [
|
203
|
+
# {
|
204
|
+
# ip_protocol: "String",
|
205
|
+
# from_port: 1,
|
206
|
+
# to_port: 1,
|
207
|
+
# user_id_group_pairs: [
|
208
|
+
# {
|
209
|
+
# user_id: "String",
|
210
|
+
# group_name: "String",
|
211
|
+
# group_id: "String",
|
212
|
+
# vpc_id: "String",
|
213
|
+
# vpc_peering_connection_id: "String",
|
214
|
+
# peering_status: "String",
|
215
|
+
# },
|
216
|
+
# ],
|
217
|
+
# ip_ranges: [
|
218
|
+
# {
|
219
|
+
# cidr_ip: "String",
|
220
|
+
# },
|
221
|
+
# ],
|
222
|
+
# prefix_list_ids: [
|
223
|
+
# {
|
224
|
+
# prefix_list_id: "String",
|
225
|
+
# },
|
226
|
+
# ],
|
227
|
+
# },
|
228
|
+
# ],
|
229
|
+
# })
|
230
|
+
# @param [Hash] options ({})
|
231
|
+
# @option options [Boolean] :dry_run
|
232
|
+
# Checks whether you have the required permissions for the action,
|
233
|
+
# without actually making the request, and provides an error response.
|
234
|
+
# If you have the required permissions, the error response is
|
235
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
236
|
+
# @option options [String] :group_name
|
237
|
+
# \[EC2-Classic, default VPC\] The name of the security group.
|
238
|
+
# @option options [String] :source_security_group_name
|
239
|
+
# \[EC2-Classic, default VPC\] The name of the source security group.
|
240
|
+
# You can't specify this parameter in combination with the following
|
241
|
+
# parameters: the CIDR IP address range, the start of the port range,
|
242
|
+
# the IP protocol, and the end of the port range. Creates rules that
|
243
|
+
# grant full ICMP, UDP, and TCP access. To create a rule with a specific
|
244
|
+
# IP protocol and port range, use a set of IP permissions instead. For
|
245
|
+
# EC2-VPC, the source security group must be in the same VPC.
|
246
|
+
# @option options [String] :source_security_group_owner_id
|
247
|
+
# \[EC2-Classic\] The AWS account number for the source security group,
|
248
|
+
# if the source security group is in a different account. You can't
|
249
|
+
# specify this parameter in combination with the following parameters:
|
250
|
+
# the CIDR IP address range, the IP protocol, the start of the port
|
251
|
+
# range, and the end of the port range. Creates rules that grant full
|
252
|
+
# ICMP, UDP, and TCP access. To create a rule with a specific IP
|
253
|
+
# protocol and port range, use a set of IP permissions instead.
|
254
|
+
# @option options [String] :ip_protocol
|
255
|
+
# The IP protocol name (`tcp`, `udp`, `icmp`) or number (see [Protocol
|
256
|
+
# Numbers][1]). (VPC only) Use `-1` to specify all traffic. If you
|
257
|
+
# specify `-1`, traffic on all ports is allowed, regardless of any ports
|
258
|
+
# you specify.
|
259
|
+
#
|
260
|
+
#
|
261
|
+
#
|
262
|
+
# [1]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
|
263
|
+
# @option options [Integer] :from_port
|
264
|
+
# The start of port range for the TCP and UDP protocols, or an ICMP type
|
265
|
+
# number. For the ICMP type number, use `-1` to specify all ICMP types.
|
266
|
+
# @option options [Integer] :to_port
|
267
|
+
# The end of port range for the TCP and UDP protocols, or an ICMP code
|
268
|
+
# number. For the ICMP code number, use `-1` to specify all ICMP codes
|
269
|
+
# for the ICMP type.
|
270
|
+
# @option options [String] :cidr_ip
|
271
|
+
# The CIDR IP address range. You can't specify this parameter when
|
272
|
+
# specifying a source security group.
|
273
|
+
# @option options [Array<Types::IpPermission>] :ip_permissions
|
274
|
+
# A set of IP permissions. Can be used to specify multiple rules in a
|
275
|
+
# single command.
|
276
|
+
# @return [EmptyStructure]
|
277
|
+
def authorize_ingress(options = {})
|
278
|
+
options = options.merge(group_id: @id)
|
279
|
+
resp = @client.authorize_security_group_ingress(options)
|
280
|
+
resp.data
|
281
|
+
end
|
282
|
+
|
283
|
+
# @example Request syntax with placeholder values
|
284
|
+
#
|
285
|
+
# tag = security_group.create_tags({
|
286
|
+
# dry_run: false,
|
287
|
+
# tags: [ # required
|
288
|
+
# {
|
289
|
+
# key: "String",
|
290
|
+
# value: "String",
|
291
|
+
# },
|
292
|
+
# ],
|
293
|
+
# })
|
294
|
+
# @param [Hash] options ({})
|
295
|
+
# @option options [Boolean] :dry_run
|
296
|
+
# Checks whether you have the required permissions for the action,
|
297
|
+
# without actually making the request, and provides an error response.
|
298
|
+
# If you have the required permissions, the error response is
|
299
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
300
|
+
# @option options [required, Array<Types::Tag>] :tags
|
301
|
+
# One or more tags. The `value` parameter is required, but if you don't
|
302
|
+
# want the tag to have a value, specify the parameter with no value, and
|
303
|
+
# we set the value to an empty string.
|
304
|
+
# @return [Tag::Collection]
|
305
|
+
def create_tags(options = {})
|
306
|
+
batch = []
|
307
|
+
options = Aws::Util.deep_merge(options, resources: [@id])
|
308
|
+
resp = @client.create_tags(options)
|
309
|
+
options[:tags].each do |t|
|
310
|
+
batch << Tag.new(
|
311
|
+
resource_id: @id,
|
312
|
+
key: t[:key],
|
313
|
+
value: t[:value],
|
314
|
+
client: @client
|
315
|
+
)
|
316
|
+
end
|
317
|
+
Tag::Collection.new([batch], size: batch.size)
|
318
|
+
end
|
319
|
+
|
320
|
+
# @example Request syntax with placeholder values
|
321
|
+
#
|
322
|
+
# security_group.delete({
|
323
|
+
# dry_run: false,
|
324
|
+
# group_name: "String",
|
325
|
+
# })
|
326
|
+
# @param [Hash] options ({})
|
327
|
+
# @option options [Boolean] :dry_run
|
328
|
+
# Checks whether you have the required permissions for the action,
|
329
|
+
# without actually making the request, and provides an error response.
|
330
|
+
# If you have the required permissions, the error response is
|
331
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
332
|
+
# @option options [String] :group_name
|
333
|
+
# \[EC2-Classic, default VPC\] The name of the security group. You can
|
334
|
+
# specify either the security group name or the security group ID.
|
335
|
+
# @return [EmptyStructure]
|
336
|
+
def delete(options = {})
|
337
|
+
options = options.merge(group_id: @id)
|
338
|
+
resp = @client.delete_security_group(options)
|
339
|
+
resp.data
|
340
|
+
end
|
341
|
+
|
342
|
+
# @example Request syntax with placeholder values
|
343
|
+
#
|
344
|
+
# security_group.revoke_egress({
|
345
|
+
# dry_run: false,
|
346
|
+
# source_security_group_name: "String",
|
347
|
+
# source_security_group_owner_id: "String",
|
348
|
+
# ip_protocol: "String",
|
349
|
+
# from_port: 1,
|
350
|
+
# to_port: 1,
|
351
|
+
# cidr_ip: "String",
|
352
|
+
# ip_permissions: [
|
353
|
+
# {
|
354
|
+
# ip_protocol: "String",
|
355
|
+
# from_port: 1,
|
356
|
+
# to_port: 1,
|
357
|
+
# user_id_group_pairs: [
|
358
|
+
# {
|
359
|
+
# user_id: "String",
|
360
|
+
# group_name: "String",
|
361
|
+
# group_id: "String",
|
362
|
+
# vpc_id: "String",
|
363
|
+
# vpc_peering_connection_id: "String",
|
364
|
+
# peering_status: "String",
|
365
|
+
# },
|
366
|
+
# ],
|
367
|
+
# ip_ranges: [
|
368
|
+
# {
|
369
|
+
# cidr_ip: "String",
|
370
|
+
# },
|
371
|
+
# ],
|
372
|
+
# prefix_list_ids: [
|
373
|
+
# {
|
374
|
+
# prefix_list_id: "String",
|
375
|
+
# },
|
376
|
+
# ],
|
377
|
+
# },
|
378
|
+
# ],
|
379
|
+
# })
|
380
|
+
# @param [Hash] options ({})
|
381
|
+
# @option options [Boolean] :dry_run
|
382
|
+
# Checks whether you have the required permissions for the action,
|
383
|
+
# without actually making the request, and provides an error response.
|
384
|
+
# If you have the required permissions, the error response is
|
385
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
386
|
+
# @option options [String] :source_security_group_name
|
387
|
+
# The name of a destination security group. To revoke outbound access to
|
388
|
+
# a destination security group, we recommend that you use a set of IP
|
389
|
+
# permissions instead.
|
390
|
+
# @option options [String] :source_security_group_owner_id
|
391
|
+
# The AWS account number for a destination security group. To revoke
|
392
|
+
# outbound access to a destination security group, we recommend that you
|
393
|
+
# use a set of IP permissions instead.
|
394
|
+
# @option options [String] :ip_protocol
|
395
|
+
# The IP protocol name or number. We recommend that you specify the
|
396
|
+
# protocol in a set of IP permissions instead.
|
397
|
+
# @option options [Integer] :from_port
|
398
|
+
# The start of port range for the TCP and UDP protocols, or an ICMP type
|
399
|
+
# number. We recommend that you specify the port range in a set of IP
|
400
|
+
# permissions instead.
|
401
|
+
# @option options [Integer] :to_port
|
402
|
+
# The end of port range for the TCP and UDP protocols, or an ICMP type
|
403
|
+
# number. We recommend that you specify the port range in a set of IP
|
404
|
+
# permissions instead.
|
405
|
+
# @option options [String] :cidr_ip
|
406
|
+
# The CIDR IP address range. We recommend that you specify the CIDR
|
407
|
+
# range in a set of IP permissions instead.
|
408
|
+
# @option options [Array<Types::IpPermission>] :ip_permissions
|
409
|
+
# A set of IP permissions. You can't specify a destination security
|
410
|
+
# group and a CIDR IP address range.
|
411
|
+
# @return [EmptyStructure]
|
412
|
+
def revoke_egress(options = {})
|
413
|
+
options = options.merge(group_id: @id)
|
414
|
+
resp = @client.revoke_security_group_egress(options)
|
415
|
+
resp.data
|
416
|
+
end
|
417
|
+
|
418
|
+
# @example Request syntax with placeholder values
|
419
|
+
#
|
420
|
+
# security_group.revoke_ingress({
|
421
|
+
# dry_run: false,
|
422
|
+
# group_name: "String",
|
423
|
+
# source_security_group_name: "String",
|
424
|
+
# source_security_group_owner_id: "String",
|
425
|
+
# ip_protocol: "String",
|
426
|
+
# from_port: 1,
|
427
|
+
# to_port: 1,
|
428
|
+
# cidr_ip: "String",
|
429
|
+
# ip_permissions: [
|
430
|
+
# {
|
431
|
+
# ip_protocol: "String",
|
432
|
+
# from_port: 1,
|
433
|
+
# to_port: 1,
|
434
|
+
# user_id_group_pairs: [
|
435
|
+
# {
|
436
|
+
# user_id: "String",
|
437
|
+
# group_name: "String",
|
438
|
+
# group_id: "String",
|
439
|
+
# vpc_id: "String",
|
440
|
+
# vpc_peering_connection_id: "String",
|
441
|
+
# peering_status: "String",
|
442
|
+
# },
|
443
|
+
# ],
|
444
|
+
# ip_ranges: [
|
445
|
+
# {
|
446
|
+
# cidr_ip: "String",
|
447
|
+
# },
|
448
|
+
# ],
|
449
|
+
# prefix_list_ids: [
|
450
|
+
# {
|
451
|
+
# prefix_list_id: "String",
|
452
|
+
# },
|
453
|
+
# ],
|
454
|
+
# },
|
455
|
+
# ],
|
456
|
+
# })
|
457
|
+
# @param [Hash] options ({})
|
458
|
+
# @option options [Boolean] :dry_run
|
459
|
+
# Checks whether you have the required permissions for the action,
|
460
|
+
# without actually making the request, and provides an error response.
|
461
|
+
# If you have the required permissions, the error response is
|
462
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
463
|
+
# @option options [String] :group_name
|
464
|
+
# \[EC2-Classic, default VPC\] The name of the security group.
|
465
|
+
# @option options [String] :source_security_group_name
|
466
|
+
# \[EC2-Classic, default VPC\] The name of the source security group.
|
467
|
+
# You can't specify this parameter in combination with the following
|
468
|
+
# parameters: the CIDR IP address range, the start of the port range,
|
469
|
+
# the IP protocol, and the end of the port range. For EC2-VPC, the
|
470
|
+
# source security group must be in the same VPC. To revoke a specific
|
471
|
+
# rule for an IP protocol and port range, use a set of IP permissions
|
472
|
+
# instead.
|
473
|
+
# @option options [String] :source_security_group_owner_id
|
474
|
+
# \[EC2-Classic\] The AWS account ID of the source security group, if
|
475
|
+
# the source security group is in a different account. You can't
|
476
|
+
# specify this parameter in combination with the following parameters:
|
477
|
+
# the CIDR IP address range, the IP protocol, the start of the port
|
478
|
+
# range, and the end of the port range. To revoke a specific rule for an
|
479
|
+
# IP protocol and port range, use a set of IP permissions instead.
|
480
|
+
# @option options [String] :ip_protocol
|
481
|
+
# The IP protocol name (`tcp`, `udp`, `icmp`) or number (see [Protocol
|
482
|
+
# Numbers][1]). Use `-1` to specify all.
|
483
|
+
#
|
484
|
+
#
|
485
|
+
#
|
486
|
+
# [1]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
|
487
|
+
# @option options [Integer] :from_port
|
488
|
+
# The start of port range for the TCP and UDP protocols, or an ICMP type
|
489
|
+
# number. For the ICMP type number, use `-1` to specify all ICMP types.
|
490
|
+
# @option options [Integer] :to_port
|
491
|
+
# The end of port range for the TCP and UDP protocols, or an ICMP code
|
492
|
+
# number. For the ICMP code number, use `-1` to specify all ICMP codes
|
493
|
+
# for the ICMP type.
|
494
|
+
# @option options [String] :cidr_ip
|
495
|
+
# The CIDR IP address range. You can't specify this parameter when
|
496
|
+
# specifying a source security group.
|
497
|
+
# @option options [Array<Types::IpPermission>] :ip_permissions
|
498
|
+
# A set of IP permissions. You can't specify a source security group
|
499
|
+
# and a CIDR IP address range.
|
500
|
+
# @return [EmptyStructure]
|
501
|
+
def revoke_ingress(options = {})
|
502
|
+
options = options.merge(group_id: @id)
|
503
|
+
resp = @client.revoke_security_group_ingress(options)
|
504
|
+
resp.data
|
505
|
+
end
|
506
|
+
|
507
|
+
# @deprecated
|
508
|
+
# @api private
|
509
|
+
def identifiers
|
510
|
+
{ id: @id }
|
511
|
+
end
|
512
|
+
deprecated(:identifiers)
|
513
|
+
|
514
|
+
private
|
515
|
+
|
516
|
+
def extract_id(args, options)
|
517
|
+
value = args[0] || options.delete(:id)
|
518
|
+
case value
|
519
|
+
when String then value
|
520
|
+
when nil then raise ArgumentError, "missing required option :id"
|
521
|
+
else
|
522
|
+
msg = "expected :id to be a String, got #{value.class}"
|
523
|
+
raise ArgumentError, msg
|
524
|
+
end
|
525
|
+
end
|
526
|
+
|
527
|
+
class Collection < Aws::Resources::Collection; end
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|