1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 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 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 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 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct RunInstancesInput {
/// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub block_device_mappings: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>,
/// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
pub image_id: ::std::option::Option<::std::string::String>,
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub instance_type: ::std::option::Option<crate::types::InstanceType>,
/// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub ipv6_address_count: ::std::option::Option<i32>,
/// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub ipv6_addresses: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>,
/// <p>The ID of the kernel.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub kernel_id: ::std::option::Option<::std::string::String>,
/// <p>The name of the key pair. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.</p><important>
/// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
/// </important>
pub key_name: ::std::option::Option<::std::string::String>,
/// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub max_count: ::std::option::Option<i32>,
/// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub min_count: ::std::option::Option<i32>,
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub monitoring: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>,
/// <p>The placement for the instance.</p>
pub placement: ::std::option::Option<crate::types::Placement>,
/// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub ramdisk_id: ::std::option::Option<::std::string::String>,
/// <p>The IDs of the security groups. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub security_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub subnet_id: ::std::option::Option<::std::string::String>,
/// <p>The user data script to make available to the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands on your Amazon EC2 instance at launch</a> in the <i>Amazon EC2 User Guide</i>. If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>
pub user_data: ::std::option::Option<::std::string::String>,
/// <p>Reserved.</p>
pub additional_info: ::std::option::Option<::std::string::String>,
/// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub client_token: ::std::option::Option<::std::string::String>,
/// <p>If you set this parameter to <code>true</code>, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html">ModifyInstanceAttribute</a>. Alternatively, if you set <code>InstanceInitiatedShutdownBehavior</code> to <code>terminate</code>, you can terminate the instance by running the shutdown command from the instance.</p>
/// <p>Default: <code>false</code></p>
pub disable_api_termination: ::std::option::Option<bool>,
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub dry_run: ::std::option::Option<bool>,
/// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
/// <p>Default: <code>false</code></p>
pub ebs_optimized: ::std::option::Option<bool>,
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub iam_instance_profile: ::std::option::Option<crate::types::IamInstanceProfileSpecification>,
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub instance_initiated_shutdown_behavior: ::std::option::Option<crate::types::ShutdownBehavior>,
/// <p>The network interfaces to associate with the instance.</p>
pub network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub private_ip_address: ::std::option::Option<::std::string::String>,
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
pub elastic_gpu_specification: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>,
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference (EI) is no longer available to new customers. For more information, see <a href="http://aws.amazon.com/machine-learning/elastic-inference/faqs/">Amazon Elastic Inference FAQs</a>.</p>
/// </note>
pub elastic_inference_accelerators: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub launch_template: ::std::option::Option<crate::types::LaunchTemplateSpecification>,
/// <p>The market (purchasing) option for the instances.</p>
/// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
pub instance_market_options: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>,
/// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub credit_specification: ::std::option::Option<crate::types::CreditSpecificationRequest>,
/// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub cpu_options: ::std::option::Option<crate::types::CpuOptionsRequest>,
/// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).</p>
pub capacity_reservation_specification: ::std::option::Option<crate::types::CapacityReservationSpecification>,
/// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub hibernation_options: ::std::option::Option<crate::types::HibernationOptionsRequest>,
/// <p>The license configurations.</p>
pub license_specifications: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>,
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
pub metadata_options: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>,
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub enclave_options: ::std::option::Option<crate::types::EnclaveOptionsRequest>,
/// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
pub private_dns_name_options: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>,
/// <p>The maintenance and recovery options for the instance.</p>
pub maintenance_options: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>,
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
pub disable_api_stop: ::std::option::Option<bool>,
/// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
pub enable_primary_ipv6: ::std::option::Option<bool>,
}
impl RunInstancesInput {
/// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.block_device_mappings.is_none()`.
pub fn block_device_mappings(&self) -> &[crate::types::BlockDeviceMapping] {
self.block_device_mappings.as_deref().unwrap_or_default()
}
/// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
pub fn image_id(&self) -> ::std::option::Option<&str> {
self.image_id.as_deref()
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn instance_type(&self) -> ::std::option::Option<&crate::types::InstanceType> {
self.instance_type.as_ref()
}
/// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn ipv6_address_count(&self) -> ::std::option::Option<i32> {
self.ipv6_address_count
}
/// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ipv6_addresses.is_none()`.
pub fn ipv6_addresses(&self) -> &[crate::types::InstanceIpv6Address] {
self.ipv6_addresses.as_deref().unwrap_or_default()
}
/// <p>The ID of the kernel.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn kernel_id(&self) -> ::std::option::Option<&str> {
self.kernel_id.as_deref()
}
/// <p>The name of the key pair. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.</p><important>
/// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
/// </important>
pub fn key_name(&self) -> ::std::option::Option<&str> {
self.key_name.as_deref()
}
/// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub fn max_count(&self) -> ::std::option::Option<i32> {
self.max_count
}
/// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub fn min_count(&self) -> ::std::option::Option<i32> {
self.min_count
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn monitoring(&self) -> ::std::option::Option<&crate::types::RunInstancesMonitoringEnabled> {
self.monitoring.as_ref()
}
/// <p>The placement for the instance.</p>
pub fn placement(&self) -> ::std::option::Option<&crate::types::Placement> {
self.placement.as_ref()
}
/// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn ramdisk_id(&self) -> ::std::option::Option<&str> {
self.ramdisk_id.as_deref()
}
/// <p>The IDs of the security groups. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
pub fn security_group_ids(&self) -> &[::std::string::String] {
self.security_group_ids.as_deref().unwrap_or_default()
}
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
/// <p>Default: Amazon EC2 uses the default security group.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_groups.is_none()`.
pub fn security_groups(&self) -> &[::std::string::String] {
self.security_groups.as_deref().unwrap_or_default()
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn subnet_id(&self) -> ::std::option::Option<&str> {
self.subnet_id.as_deref()
}
/// <p>The user data script to make available to the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands on your Amazon EC2 instance at launch</a> in the <i>Amazon EC2 User Guide</i>. If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>
pub fn user_data(&self) -> ::std::option::Option<&str> {
self.user_data.as_deref()
}
/// <p>Reserved.</p>
pub fn additional_info(&self) -> ::std::option::Option<&str> {
self.additional_info.as_deref()
}
/// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
/// <p>If you set this parameter to <code>true</code>, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html">ModifyInstanceAttribute</a>. Alternatively, if you set <code>InstanceInitiatedShutdownBehavior</code> to <code>terminate</code>, you can terminate the instance by running the shutdown command from the instance.</p>
/// <p>Default: <code>false</code></p>
pub fn disable_api_termination(&self) -> ::std::option::Option<bool> {
self.disable_api_termination
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
/// <p>Default: <code>false</code></p>
pub fn ebs_optimized(&self) -> ::std::option::Option<bool> {
self.ebs_optimized
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn iam_instance_profile(&self) -> ::std::option::Option<&crate::types::IamInstanceProfileSpecification> {
self.iam_instance_profile.as_ref()
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn instance_initiated_shutdown_behavior(&self) -> ::std::option::Option<&crate::types::ShutdownBehavior> {
self.instance_initiated_shutdown_behavior.as_ref()
}
/// <p>The network interfaces to associate with the instance.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.network_interfaces.is_none()`.
pub fn network_interfaces(&self) -> &[crate::types::InstanceNetworkInterfaceSpecification] {
self.network_interfaces.as_deref().unwrap_or_default()
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn private_ip_address(&self) -> ::std::option::Option<&str> {
self.private_ip_address.as_deref()
}
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.elastic_gpu_specification.is_none()`.
pub fn elastic_gpu_specification(&self) -> &[crate::types::ElasticGpuSpecification] {
self.elastic_gpu_specification.as_deref().unwrap_or_default()
}
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference (EI) is no longer available to new customers. For more information, see <a href="http://aws.amazon.com/machine-learning/elastic-inference/faqs/">Amazon Elastic Inference FAQs</a>.</p>
/// </note>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.elastic_inference_accelerators.is_none()`.
pub fn elastic_inference_accelerators(&self) -> &[crate::types::ElasticInferenceAccelerator] {
self.elastic_inference_accelerators.as_deref().unwrap_or_default()
}
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
self.tag_specifications.as_deref().unwrap_or_default()
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn launch_template(&self) -> ::std::option::Option<&crate::types::LaunchTemplateSpecification> {
self.launch_template.as_ref()
}
/// <p>The market (purchasing) option for the instances.</p>
/// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
pub fn instance_market_options(&self) -> ::std::option::Option<&crate::types::InstanceMarketOptionsRequest> {
self.instance_market_options.as_ref()
}
/// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn credit_specification(&self) -> ::std::option::Option<&crate::types::CreditSpecificationRequest> {
self.credit_specification.as_ref()
}
/// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn cpu_options(&self) -> ::std::option::Option<&crate::types::CpuOptionsRequest> {
self.cpu_options.as_ref()
}
/// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).</p>
pub fn capacity_reservation_specification(&self) -> ::std::option::Option<&crate::types::CapacityReservationSpecification> {
self.capacity_reservation_specification.as_ref()
}
/// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn hibernation_options(&self) -> ::std::option::Option<&crate::types::HibernationOptionsRequest> {
self.hibernation_options.as_ref()
}
/// <p>The license configurations.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.license_specifications.is_none()`.
pub fn license_specifications(&self) -> &[crate::types::LicenseConfigurationRequest] {
self.license_specifications.as_deref().unwrap_or_default()
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
pub fn metadata_options(&self) -> ::std::option::Option<&crate::types::InstanceMetadataOptionsRequest> {
self.metadata_options.as_ref()
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn enclave_options(&self) -> ::std::option::Option<&crate::types::EnclaveOptionsRequest> {
self.enclave_options.as_ref()
}
/// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
pub fn private_dns_name_options(&self) -> ::std::option::Option<&crate::types::PrivateDnsNameOptionsRequest> {
self.private_dns_name_options.as_ref()
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn maintenance_options(&self) -> ::std::option::Option<&crate::types::InstanceMaintenanceOptionsRequest> {
self.maintenance_options.as_ref()
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
pub fn disable_api_stop(&self) -> ::std::option::Option<bool> {
self.disable_api_stop
}
/// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
pub fn enable_primary_ipv6(&self) -> ::std::option::Option<bool> {
self.enable_primary_ipv6
}
}
impl ::std::fmt::Debug for RunInstancesInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("RunInstancesInput");
formatter.field("block_device_mappings", &self.block_device_mappings);
formatter.field("image_id", &self.image_id);
formatter.field("instance_type", &self.instance_type);
formatter.field("ipv6_address_count", &self.ipv6_address_count);
formatter.field("ipv6_addresses", &self.ipv6_addresses);
formatter.field("kernel_id", &self.kernel_id);
formatter.field("key_name", &self.key_name);
formatter.field("max_count", &self.max_count);
formatter.field("min_count", &self.min_count);
formatter.field("monitoring", &self.monitoring);
formatter.field("placement", &self.placement);
formatter.field("ramdisk_id", &self.ramdisk_id);
formatter.field("security_group_ids", &self.security_group_ids);
formatter.field("security_groups", &self.security_groups);
formatter.field("subnet_id", &self.subnet_id);
formatter.field("user_data", &"*** Sensitive Data Redacted ***");
formatter.field("additional_info", &self.additional_info);
formatter.field("client_token", &self.client_token);
formatter.field("disable_api_termination", &self.disable_api_termination);
formatter.field("dry_run", &self.dry_run);
formatter.field("ebs_optimized", &self.ebs_optimized);
formatter.field("iam_instance_profile", &self.iam_instance_profile);
formatter.field("instance_initiated_shutdown_behavior", &self.instance_initiated_shutdown_behavior);
formatter.field("network_interfaces", &self.network_interfaces);
formatter.field("private_ip_address", &self.private_ip_address);
formatter.field("elastic_gpu_specification", &self.elastic_gpu_specification);
formatter.field("elastic_inference_accelerators", &self.elastic_inference_accelerators);
formatter.field("tag_specifications", &self.tag_specifications);
formatter.field("launch_template", &self.launch_template);
formatter.field("instance_market_options", &self.instance_market_options);
formatter.field("credit_specification", &self.credit_specification);
formatter.field("cpu_options", &self.cpu_options);
formatter.field("capacity_reservation_specification", &self.capacity_reservation_specification);
formatter.field("hibernation_options", &self.hibernation_options);
formatter.field("license_specifications", &self.license_specifications);
formatter.field("metadata_options", &self.metadata_options);
formatter.field("enclave_options", &self.enclave_options);
formatter.field("private_dns_name_options", &self.private_dns_name_options);
formatter.field("maintenance_options", &self.maintenance_options);
formatter.field("disable_api_stop", &self.disable_api_stop);
formatter.field("enable_primary_ipv6", &self.enable_primary_ipv6);
formatter.finish()
}
}
impl RunInstancesInput {
/// Creates a new builder-style object to manufacture [`RunInstancesInput`](crate::operation::run_instances::RunInstancesInput).
pub fn builder() -> crate::operation::run_instances::builders::RunInstancesInputBuilder {
crate::operation::run_instances::builders::RunInstancesInputBuilder::default()
}
}
/// A builder for [`RunInstancesInput`](crate::operation::run_instances::RunInstancesInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct RunInstancesInputBuilder {
pub(crate) block_device_mappings: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>,
pub(crate) image_id: ::std::option::Option<::std::string::String>,
pub(crate) instance_type: ::std::option::Option<crate::types::InstanceType>,
pub(crate) ipv6_address_count: ::std::option::Option<i32>,
pub(crate) ipv6_addresses: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>,
pub(crate) kernel_id: ::std::option::Option<::std::string::String>,
pub(crate) key_name: ::std::option::Option<::std::string::String>,
pub(crate) max_count: ::std::option::Option<i32>,
pub(crate) min_count: ::std::option::Option<i32>,
pub(crate) monitoring: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>,
pub(crate) placement: ::std::option::Option<crate::types::Placement>,
pub(crate) ramdisk_id: ::std::option::Option<::std::string::String>,
pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) security_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
pub(crate) user_data: ::std::option::Option<::std::string::String>,
pub(crate) additional_info: ::std::option::Option<::std::string::String>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) disable_api_termination: ::std::option::Option<bool>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) ebs_optimized: ::std::option::Option<bool>,
pub(crate) iam_instance_profile: ::std::option::Option<crate::types::IamInstanceProfileSpecification>,
pub(crate) instance_initiated_shutdown_behavior: ::std::option::Option<crate::types::ShutdownBehavior>,
pub(crate) network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
pub(crate) elastic_gpu_specification: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>,
pub(crate) elastic_inference_accelerators: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
pub(crate) launch_template: ::std::option::Option<crate::types::LaunchTemplateSpecification>,
pub(crate) instance_market_options: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>,
pub(crate) credit_specification: ::std::option::Option<crate::types::CreditSpecificationRequest>,
pub(crate) cpu_options: ::std::option::Option<crate::types::CpuOptionsRequest>,
pub(crate) capacity_reservation_specification: ::std::option::Option<crate::types::CapacityReservationSpecification>,
pub(crate) hibernation_options: ::std::option::Option<crate::types::HibernationOptionsRequest>,
pub(crate) license_specifications: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>,
pub(crate) metadata_options: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>,
pub(crate) enclave_options: ::std::option::Option<crate::types::EnclaveOptionsRequest>,
pub(crate) private_dns_name_options: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>,
pub(crate) maintenance_options: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>,
pub(crate) disable_api_stop: ::std::option::Option<bool>,
pub(crate) enable_primary_ipv6: ::std::option::Option<bool>,
}
impl RunInstancesInputBuilder {
/// Appends an item to `block_device_mappings`.
///
/// To override the contents of this collection use [`set_block_device_mappings`](Self::set_block_device_mappings).
///
/// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn block_device_mappings(mut self, input: crate::types::BlockDeviceMapping) -> Self {
let mut v = self.block_device_mappings.unwrap_or_default();
v.push(input);
self.block_device_mappings = ::std::option::Option::Some(v);
self
}
/// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn set_block_device_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>) -> Self {
self.block_device_mappings = input;
self
}
/// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn get_block_device_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>> {
&self.block_device_mappings
}
/// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.image_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.image_id = input;
self
}
/// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
&self.image_id
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
self.instance_type = ::std::option::Option::Some(input);
self
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
self.instance_type = input;
self
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
&self.instance_type
}
/// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn ipv6_address_count(mut self, input: i32) -> Self {
self.ipv6_address_count = ::std::option::Option::Some(input);
self
}
/// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn set_ipv6_address_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.ipv6_address_count = input;
self
}
/// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn get_ipv6_address_count(&self) -> &::std::option::Option<i32> {
&self.ipv6_address_count
}
/// Appends an item to `ipv6_addresses`.
///
/// To override the contents of this collection use [`set_ipv6_addresses`](Self::set_ipv6_addresses).
///
/// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn ipv6_addresses(mut self, input: crate::types::InstanceIpv6Address) -> Self {
let mut v = self.ipv6_addresses.unwrap_or_default();
v.push(input);
self.ipv6_addresses = ::std::option::Option::Some(v);
self
}
/// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn set_ipv6_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>) -> Self {
self.ipv6_addresses = input;
self
}
/// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn get_ipv6_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>> {
&self.ipv6_addresses
}
/// <p>The ID of the kernel.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn kernel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kernel_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the kernel.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn set_kernel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kernel_id = input;
self
}
/// <p>The ID of the kernel.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn get_kernel_id(&self) -> &::std::option::Option<::std::string::String> {
&self.kernel_id
}
/// <p>The name of the key pair. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.</p><important>
/// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
/// </important>
pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the key pair. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.</p><important>
/// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
/// </important>
pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key_name = input;
self
}
/// <p>The name of the key pair. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.</p><important>
/// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
/// </important>
pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
&self.key_name
}
/// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
/// This field is required.
pub fn max_count(mut self, input: i32) -> Self {
self.max_count = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_count = input;
self
}
/// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub fn get_max_count(&self) -> &::std::option::Option<i32> {
&self.max_count
}
/// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
/// This field is required.
pub fn min_count(mut self, input: i32) -> Self {
self.min_count = ::std::option::Option::Some(input);
self
}
/// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub fn set_min_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.min_count = input;
self
}
/// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
/// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
pub fn get_min_count(&self) -> &::std::option::Option<i32> {
&self.min_count
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn monitoring(mut self, input: crate::types::RunInstancesMonitoringEnabled) -> Self {
self.monitoring = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn set_monitoring(mut self, input: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>) -> Self {
self.monitoring = input;
self
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn get_monitoring(&self) -> &::std::option::Option<crate::types::RunInstancesMonitoringEnabled> {
&self.monitoring
}
/// <p>The placement for the instance.</p>
pub fn placement(mut self, input: crate::types::Placement) -> Self {
self.placement = ::std::option::Option::Some(input);
self
}
/// <p>The placement for the instance.</p>
pub fn set_placement(mut self, input: ::std::option::Option<crate::types::Placement>) -> Self {
self.placement = input;
self
}
/// <p>The placement for the instance.</p>
pub fn get_placement(&self) -> &::std::option::Option<crate::types::Placement> {
&self.placement
}
/// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn ramdisk_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.ramdisk_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn set_ramdisk_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.ramdisk_id = input;
self
}
/// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
/// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// </important>
pub fn get_ramdisk_id(&self) -> &::std::option::Option<::std::string::String> {
&self.ramdisk_id
}
/// Appends an item to `security_group_ids`.
///
/// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
///
/// <p>The IDs of the security groups. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.security_group_ids.unwrap_or_default();
v.push(input.into());
self.security_group_ids = ::std::option::Option::Some(v);
self
}
/// <p>The IDs of the security groups. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.security_group_ids = input;
self
}
/// <p>The IDs of the security groups. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.security_group_ids
}
/// Appends an item to `security_groups`.
///
/// To override the contents of this collection use [`set_security_groups`](Self::set_security_groups).
///
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub fn security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.security_groups.unwrap_or_default();
v.push(input.into());
self.security_groups = ::std::option::Option::Some(v);
self
}
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub fn set_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.security_groups = input;
self
}
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub fn get_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.security_groups
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.subnet_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.subnet_id = input;
self
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
&self.subnet_id
}
/// <p>The user data script to make available to the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands on your Amazon EC2 instance at launch</a> in the <i>Amazon EC2 User Guide</i>. If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>
pub fn user_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.user_data = ::std::option::Option::Some(input.into());
self
}
/// <p>The user data script to make available to the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands on your Amazon EC2 instance at launch</a> in the <i>Amazon EC2 User Guide</i>. If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>
pub fn set_user_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.user_data = input;
self
}
/// <p>The user data script to make available to the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands on your Amazon EC2 instance at launch</a> in the <i>Amazon EC2 User Guide</i>. If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>
pub fn get_user_data(&self) -> &::std::option::Option<::std::string::String> {
&self.user_data
}
/// <p>Reserved.</p>
pub fn additional_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.additional_info = ::std::option::Option::Some(input.into());
self
}
/// <p>Reserved.</p>
pub fn set_additional_info(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.additional_info = input;
self
}
/// <p>Reserved.</p>
pub fn get_additional_info(&self) -> &::std::option::Option<::std::string::String> {
&self.additional_info
}
/// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// <p>If you set this parameter to <code>true</code>, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html">ModifyInstanceAttribute</a>. Alternatively, if you set <code>InstanceInitiatedShutdownBehavior</code> to <code>terminate</code>, you can terminate the instance by running the shutdown command from the instance.</p>
/// <p>Default: <code>false</code></p>
pub fn disable_api_termination(mut self, input: bool) -> Self {
self.disable_api_termination = ::std::option::Option::Some(input);
self
}
/// <p>If you set this parameter to <code>true</code>, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html">ModifyInstanceAttribute</a>. Alternatively, if you set <code>InstanceInitiatedShutdownBehavior</code> to <code>terminate</code>, you can terminate the instance by running the shutdown command from the instance.</p>
/// <p>Default: <code>false</code></p>
pub fn set_disable_api_termination(mut self, input: ::std::option::Option<bool>) -> Self {
self.disable_api_termination = input;
self
}
/// <p>If you set this parameter to <code>true</code>, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html">ModifyInstanceAttribute</a>. Alternatively, if you set <code>InstanceInitiatedShutdownBehavior</code> to <code>terminate</code>, you can terminate the instance by running the shutdown command from the instance.</p>
/// <p>Default: <code>false</code></p>
pub fn get_disable_api_termination(&self) -> &::std::option::Option<bool> {
&self.disable_api_termination
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
/// <p>Default: <code>false</code></p>
pub fn ebs_optimized(mut self, input: bool) -> Self {
self.ebs_optimized = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
/// <p>Default: <code>false</code></p>
pub fn set_ebs_optimized(mut self, input: ::std::option::Option<bool>) -> Self {
self.ebs_optimized = input;
self
}
/// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
/// <p>Default: <code>false</code></p>
pub fn get_ebs_optimized(&self) -> &::std::option::Option<bool> {
&self.ebs_optimized
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn iam_instance_profile(mut self, input: crate::types::IamInstanceProfileSpecification) -> Self {
self.iam_instance_profile = ::std::option::Option::Some(input);
self
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn set_iam_instance_profile(mut self, input: ::std::option::Option<crate::types::IamInstanceProfileSpecification>) -> Self {
self.iam_instance_profile = input;
self
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn get_iam_instance_profile(&self) -> &::std::option::Option<crate::types::IamInstanceProfileSpecification> {
&self.iam_instance_profile
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn instance_initiated_shutdown_behavior(mut self, input: crate::types::ShutdownBehavior) -> Self {
self.instance_initiated_shutdown_behavior = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn set_instance_initiated_shutdown_behavior(mut self, input: ::std::option::Option<crate::types::ShutdownBehavior>) -> Self {
self.instance_initiated_shutdown_behavior = input;
self
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn get_instance_initiated_shutdown_behavior(&self) -> &::std::option::Option<crate::types::ShutdownBehavior> {
&self.instance_initiated_shutdown_behavior
}
/// Appends an item to `network_interfaces`.
///
/// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
///
/// <p>The network interfaces to associate with the instance.</p>
pub fn network_interfaces(mut self, input: crate::types::InstanceNetworkInterfaceSpecification) -> Self {
let mut v = self.network_interfaces.unwrap_or_default();
v.push(input);
self.network_interfaces = ::std::option::Option::Some(v);
self
}
/// <p>The network interfaces to associate with the instance.</p>
pub fn set_network_interfaces(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
) -> Self {
self.network_interfaces = input;
self
}
/// <p>The network interfaces to associate with the instance.</p>
pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>> {
&self.network_interfaces
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.private_ip_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.private_ip_address = input;
self
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
&self.private_ip_address
}
/// Appends an item to `elastic_gpu_specification`.
///
/// To override the contents of this collection use [`set_elastic_gpu_specification`](Self::set_elastic_gpu_specification).
///
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
pub fn elastic_gpu_specification(mut self, input: crate::types::ElasticGpuSpecification) -> Self {
let mut v = self.elastic_gpu_specification.unwrap_or_default();
v.push(input);
self.elastic_gpu_specification = ::std::option::Option::Some(v);
self
}
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
pub fn set_elastic_gpu_specification(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>) -> Self {
self.elastic_gpu_specification = input;
self
}
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
pub fn get_elastic_gpu_specification(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>> {
&self.elastic_gpu_specification
}
/// Appends an item to `elastic_inference_accelerators`.
///
/// To override the contents of this collection use [`set_elastic_inference_accelerators`](Self::set_elastic_inference_accelerators).
///
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference (EI) is no longer available to new customers. For more information, see <a href="http://aws.amazon.com/machine-learning/elastic-inference/faqs/">Amazon Elastic Inference FAQs</a>.</p>
/// </note>
pub fn elastic_inference_accelerators(mut self, input: crate::types::ElasticInferenceAccelerator) -> Self {
let mut v = self.elastic_inference_accelerators.unwrap_or_default();
v.push(input);
self.elastic_inference_accelerators = ::std::option::Option::Some(v);
self
}
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference (EI) is no longer available to new customers. For more information, see <a href="http://aws.amazon.com/machine-learning/elastic-inference/faqs/">Amazon Elastic Inference FAQs</a>.</p>
/// </note>
pub fn set_elastic_inference_accelerators(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
) -> Self {
self.elastic_inference_accelerators = input;
self
}
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference (EI) is no longer available to new customers. For more information, see <a href="http://aws.amazon.com/machine-learning/elastic-inference/faqs/">Amazon Elastic Inference FAQs</a>.</p>
/// </note>
pub fn get_elastic_inference_accelerators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>> {
&self.elastic_inference_accelerators
}
/// Appends an item to `tag_specifications`.
///
/// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
///
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
let mut v = self.tag_specifications.unwrap_or_default();
v.push(input);
self.tag_specifications = ::std::option::Option::Some(v);
self
}
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
self.tag_specifications = input;
self
}
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
&self.tag_specifications
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn launch_template(mut self, input: crate::types::LaunchTemplateSpecification) -> Self {
self.launch_template = ::std::option::Option::Some(input);
self
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn set_launch_template(mut self, input: ::std::option::Option<crate::types::LaunchTemplateSpecification>) -> Self {
self.launch_template = input;
self
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn get_launch_template(&self) -> &::std::option::Option<crate::types::LaunchTemplateSpecification> {
&self.launch_template
}
/// <p>The market (purchasing) option for the instances.</p>
/// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
pub fn instance_market_options(mut self, input: crate::types::InstanceMarketOptionsRequest) -> Self {
self.instance_market_options = ::std::option::Option::Some(input);
self
}
/// <p>The market (purchasing) option for the instances.</p>
/// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
pub fn set_instance_market_options(mut self, input: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>) -> Self {
self.instance_market_options = input;
self
}
/// <p>The market (purchasing) option for the instances.</p>
/// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
pub fn get_instance_market_options(&self) -> &::std::option::Option<crate::types::InstanceMarketOptionsRequest> {
&self.instance_market_options
}
/// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn credit_specification(mut self, input: crate::types::CreditSpecificationRequest) -> Self {
self.credit_specification = ::std::option::Option::Some(input);
self
}
/// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn set_credit_specification(mut self, input: ::std::option::Option<crate::types::CreditSpecificationRequest>) -> Self {
self.credit_specification = input;
self
}
/// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn get_credit_specification(&self) -> &::std::option::Option<crate::types::CreditSpecificationRequest> {
&self.credit_specification
}
/// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn cpu_options(mut self, input: crate::types::CpuOptionsRequest) -> Self {
self.cpu_options = ::std::option::Option::Some(input);
self
}
/// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn set_cpu_options(mut self, input: ::std::option::Option<crate::types::CpuOptionsRequest>) -> Self {
self.cpu_options = input;
self
}
/// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn get_cpu_options(&self) -> &::std::option::Option<crate::types::CpuOptionsRequest> {
&self.cpu_options
}
/// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).</p>
pub fn capacity_reservation_specification(mut self, input: crate::types::CapacityReservationSpecification) -> Self {
self.capacity_reservation_specification = ::std::option::Option::Some(input);
self
}
/// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).</p>
pub fn set_capacity_reservation_specification(mut self, input: ::std::option::Option<crate::types::CapacityReservationSpecification>) -> Self {
self.capacity_reservation_specification = input;
self
}
/// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).</p>
pub fn get_capacity_reservation_specification(&self) -> &::std::option::Option<crate::types::CapacityReservationSpecification> {
&self.capacity_reservation_specification
}
/// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn hibernation_options(mut self, input: crate::types::HibernationOptionsRequest) -> Self {
self.hibernation_options = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn set_hibernation_options(mut self, input: ::std::option::Option<crate::types::HibernationOptionsRequest>) -> Self {
self.hibernation_options = input;
self
}
/// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn get_hibernation_options(&self) -> &::std::option::Option<crate::types::HibernationOptionsRequest> {
&self.hibernation_options
}
/// Appends an item to `license_specifications`.
///
/// To override the contents of this collection use [`set_license_specifications`](Self::set_license_specifications).
///
/// <p>The license configurations.</p>
pub fn license_specifications(mut self, input: crate::types::LicenseConfigurationRequest) -> Self {
let mut v = self.license_specifications.unwrap_or_default();
v.push(input);
self.license_specifications = ::std::option::Option::Some(v);
self
}
/// <p>The license configurations.</p>
pub fn set_license_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>) -> Self {
self.license_specifications = input;
self
}
/// <p>The license configurations.</p>
pub fn get_license_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>> {
&self.license_specifications
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
pub fn metadata_options(mut self, input: crate::types::InstanceMetadataOptionsRequest) -> Self {
self.metadata_options = ::std::option::Option::Some(input);
self
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
pub fn set_metadata_options(mut self, input: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>) -> Self {
self.metadata_options = input;
self
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
pub fn get_metadata_options(&self) -> &::std::option::Option<crate::types::InstanceMetadataOptionsRequest> {
&self.metadata_options
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn enclave_options(mut self, input: crate::types::EnclaveOptionsRequest) -> Self {
self.enclave_options = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn set_enclave_options(mut self, input: ::std::option::Option<crate::types::EnclaveOptionsRequest>) -> Self {
self.enclave_options = input;
self
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn get_enclave_options(&self) -> &::std::option::Option<crate::types::EnclaveOptionsRequest> {
&self.enclave_options
}
/// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
pub fn private_dns_name_options(mut self, input: crate::types::PrivateDnsNameOptionsRequest) -> Self {
self.private_dns_name_options = ::std::option::Option::Some(input);
self
}
/// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
pub fn set_private_dns_name_options(mut self, input: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>) -> Self {
self.private_dns_name_options = input;
self
}
/// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
pub fn get_private_dns_name_options(&self) -> &::std::option::Option<crate::types::PrivateDnsNameOptionsRequest> {
&self.private_dns_name_options
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn maintenance_options(mut self, input: crate::types::InstanceMaintenanceOptionsRequest) -> Self {
self.maintenance_options = ::std::option::Option::Some(input);
self
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn set_maintenance_options(mut self, input: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>) -> Self {
self.maintenance_options = input;
self
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn get_maintenance_options(&self) -> &::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest> {
&self.maintenance_options
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
pub fn disable_api_stop(mut self, input: bool) -> Self {
self.disable_api_stop = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
pub fn set_disable_api_stop(mut self, input: ::std::option::Option<bool>) -> Self {
self.disable_api_stop = input;
self
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
pub fn get_disable_api_stop(&self) -> &::std::option::Option<bool> {
&self.disable_api_stop
}
/// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
pub fn enable_primary_ipv6(mut self, input: bool) -> Self {
self.enable_primary_ipv6 = ::std::option::Option::Some(input);
self
}
/// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
pub fn set_enable_primary_ipv6(mut self, input: ::std::option::Option<bool>) -> Self {
self.enable_primary_ipv6 = input;
self
}
/// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
pub fn get_enable_primary_ipv6(&self) -> &::std::option::Option<bool> {
&self.enable_primary_ipv6
}
/// Consumes the builder and constructs a [`RunInstancesInput`](crate::operation::run_instances::RunInstancesInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::run_instances::RunInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::run_instances::RunInstancesInput {
block_device_mappings: self.block_device_mappings,
image_id: self.image_id,
instance_type: self.instance_type,
ipv6_address_count: self.ipv6_address_count,
ipv6_addresses: self.ipv6_addresses,
kernel_id: self.kernel_id,
key_name: self.key_name,
max_count: self.max_count,
min_count: self.min_count,
monitoring: self.monitoring,
placement: self.placement,
ramdisk_id: self.ramdisk_id,
security_group_ids: self.security_group_ids,
security_groups: self.security_groups,
subnet_id: self.subnet_id,
user_data: self.user_data,
additional_info: self.additional_info,
client_token: self.client_token,
disable_api_termination: self.disable_api_termination,
dry_run: self.dry_run,
ebs_optimized: self.ebs_optimized,
iam_instance_profile: self.iam_instance_profile,
instance_initiated_shutdown_behavior: self.instance_initiated_shutdown_behavior,
network_interfaces: self.network_interfaces,
private_ip_address: self.private_ip_address,
elastic_gpu_specification: self.elastic_gpu_specification,
elastic_inference_accelerators: self.elastic_inference_accelerators,
tag_specifications: self.tag_specifications,
launch_template: self.launch_template,
instance_market_options: self.instance_market_options,
credit_specification: self.credit_specification,
cpu_options: self.cpu_options,
capacity_reservation_specification: self.capacity_reservation_specification,
hibernation_options: self.hibernation_options,
license_specifications: self.license_specifications,
metadata_options: self.metadata_options,
enclave_options: self.enclave_options,
private_dns_name_options: self.private_dns_name_options,
maintenance_options: self.maintenance_options,
disable_api_stop: self.disable_api_stop,
enable_primary_ipv6: self.enable_primary_ipv6,
})
}
}
impl ::std::fmt::Debug for RunInstancesInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("RunInstancesInputBuilder");
formatter.field("block_device_mappings", &self.block_device_mappings);
formatter.field("image_id", &self.image_id);
formatter.field("instance_type", &self.instance_type);
formatter.field("ipv6_address_count", &self.ipv6_address_count);
formatter.field("ipv6_addresses", &self.ipv6_addresses);
formatter.field("kernel_id", &self.kernel_id);
formatter.field("key_name", &self.key_name);
formatter.field("max_count", &self.max_count);
formatter.field("min_count", &self.min_count);
formatter.field("monitoring", &self.monitoring);
formatter.field("placement", &self.placement);
formatter.field("ramdisk_id", &self.ramdisk_id);
formatter.field("security_group_ids", &self.security_group_ids);
formatter.field("security_groups", &self.security_groups);
formatter.field("subnet_id", &self.subnet_id);
formatter.field("user_data", &"*** Sensitive Data Redacted ***");
formatter.field("additional_info", &self.additional_info);
formatter.field("client_token", &self.client_token);
formatter.field("disable_api_termination", &self.disable_api_termination);
formatter.field("dry_run", &self.dry_run);
formatter.field("ebs_optimized", &self.ebs_optimized);
formatter.field("iam_instance_profile", &self.iam_instance_profile);
formatter.field("instance_initiated_shutdown_behavior", &self.instance_initiated_shutdown_behavior);
formatter.field("network_interfaces", &self.network_interfaces);
formatter.field("private_ip_address", &self.private_ip_address);
formatter.field("elastic_gpu_specification", &self.elastic_gpu_specification);
formatter.field("elastic_inference_accelerators", &self.elastic_inference_accelerators);
formatter.field("tag_specifications", &self.tag_specifications);
formatter.field("launch_template", &self.launch_template);
formatter.field("instance_market_options", &self.instance_market_options);
formatter.field("credit_specification", &self.credit_specification);
formatter.field("cpu_options", &self.cpu_options);
formatter.field("capacity_reservation_specification", &self.capacity_reservation_specification);
formatter.field("hibernation_options", &self.hibernation_options);
formatter.field("license_specifications", &self.license_specifications);
formatter.field("metadata_options", &self.metadata_options);
formatter.field("enclave_options", &self.enclave_options);
formatter.field("private_dns_name_options", &self.private_dns_name_options);
formatter.field("maintenance_options", &self.maintenance_options);
formatter.field("disable_api_stop", &self.disable_api_stop);
formatter.field("enable_primary_ipv6", &self.enable_primary_ipv6);
formatter.finish()
}
}