# 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, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = ['ResourceArgs', 'Resource']

@pulumi.input_type
class ResourceArgs:
    def __init__(__self__, *,
                 desired_state: pulumi.Input[str],
                 type_name: pulumi.Input[str],
                 role_arn: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 type_version_id: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a Resource resource.
        :param pulumi.Input[str] type_name: CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        :param pulumi.Input[str] role_arn: Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        :param pulumi.Input[str] schema: JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        :param pulumi.Input[str] type_version_id: Identifier of the CloudFormation resource type version.
        """
        pulumi.set(__self__, "desired_state", desired_state)
        pulumi.set(__self__, "type_name", type_name)
        if role_arn is not None:
            pulumi.set(__self__, "role_arn", role_arn)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if type_version_id is not None:
            pulumi.set(__self__, "type_version_id", type_version_id)

    @property
    @pulumi.getter(name="desiredState")
    def desired_state(self) -> pulumi.Input[str]:
        return pulumi.get(self, "desired_state")

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

    @property
    @pulumi.getter(name="typeName")
    def type_name(self) -> pulumi.Input[str]:
        """
        CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        """
        return pulumi.get(self, "type_name")

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

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> Optional[pulumi.Input[str]]:
        """
        Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        """
        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 schema(self) -> Optional[pulumi.Input[str]]:
        """
        JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        """
        return pulumi.get(self, "schema")

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

    @property
    @pulumi.getter(name="typeVersionId")
    def type_version_id(self) -> Optional[pulumi.Input[str]]:
        """
        Identifier of the CloudFormation resource type version.
        """
        return pulumi.get(self, "type_version_id")

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


@pulumi.input_type
class _ResourceState:
    def __init__(__self__, *,
                 desired_state: Optional[pulumi.Input[str]] = None,
                 properties: Optional[pulumi.Input[str]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 type_name: Optional[pulumi.Input[str]] = None,
                 type_version_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering Resource resources.
        :param pulumi.Input[str] role_arn: Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        :param pulumi.Input[str] schema: JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        :param pulumi.Input[str] type_name: CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        :param pulumi.Input[str] type_version_id: Identifier of the CloudFormation resource type version.
        """
        if desired_state is not None:
            pulumi.set(__self__, "desired_state", desired_state)
        if properties is not None:
            pulumi.set(__self__, "properties", properties)
        if role_arn is not None:
            pulumi.set(__self__, "role_arn", role_arn)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if type_name is not None:
            pulumi.set(__self__, "type_name", type_name)
        if type_version_id is not None:
            pulumi.set(__self__, "type_version_id", type_version_id)

    @property
    @pulumi.getter(name="desiredState")
    def desired_state(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "desired_state")

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

    @property
    @pulumi.getter
    def properties(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "properties")

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

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> Optional[pulumi.Input[str]]:
        """
        Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        """
        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 schema(self) -> Optional[pulumi.Input[str]]:
        """
        JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        """
        return pulumi.get(self, "schema")

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

    @property
    @pulumi.getter(name="typeName")
    def type_name(self) -> Optional[pulumi.Input[str]]:
        """
        CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        """
        return pulumi.get(self, "type_name")

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

    @property
    @pulumi.getter(name="typeVersionId")
    def type_version_id(self) -> Optional[pulumi.Input[str]]:
        """
        Identifier of the CloudFormation resource type version.
        """
        return pulumi.get(self, "type_version_id")

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


class Resource(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 desired_state: Optional[pulumi.Input[str]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 type_name: Optional[pulumi.Input[str]] = None,
                 type_version_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Manages a Cloud Control API Resource. The configuration and lifecycle handling of these resources is proxied through Cloud Control API handlers to the backend service.

        ## Example Usage

        ```python
        import pulumi
        import json
        import pulumi_aws as aws

        example = aws.cloudcontrol.Resource("example",
            type_name="AWS::ECS::Cluster",
            desired_state=json.dumps({
                "ClusterName": "example",
                "Tags": [{
                    "Key": "CostCenter",
                    "Value": "IT",
                }],
            }))
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] role_arn: Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        :param pulumi.Input[str] schema: JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        :param pulumi.Input[str] type_name: CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        :param pulumi.Input[str] type_version_id: Identifier of the CloudFormation resource type version.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ResourceArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages a Cloud Control API Resource. The configuration and lifecycle handling of these resources is proxied through Cloud Control API handlers to the backend service.

        ## Example Usage

        ```python
        import pulumi
        import json
        import pulumi_aws as aws

        example = aws.cloudcontrol.Resource("example",
            type_name="AWS::ECS::Cluster",
            desired_state=json.dumps({
                "ClusterName": "example",
                "Tags": [{
                    "Key": "CostCenter",
                    "Value": "IT",
                }],
            }))
        ```

        :param str resource_name: The name of the resource.
        :param ResourceArgs 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(ResourceArgs, 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,
                 desired_state: Optional[pulumi.Input[str]] = None,
                 role_arn: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 type_name: Optional[pulumi.Input[str]] = None,
                 type_version_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        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__ = ResourceArgs.__new__(ResourceArgs)

            if desired_state is None and not opts.urn:
                raise TypeError("Missing required property 'desired_state'")
            __props__.__dict__["desired_state"] = desired_state
            __props__.__dict__["role_arn"] = role_arn
            __props__.__dict__["schema"] = schema
            if type_name is None and not opts.urn:
                raise TypeError("Missing required property 'type_name'")
            __props__.__dict__["type_name"] = type_name
            __props__.__dict__["type_version_id"] = type_version_id
            __props__.__dict__["properties"] = None
        super(Resource, __self__).__init__(
            'aws:cloudcontrol/resource:Resource',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            desired_state: Optional[pulumi.Input[str]] = None,
            properties: Optional[pulumi.Input[str]] = None,
            role_arn: Optional[pulumi.Input[str]] = None,
            schema: Optional[pulumi.Input[str]] = None,
            type_name: Optional[pulumi.Input[str]] = None,
            type_version_id: Optional[pulumi.Input[str]] = None) -> 'Resource':
        """
        Get an existing Resource 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] role_arn: Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        :param pulumi.Input[str] schema: JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        :param pulumi.Input[str] type_name: CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        :param pulumi.Input[str] type_version_id: Identifier of the CloudFormation resource type version.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ResourceState.__new__(_ResourceState)

        __props__.__dict__["desired_state"] = desired_state
        __props__.__dict__["properties"] = properties
        __props__.__dict__["role_arn"] = role_arn
        __props__.__dict__["schema"] = schema
        __props__.__dict__["type_name"] = type_name
        __props__.__dict__["type_version_id"] = type_version_id
        return Resource(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="desiredState")
    def desired_state(self) -> pulumi.Output[str]:
        return pulumi.get(self, "desired_state")

    @property
    @pulumi.getter
    def properties(self) -> pulumi.Output[str]:
        return pulumi.get(self, "properties")

    @property
    @pulumi.getter(name="roleArn")
    def role_arn(self) -> pulumi.Output[Optional[str]]:
        """
        Amazon Resource Name (ARN) of the IAM Role to assume for operations.
        """
        return pulumi.get(self, "role_arn")

    @property
    @pulumi.getter
    def schema(self) -> pulumi.Output[str]:
        """
        JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`cloudformation.CloudFormationType` data source](https://www.terraform.io/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
        """
        return pulumi.get(self, "schema")

    @property
    @pulumi.getter(name="typeName")
    def type_name(self) -> pulumi.Output[str]:
        """
        CloudFormation resource type name. For example, `AWS::EC2::VPC`.
        """
        return pulumi.get(self, "type_name")

    @property
    @pulumi.getter(name="typeVersionId")
    def type_version_id(self) -> pulumi.Output[Optional[str]]:
        """
        Identifier of the CloudFormation resource type version.
        """
        return pulumi.get(self, "type_version_id")

