aws_sdk_aiops/operation/create_investigation_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_investigation_group::_create_investigation_group_output::CreateInvestigationGroupOutputBuilder;
3
4pub use crate::operation::create_investigation_group::_create_investigation_group_input::CreateInvestigationGroupInputBuilder;
5
6impl crate::operation::create_investigation_group::builders::CreateInvestigationGroupInputBuilder {
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_investigation_group::CreateInvestigationGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_investigation_group::CreateInvestigationGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_investigation_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateInvestigationGroup`.
24///
25/// <p>Creates an <i>investigation group</i> in your account. Creating an investigation group is a one-time setup task for each Region in your account. It is a necessary task to be able to perform investigations.</p>
26/// <p>Settings in the investigation group help you centrally manage the common properties of your investigations, such as the following:</p>
27/// <ul>
28/// <li>
29/// <p>Who can access the investigations</p></li>
30/// <li>
31/// <p>Whether investigation data is encrypted with a customer managed Key Management Service key.</p></li>
32/// <li>
33/// <p>How long investigations and their data are retained by default.</p></li>
34/// </ul>
35/// <p>Currently, you can have one investigation group in each Region in your account. Each investigation in a Region is a part of the investigation group in that Region</p>
36/// <p>To create an investigation group and set up CloudWatch investigations, you must be signed in to an IAM principal that has either the <code>AIOpsConsoleAdminPolicy</code> or the <code>AdministratorAccess</code> IAM policy attached, or to an account that has similar permissions.</p><important>
37/// <p>You can configure CloudWatch alarms to start investigations and add events to investigations. If you create your investigation group with <code>CreateInvestigationGroup</code> and you want to enable alarms to do this, you must use <code>PutInvestigationGroupPolicy</code> to create a resource policy that grants this permission to CloudWatch alarms.</p>
38/// <p>For more information about configuring CloudWatch alarms, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html">Using Amazon CloudWatch alarms</a></p>
39/// </important>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct CreateInvestigationGroupFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::create_investigation_group::builders::CreateInvestigationGroupInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::create_investigation_group::CreateInvestigationGroupOutput,
49        crate::operation::create_investigation_group::CreateInvestigationGroupError,
50    > for CreateInvestigationGroupFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::create_investigation_group::CreateInvestigationGroupOutput,
58            crate::operation::create_investigation_group::CreateInvestigationGroupError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl CreateInvestigationGroupFluentBuilder {
65    /// Creates a new `CreateInvestigationGroupFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the CreateInvestigationGroup as a reference.
74    pub fn as_input(&self) -> &crate::operation::create_investigation_group::builders::CreateInvestigationGroupInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::create_investigation_group::CreateInvestigationGroupOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::create_investigation_group::CreateInvestigationGroupError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::create_investigation_group::CreateInvestigationGroup::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::create_investigation_group::CreateInvestigationGroup::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::create_investigation_group::CreateInvestigationGroupOutput,
111        crate::operation::create_investigation_group::CreateInvestigationGroupError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>Provides a name for the investigation group.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>Provides a name for the investigation group.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>Provides a name for the investigation group.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>Specify the ARN of the IAM role that CloudWatch investigations will use when it gathers investigation data. The permissions in this role determine which of your resources that CloudWatch investigations will have access to during investigations.</p>
140    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Security.html#Investigations-Security-Data">How to control what data CloudWatch investigations has access to during investigations</a>.</p>
141    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.role_arn(input.into());
143        self
144    }
145    /// <p>Specify the ARN of the IAM role that CloudWatch investigations will use when it gathers investigation data. The permissions in this role determine which of your resources that CloudWatch investigations will have access to during investigations.</p>
146    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Security.html#Investigations-Security-Data">How to control what data CloudWatch investigations has access to during investigations</a>.</p>
147    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_role_arn(input);
149        self
150    }
151    /// <p>Specify the ARN of the IAM role that CloudWatch investigations will use when it gathers investigation data. The permissions in this role determine which of your resources that CloudWatch investigations will have access to during investigations.</p>
152    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Security.html#Investigations-Security-Data">How to control what data CloudWatch investigations has access to during investigations</a>.</p>
153    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_role_arn()
155    }
156    /// <p>Use this structure if you want to use a customer managed KMS key to encrypt your investigation data. If you omit this parameter, CloudWatch investigations will use an Amazon Web Services key to encrypt the data. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Security.html#Investigations-KMS">Encryption of investigation data</a>.</p>
157    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
158        self.inner = self.inner.encryption_configuration(input);
159        self
160    }
161    /// <p>Use this structure if you want to use a customer managed KMS key to encrypt your investigation data. If you omit this parameter, CloudWatch investigations will use an Amazon Web Services key to encrypt the data. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Security.html#Investigations-KMS">Encryption of investigation data</a>.</p>
162    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
163        self.inner = self.inner.set_encryption_configuration(input);
164        self
165    }
166    /// <p>Use this structure if you want to use a customer managed KMS key to encrypt your investigation data. If you omit this parameter, CloudWatch investigations will use an Amazon Web Services key to encrypt the data. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Security.html#Investigations-KMS">Encryption of investigation data</a>.</p>
167    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
168        self.inner.get_encryption_configuration()
169    }
170    /// <p>Specify how long that investigation data is kept. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Retention.html">Operational investigation data retention</a>.</p>
171    /// <p>If you omit this parameter, the default of 90 days is used.</p>
172    pub fn retention_in_days(mut self, input: i64) -> Self {
173        self.inner = self.inner.retention_in_days(input);
174        self
175    }
176    /// <p>Specify how long that investigation data is kept. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Retention.html">Operational investigation data retention</a>.</p>
177    /// <p>If you omit this parameter, the default of 90 days is used.</p>
178    pub fn set_retention_in_days(mut self, input: ::std::option::Option<i64>) -> Self {
179        self.inner = self.inner.set_retention_in_days(input);
180        self
181    }
182    /// <p>Specify how long that investigation data is kept. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Investigations-Retention.html">Operational investigation data retention</a>.</p>
183    /// <p>If you omit this parameter, the default of 90 days is used.</p>
184    pub fn get_retention_in_days(&self) -> &::std::option::Option<i64> {
185        self.inner.get_retention_in_days()
186    }
187    ///
188    /// Adds a key-value pair to `tags`.
189    ///
190    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
191    ///
192    /// <p>A list of key-value pairs to associate with the investigation group. You can associate as many as 50 tags with an investigation group. To be able to associate tags when you create the investigation group, you must have the <code>cloudwatch:TagResource</code> permission.</p>
193    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
194    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.inner = self.inner.tags(k.into(), v.into());
196        self
197    }
198    /// <p>A list of key-value pairs to associate with the investigation group. You can associate as many as 50 tags with an investigation group. To be able to associate tags when you create the investigation group, you must have the <code>cloudwatch:TagResource</code> permission.</p>
199    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
200    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
201        self.inner = self.inner.set_tags(input);
202        self
203    }
204    /// <p>A list of key-value pairs to associate with the investigation group. You can associate as many as 50 tags with an investigation group. To be able to associate tags when you create the investigation group, you must have the <code>cloudwatch:TagResource</code> permission.</p>
205    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
206    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
207        self.inner.get_tags()
208    }
209    ///
210    /// Appends an item to `tagKeyBoundaries`.
211    ///
212    /// To override the contents of this collection use [`set_tag_key_boundaries`](Self::set_tag_key_boundaries).
213    ///
214    /// <p>Enter the existing custom tag keys for custom applications in your system. Resource tags help CloudWatch investigations narrow the search space when it is unable to discover definite relationships between resources. For example, to discover that an Amazon ECS service depends on an Amazon RDS database, CloudWatch investigations can discover this relationship using data sources such as X-Ray and CloudWatch Application Signals. However, if you haven't deployed these features, CloudWatch investigations will attempt to identify possible relationships. Tag boundaries can be used to narrow the resources that will be discovered by CloudWatch investigations in these cases.</p>
215    /// <p>You don't need to enter tags created by myApplications or CloudFormation, because CloudWatch investigations can automatically detect those tags.</p>
216    pub fn tag_key_boundaries(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.inner = self.inner.tag_key_boundaries(input.into());
218        self
219    }
220    /// <p>Enter the existing custom tag keys for custom applications in your system. Resource tags help CloudWatch investigations narrow the search space when it is unable to discover definite relationships between resources. For example, to discover that an Amazon ECS service depends on an Amazon RDS database, CloudWatch investigations can discover this relationship using data sources such as X-Ray and CloudWatch Application Signals. However, if you haven't deployed these features, CloudWatch investigations will attempt to identify possible relationships. Tag boundaries can be used to narrow the resources that will be discovered by CloudWatch investigations in these cases.</p>
221    /// <p>You don't need to enter tags created by myApplications or CloudFormation, because CloudWatch investigations can automatically detect those tags.</p>
222    pub fn set_tag_key_boundaries(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
223        self.inner = self.inner.set_tag_key_boundaries(input);
224        self
225    }
226    /// <p>Enter the existing custom tag keys for custom applications in your system. Resource tags help CloudWatch investigations narrow the search space when it is unable to discover definite relationships between resources. For example, to discover that an Amazon ECS service depends on an Amazon RDS database, CloudWatch investigations can discover this relationship using data sources such as X-Ray and CloudWatch Application Signals. However, if you haven't deployed these features, CloudWatch investigations will attempt to identify possible relationships. Tag boundaries can be used to narrow the resources that will be discovered by CloudWatch investigations in these cases.</p>
227    /// <p>You don't need to enter tags created by myApplications or CloudFormation, because CloudWatch investigations can automatically detect those tags.</p>
228    pub fn get_tag_key_boundaries(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
229        self.inner.get_tag_key_boundaries()
230    }
231    ///
232    /// Adds a key-value pair to `chatbotNotificationChannel`.
233    ///
234    /// To override the contents of this collection use [`set_chatbot_notification_channel`](Self::set_chatbot_notification_channel).
235    ///
236    /// <p>Use this structure to integrate CloudWatch investigations with chat applications. This structure is a string array. For the first string, specify the ARN of an Amazon SNS topic. For the array of strings, specify the ARNs of one or more chat applications configurations that you want to associate with that topic. For more information about these configuration ARNs, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/getting-started.html">Getting started with Amazon Q in chat applications</a> and <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awschatbot.html#awschatbot-resources-for-iam-policies">Resource type defined by Amazon Web Services Chatbot</a>.</p>
237    pub fn chatbot_notification_channel(
238        mut self,
239        k: impl ::std::convert::Into<::std::string::String>,
240        v: ::std::vec::Vec<::std::string::String>,
241    ) -> Self {
242        self.inner = self.inner.chatbot_notification_channel(k.into(), v);
243        self
244    }
245    /// <p>Use this structure to integrate CloudWatch investigations with chat applications. This structure is a string array. For the first string, specify the ARN of an Amazon SNS topic. For the array of strings, specify the ARNs of one or more chat applications configurations that you want to associate with that topic. For more information about these configuration ARNs, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/getting-started.html">Getting started with Amazon Q in chat applications</a> and <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awschatbot.html#awschatbot-resources-for-iam-policies">Resource type defined by Amazon Web Services Chatbot</a>.</p>
246    pub fn set_chatbot_notification_channel(
247        mut self,
248        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
249    ) -> Self {
250        self.inner = self.inner.set_chatbot_notification_channel(input);
251        self
252    }
253    /// <p>Use this structure to integrate CloudWatch investigations with chat applications. This structure is a string array. For the first string, specify the ARN of an Amazon SNS topic. For the array of strings, specify the ARNs of one or more chat applications configurations that you want to associate with that topic. For more information about these configuration ARNs, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/getting-started.html">Getting started with Amazon Q in chat applications</a> and <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awschatbot.html#awschatbot-resources-for-iam-policies">Resource type defined by Amazon Web Services Chatbot</a>.</p>
254    pub fn get_chatbot_notification_channel(
255        &self,
256    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
257        self.inner.get_chatbot_notification_channel()
258    }
259    /// <p>Specify <code>true</code> to enable CloudWatch investigations to have access to change events that are recorded by CloudTrail. The default is <code>true</code>.</p>
260    pub fn is_cloud_trail_event_history_enabled(mut self, input: bool) -> Self {
261        self.inner = self.inner.is_cloud_trail_event_history_enabled(input);
262        self
263    }
264    /// <p>Specify <code>true</code> to enable CloudWatch investigations to have access to change events that are recorded by CloudTrail. The default is <code>true</code>.</p>
265    pub fn set_is_cloud_trail_event_history_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
266        self.inner = self.inner.set_is_cloud_trail_event_history_enabled(input);
267        self
268    }
269    /// <p>Specify <code>true</code> to enable CloudWatch investigations to have access to change events that are recorded by CloudTrail. The default is <code>true</code>.</p>
270    pub fn get_is_cloud_trail_event_history_enabled(&self) -> &::std::option::Option<bool> {
271        self.inner.get_is_cloud_trail_event_history_enabled()
272    }
273    ///
274    /// Appends an item to `crossAccountConfigurations`.
275    ///
276    /// To override the contents of this collection use [`set_cross_account_configurations`](Self::set_cross_account_configurations).
277    ///
278    /// <p>List of <code>sourceRoleArn</code> values that have been configured for cross-account access.</p>
279    pub fn cross_account_configurations(mut self, input: crate::types::CrossAccountConfiguration) -> Self {
280        self.inner = self.inner.cross_account_configurations(input);
281        self
282    }
283    /// <p>List of <code>sourceRoleArn</code> values that have been configured for cross-account access.</p>
284    pub fn set_cross_account_configurations(
285        mut self,
286        input: ::std::option::Option<::std::vec::Vec<crate::types::CrossAccountConfiguration>>,
287    ) -> Self {
288        self.inner = self.inner.set_cross_account_configurations(input);
289        self
290    }
291    /// <p>List of <code>sourceRoleArn</code> values that have been configured for cross-account access.</p>
292    pub fn get_cross_account_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CrossAccountConfiguration>> {
293        self.inner.get_cross_account_configurations()
294    }
295}