# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['Integration']


class Integration(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 custom_cloudwatch_namespaces: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 custom_namespace_sync_rules: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationCustomNamespaceSyncRuleArgs']]]]] = None,
                 enable_aws_usage: Optional[pulumi.Input[bool]] = None,
                 enable_check_large_volume: Optional[pulumi.Input[bool]] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 external_id: Optional[pulumi.Input[str]] = None,
                 import_cloud_watch: Optional[pulumi.Input[bool]] = None,
                 integration_id: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 named_token: Optional[pulumi.Input[str]] = None,
                 namespace_sync_rules: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationNamespaceSyncRuleArgs']]]]] = None,
                 poll_rate: Optional[pulumi.Input[float]] = None,
                 regions: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 services: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 token: Optional[pulumi.Input[str]] = None,
                 use_get_metric_data_method: Optional[pulumi.Input[bool]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        SignalFx AWS CloudWatch integrations. For help with this integration see [Monitoring Amazon Web Services](https://docs.signalfx.com/en/latest/integrations/amazon-web-services.html#monitor-amazon-web-services).

        > **NOTE** When managing integrations you'll need to use an admin token to authenticate the SignalFx provider.

        > **WARNING** This resource implements a part of a workflow. You must use it with one of either `aws.ExternalIntegration` or `aws.TokenIntegration`.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aws as aws
        import pulumi_signalfx as signalfx

        # This resource returns an account id in `external_id`…
        aws_myteam_external = signalfx.aws.ExternalIntegration("awsMyteamExternal")
        # Make yourself an AWS IAM role here, use `signalfx_aws_external_integration.aws_myteam_external.external_id`
        aws_sfx_role = aws.iam.Role("awsSfxRole")
        # Stuff here that uses the external and account ID
        aws_myteam = signalfx.aws.Integration("awsMyteam",
            enabled=True,
            integration_id=aws_myteam_external.id,
            external_id=aws_myteam_external.external_id,
            role_arn=aws_sfx_role.arn,
            regions=["us-east-1"],
            poll_rate=300,
            import_cloud_watch=True,
            enable_aws_usage=True,
            custom_namespace_sync_rules=[signalfx.aws.IntegrationCustomNamespaceSyncRuleArgs(
                default_action="Exclude",
                filter_action="Include",
                filter_source="filter('code', '200')",
                namespace="fart",
            )],
            namespace_sync_rules=[signalfx.aws.IntegrationNamespaceSyncRuleArgs(
                default_action="Exclude",
                filter_action="Include",
                filter_source="filter('code', '200')",
                namespace="AWS/EC2",
            )])
        ```
        ## Service Names

        > **NOTE** You can use the data source "aws.getServices" to specify all services.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[List[pulumi.Input[str]]] custom_cloudwatch_namespaces: List of custom AWS CloudWatch namespaces to monitor. Custom namespaces contain custom metrics that you define in AWS; SignalFx imports the metrics so you can monitor them.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationCustomNamespaceSyncRuleArgs']]]] custom_namespace_sync_rules: Each element controls the data collected by SignalFx for the specified namespace. Conflicts with the `custom_cloudwatch_namespaces` property.
        :param pulumi.Input[bool] enable_aws_usage: Flag that controls how SignalFx imports usage metrics from AWS to use with AWS Cost Optimizer. If `true`, SignalFx imports the metrics.
        :param pulumi.Input[bool] enable_check_large_volume: Controls how SignalFx checks for large amounts of data for this AWS integration. If `true`, SignalFx monitors the amount of data coming in from the integration.
        :param pulumi.Input[bool] enabled: Whether the integration is enabled.
        :param pulumi.Input[str] external_id: The `external_id` property from one of a `aws.ExternalIntegration` or `aws.TokenIntegration`
        :param pulumi.Input[bool] import_cloud_watch: Flag that controls how SignalFx imports Cloud Watch metrics. If true, SignalFx imports Cloud Watch metrics from AWS.
        :param pulumi.Input[str] integration_id: The id of one of a `aws.ExternalIntegration` or `aws.TokenIntegration`.
        :param pulumi.Input[str] key: If you specify `auth_method = \"SecurityToken\"` in your request to create an AWS integration object, use this property to specify the key.
        :param pulumi.Input[str] named_token: A named token to use for ingest
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationNamespaceSyncRuleArgs']]]] namespace_sync_rules: Each element in the array is an object that contains an AWS namespace name and a filter that controls the data that SignalFx collects for the namespace. Conflicts with the `services` property. If you don't specify either property, SignalFx syncs all data in all AWS namespaces.
        :param pulumi.Input[float] poll_rate: AWS poll rate (in seconds). Value between `60` and `300`.
        :param pulumi.Input[List[pulumi.Input[str]]] regions: List of AWS regions that SignalFx should monitor.
        :param pulumi.Input[str] role_arn: Role ARN that you add to an existing AWS integration object. **Note**: Ensure you use the `arn` property of your role, not the id!
        :param pulumi.Input[List[pulumi.Input[str]]] services: List of AWS services that you want SignalFx to monitor. Each element is a string designating an AWS service. Conflicts with `namespace_sync_rule`. See the documentation for [Creating Integrations](https://developers.signalfx.com/integrations_reference.html#operation/Create%20Integration) for valida values.
        :param pulumi.Input[str] token: Used with `signalfx_aws_token_integration`. Use this property to specify the token.
        :param pulumi.Input[bool] use_get_metric_data_method: Enable the use of Amazon's `GetMetricData` for collecting metrics. Note that this requires the inclusion of the `"cloudwatch:GetMetricData"` permission.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['custom_cloudwatch_namespaces'] = custom_cloudwatch_namespaces
            __props__['custom_namespace_sync_rules'] = custom_namespace_sync_rules
            __props__['enable_aws_usage'] = enable_aws_usage
            __props__['enable_check_large_volume'] = enable_check_large_volume
            if enabled is None:
                raise TypeError("Missing required property 'enabled'")
            __props__['enabled'] = enabled
            __props__['external_id'] = external_id
            __props__['import_cloud_watch'] = import_cloud_watch
            if integration_id is None:
                raise TypeError("Missing required property 'integration_id'")
            __props__['integration_id'] = integration_id
            __props__['key'] = key
            __props__['named_token'] = named_token
            __props__['namespace_sync_rules'] = namespace_sync_rules
            __props__['poll_rate'] = poll_rate
            __props__['regions'] = regions
            __props__['role_arn'] = role_arn
            __props__['services'] = services
            __props__['token'] = token
            __props__['use_get_metric_data_method'] = use_get_metric_data_method
        super(Integration, __self__).__init__(
            'signalfx:aws/integration:Integration',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            custom_cloudwatch_namespaces: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            custom_namespace_sync_rules: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationCustomNamespaceSyncRuleArgs']]]]] = None,
            enable_aws_usage: Optional[pulumi.Input[bool]] = None,
            enable_check_large_volume: Optional[pulumi.Input[bool]] = None,
            enabled: Optional[pulumi.Input[bool]] = None,
            external_id: Optional[pulumi.Input[str]] = None,
            import_cloud_watch: Optional[pulumi.Input[bool]] = None,
            integration_id: Optional[pulumi.Input[str]] = None,
            key: Optional[pulumi.Input[str]] = None,
            named_token: Optional[pulumi.Input[str]] = None,
            namespace_sync_rules: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationNamespaceSyncRuleArgs']]]]] = None,
            poll_rate: Optional[pulumi.Input[float]] = None,
            regions: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            role_arn: Optional[pulumi.Input[str]] = None,
            services: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            token: Optional[pulumi.Input[str]] = None,
            use_get_metric_data_method: Optional[pulumi.Input[bool]] = None) -> 'Integration':
        """
        Get an existing Integration resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[List[pulumi.Input[str]]] custom_cloudwatch_namespaces: List of custom AWS CloudWatch namespaces to monitor. Custom namespaces contain custom metrics that you define in AWS; SignalFx imports the metrics so you can monitor them.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationCustomNamespaceSyncRuleArgs']]]] custom_namespace_sync_rules: Each element controls the data collected by SignalFx for the specified namespace. Conflicts with the `custom_cloudwatch_namespaces` property.
        :param pulumi.Input[bool] enable_aws_usage: Flag that controls how SignalFx imports usage metrics from AWS to use with AWS Cost Optimizer. If `true`, SignalFx imports the metrics.
        :param pulumi.Input[bool] enable_check_large_volume: Controls how SignalFx checks for large amounts of data for this AWS integration. If `true`, SignalFx monitors the amount of data coming in from the integration.
        :param pulumi.Input[bool] enabled: Whether the integration is enabled.
        :param pulumi.Input[str] external_id: The `external_id` property from one of a `aws.ExternalIntegration` or `aws.TokenIntegration`
        :param pulumi.Input[bool] import_cloud_watch: Flag that controls how SignalFx imports Cloud Watch metrics. If true, SignalFx imports Cloud Watch metrics from AWS.
        :param pulumi.Input[str] integration_id: The id of one of a `aws.ExternalIntegration` or `aws.TokenIntegration`.
        :param pulumi.Input[str] key: If you specify `auth_method = \"SecurityToken\"` in your request to create an AWS integration object, use this property to specify the key.
        :param pulumi.Input[str] named_token: A named token to use for ingest
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['IntegrationNamespaceSyncRuleArgs']]]] namespace_sync_rules: Each element in the array is an object that contains an AWS namespace name and a filter that controls the data that SignalFx collects for the namespace. Conflicts with the `services` property. If you don't specify either property, SignalFx syncs all data in all AWS namespaces.
        :param pulumi.Input[float] poll_rate: AWS poll rate (in seconds). Value between `60` and `300`.
        :param pulumi.Input[List[pulumi.Input[str]]] regions: List of AWS regions that SignalFx should monitor.
        :param pulumi.Input[str] role_arn: Role ARN that you add to an existing AWS integration object. **Note**: Ensure you use the `arn` property of your role, not the id!
        :param pulumi.Input[List[pulumi.Input[str]]] services: List of AWS services that you want SignalFx to monitor. Each element is a string designating an AWS service. Conflicts with `namespace_sync_rule`. See the documentation for [Creating Integrations](https://developers.signalfx.com/integrations_reference.html#operation/Create%20Integration) for valida values.
        :param pulumi.Input[str] token: Used with `signalfx_aws_token_integration`. Use this property to specify the token.
        :param pulumi.Input[bool] use_get_metric_data_method: Enable the use of Amazon's `GetMetricData` for collecting metrics. Note that this requires the inclusion of the `"cloudwatch:GetMetricData"` permission.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["custom_cloudwatch_namespaces"] = custom_cloudwatch_namespaces
        __props__["custom_namespace_sync_rules"] = custom_namespace_sync_rules
        __props__["enable_aws_usage"] = enable_aws_usage
        __props__["enable_check_large_volume"] = enable_check_large_volume
        __props__["enabled"] = enabled
        __props__["external_id"] = external_id
        __props__["import_cloud_watch"] = import_cloud_watch
        __props__["integration_id"] = integration_id
        __props__["key"] = key
        __props__["named_token"] = named_token
        __props__["namespace_sync_rules"] = namespace_sync_rules
        __props__["poll_rate"] = poll_rate
        __props__["regions"] = regions
        __props__["role_arn"] = role_arn
        __props__["services"] = services
        __props__["token"] = token
        __props__["use_get_metric_data_method"] = use_get_metric_data_method
        return Integration(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="customCloudwatchNamespaces")
    def custom_cloudwatch_namespaces(self) -> pulumi.Output[Optional[List[str]]]:
        """
        List of custom AWS CloudWatch namespaces to monitor. Custom namespaces contain custom metrics that you define in AWS; SignalFx imports the metrics so you can monitor them.
        """
        return pulumi.get(self, "custom_cloudwatch_namespaces")

    @property
    @pulumi.getter(name="customNamespaceSyncRules")
    def custom_namespace_sync_rules(self) -> pulumi.Output[Optional[List['outputs.IntegrationCustomNamespaceSyncRule']]]:
        """
        Each element controls the data collected by SignalFx for the specified namespace. Conflicts with the `custom_cloudwatch_namespaces` property.
        """
        return pulumi.get(self, "custom_namespace_sync_rules")

    @property
    @pulumi.getter(name="enableAwsUsage")
    def enable_aws_usage(self) -> pulumi.Output[Optional[bool]]:
        """
        Flag that controls how SignalFx imports usage metrics from AWS to use with AWS Cost Optimizer. If `true`, SignalFx imports the metrics.
        """
        return pulumi.get(self, "enable_aws_usage")

    @property
    @pulumi.getter(name="enableCheckLargeVolume")
    def enable_check_large_volume(self) -> pulumi.Output[Optional[bool]]:
        """
        Controls how SignalFx checks for large amounts of data for this AWS integration. If `true`, SignalFx monitors the amount of data coming in from the integration.
        """
        return pulumi.get(self, "enable_check_large_volume")

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[bool]:
        """
        Whether the integration is enabled.
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter(name="externalId")
    def external_id(self) -> pulumi.Output[Optional[str]]:
        """
        The `external_id` property from one of a `aws.ExternalIntegration` or `aws.TokenIntegration`
        """
        return pulumi.get(self, "external_id")

    @property
    @pulumi.getter(name="importCloudWatch")
    def import_cloud_watch(self) -> pulumi.Output[Optional[bool]]:
        """
        Flag that controls how SignalFx imports Cloud Watch metrics. If true, SignalFx imports Cloud Watch metrics from AWS.
        """
        return pulumi.get(self, "import_cloud_watch")

    @property
    @pulumi.getter(name="integrationId")
    def integration_id(self) -> pulumi.Output[str]:
        """
        The id of one of a `aws.ExternalIntegration` or `aws.TokenIntegration`.
        """
        return pulumi.get(self, "integration_id")

    @property
    @pulumi.getter
    def key(self) -> pulumi.Output[Optional[str]]:
        """
        If you specify `auth_method = \"SecurityToken\"` in your request to create an AWS integration object, use this property to specify the key.
        """
        return pulumi.get(self, "key")

    @property
    @pulumi.getter(name="namedToken")
    def named_token(self) -> pulumi.Output[Optional[str]]:
        """
        A named token to use for ingest
        """
        return pulumi.get(self, "named_token")

    @property
    @pulumi.getter(name="namespaceSyncRules")
    def namespace_sync_rules(self) -> pulumi.Output[Optional[List['outputs.IntegrationNamespaceSyncRule']]]:
        """
        Each element in the array is an object that contains an AWS namespace name and a filter that controls the data that SignalFx collects for the namespace. Conflicts with the `services` property. If you don't specify either property, SignalFx syncs all data in all AWS namespaces.
        """
        return pulumi.get(self, "namespace_sync_rules")

    @property
    @pulumi.getter(name="pollRate")
    def poll_rate(self) -> pulumi.Output[Optional[float]]:
        """
        AWS poll rate (in seconds). Value between `60` and `300`.
        """
        return pulumi.get(self, "poll_rate")

    @property
    @pulumi.getter
    def regions(self) -> pulumi.Output[Optional[List[str]]]:
        """
        List of AWS regions that SignalFx should monitor.
        """
        return pulumi.get(self, "regions")

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> pulumi.Output[Optional[str]]:
        """
        Role ARN that you add to an existing AWS integration object. **Note**: Ensure you use the `arn` property of your role, not the id!
        """
        return pulumi.get(self, "role_arn")

    @property
    @pulumi.getter
    def services(self) -> pulumi.Output[Optional[List[str]]]:
        """
        List of AWS services that you want SignalFx to monitor. Each element is a string designating an AWS service. Conflicts with `namespace_sync_rule`. See the documentation for [Creating Integrations](https://developers.signalfx.com/integrations_reference.html#operation/Create%20Integration) for valida values.
        """
        return pulumi.get(self, "services")

    @property
    @pulumi.getter
    def token(self) -> pulumi.Output[Optional[str]]:
        """
        Used with `signalfx_aws_token_integration`. Use this property to specify the token.
        """
        return pulumi.get(self, "token")

    @property
    @pulumi.getter(name="useGetMetricDataMethod")
    def use_get_metric_data_method(self) -> pulumi.Output[Optional[bool]]:
        """
        Enable the use of Amazon's `GetMetricData` for collecting metrics. Note that this requires the inclusion of the `"cloudwatch:GetMetricData"` permission.
        """
        return pulumi.get(self, "use_get_metric_data_method")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

