Skip to content

Commit 69bdfb1

Browse files
Adds support for cross account investigations for CloudWatch investigations AI Operations (AIOps).
1 parent 0713eed commit 69bdfb1

18 files changed

+506
-125
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: 43 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>
@@ -119,12 +120,37 @@ internal bool IsSetChatbotNotificationChannel()
119120
return this._chatbotNotificationChannel != null && (this._chatbotNotificationChannel.Count > 0 || !AWSConfigs.InitializeCollections);
120121
}
121122

123+
/// <summary>
124+
/// Gets and sets the property CrossAccountConfigurations.
125+
/// <para>
126+
/// Number of <c>sourceAccountId</c> values that have been configured for cross-account
127+
/// access.
128+
/// </para>
129+
/// <para />
130+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
131+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
132+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
133+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
134+
/// </summary>
135+
[AWSProperty(Min=0, Max=25)]
136+
public List<CrossAccountConfiguration> CrossAccountConfigurations
137+
{
138+
get { return this._crossAccountConfigurations; }
139+
set { this._crossAccountConfigurations = value; }
140+
}
141+
142+
// Check to see if CrossAccountConfigurations property is set
143+
internal bool IsSetCrossAccountConfigurations()
144+
{
145+
return this._crossAccountConfigurations != null && (this._crossAccountConfigurations.Count > 0 || !AWSConfigs.InitializeCollections);
146+
}
147+
122148
/// <summary>
123149
/// Gets and sets the property EncryptionConfiguration.
124150
/// <para>
125151
/// Use this structure if you want to use a customer managed KMS key to encrypt your investigation
126-
/// data. If you omit this parameter, Amazon Q Developer operational investigations will
127-
/// 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
152+
/// data. If you omit this parameter, CloudWatch investigations will use an Amazon Web
153+
/// 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
128154
/// of investigation data</a>.
129155
/// </para>
130156
/// </summary>
@@ -143,8 +169,8 @@ internal bool IsSetEncryptionConfiguration()
143169
/// <summary>
144170
/// Gets and sets the property IsCloudTrailEventHistoryEnabled.
145171
/// <para>
146-
/// Specify <c>true</c> to enable Amazon Q Developer operational investigations to have
147-
/// access to change events that are recorded by CloudTrail. The default is <c>true</c>.
172+
/// Specify <c>true</c> to enable CloudWatch investigations to have access to change events
173+
/// that are recorded by CloudTrail. The default is <c>true</c>.
148174
/// </para>
149175
/// </summary>
150176
public bool? IsCloudTrailEventHistoryEnabled
@@ -162,7 +188,7 @@ internal bool IsSetIsCloudTrailEventHistoryEnabled()
162188
/// <summary>
163189
/// Gets and sets the property Name.
164190
/// <para>
165-
/// A name for the investigation group.
191+
/// Provides a name for the investigation group.
166192
/// </para>
167193
/// </summary>
168194
[AWSProperty(Required=true, Min=1, Max=512)]
@@ -205,10 +231,9 @@ internal bool IsSetRetentionInDays()
205231
/// <summary>
206232
/// Gets and sets the property RoleArn.
207233
/// <para>
208-
/// Specify the ARN of the IAM role that Amazon Q Developer operational investigations
209-
/// will use when it gathers investigation data. The permissions in this role determine
210-
/// which of your resources that Amazon Q Developer operational investigations will have
211-
/// access to during investigations.
234+
/// Specify the ARN of the IAM role that CloudWatch investigations will use when it gathers
235+
/// investigation data. The permissions in this role determine which of your resources
236+
/// that CloudWatch investigations will have access to during investigations.
212237
/// </para>
213238
///
214239
/// <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: 28 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;
@@ -130,6 +131,31 @@ internal bool IsSetCreatedBy()
130131
return this._createdBy != null;
131132
}
132133

134+
/// <summary>
135+
/// Gets and sets the property CrossAccountConfigurations.
136+
/// <para>
137+
/// Lists the <c>AWSAccountId</c> of the accounts configured for cross-account access
138+
/// and the results of the last scan performed on each account.
139+
/// </para>
140+
/// <para />
141+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
142+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
143+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
144+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
145+
/// </summary>
146+
[AWSProperty(Min=0, Max=25)]
147+
public List<CrossAccountConfiguration> CrossAccountConfigurations
148+
{
149+
get { return this._crossAccountConfigurations; }
150+
set { this._crossAccountConfigurations = value; }
151+
}
152+
153+
// Check to see if CrossAccountConfigurations property is set
154+
internal bool IsSetCrossAccountConfigurations()
155+
{
156+
return this._crossAccountConfigurations != null && (this._crossAccountConfigurations.Count > 0 || !AWSConfigs.InitializeCollections);
157+
}
158+
133159
/// <summary>
134160
/// Gets and sets the property EncryptionConfiguration.
135161
/// <para>
@@ -153,8 +179,8 @@ internal bool IsSetEncryptionConfiguration()
153179
/// <summary>
154180
/// Gets and sets the property IsCloudTrailEventHistoryEnabled.
155181
/// <para>
156-
/// Specifies whether Amazon Q Developer operational investigationshas access to change
157-
/// events that are recorded by CloudTrail.
182+
/// Specifies whether CloudWatch investigationshas access to change events that are recorded
183+
/// by CloudTrail.
158184
/// </para>
159185
/// </summary>
160186
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
@@ -92,6 +92,22 @@ public IRequest Marshall(CreateInvestigationGroupRequest publicRequest)
9292
context.Writer.WriteEndObject();
9393
}
9494

95+
if(publicRequest.IsSetCrossAccountConfigurations())
96+
{
97+
context.Writer.WritePropertyName("crossAccountConfigurations");
98+
context.Writer.WriteStartArray();
99+
foreach(var publicRequestCrossAccountConfigurationsListValue in publicRequest.CrossAccountConfigurations)
100+
{
101+
context.Writer.WriteStartObject();
102+
103+
var marshaller = CrossAccountConfigurationMarshaller.Instance;
104+
marshaller.Marshall(publicRequestCrossAccountConfigurationsListValue, context);
105+
106+
context.Writer.WriteEndObject();
107+
}
108+
context.Writer.WriteEndArray();
109+
}
110+
95111
if(publicRequest.IsSetEncryptionConfiguration())
96112
{
97113
context.Writer.WritePropertyName("encryptionConfiguration");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
#pragma warning disable CS0612,CS0618
32+
namespace Amazon.AIOps.Model.Internal.MarshallTransformations
33+
{
34+
/// <summary>
35+
/// CrossAccountConfiguration Marshaller
36+
/// </summary>
37+
public class CrossAccountConfigurationMarshaller : IRequestMarshaller<CrossAccountConfiguration, JsonMarshallerContext>
38+
{
39+
/// <summary>
40+
/// Unmarshaller the response from the service to the response class.
41+
/// </summary>
42+
/// <param name="requestObject"></param>
43+
/// <param name="context"></param>
44+
/// <returns></returns>
45+
public void Marshall(CrossAccountConfiguration requestObject, JsonMarshallerContext context)
46+
{
47+
if(requestObject == null)
48+
return;
49+
if(requestObject.IsSetSourceRoleArn())
50+
{
51+
context.Writer.WritePropertyName("sourceRoleArn");
52+
context.Writer.WriteStringValue(requestObject.SourceRoleArn);
53+
}
54+
55+
}
56+
57+
/// <summary>
58+
/// Singleton Marshaller.
59+
/// </summary>
60+
public readonly static CrossAccountConfigurationMarshaller Instance = new CrossAccountConfigurationMarshaller();
61+
62+
}
63+
}

0 commit comments

Comments
 (0)