AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
LaunchSpecification.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/ec2/EC2_EXPORTS.h>
11#include <aws/ec2/model/BlockDeviceMapping.h>
12#include <aws/ec2/model/GroupIdentifier.h>
13#include <aws/ec2/model/IamInstanceProfileSpecification.h>
14#include <aws/ec2/model/InstanceNetworkInterfaceSpecification.h>
15#include <aws/ec2/model/InstanceType.h>
16#include <aws/ec2/model/RunInstancesMonitoringEnabled.h>
17#include <aws/ec2/model/SpotPlacement.h>
18
19#include <utility>
20
21namespace Aws {
22namespace Utils {
23namespace Xml {
24class XmlNode;
25} // namespace Xml
26} // namespace Utils
27namespace EC2 {
28namespace Model {
29
37 public:
38 AWS_EC2_API LaunchSpecification() = default;
39 AWS_EC2_API LaunchSpecification(const Aws::Utils::Xml::XmlNode& xmlNode);
41
42 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
43 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
44
46
50 inline const Aws::String& GetUserData() const { return m_userData; }
51 inline bool UserDataHasBeenSet() const { return m_userDataHasBeenSet; }
52 template <typename UserDataT = Aws::String>
53 void SetUserData(UserDataT&& value) {
54 m_userDataHasBeenSet = true;
55 m_userData = std::forward<UserDataT>(value);
56 }
57 template <typename UserDataT = Aws::String>
58 LaunchSpecification& WithUserData(UserDataT&& value) {
59 SetUserData(std::forward<UserDataT>(value));
60 return *this;
61 }
63
65
68 inline const Aws::String& GetAddressingType() const { return m_addressingType; }
69 inline bool AddressingTypeHasBeenSet() const { return m_addressingTypeHasBeenSet; }
70 template <typename AddressingTypeT = Aws::String>
71 void SetAddressingType(AddressingTypeT&& value) {
72 m_addressingTypeHasBeenSet = true;
73 m_addressingType = std::forward<AddressingTypeT>(value);
74 }
75 template <typename AddressingTypeT = Aws::String>
76 LaunchSpecification& WithAddressingType(AddressingTypeT&& value) {
77 SetAddressingType(std::forward<AddressingTypeT>(value));
78 return *this;
79 }
81
83
86 inline const Aws::Vector<BlockDeviceMapping>& GetBlockDeviceMappings() const { return m_blockDeviceMappings; }
87 inline bool BlockDeviceMappingsHasBeenSet() const { return m_blockDeviceMappingsHasBeenSet; }
88 template <typename BlockDeviceMappingsT = Aws::Vector<BlockDeviceMapping>>
89 void SetBlockDeviceMappings(BlockDeviceMappingsT&& value) {
90 m_blockDeviceMappingsHasBeenSet = true;
91 m_blockDeviceMappings = std::forward<BlockDeviceMappingsT>(value);
92 }
93 template <typename BlockDeviceMappingsT = Aws::Vector<BlockDeviceMapping>>
94 LaunchSpecification& WithBlockDeviceMappings(BlockDeviceMappingsT&& value) {
95 SetBlockDeviceMappings(std::forward<BlockDeviceMappingsT>(value));
96 return *this;
97 }
98 template <typename BlockDeviceMappingsT = BlockDeviceMapping>
99 LaunchSpecification& AddBlockDeviceMappings(BlockDeviceMappingsT&& value) {
100 m_blockDeviceMappingsHasBeenSet = true;
101 m_blockDeviceMappings.emplace_back(std::forward<BlockDeviceMappingsT>(value));
102 return *this;
103 }
105
107
114 inline bool GetEbsOptimized() const { return m_ebsOptimized; }
115 inline bool EbsOptimizedHasBeenSet() const { return m_ebsOptimizedHasBeenSet; }
116 inline void SetEbsOptimized(bool value) {
117 m_ebsOptimizedHasBeenSet = true;
118 m_ebsOptimized = value;
119 }
121 SetEbsOptimized(value);
122 return *this;
123 }
125
127
130 inline const IamInstanceProfileSpecification& GetIamInstanceProfile() const { return m_iamInstanceProfile; }
131 inline bool IamInstanceProfileHasBeenSet() const { return m_iamInstanceProfileHasBeenSet; }
132 template <typename IamInstanceProfileT = IamInstanceProfileSpecification>
133 void SetIamInstanceProfile(IamInstanceProfileT&& value) {
134 m_iamInstanceProfileHasBeenSet = true;
135 m_iamInstanceProfile = std::forward<IamInstanceProfileT>(value);
136 }
137 template <typename IamInstanceProfileT = IamInstanceProfileSpecification>
138 LaunchSpecification& WithIamInstanceProfile(IamInstanceProfileT&& value) {
139 SetIamInstanceProfile(std::forward<IamInstanceProfileT>(value));
140 return *this;
141 }
143
145
148 inline const Aws::String& GetImageId() const { return m_imageId; }
149 inline bool ImageIdHasBeenSet() const { return m_imageIdHasBeenSet; }
150 template <typename ImageIdT = Aws::String>
151 void SetImageId(ImageIdT&& value) {
152 m_imageIdHasBeenSet = true;
153 m_imageId = std::forward<ImageIdT>(value);
154 }
155 template <typename ImageIdT = Aws::String>
156 LaunchSpecification& WithImageId(ImageIdT&& value) {
157 SetImageId(std::forward<ImageIdT>(value));
158 return *this;
159 }
161
163
166 inline InstanceType GetInstanceType() const { return m_instanceType; }
167 inline bool InstanceTypeHasBeenSet() const { return m_instanceTypeHasBeenSet; }
168 inline void SetInstanceType(InstanceType value) {
169 m_instanceTypeHasBeenSet = true;
170 m_instanceType = value;
171 }
173 SetInstanceType(value);
174 return *this;
175 }
177
179
182 inline const Aws::String& GetKernelId() const { return m_kernelId; }
183 inline bool KernelIdHasBeenSet() const { return m_kernelIdHasBeenSet; }
184 template <typename KernelIdT = Aws::String>
185 void SetKernelId(KernelIdT&& value) {
186 m_kernelIdHasBeenSet = true;
187 m_kernelId = std::forward<KernelIdT>(value);
188 }
189 template <typename KernelIdT = Aws::String>
190 LaunchSpecification& WithKernelId(KernelIdT&& value) {
191 SetKernelId(std::forward<KernelIdT>(value));
192 return *this;
193 }
195
197
200 inline const Aws::String& GetKeyName() const { return m_keyName; }
201 inline bool KeyNameHasBeenSet() const { return m_keyNameHasBeenSet; }
202 template <typename KeyNameT = Aws::String>
203 void SetKeyName(KeyNameT&& value) {
204 m_keyNameHasBeenSet = true;
205 m_keyName = std::forward<KeyNameT>(value);
206 }
207 template <typename KeyNameT = Aws::String>
208 LaunchSpecification& WithKeyName(KeyNameT&& value) {
209 SetKeyName(std::forward<KeyNameT>(value));
210 return *this;
211 }
213
215
219 inline const Aws::Vector<InstanceNetworkInterfaceSpecification>& GetNetworkInterfaces() const { return m_networkInterfaces; }
220 inline bool NetworkInterfacesHasBeenSet() const { return m_networkInterfacesHasBeenSet; }
221 template <typename NetworkInterfacesT = Aws::Vector<InstanceNetworkInterfaceSpecification>>
222 void SetNetworkInterfaces(NetworkInterfacesT&& value) {
223 m_networkInterfacesHasBeenSet = true;
224 m_networkInterfaces = std::forward<NetworkInterfacesT>(value);
225 }
226 template <typename NetworkInterfacesT = Aws::Vector<InstanceNetworkInterfaceSpecification>>
227 LaunchSpecification& WithNetworkInterfaces(NetworkInterfacesT&& value) {
228 SetNetworkInterfaces(std::forward<NetworkInterfacesT>(value));
229 return *this;
230 }
231 template <typename NetworkInterfacesT = InstanceNetworkInterfaceSpecification>
232 LaunchSpecification& AddNetworkInterfaces(NetworkInterfacesT&& value) {
233 m_networkInterfacesHasBeenSet = true;
234 m_networkInterfaces.emplace_back(std::forward<NetworkInterfacesT>(value));
235 return *this;
236 }
238
240
243 inline const SpotPlacement& GetPlacement() const { return m_placement; }
244 inline bool PlacementHasBeenSet() const { return m_placementHasBeenSet; }
245 template <typename PlacementT = SpotPlacement>
246 void SetPlacement(PlacementT&& value) {
247 m_placementHasBeenSet = true;
248 m_placement = std::forward<PlacementT>(value);
249 }
250 template <typename PlacementT = SpotPlacement>
251 LaunchSpecification& WithPlacement(PlacementT&& value) {
252 SetPlacement(std::forward<PlacementT>(value));
253 return *this;
254 }
256
258
261 inline const Aws::String& GetRamdiskId() const { return m_ramdiskId; }
262 inline bool RamdiskIdHasBeenSet() const { return m_ramdiskIdHasBeenSet; }
263 template <typename RamdiskIdT = Aws::String>
264 void SetRamdiskId(RamdiskIdT&& value) {
265 m_ramdiskIdHasBeenSet = true;
266 m_ramdiskId = std::forward<RamdiskIdT>(value);
267 }
268 template <typename RamdiskIdT = Aws::String>
269 LaunchSpecification& WithRamdiskId(RamdiskIdT&& value) {
270 SetRamdiskId(std::forward<RamdiskIdT>(value));
271 return *this;
272 }
274
276
279 inline const Aws::String& GetSubnetId() const { return m_subnetId; }
280 inline bool SubnetIdHasBeenSet() const { return m_subnetIdHasBeenSet; }
281 template <typename SubnetIdT = Aws::String>
282 void SetSubnetId(SubnetIdT&& value) {
283 m_subnetIdHasBeenSet = true;
284 m_subnetId = std::forward<SubnetIdT>(value);
285 }
286 template <typename SubnetIdT = Aws::String>
287 LaunchSpecification& WithSubnetId(SubnetIdT&& value) {
288 SetSubnetId(std::forward<SubnetIdT>(value));
289 return *this;
290 }
292
294
297 inline const Aws::Vector<GroupIdentifier>& GetSecurityGroups() const { return m_securityGroups; }
298 inline bool SecurityGroupsHasBeenSet() const { return m_securityGroupsHasBeenSet; }
299 template <typename SecurityGroupsT = Aws::Vector<GroupIdentifier>>
300 void SetSecurityGroups(SecurityGroupsT&& value) {
301 m_securityGroupsHasBeenSet = true;
302 m_securityGroups = std::forward<SecurityGroupsT>(value);
303 }
304 template <typename SecurityGroupsT = Aws::Vector<GroupIdentifier>>
305 LaunchSpecification& WithSecurityGroups(SecurityGroupsT&& value) {
306 SetSecurityGroups(std::forward<SecurityGroupsT>(value));
307 return *this;
308 }
309 template <typename SecurityGroupsT = GroupIdentifier>
310 LaunchSpecification& AddSecurityGroups(SecurityGroupsT&& value) {
311 m_securityGroupsHasBeenSet = true;
312 m_securityGroups.emplace_back(std::forward<SecurityGroupsT>(value));
313 return *this;
314 }
316
318
319 inline const RunInstancesMonitoringEnabled& GetMonitoring() const { return m_monitoring; }
320 inline bool MonitoringHasBeenSet() const { return m_monitoringHasBeenSet; }
321 template <typename MonitoringT = RunInstancesMonitoringEnabled>
322 void SetMonitoring(MonitoringT&& value) {
323 m_monitoringHasBeenSet = true;
324 m_monitoring = std::forward<MonitoringT>(value);
325 }
326 template <typename MonitoringT = RunInstancesMonitoringEnabled>
327 LaunchSpecification& WithMonitoring(MonitoringT&& value) {
328 SetMonitoring(std::forward<MonitoringT>(value));
329 return *this;
330 }
332 private:
333 Aws::String m_userData;
334
335 Aws::String m_addressingType;
336
337 Aws::Vector<BlockDeviceMapping> m_blockDeviceMappings;
338
339 bool m_ebsOptimized{false};
340
341 IamInstanceProfileSpecification m_iamInstanceProfile;
342
343 Aws::String m_imageId;
344
345 InstanceType m_instanceType{InstanceType::NOT_SET};
346
347 Aws::String m_kernelId;
348
349 Aws::String m_keyName;
350
352
353 SpotPlacement m_placement;
354
355 Aws::String m_ramdiskId;
356
357 Aws::String m_subnetId;
358
359 Aws::Vector<GroupIdentifier> m_securityGroups;
360
361 RunInstancesMonitoringEnabled m_monitoring;
362 bool m_userDataHasBeenSet = false;
363 bool m_addressingTypeHasBeenSet = false;
364 bool m_blockDeviceMappingsHasBeenSet = false;
365 bool m_ebsOptimizedHasBeenSet = false;
366 bool m_iamInstanceProfileHasBeenSet = false;
367 bool m_imageIdHasBeenSet = false;
368 bool m_instanceTypeHasBeenSet = false;
369 bool m_kernelIdHasBeenSet = false;
370 bool m_keyNameHasBeenSet = false;
371 bool m_networkInterfacesHasBeenSet = false;
372 bool m_placementHasBeenSet = false;
373 bool m_ramdiskIdHasBeenSet = false;
374 bool m_subnetIdHasBeenSet = false;
375 bool m_securityGroupsHasBeenSet = false;
376 bool m_monitoringHasBeenSet = false;
377};
378
379} // namespace Model
380} // namespace EC2
381} // namespace Aws
LaunchSpecification & WithUserData(UserDataT &&value)
AWS_EC2_API void OutputToStream(Aws::OStream &ostream, const char *location, unsigned index, const char *locationValue) const
LaunchSpecification & WithKeyName(KeyNameT &&value)
void SetNetworkInterfaces(NetworkInterfacesT &&value)
LaunchSpecification & WithInstanceType(InstanceType value)
void SetAddressingType(AddressingTypeT &&value)
const Aws::String & GetKeyName() const
void SetSecurityGroups(SecurityGroupsT &&value)
const RunInstancesMonitoringEnabled & GetMonitoring() const
LaunchSpecification & WithRamdiskId(RamdiskIdT &&value)
const Aws::Vector< InstanceNetworkInterfaceSpecification > & GetNetworkInterfaces() const
AWS_EC2_API LaunchSpecification()=default
LaunchSpecification & WithKernelId(KernelIdT &&value)
LaunchSpecification & AddSecurityGroups(SecurityGroupsT &&value)
const Aws::Vector< GroupIdentifier > & GetSecurityGroups() const
LaunchSpecification & WithBlockDeviceMappings(BlockDeviceMappingsT &&value)
AWS_EC2_API LaunchSpecification & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
const Aws::String & GetKernelId() const
void SetBlockDeviceMappings(BlockDeviceMappingsT &&value)
LaunchSpecification & WithIamInstanceProfile(IamInstanceProfileT &&value)
const Aws::String & GetUserData() const
LaunchSpecification & AddBlockDeviceMappings(BlockDeviceMappingsT &&value)
LaunchSpecification & WithNetworkInterfaces(NetworkInterfacesT &&value)
LaunchSpecification & WithSecurityGroups(SecurityGroupsT &&value)
LaunchSpecification & WithMonitoring(MonitoringT &&value)
LaunchSpecification & AddNetworkInterfaces(NetworkInterfacesT &&value)
AWS_EC2_API LaunchSpecification(const Aws::Utils::Xml::XmlNode &xmlNode)
const Aws::String & GetRamdiskId() const
LaunchSpecification & WithPlacement(PlacementT &&value)
void SetIamInstanceProfile(IamInstanceProfileT &&value)
AWS_EC2_API void OutputToStream(Aws::OStream &oStream, const char *location) const
LaunchSpecification & WithImageId(ImageIdT &&value)
const IamInstanceProfileSpecification & GetIamInstanceProfile() const
LaunchSpecification & WithSubnetId(SubnetIdT &&value)
const Aws::String & GetSubnetId() const
const Aws::String & GetAddressingType() const
const SpotPlacement & GetPlacement() const
const Aws::Vector< BlockDeviceMapping > & GetBlockDeviceMappings() const
const Aws::String & GetImageId() const
LaunchSpecification & WithAddressingType(AddressingTypeT &&value)
LaunchSpecification & WithEbsOptimized(bool value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
std::basic_ostream< char, std::char_traits< char > > OStream