createApplication method
Adds an application that is created from a resource group.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw TagsAlreadyExistException.
May throw ValidationException.
Parameter attachMissingPermission :
If set to true, the managed policies for SSM and CW will be attached to
the instance roles if they are missing.
Parameter autoConfigEnabled :
Indicates whether Application Insights automatically configures
unmonitored resources in the resource group.
Parameter autoCreate :
Configures all of the resources in the resource group by applying the
recommended configurations.
Parameter cWEMonitorEnabled :
Indicates whether Application Insights can listen to CloudWatch events for
the application resources, such as instance terminated,
failed deployment, and others.
Parameter groupingType :
Application Insights can create applications based on a resource group or
on an account. To create an account-based application using all of the
resources in the account, set this parameter to
ACCOUNT_BASED.
Parameter opsCenterEnabled :
When set to true, creates opsItems for any problems detected
on an application.
Parameter opsItemSNSTopicArn :
The SNS topic provided to Application Insights that is associated to the
created opsItem. Allows you to receive notifications for updates to the
opsItem.
Parameter resourceGroupName :
The name of the resource group.
Parameter sNSNotificationArn :
The SNS notification topic ARN.
Parameter tags :
List of tags to add to the application. tag key (Key) and an
associated tag value (Value). The maximum length of a tag key
is 128 characters. The maximum length of a tag value is 256 characters.
Implementation
Future<CreateApplicationResponse> createApplication({
bool? attachMissingPermission,
bool? autoConfigEnabled,
bool? autoCreate,
bool? cWEMonitorEnabled,
GroupingType? groupingType,
bool? opsCenterEnabled,
String? opsItemSNSTopicArn,
String? resourceGroupName,
String? sNSNotificationArn,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'EC2WindowsBarleyService.CreateApplication'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (attachMissingPermission != null)
'AttachMissingPermission': attachMissingPermission,
if (autoConfigEnabled != null) 'AutoConfigEnabled': autoConfigEnabled,
if (autoCreate != null) 'AutoCreate': autoCreate,
if (cWEMonitorEnabled != null) 'CWEMonitorEnabled': cWEMonitorEnabled,
if (groupingType != null) 'GroupingType': groupingType.value,
if (opsCenterEnabled != null) 'OpsCenterEnabled': opsCenterEnabled,
if (opsItemSNSTopicArn != null)
'OpsItemSNSTopicArn': opsItemSNSTopicArn,
if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName,
if (sNSNotificationArn != null)
'SNSNotificationArn': sNSNotificationArn,
if (tags != null) 'Tags': tags,
},
);
return CreateApplicationResponse.fromJson(jsonResponse.body);
}