# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class Pipeline(pulumi.CustomResource):
    arn: pulumi.Output[str]
    """
    The codepipeline ARN.
    """
    artifact_store: pulumi.Output[dict]
    """
    An artifact_store block. Artifact stores are documented below.
    * `stage` (Minimum of at least two `stage` blocks is required) A stage block. Stages are documented below.
    
      * `encryption_key` (`dict`)
    
        * `id` (`str`) - The codepipeline ID.
        * `type` (`str`)
    
      * `location` (`str`)
      * `type` (`str`)
    """
    name: pulumi.Output[str]
    """
    The name of the pipeline.
    """
    role_arn: pulumi.Output[str]
    """
    A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
    """
    stages: pulumi.Output[list]
    tags: pulumi.Output[dict]
    """
    A mapping of tags to assign to the resource.
    """
    def __init__(__self__, resource_name, opts=None, artifact_store=None, name=None, role_arn=None, stages=None, tags=None, __props__=None, __name__=None, __opts__=None):
        """
        Provides a CodePipeline.
        
        > **NOTE on `codepipeline.Pipeline`:** - the `GITHUB_TOKEN` environment variable must be set if the GitHub provider is specified.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] artifact_store: An artifact_store block. Artifact stores are documented below.
               * `stage` (Minimum of at least two `stage` blocks is required) A stage block. Stages are documented below.
        :param pulumi.Input[str] name: The name of the pipeline.
        :param pulumi.Input[str] role_arn: A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.
        
        The **artifact_store** object supports the following:
        
          * `encryption_key` (`pulumi.Input[dict]`)
        
            * `id` (`pulumi.Input[str]`) - The codepipeline ID.
            * `type` (`pulumi.Input[str]`)
        
          * `location` (`pulumi.Input[str]`)
          * `type` (`pulumi.Input[str]`)
        
        The **stages** object supports the following:
        
          * `actions` (`pulumi.Input[list]`)
        
            * `category` (`pulumi.Input[str]`)
            * `configuration` (`pulumi.Input[dict]`)
            * `inputArtifacts` (`pulumi.Input[list]`)
            * `name` (`pulumi.Input[str]`) - The name of the pipeline.
            * `outputArtifacts` (`pulumi.Input[list]`)
            * `owner` (`pulumi.Input[str]`)
            * `provider` (`pulumi.Input[str]`)
            * `role_arn` (`pulumi.Input[str]`) - A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
            * `runOrder` (`pulumi.Input[float]`)
            * `version` (`pulumi.Input[str]`)
        
          * `name` (`pulumi.Input[str]`) - The name of the pipeline.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/codepipeline.html.markdown.
        """
        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()

            if artifact_store is None:
                raise TypeError("Missing required property 'artifact_store'")
            __props__['artifact_store'] = artifact_store
            __props__['name'] = name
            if role_arn is None:
                raise TypeError("Missing required property 'role_arn'")
            __props__['role_arn'] = role_arn
            if stages is None:
                raise TypeError("Missing required property 'stages'")
            __props__['stages'] = stages
            __props__['tags'] = tags
            __props__['arn'] = None
        super(Pipeline, __self__).__init__(
            'aws:codepipeline/pipeline:Pipeline',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, arn=None, artifact_store=None, name=None, role_arn=None, stages=None, tags=None):
        """
        Get an existing Pipeline 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] arn: The codepipeline ARN.
        :param pulumi.Input[dict] artifact_store: An artifact_store block. Artifact stores are documented below.
               * `stage` (Minimum of at least two `stage` blocks is required) A stage block. Stages are documented below.
        :param pulumi.Input[str] name: The name of the pipeline.
        :param pulumi.Input[str] role_arn: A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.
        
        The **artifact_store** object supports the following:
        
          * `encryption_key` (`pulumi.Input[dict]`)
        
            * `id` (`pulumi.Input[str]`) - The codepipeline ID.
            * `type` (`pulumi.Input[str]`)
        
          * `location` (`pulumi.Input[str]`)
          * `type` (`pulumi.Input[str]`)
        
        The **stages** object supports the following:
        
          * `actions` (`pulumi.Input[list]`)
        
            * `category` (`pulumi.Input[str]`)
            * `configuration` (`pulumi.Input[dict]`)
            * `inputArtifacts` (`pulumi.Input[list]`)
            * `name` (`pulumi.Input[str]`) - The name of the pipeline.
            * `outputArtifacts` (`pulumi.Input[list]`)
            * `owner` (`pulumi.Input[str]`)
            * `provider` (`pulumi.Input[str]`)
            * `role_arn` (`pulumi.Input[str]`) - A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
            * `runOrder` (`pulumi.Input[float]`)
            * `version` (`pulumi.Input[str]`)
        
          * `name` (`pulumi.Input[str]`) - The name of the pipeline.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/codepipeline.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["arn"] = arn
        __props__["artifact_store"] = artifact_store
        __props__["name"] = name
        __props__["role_arn"] = role_arn
        __props__["stages"] = stages
        __props__["tags"] = tags
        return Pipeline(resource_name, opts=opts, __props__=__props__)
    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

