aws_sdk_apprunner/operation/create_service/
_create_service_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateServiceInput {
6    /// <p>A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region.</p>
7    pub service_name: ::std::option::Option<::std::string::String>,
8    /// <p>The source to deploy to the App Runner service. It can be a code or an image repository.</p>
9    pub source_configuration: ::std::option::Option<crate::types::SourceConfiguration>,
10    /// <p>The runtime configuration of instances (scaling units) of your service.</p>
11    pub instance_configuration: ::std::option::Option<crate::types::InstanceConfiguration>,
12    /// <p>An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair.</p>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14    /// <p>An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. By default, App Runner uses an Amazon Web Services managed key.</p>
15    pub encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
16    /// <p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>
17    pub health_check_configuration: ::std::option::Option<crate::types::HealthCheckConfiguration>,
18    /// <p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration.</p>
19    /// <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3</code></p>
20    /// <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability</code></p>
21    pub auto_scaling_configuration_arn: ::std::option::Option<::std::string::String>,
22    /// <p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>
23    pub network_configuration: ::std::option::Option<crate::types::NetworkConfiguration>,
24    /// <p>The observability configuration of your service.</p>
25    pub observability_configuration: ::std::option::Option<crate::types::ServiceObservabilityConfiguration>,
26}
27impl CreateServiceInput {
28    /// <p>A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region.</p>
29    pub fn service_name(&self) -> ::std::option::Option<&str> {
30        self.service_name.as_deref()
31    }
32    /// <p>The source to deploy to the App Runner service. It can be a code or an image repository.</p>
33    pub fn source_configuration(&self) -> ::std::option::Option<&crate::types::SourceConfiguration> {
34        self.source_configuration.as_ref()
35    }
36    /// <p>The runtime configuration of instances (scaling units) of your service.</p>
37    pub fn instance_configuration(&self) -> ::std::option::Option<&crate::types::InstanceConfiguration> {
38        self.instance_configuration.as_ref()
39    }
40    /// <p>An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair.</p>
41    ///
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
43    pub fn tags(&self) -> &[crate::types::Tag] {
44        self.tags.as_deref().unwrap_or_default()
45    }
46    /// <p>An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. By default, App Runner uses an Amazon Web Services managed key.</p>
47    pub fn encryption_configuration(&self) -> ::std::option::Option<&crate::types::EncryptionConfiguration> {
48        self.encryption_configuration.as_ref()
49    }
50    /// <p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>
51    pub fn health_check_configuration(&self) -> ::std::option::Option<&crate::types::HealthCheckConfiguration> {
52        self.health_check_configuration.as_ref()
53    }
54    /// <p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration.</p>
55    /// <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3</code></p>
56    /// <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability</code></p>
57    pub fn auto_scaling_configuration_arn(&self) -> ::std::option::Option<&str> {
58        self.auto_scaling_configuration_arn.as_deref()
59    }
60    /// <p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>
61    pub fn network_configuration(&self) -> ::std::option::Option<&crate::types::NetworkConfiguration> {
62        self.network_configuration.as_ref()
63    }
64    /// <p>The observability configuration of your service.</p>
65    pub fn observability_configuration(&self) -> ::std::option::Option<&crate::types::ServiceObservabilityConfiguration> {
66        self.observability_configuration.as_ref()
67    }
68}
69impl CreateServiceInput {
70    /// Creates a new builder-style object to manufacture [`CreateServiceInput`](crate::operation::create_service::CreateServiceInput).
71    pub fn builder() -> crate::operation::create_service::builders::CreateServiceInputBuilder {
72        crate::operation::create_service::builders::CreateServiceInputBuilder::default()
73    }
74}
75
76/// A builder for [`CreateServiceInput`](crate::operation::create_service::CreateServiceInput).
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct CreateServiceInputBuilder {
80    pub(crate) service_name: ::std::option::Option<::std::string::String>,
81    pub(crate) source_configuration: ::std::option::Option<crate::types::SourceConfiguration>,
82    pub(crate) instance_configuration: ::std::option::Option<crate::types::InstanceConfiguration>,
83    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
84    pub(crate) encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
85    pub(crate) health_check_configuration: ::std::option::Option<crate::types::HealthCheckConfiguration>,
86    pub(crate) auto_scaling_configuration_arn: ::std::option::Option<::std::string::String>,
87    pub(crate) network_configuration: ::std::option::Option<crate::types::NetworkConfiguration>,
88    pub(crate) observability_configuration: ::std::option::Option<crate::types::ServiceObservabilityConfiguration>,
89}
90impl CreateServiceInputBuilder {
91    /// <p>A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region.</p>
92    /// This field is required.
93    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.service_name = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region.</p>
98    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.service_name = input;
100        self
101    }
102    /// <p>A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region.</p>
103    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
104        &self.service_name
105    }
106    /// <p>The source to deploy to the App Runner service. It can be a code or an image repository.</p>
107    /// This field is required.
108    pub fn source_configuration(mut self, input: crate::types::SourceConfiguration) -> Self {
109        self.source_configuration = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>The source to deploy to the App Runner service. It can be a code or an image repository.</p>
113    pub fn set_source_configuration(mut self, input: ::std::option::Option<crate::types::SourceConfiguration>) -> Self {
114        self.source_configuration = input;
115        self
116    }
117    /// <p>The source to deploy to the App Runner service. It can be a code or an image repository.</p>
118    pub fn get_source_configuration(&self) -> &::std::option::Option<crate::types::SourceConfiguration> {
119        &self.source_configuration
120    }
121    /// <p>The runtime configuration of instances (scaling units) of your service.</p>
122    pub fn instance_configuration(mut self, input: crate::types::InstanceConfiguration) -> Self {
123        self.instance_configuration = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The runtime configuration of instances (scaling units) of your service.</p>
127    pub fn set_instance_configuration(mut self, input: ::std::option::Option<crate::types::InstanceConfiguration>) -> Self {
128        self.instance_configuration = input;
129        self
130    }
131    /// <p>The runtime configuration of instances (scaling units) of your service.</p>
132    pub fn get_instance_configuration(&self) -> &::std::option::Option<crate::types::InstanceConfiguration> {
133        &self.instance_configuration
134    }
135    /// Appends an item to `tags`.
136    ///
137    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
138    ///
139    /// <p>An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair.</p>
140    pub fn tags(mut self, input: crate::types::Tag) -> Self {
141        let mut v = self.tags.unwrap_or_default();
142        v.push(input);
143        self.tags = ::std::option::Option::Some(v);
144        self
145    }
146    /// <p>An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair.</p>
147    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
148        self.tags = input;
149        self
150    }
151    /// <p>An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair.</p>
152    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
153        &self.tags
154    }
155    /// <p>An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. By default, App Runner uses an Amazon Web Services managed key.</p>
156    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
157        self.encryption_configuration = ::std::option::Option::Some(input);
158        self
159    }
160    /// <p>An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. By default, App Runner uses an Amazon Web Services managed key.</p>
161    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
162        self.encryption_configuration = input;
163        self
164    }
165    /// <p>An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. By default, App Runner uses an Amazon Web Services managed key.</p>
166    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
167        &self.encryption_configuration
168    }
169    /// <p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>
170    pub fn health_check_configuration(mut self, input: crate::types::HealthCheckConfiguration) -> Self {
171        self.health_check_configuration = ::std::option::Option::Some(input);
172        self
173    }
174    /// <p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>
175    pub fn set_health_check_configuration(mut self, input: ::std::option::Option<crate::types::HealthCheckConfiguration>) -> Self {
176        self.health_check_configuration = input;
177        self
178    }
179    /// <p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>
180    pub fn get_health_check_configuration(&self) -> &::std::option::Option<crate::types::HealthCheckConfiguration> {
181        &self.health_check_configuration
182    }
183    /// <p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration.</p>
184    /// <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3</code></p>
185    /// <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability</code></p>
186    pub fn auto_scaling_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.auto_scaling_configuration_arn = ::std::option::Option::Some(input.into());
188        self
189    }
190    /// <p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration.</p>
191    /// <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3</code></p>
192    /// <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability</code></p>
193    pub fn set_auto_scaling_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.auto_scaling_configuration_arn = input;
195        self
196    }
197    /// <p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration.</p>
198    /// <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3</code></p>
199    /// <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability</code></p>
200    pub fn get_auto_scaling_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
201        &self.auto_scaling_configuration_arn
202    }
203    /// <p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>
204    pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
205        self.network_configuration = ::std::option::Option::Some(input);
206        self
207    }
208    /// <p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>
209    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
210        self.network_configuration = input;
211        self
212    }
213    /// <p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>
214    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
215        &self.network_configuration
216    }
217    /// <p>The observability configuration of your service.</p>
218    pub fn observability_configuration(mut self, input: crate::types::ServiceObservabilityConfiguration) -> Self {
219        self.observability_configuration = ::std::option::Option::Some(input);
220        self
221    }
222    /// <p>The observability configuration of your service.</p>
223    pub fn set_observability_configuration(mut self, input: ::std::option::Option<crate::types::ServiceObservabilityConfiguration>) -> Self {
224        self.observability_configuration = input;
225        self
226    }
227    /// <p>The observability configuration of your service.</p>
228    pub fn get_observability_configuration(&self) -> &::std::option::Option<crate::types::ServiceObservabilityConfiguration> {
229        &self.observability_configuration
230    }
231    /// Consumes the builder and constructs a [`CreateServiceInput`](crate::operation::create_service::CreateServiceInput).
232    pub fn build(
233        self,
234    ) -> ::std::result::Result<crate::operation::create_service::CreateServiceInput, ::aws_smithy_types::error::operation::BuildError> {
235        ::std::result::Result::Ok(crate::operation::create_service::CreateServiceInput {
236            service_name: self.service_name,
237            source_configuration: self.source_configuration,
238            instance_configuration: self.instance_configuration,
239            tags: self.tags,
240            encryption_configuration: self.encryption_configuration,
241            health_check_configuration: self.health_check_configuration,
242            auto_scaling_configuration_arn: self.auto_scaling_configuration_arn,
243            network_configuration: self.network_configuration,
244            observability_configuration: self.observability_configuration,
245        })
246    }
247}