aws_sdk_elasticbeanstalk/types/
_build_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Settings for an AWS CodeBuild build.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BuildConfiguration {
7    /// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
8    pub artifact_name: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
10    pub code_build_service_role: ::std::string::String,
11    /// <p>Information about the compute resources the build project will use.</p>
12    /// <ul>
13    /// <li>
14    /// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
15    /// <li>
16    /// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
17    /// <li>
18    /// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
19    /// </ul>
20    pub compute_type: ::std::option::Option<crate::types::ComputeType>,
21    /// <p>The ID of the Docker image to use for this build project.</p>
22    pub image: ::std::string::String,
23    /// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
24    pub timeout_in_minutes: ::std::option::Option<i32>,
25}
26impl BuildConfiguration {
27    /// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
28    pub fn artifact_name(&self) -> ::std::option::Option<&str> {
29        self.artifact_name.as_deref()
30    }
31    /// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
32    pub fn code_build_service_role(&self) -> &str {
33        use std::ops::Deref;
34        self.code_build_service_role.deref()
35    }
36    /// <p>Information about the compute resources the build project will use.</p>
37    /// <ul>
38    /// <li>
39    /// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
40    /// <li>
41    /// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
42    /// <li>
43    /// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
44    /// </ul>
45    pub fn compute_type(&self) -> ::std::option::Option<&crate::types::ComputeType> {
46        self.compute_type.as_ref()
47    }
48    /// <p>The ID of the Docker image to use for this build project.</p>
49    pub fn image(&self) -> &str {
50        use std::ops::Deref;
51        self.image.deref()
52    }
53    /// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
54    pub fn timeout_in_minutes(&self) -> ::std::option::Option<i32> {
55        self.timeout_in_minutes
56    }
57}
58impl BuildConfiguration {
59    /// Creates a new builder-style object to manufacture [`BuildConfiguration`](crate::types::BuildConfiguration).
60    pub fn builder() -> crate::types::builders::BuildConfigurationBuilder {
61        crate::types::builders::BuildConfigurationBuilder::default()
62    }
63}
64
65/// A builder for [`BuildConfiguration`](crate::types::BuildConfiguration).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct BuildConfigurationBuilder {
69    pub(crate) artifact_name: ::std::option::Option<::std::string::String>,
70    pub(crate) code_build_service_role: ::std::option::Option<::std::string::String>,
71    pub(crate) compute_type: ::std::option::Option<crate::types::ComputeType>,
72    pub(crate) image: ::std::option::Option<::std::string::String>,
73    pub(crate) timeout_in_minutes: ::std::option::Option<i32>,
74}
75impl BuildConfigurationBuilder {
76    /// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
77    pub fn artifact_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.artifact_name = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
82    pub fn set_artifact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.artifact_name = input;
84        self
85    }
86    /// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
87    pub fn get_artifact_name(&self) -> &::std::option::Option<::std::string::String> {
88        &self.artifact_name
89    }
90    /// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
91    /// This field is required.
92    pub fn code_build_service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.code_build_service_role = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
97    pub fn set_code_build_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.code_build_service_role = input;
99        self
100    }
101    /// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
102    pub fn get_code_build_service_role(&self) -> &::std::option::Option<::std::string::String> {
103        &self.code_build_service_role
104    }
105    /// <p>Information about the compute resources the build project will use.</p>
106    /// <ul>
107    /// <li>
108    /// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
109    /// <li>
110    /// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
111    /// <li>
112    /// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
113    /// </ul>
114    pub fn compute_type(mut self, input: crate::types::ComputeType) -> Self {
115        self.compute_type = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>Information about the compute resources the build project will use.</p>
119    /// <ul>
120    /// <li>
121    /// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
122    /// <li>
123    /// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
124    /// <li>
125    /// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
126    /// </ul>
127    pub fn set_compute_type(mut self, input: ::std::option::Option<crate::types::ComputeType>) -> Self {
128        self.compute_type = input;
129        self
130    }
131    /// <p>Information about the compute resources the build project will use.</p>
132    /// <ul>
133    /// <li>
134    /// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
135    /// <li>
136    /// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
137    /// <li>
138    /// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
139    /// </ul>
140    pub fn get_compute_type(&self) -> &::std::option::Option<crate::types::ComputeType> {
141        &self.compute_type
142    }
143    /// <p>The ID of the Docker image to use for this build project.</p>
144    /// This field is required.
145    pub fn image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.image = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The ID of the Docker image to use for this build project.</p>
150    pub fn set_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.image = input;
152        self
153    }
154    /// <p>The ID of the Docker image to use for this build project.</p>
155    pub fn get_image(&self) -> &::std::option::Option<::std::string::String> {
156        &self.image
157    }
158    /// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
159    pub fn timeout_in_minutes(mut self, input: i32) -> Self {
160        self.timeout_in_minutes = ::std::option::Option::Some(input);
161        self
162    }
163    /// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
164    pub fn set_timeout_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
165        self.timeout_in_minutes = input;
166        self
167    }
168    /// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
169    pub fn get_timeout_in_minutes(&self) -> &::std::option::Option<i32> {
170        &self.timeout_in_minutes
171    }
172    /// Consumes the builder and constructs a [`BuildConfiguration`](crate::types::BuildConfiguration).
173    /// This method will fail if any of the following fields are not set:
174    /// - [`code_build_service_role`](crate::types::builders::BuildConfigurationBuilder::code_build_service_role)
175    /// - [`image`](crate::types::builders::BuildConfigurationBuilder::image)
176    pub fn build(self) -> ::std::result::Result<crate::types::BuildConfiguration, ::aws_smithy_types::error::operation::BuildError> {
177        ::std::result::Result::Ok(crate::types::BuildConfiguration {
178            artifact_name: self.artifact_name,
179            code_build_service_role: self.code_build_service_role.ok_or_else(|| {
180                ::aws_smithy_types::error::operation::BuildError::missing_field(
181                    "code_build_service_role",
182                    "code_build_service_role was not specified but it is required when building BuildConfiguration",
183                )
184            })?,
185            compute_type: self.compute_type,
186            image: self.image.ok_or_else(|| {
187                ::aws_smithy_types::error::operation::BuildError::missing_field(
188                    "image",
189                    "image was not specified but it is required when building BuildConfiguration",
190                )
191            })?,
192            timeout_in_minutes: self.timeout_in_minutes,
193        })
194    }
195}