aws-sdk-cloudformation 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-cloudformation.rb +2 -2
- data/lib/aws-sdk-cloudformation/client.rb +2202 -1943
- data/lib/aws-sdk-cloudformation/client_api.rb +882 -874
- data/lib/aws-sdk-cloudformation/errors.rb +4 -13
- data/lib/aws-sdk-cloudformation/event.rb +120 -122
- data/lib/aws-sdk-cloudformation/resource.rb +249 -251
- data/lib/aws-sdk-cloudformation/stack.rb +654 -656
- data/lib/aws-sdk-cloudformation/stack_resource.rb +156 -158
- data/lib/aws-sdk-cloudformation/stack_resource_summary.rb +128 -130
- data/lib/aws-sdk-cloudformation/types.rb +2961 -2674
- data/lib/aws-sdk-cloudformation/waiters.rb +281 -232
- metadata +2 -2
@@ -1,23 +1,14 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
module
|
10
|
-
module Errors
|
8
|
+
module Aws::CloudFormation
|
9
|
+
module Errors
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Errors::DynamicErrors
|
13
12
|
|
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
13
|
end
|
23
14
|
end
|
@@ -1,148 +1,146 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::CloudFormation
|
9
|
+
class Event
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(id, options = {})
|
14
|
+
# @param [String] id
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :id
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@id = extract_id(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :event_id :id
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The unique ID name of the instance of the stack.
|
35
|
+
# @return [String]
|
36
|
+
def stack_id
|
37
|
+
data.stack_id
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The name associated with a stack.
|
41
|
+
# @return [String]
|
42
|
+
def stack_name
|
43
|
+
data.stack_name
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The logical name of the resource specified in the template.
|
47
|
+
# @return [String]
|
48
|
+
def logical_resource_id
|
49
|
+
data.logical_resource_id
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
52
|
+
# The name or unique identifier associated with the physical instance of
|
53
|
+
# the resource.
|
54
|
+
# @return [String]
|
55
|
+
def physical_resource_id
|
56
|
+
data.physical_resource_id
|
57
|
+
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
59
|
+
# Type of resource. (For more information, go to [ AWS Resource Types
|
60
|
+
# Reference][1] in the AWS CloudFormation User Guide.)
|
61
|
+
#
|
62
|
+
#
|
63
|
+
#
|
64
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
|
65
|
+
# @return [String]
|
66
|
+
def resource_type
|
67
|
+
data.resource_type
|
68
|
+
end
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
# Time the status was updated.
|
71
|
+
# @return [Time]
|
72
|
+
def timestamp
|
73
|
+
data.timestamp
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
# Current status of the resource.
|
77
|
+
# @return [String]
|
78
|
+
def resource_status
|
79
|
+
data.resource_status
|
80
|
+
end
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
# Success/failure message associated with the resource.
|
83
|
+
# @return [String]
|
84
|
+
def resource_status_reason
|
85
|
+
data.resource_status_reason
|
86
|
+
end
|
88
87
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
88
|
+
# BLOB of the properties used to create the resource.
|
89
|
+
# @return [String]
|
90
|
+
def resource_properties
|
91
|
+
data.resource_properties
|
92
|
+
end
|
94
93
|
|
95
|
-
|
94
|
+
# @!endgroup
|
96
95
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
# @return [Client]
|
97
|
+
def client
|
98
|
+
@client
|
99
|
+
end
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
101
|
+
# @raise [NotImplementedError]
|
102
|
+
# @api private
|
103
|
+
def load
|
104
|
+
msg = "#load is not implemented, data only available via enumeration"
|
105
|
+
raise NotImplementedError, msg
|
106
|
+
end
|
107
|
+
alias :reload :load
|
108
|
+
|
109
|
+
# @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
|
110
|
+
# @return [Types::StackEvent]
|
111
|
+
# Returns the data for this {Event}.
|
112
|
+
def data
|
113
|
+
load unless @data
|
114
|
+
@data
|
115
|
+
end
|
117
116
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
117
|
+
# @return [Boolean]
|
118
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
119
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
120
|
+
def data_loaded?
|
121
|
+
!!@data
|
122
|
+
end
|
124
123
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
def extract_id(args, options)
|
135
|
-
value = args[0] || options.delete(:id)
|
136
|
-
case value
|
137
|
-
when String then value
|
138
|
-
when nil then raise ArgumentError, "missing required option :id"
|
139
|
-
else
|
140
|
-
msg = "expected :id to be a String, got #{value.class}"
|
141
|
-
raise ArgumentError, msg
|
142
|
-
end
|
143
|
-
end
|
124
|
+
# @deprecated
|
125
|
+
# @api private
|
126
|
+
def identifiers
|
127
|
+
{ id: @id }
|
128
|
+
end
|
129
|
+
deprecated(:identifiers)
|
130
|
+
|
131
|
+
private
|
144
132
|
|
145
|
-
|
133
|
+
def extract_id(args, options)
|
134
|
+
value = args[0] || options.delete(:id)
|
135
|
+
case value
|
136
|
+
when String then value
|
137
|
+
when nil then raise ArgumentError, "missing required option :id"
|
138
|
+
else
|
139
|
+
msg = "expected :id to be a String, got #{value.class}"
|
140
|
+
raise ArgumentError, msg
|
141
|
+
end
|
146
142
|
end
|
143
|
+
|
144
|
+
class Collection < Aws::Resources::Collection; end
|
147
145
|
end
|
148
146
|
end
|
@@ -1,271 +1,269 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class Resource
|
8
|
+
module Aws::CloudFormation
|
9
|
+
class Resource
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
# @param options ({})
|
12
|
+
# @option options [Client] :client
|
13
|
+
def initialize(options = {})
|
14
|
+
@client = options[:client] || Client.new(options)
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
# @return [Client]
|
18
|
+
def client
|
19
|
+
@client
|
20
|
+
end
|
22
21
|
|
23
|
-
|
22
|
+
# @!group Actions
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
24
|
+
# @example Request syntax with placeholder values
|
25
|
+
#
|
26
|
+
# stack = cloud_formation.create_stack({
|
27
|
+
# stack_name: "StackName", # required
|
28
|
+
# template_body: "TemplateBody",
|
29
|
+
# template_url: "TemplateURL",
|
30
|
+
# parameters: [
|
31
|
+
# {
|
32
|
+
# parameter_key: "ParameterKey",
|
33
|
+
# parameter_value: "ParameterValue",
|
34
|
+
# use_previous_value: false,
|
35
|
+
# },
|
36
|
+
# ],
|
37
|
+
# disable_rollback: false,
|
38
|
+
# timeout_in_minutes: 1,
|
39
|
+
# notification_arns: ["NotificationARN"],
|
40
|
+
# capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM
|
41
|
+
# resource_types: ["ResourceType"],
|
42
|
+
# role_arn: "RoleARN",
|
43
|
+
# on_failure: "DO_NOTHING", # accepts DO_NOTHING, ROLLBACK, DELETE
|
44
|
+
# stack_policy_body: "StackPolicyBody",
|
45
|
+
# stack_policy_url: "StackPolicyURL",
|
46
|
+
# tags: [
|
47
|
+
# {
|
48
|
+
# key: "TagKey",
|
49
|
+
# value: "TagValue",
|
50
|
+
# },
|
51
|
+
# ],
|
52
|
+
# })
|
53
|
+
# @param [Hash] options ({})
|
54
|
+
# @option options [required, String] :stack_name
|
55
|
+
# The name that is associated with the stack. The name must be unique in
|
56
|
+
# the region in which you are creating the stack.
|
57
|
+
#
|
58
|
+
# <note markdown="1"> A stack name can contain only alphanumeric characters (case sensitive)
|
59
|
+
# and hyphens. It must start with an alphabetic character and cannot be
|
60
|
+
# longer than 128 characters.
|
61
|
+
#
|
62
|
+
# </note>
|
63
|
+
# @option options [String] :template_body
|
64
|
+
# Structure containing the template body with a minimum length of 1 byte
|
65
|
+
# and a maximum length of 51,200 bytes. For more information, go to
|
66
|
+
# [Template Anatomy][1] in the AWS CloudFormation User Guide.
|
67
|
+
#
|
68
|
+
# Conditional: You must specify either the `TemplateBody` or the
|
69
|
+
# `TemplateURL` parameter, but not both.
|
70
|
+
#
|
71
|
+
#
|
72
|
+
#
|
73
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
|
74
|
+
# @option options [String] :template_url
|
75
|
+
# Location of file containing the template body. The URL must point to a
|
76
|
+
# template (max size: 460,800 bytes) that is located in an Amazon S3
|
77
|
+
# bucket. For more information, go to the [Template Anatomy][1] in the
|
78
|
+
# AWS CloudFormation User Guide.
|
79
|
+
#
|
80
|
+
# Conditional: You must specify either the `TemplateBody` or the
|
81
|
+
# `TemplateURL` parameter, but not both.
|
82
|
+
#
|
83
|
+
#
|
84
|
+
#
|
85
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
|
86
|
+
# @option options [Array<Types::Parameter>] :parameters
|
87
|
+
# A list of `Parameter` structures that specify input parameters for the
|
88
|
+
# stack. For more information, see the [Parameter][1] data type.
|
89
|
+
#
|
90
|
+
#
|
91
|
+
#
|
92
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html
|
93
|
+
# @option options [Boolean] :disable_rollback
|
94
|
+
# Set to `true` to disable rollback of the stack if stack creation
|
95
|
+
# failed. You can specify either `DisableRollback` or `OnFailure`, but
|
96
|
+
# not both.
|
97
|
+
#
|
98
|
+
# Default: `false`
|
99
|
+
# @option options [Integer] :timeout_in_minutes
|
100
|
+
# The amount of time that can pass before the stack status becomes
|
101
|
+
# CREATE\_FAILED; if `DisableRollback` is not set or is set to `false`,
|
102
|
+
# the stack will be rolled back.
|
103
|
+
# @option options [Array<String>] :notification_arns
|
104
|
+
# The Simple Notification Service (SNS) topic ARNs to publish stack
|
105
|
+
# related events. You can find your SNS topic ARNs using the [SNS
|
106
|
+
# console][1] or your Command Line Interface (CLI).
|
107
|
+
#
|
108
|
+
#
|
109
|
+
#
|
110
|
+
# [1]: https://console.aws.amazon.com/sns
|
111
|
+
# @option options [Array<String>] :capabilities
|
112
|
+
# A list of values that you must specify before AWS CloudFormation can
|
113
|
+
# create certain stacks. Some stack templates might include resources
|
114
|
+
# that can affect permissions in your AWS account, for example, by
|
115
|
+
# creating new AWS Identity and Access Management (IAM) users. For those
|
116
|
+
# stacks, you must explicitly acknowledge their capabilities by
|
117
|
+
# specifying this parameter.
|
118
|
+
#
|
119
|
+
# The only valid values are `CAPABILITY_IAM` and `CAPABILITY_NAMED_IAM`.
|
120
|
+
# The following resources require you to specify this parameter: [
|
121
|
+
# AWS::IAM::AccessKey][1], [ AWS::IAM::Group][2], [
|
122
|
+
# AWS::IAM::InstanceProfile][3], [ AWS::IAM::Policy][4], [
|
123
|
+
# AWS::IAM::Role][5], [ AWS::IAM::User][6], and [
|
124
|
+
# AWS::IAM::UserToGroupAddition][7]. If your stack template contains
|
125
|
+
# these resources, we recommend that you review all permissions
|
126
|
+
# associated with them and edit their permissions if necessary.
|
127
|
+
#
|
128
|
+
# If you have IAM resources, you can specify either capability. If you
|
129
|
+
# have IAM resources with custom names, you must specify
|
130
|
+
# `CAPABILITY_NAMED_IAM`. If you don't specify this parameter, this
|
131
|
+
# action returns an `InsufficientCapabilities` error.
|
132
|
+
#
|
133
|
+
# For more information, see [Acknowledging IAM Resources in AWS
|
134
|
+
# CloudFormation Templates][8].
|
135
|
+
#
|
136
|
+
#
|
137
|
+
#
|
138
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html
|
139
|
+
# [2]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html
|
140
|
+
# [3]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html
|
141
|
+
# [4]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html
|
142
|
+
# [5]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html
|
143
|
+
# [6]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html
|
144
|
+
# [7]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html
|
145
|
+
# [8]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities
|
146
|
+
# @option options [Array<String>] :resource_types
|
147
|
+
# The template resource types that you have permissions to work with for
|
148
|
+
# this create stack action, such as `AWS::EC2::Instance`, `AWS::EC2::*`,
|
149
|
+
# or `Custom::MyCustomInstance`. Use the following syntax to describe
|
150
|
+
# template resource types: `AWS::*` (for all AWS resource), `Custom::*`
|
151
|
+
# (for all custom resources), `Custom::logical_ID ` (for a specific
|
152
|
+
# custom resource), `AWS::service_name::*` (for all resources of a
|
153
|
+
# particular AWS service), and `AWS::service_name::resource_logical_ID `
|
154
|
+
# (for a specific AWS resource).
|
155
|
+
#
|
156
|
+
# If the list of resource types doesn't include a resource that you're
|
157
|
+
# creating, the stack creation fails. By default, AWS CloudFormation
|
158
|
+
# grants permissions to all resource types. AWS Identity and Access
|
159
|
+
# Management (IAM) uses this parameter for AWS CloudFormation-specific
|
160
|
+
# condition keys in IAM policies. For more information, see [Controlling
|
161
|
+
# Access with AWS Identity and Access Management][1].
|
162
|
+
#
|
163
|
+
#
|
164
|
+
#
|
165
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html
|
166
|
+
# @option options [String] :role_arn
|
167
|
+
# The Amazon Resource Name (ARN) of an AWS Identity and Access
|
168
|
+
# Management (IAM) role that AWS CloudFormation assumes to create the
|
169
|
+
# stack. AWS CloudFormation uses the role's credentials to make calls
|
170
|
+
# on your behalf. AWS CloudFormation always uses this role for all
|
171
|
+
# future operations on the stack. As long as users have permission to
|
172
|
+
# operate on the stack, AWS CloudFormation uses this role even if the
|
173
|
+
# users don't have permission to pass it. Ensure that the role grants
|
174
|
+
# least privilege.
|
175
|
+
#
|
176
|
+
# If you don't specify a value, AWS CloudFormation uses the role that
|
177
|
+
# was previously associated with the stack. If no role is available, AWS
|
178
|
+
# CloudFormation uses a temporary session that is generated from your
|
179
|
+
# user credentials.
|
180
|
+
# @option options [String] :on_failure
|
181
|
+
# Determines what action will be taken if stack creation fails. This
|
182
|
+
# must be one of: DO\_NOTHING, ROLLBACK, or DELETE. You can specify
|
183
|
+
# either `OnFailure` or `DisableRollback`, but not both.
|
184
|
+
#
|
185
|
+
# Default: `ROLLBACK`
|
186
|
+
# @option options [String] :stack_policy_body
|
187
|
+
# Structure containing the stack policy body. For more information, go
|
188
|
+
# to [ Prevent Updates to Stack Resources][1] in the *AWS CloudFormation
|
189
|
+
# User Guide*. You can specify either the `StackPolicyBody` or the
|
190
|
+
# `StackPolicyURL` parameter, but not both.
|
191
|
+
#
|
192
|
+
#
|
193
|
+
#
|
194
|
+
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html
|
195
|
+
# @option options [String] :stack_policy_url
|
196
|
+
# Location of a file containing the stack policy. The URL must point to
|
197
|
+
# a policy (maximum size: 16 KB) located in an S3 bucket in the same
|
198
|
+
# region as the stack. You can specify either the `StackPolicyBody` or
|
199
|
+
# the `StackPolicyURL` parameter, but not both.
|
200
|
+
# @option options [Array<Types::Tag>] :tags
|
201
|
+
# Key-value pairs to associate with this stack. AWS CloudFormation also
|
202
|
+
# propagates these tags to the resources created in the stack. A maximum
|
203
|
+
# number of 10 tags can be specified.
|
204
|
+
# @return [Stack]
|
205
|
+
def create_stack(options = {})
|
206
|
+
resp = @client.create_stack(options)
|
207
|
+
Stack.new(
|
208
|
+
name: options[:stack_name],
|
209
|
+
client: @client
|
210
|
+
)
|
211
|
+
end
|
213
212
|
|
214
|
-
|
213
|
+
# @!group Associations
|
215
214
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
215
|
+
# @param [String] id
|
216
|
+
# @return [Event]
|
217
|
+
def event(id)
|
218
|
+
Event.new(
|
219
|
+
id: id,
|
220
|
+
client: @client
|
221
|
+
)
|
222
|
+
end
|
224
223
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
224
|
+
# @param [String] name
|
225
|
+
# @return [Stack]
|
226
|
+
def stack(name)
|
227
|
+
Stack.new(
|
228
|
+
name: name,
|
229
|
+
client: @client
|
230
|
+
)
|
231
|
+
end
|
233
232
|
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
end
|
263
|
-
y.yield(batch)
|
233
|
+
# @example Request syntax with placeholder values
|
234
|
+
#
|
235
|
+
# stacks = cloud_formation.stacks({
|
236
|
+
# stack_name: "StackName",
|
237
|
+
# })
|
238
|
+
# @param [Hash] options ({})
|
239
|
+
# @option options [String] :stack_name
|
240
|
+
# The name or the unique stack ID that is associated with the stack,
|
241
|
+
# which are not always interchangeable:
|
242
|
+
#
|
243
|
+
# * Running stacks: You can specify either the stack's name or its
|
244
|
+
# unique stack ID.
|
245
|
+
#
|
246
|
+
# * Deleted stacks: You must specify the unique stack ID.
|
247
|
+
#
|
248
|
+
# Default: There is no default value.
|
249
|
+
# @return [Stack::Collection]
|
250
|
+
def stacks(options = {})
|
251
|
+
batches = Enumerator.new do |y|
|
252
|
+
resp = @client.describe_stacks(options)
|
253
|
+
resp.each_page do |page|
|
254
|
+
batch = []
|
255
|
+
page.data.stacks.each do |s|
|
256
|
+
batch << Stack.new(
|
257
|
+
name: s.stack_name,
|
258
|
+
data: s,
|
259
|
+
client: @client
|
260
|
+
)
|
264
261
|
end
|
262
|
+
y.yield(batch)
|
265
263
|
end
|
266
|
-
Stack::Collection.new(batches)
|
267
264
|
end
|
268
|
-
|
265
|
+
Stack::Collection.new(batches)
|
269
266
|
end
|
267
|
+
|
270
268
|
end
|
271
269
|
end
|