createInvestigationGroup method
- required String name,
- required String roleArn,
- Map<
String, List< ? chatbotNotificationChannel,String> > - List<
CrossAccountConfiguration> ? crossAccountConfigurations, - EncryptionConfiguration? encryptionConfiguration,
- bool? isCloudTrailEventHistoryEnabled,
- int? retentionInDays,
- List<
String> ? tagKeyBoundaries, - Map<
String, String> ? tags,
Creates an investigation group 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.
Settings in the investigation group help you centrally manage the common properties of your investigations, such as the following:
- Who can access the investigations
- Whether investigation data is encrypted with a customer managed Key Management Service key.
- How long investigations and their data are retained by default.
To create an investigation group and set up CloudWatch investigations, you
must be signed in to an IAM principal that has either the
AIOpsConsoleAdminPolicy or the
AdministratorAccess IAM policy attached, or to an account
that has similar permissions.
For more information about configuring CloudWatch alarms, see Using Amazon CloudWatch alarms
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
Provides a name for the investigation group.
Parameter roleArn :
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.
For more information, see How to control what data CloudWatch investigations has access to during investigations.
Parameter chatbotNotificationChannel :
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 Getting
started with Amazon Q in chat applications and Resource
type defined by Amazon Web Services Chatbot.
Parameter crossAccountConfigurations :
List of sourceRoleArn values that have been configured for
cross-account access.
Parameter encryptionConfiguration :
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 Encryption
of investigation data.
Parameter isCloudTrailEventHistoryEnabled :
Specify true to enable CloudWatch investigations to have
access to change events that are recorded by CloudTrail. The default is
true.
Parameter retentionInDays :
Specify how long that investigation data is kept. For more information,
see Operational
investigation data retention.
If you omit this parameter, the default of 90 days is used.
Parameter tagKeyBoundaries :
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.
You don't need to enter tags created by myApplications or CloudFormation, because CloudWatch investigations can automatically detect those tags.
Parameter tags :
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 cloudwatch:TagResource permission.
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.
Implementation
Future<CreateInvestigationGroupOutput> createInvestigationGroup({
required String name,
required String roleArn,
Map<String, List<String>>? chatbotNotificationChannel,
List<CrossAccountConfiguration>? crossAccountConfigurations,
EncryptionConfiguration? encryptionConfiguration,
bool? isCloudTrailEventHistoryEnabled,
int? retentionInDays,
List<String>? tagKeyBoundaries,
Map<String, String>? tags,
}) async {
_s.validateNumRange(
'retentionInDays',
retentionInDays,
7,
90,
);
final $payload = <String, dynamic>{
'name': name,
'roleArn': roleArn,
if (chatbotNotificationChannel != null)
'chatbotNotificationChannel': chatbotNotificationChannel,
if (crossAccountConfigurations != null)
'crossAccountConfigurations': crossAccountConfigurations,
if (encryptionConfiguration != null)
'encryptionConfiguration': encryptionConfiguration,
if (isCloudTrailEventHistoryEnabled != null)
'isCloudTrailEventHistoryEnabled': isCloudTrailEventHistoryEnabled,
if (retentionInDays != null) 'retentionInDays': retentionInDays,
if (tagKeyBoundaries != null) 'tagKeyBoundaries': tagKeyBoundaries,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/investigationGroups',
exceptionFnMap: _exceptionFns,
);
return CreateInvestigationGroupOutput.fromJson(response);
}