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#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct CreateEnvironmentFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::create_environment::builders::CreateEnvironmentInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::create_environment::CreateEnvironmentOutput,
43 crate::operation::create_environment::CreateEnvironmentError,
44 > for CreateEnvironmentFluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::create_environment::CreateEnvironmentOutput,
52 crate::operation::create_environment::CreateEnvironmentError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl CreateEnvironmentFluentBuilder {
59 /// Creates a new `CreateEnvironmentFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the CreateEnvironment as a reference.
68 pub fn as_input(&self) -> &crate::operation::create_environment::builders::CreateEnvironmentInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::create_environment::CreateEnvironmentOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::create_environment::CreateEnvironmentError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::create_environment::CreateEnvironment::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::create_environment::CreateEnvironment::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::create_environment::CreateEnvironmentOutput,
105 crate::operation::create_environment::CreateEnvironmentError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>The name of the environment.</p>
120 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.name(input.into());
122 self
123 }
124 /// <p>The name of the environment.</p>
125 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_name(input);
127 self
128 }
129 /// <p>The name of the environment.</p>
130 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_name()
132 }
133 /// <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>
134 pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.template_name(input.into());
136 self
137 }
138 /// <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>
139 pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_template_name(input);
141 self
142 }
143 /// <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>
144 pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_template_name()
146 }
147 /// <p>The major version of the environment template.</p>
148 pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.inner = self.inner.template_major_version(input.into());
150 self
151 }
152 /// <p>The major version of the environment template.</p>
153 pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_template_major_version(input);
155 self
156 }
157 /// <p>The major version of the environment template.</p>
158 pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
159 self.inner.get_template_major_version()
160 }
161 /// <p>The minor version of the environment template.</p>
162 pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163 self.inner = self.inner.template_minor_version(input.into());
164 self
165 }
166 /// <p>The minor version of the environment template.</p>
167 pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.inner = self.inner.set_template_minor_version(input);
169 self
170 }
171 /// <p>The minor version of the environment template.</p>
172 pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_template_minor_version()
174 }
175 /// <p>A description of the environment that's being created and deployed.</p>
176 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.inner = self.inner.description(input.into());
178 self
179 }
180 /// <p>A description of the environment that's being created and deployed.</p>
181 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182 self.inner = self.inner.set_description(input);
183 self
184 }
185 /// <p>A description of the environment that's being created and deployed.</p>
186 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
187 self.inner.get_description()
188 }
189 /// <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>
190 pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.inner = self.inner.spec(input.into());
192 self
193 }
194 /// <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>
195 pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.inner = self.inner.set_spec(input);
197 self
198 }
199 /// <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>
200 pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
201 self.inner.get_spec()
202 }
203 /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make calls to other services on your behalf.</p>
204 /// <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>
205 pub fn proton_service_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206 self.inner = self.inner.proton_service_role_arn(input.into());
207 self
208 }
209 /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make calls to other services on your behalf.</p>
210 /// <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>
211 pub fn set_proton_service_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212 self.inner = self.inner.set_proton_service_role_arn(input);
213 self
214 }
215 /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make calls to other services on your behalf.</p>
216 /// <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>
217 pub fn get_proton_service_role_arn(&self) -> &::std::option::Option<::std::string::String> {
218 self.inner.get_proton_service_role_arn()
219 }
220 /// <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>
221 /// <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>
222 pub fn environment_account_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223 self.inner = self.inner.environment_account_connection_id(input.into());
224 self
225 }
226 /// <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>
227 /// <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>
228 pub fn set_environment_account_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229 self.inner = self.inner.set_environment_account_connection_id(input);
230 self
231 }
232 /// <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>
233 /// <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>
234 pub fn get_environment_account_connection_id(&self) -> &::std::option::Option<::std::string::String> {
235 self.inner.get_environment_account_connection_id()
236 }
237 ///
238 /// Appends an item to `tags`.
239 ///
240 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
241 ///
242 /// <p>An optional list of metadata items that you can associate with the Proton environment. A tag is a key-value pair.</p>
243 /// <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>
244 pub fn tags(mut self, input: crate::types::Tag) -> Self {
245 self.inner = self.inner.tags(input);
246 self
247 }
248 /// <p>An optional list of metadata items that you can associate with the Proton environment. A tag is a key-value pair.</p>
249 /// <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>
250 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
251 self.inner = self.inner.set_tags(input);
252 self
253 }
254 /// <p>An optional list of metadata items that you can associate with the Proton environment. A tag is a key-value pair.</p>
255 /// <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>
256 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
257 self.inner.get_tags()
258 }
259 /// <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>
260 /// <p>To use self-managed provisioning for the environment, specify this parameter and omit the <code>environmentAccountConnectionId</code> and <code>protonServiceRoleArn</code> parameters.</p>
261 pub fn provisioning_repository(mut self, input: crate::types::RepositoryBranchInput) -> Self {
262 self.inner = self.inner.provisioning_repository(input);
263 self
264 }
265 /// <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>
266 /// <p>To use self-managed provisioning for the environment, specify this parameter and omit the <code>environmentAccountConnectionId</code> and <code>protonServiceRoleArn</code> parameters.</p>
267 pub fn set_provisioning_repository(mut self, input: ::std::option::Option<crate::types::RepositoryBranchInput>) -> Self {
268 self.inner = self.inner.set_provisioning_repository(input);
269 self
270 }
271 /// <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>
272 /// <p>To use self-managed provisioning for the environment, specify this parameter and omit the <code>environmentAccountConnectionId</code> and <code>protonServiceRoleArn</code> parameters.</p>
273 pub fn get_provisioning_repository(&self) -> &::std::option::Option<crate::types::RepositoryBranchInput> {
274 self.inner.get_provisioning_repository()
275 }
276 /// <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>
277 /// <p>You must specify <code>componentRoleArn</code> to allow directly defined components to be associated with this environment.</p>
278 /// <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>
279 pub fn component_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280 self.inner = self.inner.component_role_arn(input.into());
281 self
282 }
283 /// <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>
284 /// <p>You must specify <code>componentRoleArn</code> to allow directly defined components to be associated with this environment.</p>
285 /// <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>
286 pub fn set_component_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287 self.inner = self.inner.set_component_role_arn(input);
288 self
289 }
290 /// <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>
291 /// <p>You must specify <code>componentRoleArn</code> to allow directly defined components to be associated with this environment.</p>
292 /// <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>
293 pub fn get_component_role_arn(&self) -> &::std::option::Option<::std::string::String> {
294 self.inner.get_component_role_arn()
295 }
296 /// <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>
297 /// <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>
298 pub fn codebuild_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299 self.inner = self.inner.codebuild_role_arn(input.into());
300 self
301 }
302 /// <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>
303 /// <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>
304 pub fn set_codebuild_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305 self.inner = self.inner.set_codebuild_role_arn(input);
306 self
307 }
308 /// <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>
309 /// <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>
310 pub fn get_codebuild_role_arn(&self) -> &::std::option::Option<::std::string::String> {
311 self.inner.get_codebuild_role_arn()
312 }
313}