ApplicationInsights / Client / create_application

create_application#

ApplicationInsights.Client.create_application(**kwargs)#

Adds an application that is created from a resource group.

See also: AWS API Documentation

Request Syntax

response = client.create_application(
    ResourceGroupName='string',
    OpsCenterEnabled=True|False,
    CWEMonitorEnabled=True|False,
    OpsItemSNSTopicArn='string',
    SNSNotificationArn='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    AutoConfigEnabled=True|False,
    AutoCreate=True|False,
    GroupingType='ACCOUNT_BASED',
    AttachMissingPermission=True|False
)
Parameters:
  • ResourceGroupName (string) – The name of the resource group.

  • OpsCenterEnabled (boolean) – When set to true, creates opsItems for any problems detected on an application.

  • CWEMonitorEnabled (boolean) – Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as instance terminated, failed deployment, and others.

  • OpsItemSNSTopicArn (string) – The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.

  • SNSNotificationArn (string) – The SNS notification topic ARN.

  • Tags (list) –

    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.

    • (dict) –

      An object that defines the tags associated with an application. A tag is a label that you optionally define and associate with an application. Tags can help you categorize and manage resources in different ways, such as by purpose, owner, environment, or other criteria.

      Each tag consists of a required tag key and an associated tag value, both of which you define. A tag key is a general label that acts as a category for a more specific tag value. A tag value acts as a descriptor within a tag key. A tag key can contain as many as 128 characters. A tag value can contain as many as 256 characters. The characters can be Unicode letters, digits, white space, or one of the following symbols: _ . : / = + -. The following additional restrictions apply to tags:

      • Tag keys and values are case sensitive.

      • For each associated resource, each tag key must be unique and it can have only one value.

      • The aws: prefix is reserved for use by Amazon Web Services; you can’t use it in any tag keys or values that you define. In addition, you can’t edit or remove tag keys or values that use this prefix.

      • Key (string) – [REQUIRED]

        One part of a key-value pair that defines a tag. The maximum length of a tag key is 128 characters. The minimum length is 1 character.

      • Value (string) – [REQUIRED]

        The optional part of a key-value pair that defines a tag. The maximum length of a tag value is 256 characters. The minimum length is 0 characters. If you don’t want an application to have a specific tag value, don’t specify a value for this parameter.

  • AutoConfigEnabled (boolean) – Indicates whether Application Insights automatically configures unmonitored resources in the resource group.

  • AutoCreate (boolean) – Configures all of the resources in the resource group by applying the recommended configurations.

  • GroupingType (string) – 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.

  • AttachMissingPermission (boolean) – If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.

Return type:

dict

Returns:

Response Syntax

{
    'ApplicationInfo': {
        'AccountId': 'string',
        'ResourceGroupName': 'string',
        'LifeCycle': 'string',
        'OpsItemSNSTopicArn': 'string',
        'SNSNotificationArn': 'string',
        'OpsCenterEnabled': True|False,
        'CWEMonitorEnabled': True|False,
        'Remarks': 'string',
        'AutoConfigEnabled': True|False,
        'DiscoveryType': 'RESOURCE_GROUP_BASED'|'ACCOUNT_BASED',
        'AttachMissingPermission': True|False
    }
}

Response Structure

  • (dict) –

    • ApplicationInfo (dict) –

      Information about the application.

      • AccountId (string) –

        The Amazon Web Services account ID for the owner of the application.

      • ResourceGroupName (string) –

        The name of the resource group used for the application.

      • LifeCycle (string) –

        The lifecycle of the application.

      • OpsItemSNSTopicArn (string) –

        The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS notifications for opsItem updates.

      • SNSNotificationArn (string) –

        The SNS topic ARN that is associated with SNS notifications for updates or issues.

      • OpsCenterEnabled (boolean) –

        Indicates whether Application Insights will create opsItems for any problem detected by Application Insights for an application.

      • CWEMonitorEnabled (boolean) –

        Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as instance terminated, failed deployment, and others.

      • Remarks (string) –

        The issues on the user side that block Application Insights from successfully monitoring an application. Example remarks include:

        • “Configuring application, detected 1 Errors, 3 Warnings”

        • “Configuring application, detected 1 Unconfigured Components”

      • AutoConfigEnabled (boolean) –

        Indicates whether auto-configuration is turned on for this application.

      • DiscoveryType (string) –

        The method used by Application Insights to onboard your resources.

      • AttachMissingPermission (boolean) –

        If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.

Exceptions

  • ApplicationInsights.Client.exceptions.ResourceInUseException

  • ApplicationInsights.Client.exceptions.ResourceNotFoundException

  • ApplicationInsights.Client.exceptions.ValidationException

  • ApplicationInsights.Client.exceptions.InternalServerException

  • ApplicationInsights.Client.exceptions.TagsAlreadyExistException

  • ApplicationInsights.Client.exceptions.AccessDeniedException