Skip to content

Commit 7dd8679

Browse files
Adds support for cross account investigations for CloudWatch investigations AI Operations (AIOps).
1 parent 7d5353d commit 7dd8679

20 files changed

+523
-147
lines changed

generator/ServiceModels/aiops/aiops-2018-05-10.api.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@
288288
"tags":{"shape":"Tags"},
289289
"tagKeyBoundaries":{"shape":"TagKeyBoundaries"},
290290
"chatbotNotificationChannel":{"shape":"ChatbotNotificationChannel"},
291-
"isCloudTrailEventHistoryEnabled":{"shape":"Boolean"}
291+
"isCloudTrailEventHistoryEnabled":{"shape":"Boolean"},
292+
"crossAccountConfigurations":{"shape":"CrossAccountConfigurations"}
292293
}
293294
},
294295
"CreateInvestigationGroupOutput":{
@@ -297,6 +298,18 @@
297298
"arn":{"shape":"InvestigationGroupArn"}
298299
}
299300
},
301+
"CrossAccountConfiguration":{
302+
"type":"structure",
303+
"members":{
304+
"sourceRoleArn":{"shape":"RoleArn"}
305+
}
306+
},
307+
"CrossAccountConfigurations":{
308+
"type":"list",
309+
"member":{"shape":"CrossAccountConfiguration"},
310+
"max":25,
311+
"min":0
312+
},
300313
"DeleteInvestigationGroupPolicyOutput":{
301314
"type":"structure",
302315
"members":{
@@ -392,7 +405,8 @@
392405
"retentionInDays":{"shape":"Retention"},
393406
"chatbotNotificationChannel":{"shape":"ChatbotNotificationChannel"},
394407
"tagKeyBoundaries":{"shape":"TagKeyBoundaries"},
395-
"isCloudTrailEventHistoryEnabled":{"shape":"Boolean"}
408+
"isCloudTrailEventHistoryEnabled":{"shape":"Boolean"},
409+
"crossAccountConfigurations":{"shape":"CrossAccountConfigurations"}
396410
}
397411
},
398412
"IdentifierStringWithPatternAndLengthLimits":{
@@ -665,7 +679,8 @@
665679
"encryptionConfiguration":{"shape":"EncryptionConfiguration"},
666680
"tagKeyBoundaries":{"shape":"TagKeyBoundaries"},
667681
"chatbotNotificationChannel":{"shape":"ChatbotNotificationChannel"},
668-
"isCloudTrailEventHistoryEnabled":{"shape":"Boolean"}
682+
"isCloudTrailEventHistoryEnabled":{"shape":"Boolean"},
683+
"crossAccountConfigurations":{"shape":"CrossAccountConfigurations"}
669684
}
670685
},
671686
"ValidationException":{

generator/ServiceModels/aiops/aiops-2018-05-10.docs.json

Lines changed: 29 additions & 14 deletions
Large diffs are not rendered by default.

generator/ServiceModels/aiops/aiops-2018-05-10.normal.json

Lines changed: 42 additions & 14 deletions
Large diffs are not rendered by default.

sdk/code-analysis/ServiceAnalysis/AIOps/Generated/PropertyValueRules.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@
119119
<max>2048</max>
120120
<pattern>arn:.*</pattern>
121121
</property-value-rule>
122+
<property-value-rule>
123+
<property>Amazon.AIOps.Model.CrossAccountConfiguration.SourceRoleArn</property>
124+
<min>20</min>
125+
<max>2048</max>
126+
<pattern>arn:.*</pattern>
127+
</property-value-rule>
122128
<property-value-rule>
123129
<property>Amazon.AIOps.Model.EncryptionConfiguration.KmsKeyId</property>
124130
<min>1</min>

sdk/src/Services/AIOps/Generated/Model/CreateInvestigationGroupRequest.cs

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ namespace Amazon.AIOps.Model
6060
/// </para>
6161
///
6262
/// <para>
63-
/// To create an investigation group and set up Amazon Q Developer operational investigations,
64-
/// you must be signed in to an IAM principal that has the either the <c>AIOpsConsoleAdminPolicy</c>
63+
/// To create an investigation group and set up CloudWatch investigations, you must be
64+
/// signed in to an IAM principal that has the either the <c>AIOpsConsoleAdminPolicy</c>
6565
/// or the <c>AdministratorAccess</c> IAM policy attached, or to an account that has similar
6666
/// permissions.
6767
/// </para>
@@ -74,14 +74,15 @@ namespace Amazon.AIOps.Model
7474
/// </para>
7575
///
7676
/// <para>
77-
/// For more information about configuring CloudWatch alarms to work with Amazon Q Developer
78-
/// operational investigations, see
77+
/// For more information about configuring CloudWatch alarms to work with CloudWatch investigations,
78+
/// see
7979
/// </para>
8080
/// </important>
8181
/// </summary>
8282
public partial class CreateInvestigationGroupRequest : AmazonAIOpsRequest
8383
{
8484
private Dictionary<string, List<string>> _chatbotNotificationChannel = AWSConfigs.InitializeCollections ? new Dictionary<string, List<string>>() : null;
85+
private List<CrossAccountConfiguration> _crossAccountConfigurations = AWSConfigs.InitializeCollections ? new List<CrossAccountConfiguration>() : null;
8586
private EncryptionConfiguration _encryptionConfiguration;
8687
private bool? _isCloudTrailEventHistoryEnabled;
8788
private string _name;
@@ -93,11 +94,11 @@ public partial class CreateInvestigationGroupRequest : AmazonAIOpsRequest
9394
/// <summary>
9495
/// Gets and sets the property ChatbotNotificationChannel.
9596
/// <para>
96-
/// Use this structure to integrate Amazon Q Developer operational investigations with
97-
/// Amazon Q in chat applications. This structure is a string array. For the first string,
98-
/// specify the ARN of an Amazon SNS topic. For the array of strings, specify the ARNs
99-
/// of one or more Amazon Q in chat applications configurations that you want to associate
100-
/// 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
97+
/// Use this structure to integrate CloudWatch investigations with Amazon Q in chat applications.
98+
/// This structure is a string array. For the first string, specify the ARN of an Amazon
99+
/// SNS topic. For the array of strings, specify the ARNs of one or more Amazon Q in chat
100+
/// applications configurations that you want to associate with that topic. For more information
101+
/// about these configuration ARNs, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/getting-started.html">Getting
101102
/// 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
102103
/// type defined by Amazon Web Services Chatbot</a>.
103104
/// </para>
@@ -114,12 +115,32 @@ internal bool IsSetChatbotNotificationChannel()
114115
return this._chatbotNotificationChannel != null && (this._chatbotNotificationChannel.Count > 0 || !AWSConfigs.InitializeCollections);
115116
}
116117

118+
/// <summary>
119+
/// Gets and sets the property CrossAccountConfigurations.
120+
/// <para>
121+
/// Number of <c>sourceAccountId</c> values that have been configured for cross-account
122+
/// access.
123+
/// </para>
124+
/// </summary>
125+
[AWSProperty(Min=0, Max=25)]
126+
public List<CrossAccountConfiguration> CrossAccountConfigurations
127+
{
128+
get { return this._crossAccountConfigurations; }
129+
set { this._crossAccountConfigurations = value; }
130+
}
131+
132+
// Check to see if CrossAccountConfigurations property is set
133+
internal bool IsSetCrossAccountConfigurations()
134+
{
135+
return this._crossAccountConfigurations != null && (this._crossAccountConfigurations.Count > 0 || !AWSConfigs.InitializeCollections);
136+
}
137+
117138
/// <summary>
118139
/// Gets and sets the property EncryptionConfiguration.
119140
/// <para>
120141
/// Use this structure if you want to use a customer managed KMS key to encrypt your investigation
121-
/// data. If you omit this parameter, Amazon Q Developer operational investigations will
122-
/// 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
142+
/// data. If you omit this parameter, CloudWatch investigations will use an Amazon Web
143+
/// 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
123144
/// of investigation data</a>.
124145
/// </para>
125146
/// </summary>
@@ -138,8 +159,8 @@ internal bool IsSetEncryptionConfiguration()
138159
/// <summary>
139160
/// Gets and sets the property IsCloudTrailEventHistoryEnabled.
140161
/// <para>
141-
/// Specify <c>true</c> to enable Amazon Q Developer operational investigations to have
142-
/// access to change events that are recorded by CloudTrail. The default is <c>true</c>.
162+
/// Specify <c>true</c> to enable CloudWatch investigations to have access to change events
163+
/// that are recorded by CloudTrail. The default is <c>true</c>.
143164
/// </para>
144165
/// </summary>
145166
public bool IsCloudTrailEventHistoryEnabled
@@ -157,7 +178,7 @@ internal bool IsSetIsCloudTrailEventHistoryEnabled()
157178
/// <summary>
158179
/// Gets and sets the property Name.
159180
/// <para>
160-
/// A name for the investigation group.
181+
/// Provides a name for the investigation group.
161182
/// </para>
162183
/// </summary>
163184
[AWSProperty(Required=true, Min=1, Max=512)]
@@ -200,10 +221,9 @@ internal bool IsSetRetentionInDays()
200221
/// <summary>
201222
/// Gets and sets the property RoleArn.
202223
/// <para>
203-
/// Specify the ARN of the IAM role that Amazon Q Developer operational investigations
204-
/// will use when it gathers investigation data. The permissions in this role determine
205-
/// which of your resources that Amazon Q Developer operational investigations will have
206-
/// access to during investigations.
224+
/// Specify the ARN of the IAM role that CloudWatch investigations will use when it gathers
225+
/// investigation data. The permissions in this role determine which of your resources
226+
/// that CloudWatch investigations will have access to during investigations.
207227
/// </para>
208228
///
209229
/// <para>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the aiops-2018-05-10.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.AIOps.Model
31+
{
32+
/// <summary>
33+
/// This structure contains information about the cross-account configuration in the account.
34+
/// </summary>
35+
public partial class CrossAccountConfiguration
36+
{
37+
private string _sourceRoleArn;
38+
39+
/// <summary>
40+
/// Gets and sets the property SourceRoleArn.
41+
/// <para>
42+
/// The ARN of an existing role which will be used to do investigations on your behalf.
43+
///
44+
/// </para>
45+
/// </summary>
46+
[AWSProperty(Min=20, Max=2048)]
47+
public string SourceRoleArn
48+
{
49+
get { return this._sourceRoleArn; }
50+
set { this._sourceRoleArn = value; }
51+
}
52+
53+
// Check to see if SourceRoleArn property is set
54+
internal bool IsSetSourceRoleArn()
55+
{
56+
return this._sourceRoleArn != null;
57+
}
58+
59+
}
60+
}

sdk/src/Services/AIOps/Generated/Model/GetInvestigationGroupResponse.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public partial class GetInvestigationGroupResponse : AmazonWebServiceResponse
3838
private Dictionary<string, List<string>> _chatbotNotificationChannel = AWSConfigs.InitializeCollections ? new Dictionary<string, List<string>>() : null;
3939
private DateTime? _createdAt;
4040
private string _createdBy;
41+
private List<CrossAccountConfiguration> _crossAccountConfigurations = AWSConfigs.InitializeCollections ? new List<CrossAccountConfiguration>() : null;
4142
private EncryptionConfiguration _encryptionConfiguration;
4243
private bool? _isCloudTrailEventHistoryEnabled;
4344
private DateTime? _lastModifiedAt;
@@ -125,6 +126,26 @@ internal bool IsSetCreatedBy()
125126
return this._createdBy != null;
126127
}
127128

129+
/// <summary>
130+
/// Gets and sets the property CrossAccountConfigurations.
131+
/// <para>
132+
/// Lists the <c>AWSAccountId</c> of the accounts configured for cross-account access
133+
/// and the results of the last scan performed on each account.
134+
/// </para>
135+
/// </summary>
136+
[AWSProperty(Min=0, Max=25)]
137+
public List<CrossAccountConfiguration> CrossAccountConfigurations
138+
{
139+
get { return this._crossAccountConfigurations; }
140+
set { this._crossAccountConfigurations = value; }
141+
}
142+
143+
// Check to see if CrossAccountConfigurations property is set
144+
internal bool IsSetCrossAccountConfigurations()
145+
{
146+
return this._crossAccountConfigurations != null && (this._crossAccountConfigurations.Count > 0 || !AWSConfigs.InitializeCollections);
147+
}
148+
128149
/// <summary>
129150
/// Gets and sets the property EncryptionConfiguration.
130151
/// <para>
@@ -148,8 +169,8 @@ internal bool IsSetEncryptionConfiguration()
148169
/// <summary>
149170
/// Gets and sets the property IsCloudTrailEventHistoryEnabled.
150171
/// <para>
151-
/// Specifies whether Amazon Q Developer operational investigationshas access to change
152-
/// events that are recorded by CloudTrail.
172+
/// Specifies whether CloudWatch investigationshas access to change events that are recorded
173+
/// by CloudTrail.
153174
/// </para>
154175
/// </summary>
155176
public bool IsCloudTrailEventHistoryEnabled

sdk/src/Services/AIOps/Generated/Model/Internal/MarshallTransformations/CreateInvestigationGroupRequestMarshaller.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@ public IRequest Marshall(CreateInvestigationGroupRequest publicRequest)
8686
context.Writer.WriteObjectEnd();
8787
}
8888

89+
if(publicRequest.IsSetCrossAccountConfigurations())
90+
{
91+
context.Writer.WritePropertyName("crossAccountConfigurations");
92+
context.Writer.WriteArrayStart();
93+
foreach(var publicRequestCrossAccountConfigurationsListValue in publicRequest.CrossAccountConfigurations)
94+
{
95+
context.Writer.WriteObjectStart();
96+
97+
var marshaller = CrossAccountConfigurationMarshaller.Instance;
98+
marshaller.Marshall(publicRequestCrossAccountConfigurationsListValue, context);
99+
100+
context.Writer.WriteObjectEnd();
101+
}
102+
context.Writer.WriteArrayEnd();
103+
}
104+
89105
if(publicRequest.IsSetEncryptionConfiguration())
90106
{
91107
context.Writer.WritePropertyName("encryptionConfiguration");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the aiops-2018-05-10.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Text;
24+
using System.Xml.Serialization;
25+
26+
using Amazon.AIOps.Model;
27+
using Amazon.Runtime;
28+
using Amazon.Runtime.Internal;
29+
using Amazon.Runtime.Internal.Transform;
30+
using Amazon.Runtime.Internal.Util;
31+
using ThirdParty.Json.LitJson;
32+
33+
#pragma warning disable CS0612,CS0618
34+
namespace Amazon.AIOps.Model.Internal.MarshallTransformations
35+
{
36+
/// <summary>
37+
/// CrossAccountConfiguration Marshaller
38+
/// </summary>
39+
public class CrossAccountConfigurationMarshaller : IRequestMarshaller<CrossAccountConfiguration, JsonMarshallerContext>
40+
{
41+
/// <summary>
42+
/// Unmarshaller the response from the service to the response class.
43+
/// </summary>
44+
/// <param name="requestObject"></param>
45+
/// <param name="context"></param>
46+
/// <returns></returns>
47+
public void Marshall(CrossAccountConfiguration requestObject, JsonMarshallerContext context)
48+
{
49+
if(requestObject == null)
50+
return;
51+
if(requestObject.IsSetSourceRoleArn())
52+
{
53+
context.Writer.WritePropertyName("sourceRoleArn");
54+
context.Writer.Write(requestObject.SourceRoleArn);
55+
}
56+
57+
}
58+
59+
/// <summary>
60+
/// Singleton Marshaller.
61+
/// </summary>
62+
public readonly static CrossAccountConfigurationMarshaller Instance = new CrossAccountConfigurationMarshaller();
63+
64+
}
65+
}

0 commit comments

Comments
 (0)