aws_sdk_ec2/types/
_launch_template_cpu_options.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The CPU options for the instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct LaunchTemplateCpuOptions {
7    /// <p>The number of CPU cores for the instance.</p>
8    pub core_count: ::std::option::Option<i32>,
9    /// <p>The number of threads per CPU core.</p>
10    pub threads_per_core: ::std::option::Option<i32>,
11    /// <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html">AMD SEV-SNP for Amazon EC2 instances</a>.</p>
12    pub amd_sev_snp: ::std::option::Option<crate::types::AmdSevSnpSpecification>,
13}
14impl LaunchTemplateCpuOptions {
15    /// <p>The number of CPU cores for the instance.</p>
16    pub fn core_count(&self) -> ::std::option::Option<i32> {
17        self.core_count
18    }
19    /// <p>The number of threads per CPU core.</p>
20    pub fn threads_per_core(&self) -> ::std::option::Option<i32> {
21        self.threads_per_core
22    }
23    /// <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html">AMD SEV-SNP for Amazon EC2 instances</a>.</p>
24    pub fn amd_sev_snp(&self) -> ::std::option::Option<&crate::types::AmdSevSnpSpecification> {
25        self.amd_sev_snp.as_ref()
26    }
27}
28impl LaunchTemplateCpuOptions {
29    /// Creates a new builder-style object to manufacture [`LaunchTemplateCpuOptions`](crate::types::LaunchTemplateCpuOptions).
30    pub fn builder() -> crate::types::builders::LaunchTemplateCpuOptionsBuilder {
31        crate::types::builders::LaunchTemplateCpuOptionsBuilder::default()
32    }
33}
34
35/// A builder for [`LaunchTemplateCpuOptions`](crate::types::LaunchTemplateCpuOptions).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct LaunchTemplateCpuOptionsBuilder {
39    pub(crate) core_count: ::std::option::Option<i32>,
40    pub(crate) threads_per_core: ::std::option::Option<i32>,
41    pub(crate) amd_sev_snp: ::std::option::Option<crate::types::AmdSevSnpSpecification>,
42}
43impl LaunchTemplateCpuOptionsBuilder {
44    /// <p>The number of CPU cores for the instance.</p>
45    pub fn core_count(mut self, input: i32) -> Self {
46        self.core_count = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The number of CPU cores for the instance.</p>
50    pub fn set_core_count(mut self, input: ::std::option::Option<i32>) -> Self {
51        self.core_count = input;
52        self
53    }
54    /// <p>The number of CPU cores for the instance.</p>
55    pub fn get_core_count(&self) -> &::std::option::Option<i32> {
56        &self.core_count
57    }
58    /// <p>The number of threads per CPU core.</p>
59    pub fn threads_per_core(mut self, input: i32) -> Self {
60        self.threads_per_core = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The number of threads per CPU core.</p>
64    pub fn set_threads_per_core(mut self, input: ::std::option::Option<i32>) -> Self {
65        self.threads_per_core = input;
66        self
67    }
68    /// <p>The number of threads per CPU core.</p>
69    pub fn get_threads_per_core(&self) -> &::std::option::Option<i32> {
70        &self.threads_per_core
71    }
72    /// <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html">AMD SEV-SNP for Amazon EC2 instances</a>.</p>
73    pub fn amd_sev_snp(mut self, input: crate::types::AmdSevSnpSpecification) -> Self {
74        self.amd_sev_snp = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html">AMD SEV-SNP for Amazon EC2 instances</a>.</p>
78    pub fn set_amd_sev_snp(mut self, input: ::std::option::Option<crate::types::AmdSevSnpSpecification>) -> Self {
79        self.amd_sev_snp = input;
80        self
81    }
82    /// <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html">AMD SEV-SNP for Amazon EC2 instances</a>.</p>
83    pub fn get_amd_sev_snp(&self) -> &::std::option::Option<crate::types::AmdSevSnpSpecification> {
84        &self.amd_sev_snp
85    }
86    /// Consumes the builder and constructs a [`LaunchTemplateCpuOptions`](crate::types::LaunchTemplateCpuOptions).
87    pub fn build(self) -> crate::types::LaunchTemplateCpuOptions {
88        crate::types::LaunchTemplateCpuOptions {
89            core_count: self.core_count,
90            threads_per_core: self.threads_per_core,
91            amd_sev_snp: self.amd_sev_snp,
92        }
93    }
94}