aws-sdk-opsworks 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
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
+
@@ -0,0 +1,23 @@
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 OpsWorks
10
+ module Errors
11
+
12
+ extend Aws::Errors::DynamicErrors
13
+
14
+ # Raised when calling #load or #data on a resource class that can not be
15
+ # loaded. This can happen when:
16
+ #
17
+ # * A resource class has identifiers, but no data attributes.
18
+ # * Resource data is only available when making an API call that
19
+ # enumerates all resources of that type.
20
+ class ResourceNotLoadable < RuntimeError; end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,298 @@
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 OpsWorks
10
+ class Layer
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
+
34
+ # The layer stack ID.
35
+ # @return [String]
36
+ def stack_id
37
+ data.stack_id
38
+ end
39
+
40
+ # The layer ID.
41
+ # @return [String]
42
+ def layer_id
43
+ data.layer_id
44
+ end
45
+
46
+ # The layer type.
47
+ # @return [String]
48
+ def type
49
+ data.type
50
+ end
51
+
52
+ # The layer name.
53
+ # @return [String]
54
+ def name
55
+ data.name
56
+ end
57
+
58
+ # The layer short name.
59
+ # @return [String]
60
+ def shortname
61
+ data.shortname
62
+ end
63
+
64
+ # The layer attributes.
65
+ #
66
+ # For the `HaproxyStatsPassword`, `MysqlRootPassword`, and
67
+ # `GangliaPassword` attributes, AWS OpsWorks returns
68
+ # `*****FILTERED*****` instead of the actual value
69
+ #
70
+ # For an ECS Cluster layer, AWS OpsWorks the `EcsClusterArn` attribute
71
+ # is set to the cluster's ARN.
72
+ # @return [Hash<String,String>]
73
+ def attributes
74
+ data.attributes
75
+ end
76
+
77
+ # The ARN of the default IAM profile to be used for the layer's EC2
78
+ # instances. For more information about IAM ARNs, see [Using
79
+ # Identifiers][1].
80
+ #
81
+ #
82
+ #
83
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
84
+ # @return [String]
85
+ def custom_instance_profile_arn
86
+ data.custom_instance_profile_arn
87
+ end
88
+
89
+ # A JSON formatted string containing the layer's custom stack
90
+ # configuration and deployment attributes.
91
+ # @return [String]
92
+ def custom_json
93
+ data.custom_json
94
+ end
95
+
96
+ # An array containing the layer's custom security group IDs.
97
+ # @return [Array<String>]
98
+ def custom_security_group_ids
99
+ data.custom_security_group_ids
100
+ end
101
+
102
+ # An array containing the layer's security group names.
103
+ # @return [Array<String>]
104
+ def default_security_group_names
105
+ data.default_security_group_names
106
+ end
107
+
108
+ # An array of `Package` objects that describe the layer's packages.
109
+ # @return [Array<String>]
110
+ def packages
111
+ data.packages
112
+ end
113
+
114
+ # A `VolumeConfigurations` object that describes the layer's Amazon EBS
115
+ # volumes.
116
+ # @return [Array<Types::VolumeConfiguration>]
117
+ def volume_configurations
118
+ data.volume_configurations
119
+ end
120
+
121
+ # Whether auto healing is disabled for the layer.
122
+ # @return [Boolean]
123
+ def enable_auto_healing
124
+ data.enable_auto_healing
125
+ end
126
+
127
+ # Whether to automatically assign an [Elastic IP address][1] to the
128
+ # layer's instances. For more information, see [How to Edit a
129
+ # Layer][2].
130
+ #
131
+ #
132
+ #
133
+ # [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
134
+ # [2]: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html
135
+ # @return [Boolean]
136
+ def auto_assign_elastic_ips
137
+ data.auto_assign_elastic_ips
138
+ end
139
+
140
+ # For stacks that are running in a VPC, whether to automatically assign
141
+ # a public IP address to the layer's instances. For more information,
142
+ # see [How to Edit a Layer][1].
143
+ #
144
+ #
145
+ #
146
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html
147
+ # @return [Boolean]
148
+ def auto_assign_public_ips
149
+ data.auto_assign_public_ips
150
+ end
151
+
152
+ # AWS OpsWorks supports five lifecycle events: **setup**,
153
+ # **configuration**, **deploy**, **undeploy**, and **shutdown**. For
154
+ # each layer, AWS OpsWorks runs a set of standard recipes for each
155
+ # event. In addition, you can provide custom recipes for any or all
156
+ # layers and events. AWS OpsWorks runs custom event recipes after the
157
+ # standard recipes. `LayerCustomRecipes` specifies the custom recipes
158
+ # for a particular layer to be run in response to each of the five
159
+ # events.
160
+ #
161
+ # To specify a recipe, use the cookbook's directory name in the
162
+ # repository followed by two colons and the recipe name, which is the
163
+ # recipe's file name without the .rb extension. For example:
164
+ # phpapp2::dbsetup specifies the dbsetup.rb recipe in the repository's
165
+ # phpapp2 folder.
166
+ # @return [Types::Recipes]
167
+ def default_recipes
168
+ data.default_recipes
169
+ end
170
+
171
+ # A `LayerCustomRecipes` object that specifies the layer's custom
172
+ # recipes.
173
+ # @return [Types::Recipes]
174
+ def custom_recipes
175
+ data.custom_recipes
176
+ end
177
+
178
+ # Date when the layer was created.
179
+ # @return [String]
180
+ def created_at
181
+ data.created_at
182
+ end
183
+
184
+ # Whether to install operating system and package updates when the
185
+ # instance boots. The default value is `true`. If this value is set to
186
+ # `false`, you must then update your instances manually by using
187
+ # CreateDeployment to run the `update_dependencies` stack command or
188
+ # manually running `yum` (Amazon Linux) or `apt-get` (Ubuntu) on the
189
+ # instances.
190
+ #
191
+ # <note markdown="1"> We strongly recommend using the default value of `true`, to ensure
192
+ # that your instances have the latest security updates.
193
+ #
194
+ # </note>
195
+ # @return [Boolean]
196
+ def install_updates_on_boot
197
+ data.install_updates_on_boot
198
+ end
199
+
200
+ # Whether the layer uses Amazon EBS-optimized instances.
201
+ # @return [Boolean]
202
+ def use_ebs_optimized_instances
203
+ data.use_ebs_optimized_instances
204
+ end
205
+
206
+ # A `LifeCycleEventConfiguration` object that specifies the Shutdown
207
+ # event configuration.
208
+ # @return [Types::LifecycleEventConfiguration]
209
+ def lifecycle_event_configuration
210
+ data.lifecycle_event_configuration
211
+ end
212
+
213
+ # @!endgroup
214
+
215
+ # @return [Client]
216
+ def client
217
+ @client
218
+ end
219
+
220
+ # Loads, or reloads {#data} for the current {Layer}.
221
+ # Returns `self` making it possible to chain methods.
222
+ #
223
+ # layer.reload.data
224
+ #
225
+ # @return [self]
226
+ def load
227
+ resp = @client.describe_layers(layer_ids: [@id])
228
+ @data = resp.layers[0]
229
+ self
230
+ end
231
+ alias :reload :load
232
+
233
+ # @return [Types::Layer]
234
+ # Returns the data for this {Layer}. Calls
235
+ # {Client#describe_layers} if {#data_loaded?} is `false`.
236
+ def data
237
+ load unless @data
238
+ @data
239
+ end
240
+
241
+ # @return [Boolean]
242
+ # Returns `true` if this resource is loaded. Accessing attributes or
243
+ # {#data} on an unloaded resource will trigger a call to {#load}.
244
+ def data_loaded?
245
+ !!@data
246
+ end
247
+
248
+ # @!group Actions
249
+
250
+ # @example Request syntax with placeholder values
251
+ #
252
+ # layer.delete()
253
+ # @param [Hash] options ({})
254
+ # @return [EmptyStructure]
255
+ def delete(options = {})
256
+ options = options.merge(layer_id: @id)
257
+ resp = @client.delete_layer(options)
258
+ resp.data
259
+ end
260
+
261
+ # @!group Associations
262
+
263
+ # @return [Stack, nil]
264
+ def stack
265
+ if data.stack_id
266
+ Stack.new(
267
+ id: data.stack_id,
268
+ client: @client
269
+ )
270
+ else
271
+ nil
272
+ end
273
+ end
274
+
275
+ # @deprecated
276
+ # @api private
277
+ def identifiers
278
+ { id: @id }
279
+ end
280
+ deprecated(:identifiers)
281
+
282
+ private
283
+
284
+ def extract_id(args, options)
285
+ value = args[0] || options.delete(:id)
286
+ case value
287
+ when String then value
288
+ when nil then raise ArgumentError, "missing required option :id"
289
+ else
290
+ msg = "expected :id to be a String, got #{value.class}"
291
+ raise ArgumentError, msg
292
+ end
293
+ end
294
+
295
+ class Collection < Aws::Resources::Collection; end
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,377 @@
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 OpsWorks
10
+ class Resource
11
+
12
+ # @param options ({})
13
+ # @option options [Client] :client
14
+ def initialize(options = {})
15
+ @client = options[:client] || Client.new(options)
16
+ end
17
+
18
+ # @return [Client]
19
+ def client
20
+ @client
21
+ end
22
+
23
+ # @!group Actions
24
+
25
+ # @example Request syntax with placeholder values
26
+ #
27
+ # stack = ops_works.create_stack({
28
+ # name: "String", # required
29
+ # region: "String", # required
30
+ # vpc_id: "String",
31
+ # attributes: {
32
+ # "Color" => "String",
33
+ # },
34
+ # service_role_arn: "String", # required
35
+ # default_instance_profile_arn: "String", # required
36
+ # default_os: "String",
37
+ # hostname_theme: "String",
38
+ # default_availability_zone: "String",
39
+ # default_subnet_id: "String",
40
+ # custom_json: "String",
41
+ # configuration_manager: {
42
+ # name: "String",
43
+ # version: "String",
44
+ # },
45
+ # chef_configuration: {
46
+ # manage_berkshelf: false,
47
+ # berkshelf_version: "String",
48
+ # },
49
+ # use_custom_cookbooks: false,
50
+ # use_opsworks_security_groups: false,
51
+ # custom_cookbooks_source: {
52
+ # type: "git", # accepts git, svn, archive, s3
53
+ # url: "String",
54
+ # username: "String",
55
+ # password: "String",
56
+ # ssh_key: "String",
57
+ # revision: "String",
58
+ # },
59
+ # default_ssh_key_name: "String",
60
+ # default_root_device_type: "ebs", # accepts ebs, instance-store
61
+ # agent_version: "String",
62
+ # })
63
+ # @param [Hash] options ({})
64
+ # @option options [required, String] :name
65
+ # The stack name.
66
+ # @option options [required, String] :region
67
+ # The stack's AWS region, such as "ap-south-1". For more information
68
+ # about Amazon regions, see [Regions and Endpoints][1].
69
+ #
70
+ #
71
+ #
72
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/rande.html
73
+ # @option options [String] :vpc_id
74
+ # The ID of the VPC that the stack is to be launched into. The VPC must
75
+ # be in the stack's region. All instances are launched into this VPC.
76
+ # You cannot change the ID later.
77
+ #
78
+ # * If your account supports EC2-Classic, the default value is `no VPC`.
79
+ #
80
+ # * If your account does not support EC2-Classic, the default value is
81
+ # the default VPC for the specified region.
82
+ #
83
+ # If the VPC ID corresponds to a default VPC and you have specified
84
+ # either the `DefaultAvailabilityZone` or the `DefaultSubnetId`
85
+ # parameter only, AWS OpsWorks infers the value of the other parameter.
86
+ # If you specify neither parameter, AWS OpsWorks sets these parameters
87
+ # to the first valid Availability Zone for the specified region and the
88
+ # corresponding default VPC subnet ID, respectively.
89
+ #
90
+ # If you specify a nondefault VPC ID, note the following:
91
+ #
92
+ # * It must belong to a VPC in your account that is in the specified
93
+ # region.
94
+ #
95
+ # * You must specify a value for `DefaultSubnetId`.
96
+ #
97
+ # For more information on how to use AWS OpsWorks with a VPC, see
98
+ # [Running a Stack in a VPC][1]. For more information on default VPC and
99
+ # EC2-Classic, see [Supported Platforms][2].
100
+ #
101
+ #
102
+ #
103
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html
104
+ # [2]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html
105
+ # @option options [Hash<String,String>] :attributes
106
+ # One or more user-defined key-value pairs to be added to the stack
107
+ # attributes.
108
+ # @option options [required, String] :service_role_arn
109
+ # The stack's AWS Identity and Access Management (IAM) role, which
110
+ # allows AWS OpsWorks to work with AWS resources on your behalf. You
111
+ # must set this parameter to the Amazon Resource Name (ARN) for an
112
+ # existing IAM role. For more information about IAM ARNs, see [Using
113
+ # Identifiers][1].
114
+ #
115
+ #
116
+ #
117
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
118
+ # @option options [required, String] :default_instance_profile_arn
119
+ # The Amazon Resource Name (ARN) of an IAM profile that is the default
120
+ # profile for all of the stack's EC2 instances. For more information
121
+ # about IAM ARNs, see [Using Identifiers][1].
122
+ #
123
+ #
124
+ #
125
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
126
+ # @option options [String] :default_os
127
+ # The stack's default operating system, which is installed on every
128
+ # instance unless you specify a different operating system when you
129
+ # create the instance. You can specify one of the following.
130
+ #
131
+ # * A supported Linux operating system: An Amazon Linux version, such as
132
+ # `Amazon Linux 2016.03`, `Amazon Linux 2015.09`, or `Amazon Linux
133
+ # 2015.03`.
134
+ #
135
+ # * A supported Ubuntu operating system, such as `Ubuntu 16.04 LTS`,
136
+ # `Ubuntu 14.04 LTS`, or `Ubuntu 12.04 LTS`.
137
+ #
138
+ # * `CentOS 7`
139
+ #
140
+ # * `Red Hat Enterprise Linux 7`
141
+ #
142
+ # * A supported Windows operating system, such as `Microsoft Windows
143
+ # Server 2012 R2 Base`, `Microsoft Windows Server 2012 R2 with SQL
144
+ # Server Express`, `Microsoft Windows Server 2012 R2 with SQL Server
145
+ # Standard`, or `Microsoft Windows Server 2012 R2 with SQL Server
146
+ # Web`.
147
+ #
148
+ # * A custom AMI: `Custom`. You specify the custom AMI you want to use
149
+ # when you create instances. For more information, see [ Using Custom
150
+ # AMIs][1].
151
+ #
152
+ # The default option is the current Amazon Linux version. For more
153
+ # information on the supported operating systems, see [AWS OpsWorks
154
+ # Operating Systems][2].
155
+ #
156
+ #
157
+ #
158
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html
159
+ # [2]: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html
160
+ # @option options [String] :hostname_theme
161
+ # The stack's host name theme, with spaces replaced by underscores. The
162
+ # theme is used to generate host names for the stack's instances. By
163
+ # default, `HostnameTheme` is set to `Layer_Dependent`, which creates
164
+ # host names by appending integers to the layer's short name. The other
165
+ # themes are:
166
+ #
167
+ # * `Baked_Goods`
168
+ #
169
+ # * `Clouds`
170
+ #
171
+ # * `Europe_Cities`
172
+ #
173
+ # * `Fruits`
174
+ #
175
+ # * `Greek_Deities`
176
+ #
177
+ # * `Legendary_creatures_from_Japan`
178
+ #
179
+ # * `Planets_and_Moons`
180
+ #
181
+ # * `Roman_Deities`
182
+ #
183
+ # * `Scottish_Islands`
184
+ #
185
+ # * `US_Cities`
186
+ #
187
+ # * `Wild_Cats`
188
+ #
189
+ # To obtain a generated host name, call `GetHostNameSuggestion`, which
190
+ # returns a host name based on the current theme.
191
+ # @option options [String] :default_availability_zone
192
+ # The stack's default Availability Zone, which must be in the specified
193
+ # region. For more information, see [Regions and Endpoints][1]. If you
194
+ # also specify a value for `DefaultSubnetId`, the subnet must be in the
195
+ # same zone. For more information, see the `VpcId` parameter
196
+ # description.
197
+ #
198
+ #
199
+ #
200
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/rande.html
201
+ # @option options [String] :default_subnet_id
202
+ # The stack's default VPC subnet ID. This parameter is required if you
203
+ # specify a value for the `VpcId` parameter. All instances are launched
204
+ # into this subnet unless you specify otherwise when you create the
205
+ # instance. If you also specify a value for `DefaultAvailabilityZone`,
206
+ # the subnet must be in that zone. For information on default values and
207
+ # when this parameter is required, see the `VpcId` parameter
208
+ # description.
209
+ # @option options [String] :custom_json
210
+ # A string that contains user-defined, custom JSON. It can be used to
211
+ # override the corresponding default stack configuration attribute
212
+ # values or to pass data to recipes. The string should be in the
213
+ # following format:
214
+ #
215
+ # `"\{"key1": "value1", "key2": "value2",...\}"`
216
+ #
217
+ # For more information on custom JSON, see [Use Custom JSON to Modify
218
+ # the Stack Configuration Attributes][1].
219
+ #
220
+ #
221
+ #
222
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html
223
+ # @option options [Types::StackConfigurationManager] :configuration_manager
224
+ # The configuration manager. When you create a stack we recommend that
225
+ # you use the configuration manager to specify the Chef version: 12,
226
+ # 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The
227
+ # default value for Linux stacks is currently 11.4.
228
+ # @option options [Types::ChefConfiguration] :chef_configuration
229
+ # A `ChefConfiguration` object that specifies whether to enable
230
+ # Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more
231
+ # information, see [Create a New Stack][1].
232
+ #
233
+ #
234
+ #
235
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html
236
+ # @option options [Boolean] :use_custom_cookbooks
237
+ # Whether the stack uses custom cookbooks.
238
+ # @option options [Boolean] :use_opsworks_security_groups
239
+ # Whether to associate the AWS OpsWorks built-in security groups with
240
+ # the stack's layers.
241
+ #
242
+ # AWS OpsWorks provides a standard set of built-in security groups, one
243
+ # for each layer, which are associated with layers by default. With
244
+ # `UseOpsworksSecurityGroups` you can instead provide your own custom
245
+ # security groups. `UseOpsworksSecurityGroups` has the following
246
+ # settings:
247
+ #
248
+ # * True - AWS OpsWorks automatically associates the appropriate
249
+ # built-in security group with each layer (default setting). You can
250
+ # associate additional security groups with a layer after you create
251
+ # it, but you cannot delete the built-in security group.
252
+ #
253
+ # * False - AWS OpsWorks does not associate built-in security groups
254
+ # with layers. You must create appropriate EC2 security groups and
255
+ # associate a security group with each layer that you create. However,
256
+ # you can still manually associate a built-in security group with a
257
+ # layer on creation; custom security groups are required only for
258
+ # those layers that need custom settings.
259
+ #
260
+ # For more information, see [Create a New Stack][1].
261
+ #
262
+ #
263
+ #
264
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html
265
+ # @option options [Types::Source] :custom_cookbooks_source
266
+ # Contains the information required to retrieve an app or cookbook from
267
+ # a repository. For more information, see [Creating Apps][1] or [Custom
268
+ # Recipes and Cookbooks][2].
269
+ #
270
+ #
271
+ #
272
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html
273
+ # [2]: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html
274
+ # @option options [String] :default_ssh_key_name
275
+ # A default Amazon EC2 key pair name. The default value is none. If you
276
+ # specify a key pair name, AWS OpsWorks installs the public key on the
277
+ # instance and you can use the private key with an SSH client to log in
278
+ # to the instance. For more information, see [ Using SSH to Communicate
279
+ # with an Instance][1] and [ Managing SSH Access][2]. You can override
280
+ # this setting by specifying a different key pair, or no key pair, when
281
+ # you [ create an instance][3].
282
+ #
283
+ #
284
+ #
285
+ # [1]: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html
286
+ # [2]: http://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html
287
+ # [3]: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html
288
+ # @option options [String] :default_root_device_type
289
+ # The default root device type. This value is the default for all
290
+ # instances in the stack, but you can override it when you create an
291
+ # instance. The default option is `instance-store`. For more
292
+ # information, see [Storage for the Root Device][1].
293
+ #
294
+ #
295
+ #
296
+ # [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device
297
+ # @option options [String] :agent_version
298
+ # The default AWS OpsWorks agent version. You have the following
299
+ # options:
300
+ #
301
+ # * Auto-update - Set this parameter to `LATEST`. AWS OpsWorks
302
+ # automatically installs new agent versions on the stack's instances
303
+ # as soon as they are available.
304
+ #
305
+ # * Fixed version - Set this parameter to your preferred agent version.
306
+ # To update the agent version, you must edit the stack configuration
307
+ # and specify a new version. AWS OpsWorks then automatically installs
308
+ # that version on the stack's instances.
309
+ #
310
+ # The default setting is the most recent release of the agent. To
311
+ # specify an agent version, you must use the complete version number,
312
+ # not the abbreviated number shown on the console. For a list of
313
+ # available agent version numbers, call DescribeAgentVersions.
314
+ #
315
+ # <note markdown="1"> You can also specify an agent version when you create or update an
316
+ # instance, which overrides the stack's default setting.
317
+ #
318
+ # </note>
319
+ # @return [Stack]
320
+ def create_stack(options = {})
321
+ resp = @client.create_stack(options)
322
+ Stack.new(
323
+ id: resp.data.stack_id,
324
+ client: @client
325
+ )
326
+ end
327
+
328
+ # @!group Associations
329
+
330
+ # @param [String] id
331
+ # @return [Layer]
332
+ def layer(id)
333
+ Layer.new(
334
+ id: id,
335
+ client: @client
336
+ )
337
+ end
338
+
339
+ # @param [String] id
340
+ # @return [Stack]
341
+ def stack(id)
342
+ Stack.new(
343
+ id: id,
344
+ client: @client
345
+ )
346
+ end
347
+
348
+ # @example Request syntax with placeholder values
349
+ #
350
+ # stacks = ops_works.stacks({
351
+ # stack_ids: ["String"],
352
+ # })
353
+ # @param [Hash] options ({})
354
+ # @option options [Array<String>] :stack_ids
355
+ # An array of stack IDs that specify the stacks to be described. If you
356
+ # omit this parameter, `DescribeStacks` returns a description of every
357
+ # stack.
358
+ # @return [Stack::Collection]
359
+ def stacks(options = {})
360
+ batches = Enumerator.new do |y|
361
+ batch = []
362
+ resp = @client.describe_stacks(options)
363
+ resp.data.stacks.each do |s|
364
+ batch << Stack.new(
365
+ id: s.stack_id,
366
+ data: s,
367
+ client: @client
368
+ )
369
+ end
370
+ y.yield(batch)
371
+ end
372
+ Stack::Collection.new(batches)
373
+ end
374
+
375
+ end
376
+ end
377
+ end