# 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 copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = ['MetricExportCloudwatchConfigArgs', 'MetricExportCloudwatchConfig']

@pulumi.input_type
class MetricExportCloudwatchConfigArgs:
    def __init__(__self__, *,
                 cluster_id: pulumi.Input[str],
                 role_arn: pulumi.Input[str],
                 log_group_name: Optional[pulumi.Input[str]] = None,
                 target_region: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a MetricExportCloudwatchConfig resource.
        :param pulumi.Input[str] cluster_id: Cluster ID.
        :param pulumi.Input[str] role_arn: The IAM role used to upload metric segments to the target AWS account.
        :param pulumi.Input[str] log_group_name: The customized AWS CloudWatch log group name.
        :param pulumi.Input[str] target_region: The specific AWS region that the metrics will be exported to.
        """
        pulumi.set(__self__, "cluster_id", cluster_id)
        pulumi.set(__self__, "role_arn", role_arn)
        if log_group_name is not None:
            pulumi.set(__self__, "log_group_name", log_group_name)
        if target_region is not None:
            pulumi.set(__self__, "target_region", target_region)

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> pulumi.Input[str]:
        """
        Cluster ID.
        """
        return pulumi.get(self, "cluster_id")

    @cluster_id.setter
    def cluster_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "cluster_id", value)

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> pulumi.Input[str]:
        """
        The IAM role used to upload metric segments to the target AWS account.
        """
        return pulumi.get(self, "role_arn")

    @role_arn.setter
    def role_arn(self, value: pulumi.Input[str]):
        pulumi.set(self, "role_arn", value)

    @property
    @pulumi.getter(name="logGroupName")
    def log_group_name(self) -> Optional[pulumi.Input[str]]:
        """
        The customized AWS CloudWatch log group name.
        """
        return pulumi.get(self, "log_group_name")

    @log_group_name.setter
    def log_group_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "log_group_name", value)

    @property
    @pulumi.getter(name="targetRegion")
    def target_region(self) -> Optional[pulumi.Input[str]]:
        """
        The specific AWS region that the metrics will be exported to.
        """
        return pulumi.get(self, "target_region")

    @target_region.setter
    def target_region(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "target_region", value)


@pulumi.input_type
class _MetricExportCloudwatchConfigState:
    def __init__(__self__, *,
                 cluster_id: Optional[pulumi.Input[str]] = None,
                 log_group_name: Optional[pulumi.Input[str]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 target_region: Optional[pulumi.Input[str]] = None,
                 user_message: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering MetricExportCloudwatchConfig resources.
        :param pulumi.Input[str] cluster_id: Cluster ID.
        :param pulumi.Input[str] log_group_name: The customized AWS CloudWatch log group name.
        :param pulumi.Input[str] role_arn: The IAM role used to upload metric segments to the target AWS account.
        :param pulumi.Input[str] status: Encodes the possible states that a metric export configuration can be in as it is created, deployed, and disabled.
        :param pulumi.Input[str] target_region: The specific AWS region that the metrics will be exported to.
        :param pulumi.Input[str] user_message: Elaborates on the metric export status and hints at how to fix issues that may have occurred during asynchronous operations.
        """
        if cluster_id is not None:
            pulumi.set(__self__, "cluster_id", cluster_id)
        if log_group_name is not None:
            pulumi.set(__self__, "log_group_name", log_group_name)
        if role_arn is not None:
            pulumi.set(__self__, "role_arn", role_arn)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if target_region is not None:
            pulumi.set(__self__, "target_region", target_region)
        if user_message is not None:
            pulumi.set(__self__, "user_message", user_message)

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> Optional[pulumi.Input[str]]:
        """
        Cluster ID.
        """
        return pulumi.get(self, "cluster_id")

    @cluster_id.setter
    def cluster_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "cluster_id", value)

    @property
    @pulumi.getter(name="logGroupName")
    def log_group_name(self) -> Optional[pulumi.Input[str]]:
        """
        The customized AWS CloudWatch log group name.
        """
        return pulumi.get(self, "log_group_name")

    @log_group_name.setter
    def log_group_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "log_group_name", value)

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> Optional[pulumi.Input[str]]:
        """
        The IAM role used to upload metric segments to the target AWS account.
        """
        return pulumi.get(self, "role_arn")

    @role_arn.setter
    def role_arn(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "role_arn", value)

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[str]]:
        """
        Encodes the possible states that a metric export configuration can be in as it is created, deployed, and disabled.
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter(name="targetRegion")
    def target_region(self) -> Optional[pulumi.Input[str]]:
        """
        The specific AWS region that the metrics will be exported to.
        """
        return pulumi.get(self, "target_region")

    @target_region.setter
    def target_region(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "target_region", value)

    @property
    @pulumi.getter(name="userMessage")
    def user_message(self) -> Optional[pulumi.Input[str]]:
        """
        Elaborates on the metric export status and hints at how to fix issues that may have occurred during asynchronous operations.
        """
        return pulumi.get(self, "user_message")

    @user_message.setter
    def user_message(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "user_message", value)


class MetricExportCloudwatchConfig(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cluster_id: Optional[pulumi.Input[str]] = None,
                 log_group_name: Optional[pulumi.Input[str]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 target_region: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Amazon CloudWatch metric export configuration for a cluster.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_cockroach as cockroach

        config = pulumi.Config()
        cluster_id = config.require("clusterId")
        role_arn = config.require("roleArn")
        log_group_name = config.require("logGroupName")
        aws_region = config.require("awsRegion")
        example = cockroach.MetricExportCloudwatchConfig("example",
            cluster_id=cluster_id,
            role_arn=role_arn,
            log_group_name=log_group_name,
            target_region=aws_region)
        ```

        ## Import

        format: <cluster id>

        ```sh
        $ pulumi import cockroach:index/metricExportCloudwatchConfig:MetricExportCloudwatchConfig example 1f69fdd2-600a-4cfc-a9ba-16995df0d77d
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] cluster_id: Cluster ID.
        :param pulumi.Input[str] log_group_name: The customized AWS CloudWatch log group name.
        :param pulumi.Input[str] role_arn: The IAM role used to upload metric segments to the target AWS account.
        :param pulumi.Input[str] target_region: The specific AWS region that the metrics will be exported to.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: MetricExportCloudwatchConfigArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Amazon CloudWatch metric export configuration for a cluster.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_cockroach as cockroach

        config = pulumi.Config()
        cluster_id = config.require("clusterId")
        role_arn = config.require("roleArn")
        log_group_name = config.require("logGroupName")
        aws_region = config.require("awsRegion")
        example = cockroach.MetricExportCloudwatchConfig("example",
            cluster_id=cluster_id,
            role_arn=role_arn,
            log_group_name=log_group_name,
            target_region=aws_region)
        ```

        ## Import

        format: <cluster id>

        ```sh
        $ pulumi import cockroach:index/metricExportCloudwatchConfig:MetricExportCloudwatchConfig example 1f69fdd2-600a-4cfc-a9ba-16995df0d77d
        ```

        :param str resource_name: The name of the resource.
        :param MetricExportCloudwatchConfigArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(MetricExportCloudwatchConfigArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cluster_id: Optional[pulumi.Input[str]] = None,
                 log_group_name: Optional[pulumi.Input[str]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 target_region: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = MetricExportCloudwatchConfigArgs.__new__(MetricExportCloudwatchConfigArgs)

            if cluster_id is None and not opts.urn:
                raise TypeError("Missing required property 'cluster_id'")
            __props__.__dict__["cluster_id"] = cluster_id
            __props__.__dict__["log_group_name"] = log_group_name
            if role_arn is None and not opts.urn:
                raise TypeError("Missing required property 'role_arn'")
            __props__.__dict__["role_arn"] = role_arn
            __props__.__dict__["target_region"] = target_region
            __props__.__dict__["status"] = None
            __props__.__dict__["user_message"] = None
        super(MetricExportCloudwatchConfig, __self__).__init__(
            'cockroach:index/metricExportCloudwatchConfig:MetricExportCloudwatchConfig',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            cluster_id: Optional[pulumi.Input[str]] = None,
            log_group_name: Optional[pulumi.Input[str]] = None,
            role_arn: Optional[pulumi.Input[str]] = None,
            status: Optional[pulumi.Input[str]] = None,
            target_region: Optional[pulumi.Input[str]] = None,
            user_message: Optional[pulumi.Input[str]] = None) -> 'MetricExportCloudwatchConfig':
        """
        Get an existing MetricExportCloudwatchConfig 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[str] cluster_id: Cluster ID.
        :param pulumi.Input[str] log_group_name: The customized AWS CloudWatch log group name.
        :param pulumi.Input[str] role_arn: The IAM role used to upload metric segments to the target AWS account.
        :param pulumi.Input[str] status: Encodes the possible states that a metric export configuration can be in as it is created, deployed, and disabled.
        :param pulumi.Input[str] target_region: The specific AWS region that the metrics will be exported to.
        :param pulumi.Input[str] user_message: Elaborates on the metric export status and hints at how to fix issues that may have occurred during asynchronous operations.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _MetricExportCloudwatchConfigState.__new__(_MetricExportCloudwatchConfigState)

        __props__.__dict__["cluster_id"] = cluster_id
        __props__.__dict__["log_group_name"] = log_group_name
        __props__.__dict__["role_arn"] = role_arn
        __props__.__dict__["status"] = status
        __props__.__dict__["target_region"] = target_region
        __props__.__dict__["user_message"] = user_message
        return MetricExportCloudwatchConfig(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> pulumi.Output[str]:
        """
        Cluster ID.
        """
        return pulumi.get(self, "cluster_id")

    @property
    @pulumi.getter(name="logGroupName")
    def log_group_name(self) -> pulumi.Output[str]:
        """
        The customized AWS CloudWatch log group name.
        """
        return pulumi.get(self, "log_group_name")

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> pulumi.Output[str]:
        """
        The IAM role used to upload metric segments to the target AWS account.
        """
        return pulumi.get(self, "role_arn")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[str]:
        """
        Encodes the possible states that a metric export configuration can be in as it is created, deployed, and disabled.
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="targetRegion")
    def target_region(self) -> pulumi.Output[str]:
        """
        The specific AWS region that the metrics will be exported to.
        """
        return pulumi.get(self, "target_region")

    @property
    @pulumi.getter(name="userMessage")
    def user_message(self) -> pulumi.Output[str]:
        """
        Elaborates on the metric export status and hints at how to fix issues that may have occurred during asynchronous operations.
        """
        return pulumi.get(self, "user_message")

