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

__all__ = ['ExtensionAssociationArgs', 'ExtensionAssociation']

@pulumi.input_type
class ExtensionAssociationArgs:
    def __init__(__self__, *,
                 extension_arn: pulumi.Input[str],
                 resource_arn: pulumi.Input[str],
                 parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None):
        """
        The set of arguments for constructing a ExtensionAssociation resource.
        :param pulumi.Input[str] extension_arn: The ARN of the extension defined in the association.
        :param pulumi.Input[str] resource_arn: The ARN of the application, configuration profile, or environment to associate with the extension.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] parameters: The parameter names and values defined for the association.
        """
        pulumi.set(__self__, "extension_arn", extension_arn)
        pulumi.set(__self__, "resource_arn", resource_arn)
        if parameters is not None:
            pulumi.set(__self__, "parameters", parameters)

    @property
    @pulumi.getter(name="extensionArn")
    def extension_arn(self) -> pulumi.Input[str]:
        """
        The ARN of the extension defined in the association.
        """
        return pulumi.get(self, "extension_arn")

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

    @property
    @pulumi.getter(name="resourceArn")
    def resource_arn(self) -> pulumi.Input[str]:
        """
        The ARN of the application, configuration profile, or environment to associate with the extension.
        """
        return pulumi.get(self, "resource_arn")

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

    @property
    @pulumi.getter
    def parameters(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
        """
        The parameter names and values defined for the association.
        """
        return pulumi.get(self, "parameters")

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


@pulumi.input_type
class _ExtensionAssociationState:
    def __init__(__self__, *,
                 arn: Optional[pulumi.Input[str]] = None,
                 extension_arn: Optional[pulumi.Input[str]] = None,
                 extension_version: Optional[pulumi.Input[int]] = None,
                 parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 resource_arn: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering ExtensionAssociation resources.
        :param pulumi.Input[str] arn: ARN of the AppConfig Extension Association.
        :param pulumi.Input[str] extension_arn: The ARN of the extension defined in the association.
        :param pulumi.Input[int] extension_version: The version number for the extension defined in the association.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] parameters: The parameter names and values defined for the association.
        :param pulumi.Input[str] resource_arn: The ARN of the application, configuration profile, or environment to associate with the extension.
        """
        if arn is not None:
            pulumi.set(__self__, "arn", arn)
        if extension_arn is not None:
            pulumi.set(__self__, "extension_arn", extension_arn)
        if extension_version is not None:
            pulumi.set(__self__, "extension_version", extension_version)
        if parameters is not None:
            pulumi.set(__self__, "parameters", parameters)
        if resource_arn is not None:
            pulumi.set(__self__, "resource_arn", resource_arn)

    @property
    @pulumi.getter
    def arn(self) -> Optional[pulumi.Input[str]]:
        """
        ARN of the AppConfig Extension Association.
        """
        return pulumi.get(self, "arn")

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

    @property
    @pulumi.getter(name="extensionArn")
    def extension_arn(self) -> Optional[pulumi.Input[str]]:
        """
        The ARN of the extension defined in the association.
        """
        return pulumi.get(self, "extension_arn")

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

    @property
    @pulumi.getter(name="extensionVersion")
    def extension_version(self) -> Optional[pulumi.Input[int]]:
        """
        The version number for the extension defined in the association.
        """
        return pulumi.get(self, "extension_version")

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

    @property
    @pulumi.getter
    def parameters(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
        """
        The parameter names and values defined for the association.
        """
        return pulumi.get(self, "parameters")

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

    @property
    @pulumi.getter(name="resourceArn")
    def resource_arn(self) -> Optional[pulumi.Input[str]]:
        """
        The ARN of the application, configuration profile, or environment to associate with the extension.
        """
        return pulumi.get(self, "resource_arn")

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


class ExtensionAssociation(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 extension_arn: Optional[pulumi.Input[str]] = None,
                 parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 resource_arn: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Associates an AppConfig Extension with a Resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aws as aws

        test_topic = aws.sns.Topic("testTopic")
        test_policy_document = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
            actions=["sts:AssumeRole"],
            principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
                type="Service",
                identifiers=["appconfig.amazonaws.com"],
            )],
        )])
        test_role = aws.iam.Role("testRole", assume_role_policy=test_policy_document.json)
        test_extension = aws.appconfig.Extension("testExtension",
            description="test description",
            action_points=[aws.appconfig.ExtensionActionPointArgs(
                point="ON_DEPLOYMENT_COMPLETE",
                actions=[aws.appconfig.ExtensionActionPointActionArgs(
                    name="test",
                    role_arn=test_role.arn,
                    uri=test_topic.arn,
                )],
            )],
            tags={
                "Type": "AppConfig Extension",
            })
        test_application = aws.appconfig.Application("testApplication")
        test_extension_association = aws.appconfig.ExtensionAssociation("testExtensionAssociation",
            extension_arn=test_extension.arn,
            resource_arn=test_application.arn)
        ```

        ## Import

        AppConfig Extension Associations can be imported using their extension association ID, e.g.,

        ```sh
         $ pulumi import aws:appconfig/extensionAssociation:ExtensionAssociation example 71rxuzt
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] extension_arn: The ARN of the extension defined in the association.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] parameters: The parameter names and values defined for the association.
        :param pulumi.Input[str] resource_arn: The ARN of the application, configuration profile, or environment to associate with the extension.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ExtensionAssociationArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Associates an AppConfig Extension with a Resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aws as aws

        test_topic = aws.sns.Topic("testTopic")
        test_policy_document = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
            actions=["sts:AssumeRole"],
            principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
                type="Service",
                identifiers=["appconfig.amazonaws.com"],
            )],
        )])
        test_role = aws.iam.Role("testRole", assume_role_policy=test_policy_document.json)
        test_extension = aws.appconfig.Extension("testExtension",
            description="test description",
            action_points=[aws.appconfig.ExtensionActionPointArgs(
                point="ON_DEPLOYMENT_COMPLETE",
                actions=[aws.appconfig.ExtensionActionPointActionArgs(
                    name="test",
                    role_arn=test_role.arn,
                    uri=test_topic.arn,
                )],
            )],
            tags={
                "Type": "AppConfig Extension",
            })
        test_application = aws.appconfig.Application("testApplication")
        test_extension_association = aws.appconfig.ExtensionAssociation("testExtensionAssociation",
            extension_arn=test_extension.arn,
            resource_arn=test_application.arn)
        ```

        ## Import

        AppConfig Extension Associations can be imported using their extension association ID, e.g.,

        ```sh
         $ pulumi import aws:appconfig/extensionAssociation:ExtensionAssociation example 71rxuzt
        ```

        :param str resource_name: The name of the resource.
        :param ExtensionAssociationArgs 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(ExtensionAssociationArgs, 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,
                 extension_arn: Optional[pulumi.Input[str]] = None,
                 parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 resource_arn: 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__ = ExtensionAssociationArgs.__new__(ExtensionAssociationArgs)

            if extension_arn is None and not opts.urn:
                raise TypeError("Missing required property 'extension_arn'")
            __props__.__dict__["extension_arn"] = extension_arn
            __props__.__dict__["parameters"] = parameters
            if resource_arn is None and not opts.urn:
                raise TypeError("Missing required property 'resource_arn'")
            __props__.__dict__["resource_arn"] = resource_arn
            __props__.__dict__["arn"] = None
            __props__.__dict__["extension_version"] = None
        super(ExtensionAssociation, __self__).__init__(
            'aws:appconfig/extensionAssociation:ExtensionAssociation',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            arn: Optional[pulumi.Input[str]] = None,
            extension_arn: Optional[pulumi.Input[str]] = None,
            extension_version: Optional[pulumi.Input[int]] = None,
            parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
            resource_arn: Optional[pulumi.Input[str]] = None) -> 'ExtensionAssociation':
        """
        Get an existing ExtensionAssociation 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] arn: ARN of the AppConfig Extension Association.
        :param pulumi.Input[str] extension_arn: The ARN of the extension defined in the association.
        :param pulumi.Input[int] extension_version: The version number for the extension defined in the association.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] parameters: The parameter names and values defined for the association.
        :param pulumi.Input[str] resource_arn: The ARN of the application, configuration profile, or environment to associate with the extension.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ExtensionAssociationState.__new__(_ExtensionAssociationState)

        __props__.__dict__["arn"] = arn
        __props__.__dict__["extension_arn"] = extension_arn
        __props__.__dict__["extension_version"] = extension_version
        __props__.__dict__["parameters"] = parameters
        __props__.__dict__["resource_arn"] = resource_arn
        return ExtensionAssociation(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def arn(self) -> pulumi.Output[str]:
        """
        ARN of the AppConfig Extension Association.
        """
        return pulumi.get(self, "arn")

    @property
    @pulumi.getter(name="extensionArn")
    def extension_arn(self) -> pulumi.Output[str]:
        """
        The ARN of the extension defined in the association.
        """
        return pulumi.get(self, "extension_arn")

    @property
    @pulumi.getter(name="extensionVersion")
    def extension_version(self) -> pulumi.Output[int]:
        """
        The version number for the extension defined in the association.
        """
        return pulumi.get(self, "extension_version")

    @property
    @pulumi.getter
    def parameters(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
        """
        The parameter names and values defined for the association.
        """
        return pulumi.get(self, "parameters")

    @property
    @pulumi.getter(name="resourceArn")
    def resource_arn(self) -> pulumi.Output[str]:
        """
        The ARN of the application, configuration profile, or environment to associate with the extension.
        """
        return pulumi.get(self, "resource_arn")

