aws_sdk_proton/operation/create_environment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_environment::_create_environment_output::CreateEnvironmentOutputBuilder;
3
4pub use crate::operation::create_environment::_create_environment_input::CreateEnvironmentInputBuilder;
5
6impl crate::operation::create_environment::builders::CreateEnvironmentInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_environment::CreateEnvironmentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_environment::CreateEnvironmentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_environment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateEnvironment`.
24///
25/// <p>Deploy a new environment. An Proton environment is created from an environment template that defines infrastructure and resources that can be shared across services.</p>
26/// <p class="title"><b>You can provision environments using the following methods:</b></p>
27/// <ul>
28/// <li>
29/// <p>Amazon Web Services-managed provisioning: Proton makes direct calls to provision your resources.</p></li>
30/// <li>
31/// <p>Self-managed provisioning: Proton makes pull requests on your repository to provide compiled infrastructure as code (IaC) files that your IaC engine uses to provision resources.</p></li>
32/// </ul>
33/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-environments.html">Environments</a> and <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-works-prov-methods.html">Provisioning methods</a> in the <i>Proton User Guide</i>.</p>
34#[deprecated(note = "AWS Proton is not accepting new customers.", since = "10/07/2025")]
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreateEnvironmentFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::create_environment::builders::CreateEnvironmentInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::create_environment::CreateEnvironmentOutput,
44        crate::operation::create_environment::CreateEnvironmentError,
45    > for CreateEnvironmentFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::create_environment::CreateEnvironmentOutput,
53            crate::operation::create_environment::CreateEnvironmentError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl CreateEnvironmentFluentBuilder {
60    /// Creates a new `CreateEnvironmentFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the CreateEnvironment as a reference.
69    pub fn as_input(&self) -> &crate::operation::create_environment::builders::CreateEnvironmentInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::create_environment::CreateEnvironmentOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::create_environment::CreateEnvironmentError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::create_environment::CreateEnvironment::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::create_environment::CreateEnvironment::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::create_environment::CreateEnvironmentOutput,
106        crate::operation::create_environment::CreateEnvironmentError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The name of the environment.</p>
121    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.name(input.into());
123        self
124    }
125    /// <p>The name of the environment.</p>
126    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_name(input);
128        self
129    }
130    /// <p>The name of the environment.</p>
131    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_name()
133    }
134    /// <p>The name of the environment template. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html">Environment Templates</a> in the <i>Proton User Guide</i>.</p>
135    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.template_name(input.into());
137        self
138    }
139    /// <p>The name of the environment template. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html">Environment Templates</a> in the <i>Proton User Guide</i>.</p>
140    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_template_name(input);
142        self
143    }
144    /// <p>The name of the environment template. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html">Environment Templates</a> in the <i>Proton User Guide</i>.</p>
145    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_template_name()
147    }
148    /// <p>The major version of the environment template.</p>
149    pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.template_major_version(input.into());
151        self
152    }
153    /// <p>The major version of the environment template.</p>
154    pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_template_major_version(input);
156        self
157    }
158    /// <p>The major version of the environment template.</p>
159    pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_template_major_version()
161    }
162    /// <p>The minor version of the environment template.</p>
163    pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.template_minor_version(input.into());
165        self
166    }
167    /// <p>The minor version of the environment template.</p>
168    pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_template_minor_version(input);
170        self
171    }
172    /// <p>The minor version of the environment template.</p>
173    pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_template_minor_version()
175    }
176    /// <p>A description of the environment that's being created and deployed.</p>
177    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.description(input.into());
179        self
180    }
181    /// <p>A description of the environment that's being created and deployed.</p>
182    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_description(input);
184        self
185    }
186    /// <p>A description of the environment that's being created and deployed.</p>
187    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_description()
189    }
190    /// <p>A YAML formatted string that provides inputs as defined in the environment template bundle schema file. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-environments.html">Environments</a> in the <i>Proton User Guide</i>.</p>
191    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.spec(input.into());
193        self
194    }
195    /// <p>A YAML formatted string that provides inputs as defined in the environment template bundle schema file. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-environments.html">Environments</a> in the <i>Proton User Guide</i>.</p>
196    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_spec(input);
198        self
199    }
200    /// <p>A YAML formatted string that provides inputs as defined in the environment template bundle schema file. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-environments.html">Environments</a> in the <i>Proton User Guide</i>.</p>
201    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_spec()
203    }
204    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make calls to other services on your behalf.</p>
205    /// <p>To use Amazon Web Services-managed provisioning for the environment, specify either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and omit the <code>provisioningRepository</code> parameter.</p>
206    pub fn proton_service_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.proton_service_role_arn(input.into());
208        self
209    }
210    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make calls to other services on your behalf.</p>
211    /// <p>To use Amazon Web Services-managed provisioning for the environment, specify either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and omit the <code>provisioningRepository</code> parameter.</p>
212    pub fn set_proton_service_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_proton_service_role_arn(input);
214        self
215    }
216    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make calls to other services on your behalf.</p>
217    /// <p>To use Amazon Web Services-managed provisioning for the environment, specify either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and omit the <code>provisioningRepository</code> parameter.</p>
218    pub fn get_proton_service_role_arn(&self) -> &::std::option::Option<::std::string::String> {
219        self.inner.get_proton_service_role_arn()
220    }
221    /// <p>The ID of the environment account connection that you provide if you're provisioning your environment infrastructure resources to an environment account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-env-account-connections.html">Environment account connections</a> in the <i>Proton User guide</i>.</p>
222    /// <p>To use Amazon Web Services-managed provisioning for the environment, specify either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and omit the <code>provisioningRepository</code> parameter.</p>
223    pub fn environment_account_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.inner = self.inner.environment_account_connection_id(input.into());
225        self
226    }
227    /// <p>The ID of the environment account connection that you provide if you're provisioning your environment infrastructure resources to an environment account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-env-account-connections.html">Environment account connections</a> in the <i>Proton User guide</i>.</p>
228    /// <p>To use Amazon Web Services-managed provisioning for the environment, specify either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and omit the <code>provisioningRepository</code> parameter.</p>
229    pub fn set_environment_account_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.inner = self.inner.set_environment_account_connection_id(input);
231        self
232    }
233    /// <p>The ID of the environment account connection that you provide if you're provisioning your environment infrastructure resources to an environment account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-env-account-connections.html">Environment account connections</a> in the <i>Proton User guide</i>.</p>
234    /// <p>To use Amazon Web Services-managed provisioning for the environment, specify either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and omit the <code>provisioningRepository</code> parameter.</p>
235    pub fn get_environment_account_connection_id(&self) -> &::std::option::Option<::std::string::String> {
236        self.inner.get_environment_account_connection_id()
237    }
238    ///
239    /// Appends an item to `tags`.
240    ///
241    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
242    ///
243    /// <p>An optional list of metadata items that you can associate with the Proton environment. A tag is a key-value pair.</p>
244    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
245    pub fn tags(mut self, input: crate::types::Tag) -> Self {
246        self.inner = self.inner.tags(input);
247        self
248    }
249    /// <p>An optional list of metadata items that you can associate with the Proton environment. A tag is a key-value pair.</p>
250    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
251    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
252        self.inner = self.inner.set_tags(input);
253        self
254    }
255    /// <p>An optional list of metadata items that you can associate with the Proton environment. A tag is a key-value pair.</p>
256    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
257    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
258        self.inner.get_tags()
259    }
260    /// <p>The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see <code>CreateRepository</code>.</p>
261    /// <p>To use self-managed provisioning for the environment, specify this parameter and omit the <code>environmentAccountConnectionId</code> and <code>protonServiceRoleArn</code> parameters.</p>
262    pub fn provisioning_repository(mut self, input: crate::types::RepositoryBranchInput) -> Self {
263        self.inner = self.inner.provisioning_repository(input);
264        self
265    }
266    /// <p>The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see <code>CreateRepository</code>.</p>
267    /// <p>To use self-managed provisioning for the environment, specify this parameter and omit the <code>environmentAccountConnectionId</code> and <code>protonServiceRoleArn</code> parameters.</p>
268    pub fn set_provisioning_repository(mut self, input: ::std::option::Option<crate::types::RepositoryBranchInput>) -> Self {
269        self.inner = self.inner.set_provisioning_repository(input);
270        self
271    }
272    /// <p>The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see <code>CreateRepository</code>.</p>
273    /// <p>To use self-managed provisioning for the environment, specify this parameter and omit the <code>environmentAccountConnectionId</code> and <code>protonServiceRoleArn</code> parameters.</p>
274    pub fn get_provisioning_repository(&self) -> &::std::option::Option<crate::types::RepositoryBranchInput> {
275        self.inner.get_provisioning_repository()
276    }
277    /// <p>The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.</p>
278    /// <p>You must specify <code>componentRoleArn</code> to allow directly defined components to be associated with this environment.</p>
279    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
280    pub fn component_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281        self.inner = self.inner.component_role_arn(input.into());
282        self
283    }
284    /// <p>The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.</p>
285    /// <p>You must specify <code>componentRoleArn</code> to allow directly defined components to be associated with this environment.</p>
286    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
287    pub fn set_component_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.inner = self.inner.set_component_role_arn(input);
289        self
290    }
291    /// <p>The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.</p>
292    /// <p>You must specify <code>componentRoleArn</code> to allow directly defined components to be associated with this environment.</p>
293    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
294    pub fn get_component_role_arn(&self) -> &::std::option::Option<::std::string::String> {
295        self.inner.get_component_role_arn()
296    }
297    /// <p>The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.</p>
298    /// <p>To use CodeBuild-based provisioning for the environment or for any service instance running in the environment, specify either the <code>environmentAccountConnectionId</code> or <code>codebuildRoleArn</code> parameter.</p>
299    pub fn codebuild_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300        self.inner = self.inner.codebuild_role_arn(input.into());
301        self
302    }
303    /// <p>The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.</p>
304    /// <p>To use CodeBuild-based provisioning for the environment or for any service instance running in the environment, specify either the <code>environmentAccountConnectionId</code> or <code>codebuildRoleArn</code> parameter.</p>
305    pub fn set_codebuild_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
306        self.inner = self.inner.set_codebuild_role_arn(input);
307        self
308    }
309    /// <p>The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.</p>
310    /// <p>To use CodeBuild-based provisioning for the environment or for any service instance running in the environment, specify either the <code>environmentAccountConnectionId</code> or <code>codebuildRoleArn</code> parameter.</p>
311    pub fn get_codebuild_role_arn(&self) -> &::std::option::Option<::std::string::String> {
312        self.inner.get_codebuild_role_arn()
313    }
314}