aws_sdk_appmesh/operation/create_virtual_node/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_virtual_node::_create_virtual_node_output::CreateVirtualNodeOutputBuilder;
3
4pub use crate::operation::create_virtual_node::_create_virtual_node_input::CreateVirtualNodeInputBuilder;
5
6impl crate::operation::create_virtual_node::builders::CreateVirtualNodeInputBuilder {
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_virtual_node::CreateVirtualNodeOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_virtual_node::CreateVirtualNodeError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_virtual_node();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateVirtualNode`.
24///
25/// <p>Creates a virtual node within a service mesh.</p>
26/// <p>A virtual node acts as a logical pointer to a particular task group, such as an Amazon ECS service or a Kubernetes deployment. When you create a virtual node, you can specify the service discovery information for your task group, and whether the proxy running in a task group will communicate with other proxies using Transport Layer Security (TLS).</p>
27/// <p>You define a <code>listener</code> for any inbound traffic that your virtual node expects. Any virtual service that your virtual node expects to communicate to is specified as a <code>backend</code>.</p>
28/// <p>The response metadata for your new virtual node contains the <code>arn</code> that is associated with the virtual node. Set this value to the full ARN; for example, <code>arn:aws:appmesh:us-west-2:123456789012:myMesh/default/virtualNode/myApp</code>) as the <code>APPMESH_RESOURCE_ARN</code> environment variable for your task group's Envoy proxy container in your task definition or pod spec. This is then mapped to the <code>node.id</code> and <code>node.cluster</code> Envoy parameters.</p><note>
29/// <p>By default, App Mesh uses the name of the resource you specified in <code>APPMESH_RESOURCE_ARN</code> when Envoy is referring to itself in metrics and traces. You can override this behavior by setting the <code>APPMESH_RESOURCE_CLUSTER</code> environment variable with your own name.</p>
30/// </note>
31/// <p>For more information about virtual nodes, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html">Virtual nodes</a>. You must be using <code>1.15.0</code> or later of the Envoy image when setting these variables. For more information aboutApp Mesh Envoy variables, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/envoy.html">Envoy image</a> in the App Mesh User Guide.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct CreateVirtualNodeFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::create_virtual_node::builders::CreateVirtualNodeInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39 crate::client::customize::internal::CustomizableSend<
40 crate::operation::create_virtual_node::CreateVirtualNodeOutput,
41 crate::operation::create_virtual_node::CreateVirtualNodeError,
42 > for CreateVirtualNodeFluentBuilder
43{
44 fn send(
45 self,
46 config_override: crate::config::Builder,
47 ) -> crate::client::customize::internal::BoxFuture<
48 crate::client::customize::internal::SendResult<
49 crate::operation::create_virtual_node::CreateVirtualNodeOutput,
50 crate::operation::create_virtual_node::CreateVirtualNodeError,
51 >,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl CreateVirtualNodeFluentBuilder {
57 /// Creates a new `CreateVirtualNodeFluentBuilder`.
58 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59 Self {
60 handle,
61 inner: ::std::default::Default::default(),
62 config_override: ::std::option::Option::None,
63 }
64 }
65 /// Access the CreateVirtualNode as a reference.
66 pub fn as_input(&self) -> &crate::operation::create_virtual_node::builders::CreateVirtualNodeInputBuilder {
67 &self.inner
68 }
69 /// Sends the request and returns the response.
70 ///
71 /// If an error occurs, an `SdkError` will be returned with additional details that
72 /// can be matched against.
73 ///
74 /// By default, any retryable failures will be retried twice. Retry behavior
75 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76 /// set when configuring the client.
77 pub async fn send(
78 self,
79 ) -> ::std::result::Result<
80 crate::operation::create_virtual_node::CreateVirtualNodeOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::create_virtual_node::CreateVirtualNodeError,
83 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84 >,
85 > {
86 let input = self
87 .inner
88 .build()
89 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90 let runtime_plugins = crate::operation::create_virtual_node::CreateVirtualNode::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::create_virtual_node::CreateVirtualNode::orchestrate(&runtime_plugins, input).await
96 }
97
98 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99 pub fn customize(
100 self,
101 ) -> crate::client::customize::CustomizableOperation<
102 crate::operation::create_virtual_node::CreateVirtualNodeOutput,
103 crate::operation::create_virtual_node::CreateVirtualNodeError,
104 Self,
105 > {
106 crate::client::customize::CustomizableOperation::new(self)
107 }
108 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109 self.set_config_override(::std::option::Option::Some(config_override.into()));
110 self
111 }
112
113 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114 self.config_override = config_override;
115 self
116 }
117 /// <p>The name to use for the virtual node.</p>
118 pub fn virtual_node_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.inner = self.inner.virtual_node_name(input.into());
120 self
121 }
122 /// <p>The name to use for the virtual node.</p>
123 pub fn set_virtual_node_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.inner = self.inner.set_virtual_node_name(input);
125 self
126 }
127 /// <p>The name to use for the virtual node.</p>
128 pub fn get_virtual_node_name(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_virtual_node_name()
130 }
131 /// <p>The name of the service mesh to create the virtual node in.</p>
132 pub fn mesh_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.mesh_name(input.into());
134 self
135 }
136 /// <p>The name of the service mesh to create the virtual node in.</p>
137 pub fn set_mesh_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_mesh_name(input);
139 self
140 }
141 /// <p>The name of the service mesh to create the virtual node in.</p>
142 pub fn get_mesh_name(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_mesh_name()
144 }
145 /// <p>The virtual node specification to apply.</p>
146 pub fn spec(mut self, input: crate::types::VirtualNodeSpec) -> Self {
147 self.inner = self.inner.spec(input);
148 self
149 }
150 /// <p>The virtual node specification to apply.</p>
151 pub fn set_spec(mut self, input: ::std::option::Option<crate::types::VirtualNodeSpec>) -> Self {
152 self.inner = self.inner.set_spec(input);
153 self
154 }
155 /// <p>The virtual node specification to apply.</p>
156 pub fn get_spec(&self) -> &::std::option::Option<crate::types::VirtualNodeSpec> {
157 self.inner.get_spec()
158 }
159 ///
160 /// Appends an item to `tags`.
161 ///
162 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
163 ///
164 /// <p>Optional metadata that you can apply to the virtual node to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
165 pub fn tags(mut self, input: crate::types::TagRef) -> Self {
166 self.inner = self.inner.tags(input);
167 self
168 }
169 /// <p>Optional metadata that you can apply to the virtual node to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
170 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>) -> Self {
171 self.inner = self.inner.set_tags(input);
172 self
173 }
174 /// <p>Optional metadata that you can apply to the virtual node to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
175 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagRef>> {
176 self.inner.get_tags()
177 }
178 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
179 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.client_token(input.into());
181 self
182 }
183 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
184 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185 self.inner = self.inner.set_client_token(input);
186 self
187 }
188 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
189 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
190 self.inner.get_client_token()
191 }
192 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
193 pub fn mesh_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194 self.inner = self.inner.mesh_owner(input.into());
195 self
196 }
197 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
198 pub fn set_mesh_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.inner = self.inner.set_mesh_owner(input);
200 self
201 }
202 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
203 pub fn get_mesh_owner(&self) -> &::std::option::Option<::std::string::String> {
204 self.inner.get_mesh_owner()
205 }
206}