Skip to content

create_application

create_application(
    *,
    config_overrides: Optional[ApplicationInsightsClientConfig] = None,
    resource_group_name: Optional[ResourceGroupName] = None,
    ops_center_enabled: Optional[OpsCenterEnabled] = None,
    cwe_monitor_enabled: Optional[CWEMonitorEnabled] = None,
    ops_item_sns_topic_arn: Optional[OpsItemSNSTopicArn] = None,
    sns_notification_arn: Optional[SNSNotificationArn] = None,
    tags: Optional[TagList] = None,
    auto_config_enabled: Optional[AutoConfigEnabled] = None,
    auto_create: Optional[AutoCreate] = None,
    grouping_type: Optional[GroupingType] = None,
    attach_missing_permission: Optional[AttachMissingPermission] = None,
) -> CreateApplicationResponse

Adds an application that is created from a resource group.

Parameters:

  • resource_group_name (Optional[ResourceGroupName], default: None ) –

    The name of the resource group.

  • ops_center_enabled (Optional[OpsCenterEnabled], default: None ) –

    When set to true, creates opsItems for any problems detected on an application.

  • cwe_monitor_enabled (Optional[CWEMonitorEnabled], default: None ) –

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

  • ops_item_sns_topic_arn (Optional[OpsItemSNSTopicArn], default: None ) –

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

  • sns_notification_arn (Optional[SNSNotificationArn], default: None ) –

    The SNS notification topic ARN.

  • tags (Optional[TagList], default: None ) –

    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.

  • auto_config_enabled (Optional[AutoConfigEnabled], default: None ) –

    Indicates whether Application Insights automatically configures unmonitored resources in the resource group.

  • auto_create (Optional[AutoCreate], default: None ) –

    Configures all of the resources in the resource group by applying the recommended configurations.

  • grouping_type (Optional[GroupingType], default: None ) –

    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.

  • attach_missing_permission (Optional[AttachMissingPermission], default: None ) –

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

Raises:

Source code in docs_src/capo_application_insights/_services/application_insights.py
def create_application(
    self,
    *,
    config_overrides: Optional[ApplicationInsightsClientConfig] = None,
    resource_group_name: Optional[
        "capo_application_insights.types.resource_group_name.ResourceGroupName"
    ] = None,
    ops_center_enabled: Optional[
        "capo_application_insights.types.ops_center_enabled.OpsCenterEnabled"
    ] = None,
    cwe_monitor_enabled: Optional[
        "capo_application_insights.types.cwe_monitor_enabled.CWEMonitorEnabled"
    ] = None,
    ops_item_sns_topic_arn: Optional[
        "capo_application_insights.types.ops_item_sns_topic_arn.OpsItemSNSTopicArn"
    ] = None,
    sns_notification_arn: Optional[
        "capo_application_insights.types.sns_notification_arn.SNSNotificationArn"
    ] = None,
    tags: Optional["capo_application_insights.types.tag_list.TagList"] = None,
    auto_config_enabled: Optional[
        "capo_application_insights.types.auto_config_enabled.AutoConfigEnabled"
    ] = None,
    auto_create: Optional[
        "capo_application_insights.types.auto_create.AutoCreate"
    ] = None,
    grouping_type: Optional[
        "capo_application_insights.types.grouping_type.GroupingType"
    ] = None,
    attach_missing_permission: Optional[
        "capo_application_insights.types.attach_missing_permission.AttachMissingPermission"
    ] = None,
) -> "capo_application_insights.types.create_application_response.CreateApplicationResponse":
    """<p>Adds an application that is created from a resource group.</p>

    Args:
        resource_group_name: <p>The name of the resource group.</p>
        ops_center_enabled: <p> When set to <code>true</code>, creates opsItems for any problems detected on an application. </p>
        cwe_monitor_enabled: <p> Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others. </p>
        ops_item_sns_topic_arn: <p> The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem. </p>
        sns_notification_arn: <p> The SNS notification topic ARN. </p>
        tags: <p>List of tags to add to the application. tag key (<code>Key</code>) and an associated tag value (<code>Value</code>). The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
        auto_config_enabled: <p> Indicates whether Application Insights automatically configures unmonitored resources in the resource group. </p>
        auto_create: <p> Configures all of the resources in the resource group by applying the recommended configurations. </p>
        grouping_type: <p>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 <code>ACCOUNT_BASED</code>. </p>
        attach_missing_permission: <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>

    Raises:
        capo_application_insights.errors.access_denied_exception.AccessDeniedException: <p> User does not have permissions to perform this action. </p>
        capo_application_insights.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_application_insights.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is already created or in use.</p>
        capo_application_insights.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist in the customer account.</p>
        capo_application_insights.errors.tags_already_exist_exception.TagsAlreadyExistException: <p>Tags are already registered for the specified application ARN.</p>
        capo_application_insights.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_application_insights.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_application_insights.types.create_application_request.CreateApplicationRequest]",
    ) -> OperationResponse[
        "capo_application_insights.types.create_application_response.CreateApplicationResponse"
    ]:
        import capo_application_insights._operations.ec2_windows_barley_service.create_application

        output, http_response = (
            capo_application_insights._operations.ec2_windows_barley_service.create_application.create_application(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplication")
    )
    input_: capo_application_insights.types.create_application_request.CreateApplicationRequest = {}
    if resource_group_name is not None:
        input_["resource_group_name"] = resource_group_name
    if ops_center_enabled is not None:
        input_["ops_center_enabled"] = ops_center_enabled
    if cwe_monitor_enabled is not None:
        input_["cwe_monitor_enabled"] = cwe_monitor_enabled
    if ops_item_sns_topic_arn is not None:
        input_["ops_item_sns_topic_arn"] = ops_item_sns_topic_arn
    if sns_notification_arn is not None:
        input_["sns_notification_arn"] = sns_notification_arn
    if tags is not None:
        input_["tags"] = tags
    if auto_config_enabled is not None:
        input_["auto_config_enabled"] = auto_config_enabled
    if auto_create is not None:
        input_["auto_create"] = auto_create
    if grouping_type is not None:
        input_["grouping_type"] = grouping_type
    if attach_missing_permission is not None:
        input_["attach_missing_permission"] = attach_missing_permission

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output