{
  "typeName" : "AWS::CodePipeline::Pipeline",
  "description" : "The AWS::CodePipeline::Pipeline resource creates a CodePipeline pipeline that describes how software changes go through a release process.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-codepipeline",
  "definitions" : {
    "BlockerDeclaration" : {
      "description" : "Reserved for future use.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "description" : "Reserved for future use.",
          "type" : "string"
        },
        "Type" : {
          "description" : "Reserved for future use.",
          "type" : "string",
          "enum" : [ "Schedule" ]
        }
      },
      "required" : [ "Type", "Name" ]
    },
    "GitConfiguration" : {
      "description" : "A type of trigger configuration for Git-based source actions.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Push" : {
          "description" : "The field where the repository event that will start the pipeline, such as pushing Git tags, is specified with details.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/GitPushFilter"
          }
        },
        "SourceActionName" : {
          "description" : "The name of the pipeline source action where the trigger configuration, such as Git tags, is specified. The trigger configuration will start the pipeline upon the specified change only.",
          "type" : "string"
        },
        "PullRequest" : {
          "description" : "The field where the repository event that will start the pipeline is specified as pull requests.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/GitPullRequestFilter"
          }
        }
      },
      "required" : [ "SourceActionName" ]
    },
    "ActionTypeId" : {
      "description" : "Represents information about an action type.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Owner" : {
          "description" : "The creator of the action being called. There are three valid values for the Owner field in the action category section within your pipeline structure: AWS, ThirdParty, and Custom.",
          "type" : "string"
        },
        "Category" : {
          "description" : "A category defines what kind of action can be taken in the stage, and constrains the provider type for the action. Valid categories are limited to one of the values below.",
          "type" : "string",
          "enum" : [ "Source", "Build", "Test", "Deploy", "Invoke", "Approval", "Compute" ]
        },
        "Version" : {
          "description" : "A string that describes the action version.",
          "type" : "string"
        },
        "Provider" : {
          "description" : "The provider of the service being called by the action. Valid providers are determined by the action category. For example, an action in the Deploy category type might have a provider of CodeDeploy, which would be specified as CodeDeploy.",
          "type" : "string"
        }
      },
      "required" : [ "Owner", "Category", "Version", "Provider" ]
    },
    "ArtifactStoreMap" : {
      "description" : "A mapping of artifactStore objects and their corresponding AWS Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ArtifactStore" : {
          "$ref" : "#/definitions/ArtifactStore"
        },
        "Region" : {
          "description" : "The action declaration's AWS Region, such as us-east-1.",
          "type" : "string"
        }
      },
      "required" : [ "ArtifactStore", "Region" ]
    },
    "PipelineTriggerDeclaration" : {
      "description" : "Represents information about the specified trigger configuration, such as the filter criteria and the source stage for the action that contains the trigger.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "GitConfiguration" : {
          "$ref" : "#/definitions/GitConfiguration"
        },
        "ProviderType" : {
          "description" : "The source provider for the event, such as connections configured for a repository with Git tags, for the specified trigger configuration.",
          "type" : "string",
          "enum" : [ "CodeStarSourceConnection" ]
        }
      },
      "required" : [ "ProviderType" ]
    },
    "EncryptionKey" : {
      "description" : "Represents information about the key used to encrypt data in the artifact store, such as an AWS Key Management Service (AWS KMS) key",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Type" : {
          "description" : "The type of encryption key, such as an AWS KMS key. When creating or updating a pipeline, the value must be set to 'KMS'.",
          "type" : "string"
        },
        "Id" : {
          "description" : "The ID used to identify the key. For an AWS KMS key, you can use the key ID, the key ARN, or the alias ARN.",
          "type" : "string"
        }
      },
      "required" : [ "Type", "Id" ]
    },
    "GitPullRequestFilter" : {
      "description" : "The event criteria for the pull request trigger configuration, such as the lists of branches or file paths to include and exclude.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "FilePaths" : {
          "$ref" : "#/definitions/GitFilePathFilterCriteria"
        },
        "Events" : {
          "description" : "The field that specifies which pull request events to filter on (opened, updated, closed) for the trigger configuration.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Branches" : {
          "$ref" : "#/definitions/GitBranchFilterCriteria"
        }
      }
    },
    "GitPushFilter" : {
      "description" : "The event criteria that specify when a specified repository event will start the pipeline for the specified trigger configuration, such as the lists of Git tags to include and exclude.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "FilePaths" : {
          "$ref" : "#/definitions/GitFilePathFilterCriteria"
        },
        "Branches" : {
          "$ref" : "#/definitions/GitBranchFilterCriteria"
        },
        "Tags" : {
          "$ref" : "#/definitions/GitTagFilterCriteria"
        }
      }
    },
    "ActionDeclaration" : {
      "description" : "Represents information about an action declaration.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ActionTypeId" : {
          "$ref" : "#/definitions/ActionTypeId"
        },
        "Configuration" : {
          "description" : "The action's configuration. These are key-value pairs that specify input values for an action.",
          "type" : "object"
        },
        "InputArtifacts" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/InputArtifact"
          }
        },
        "OutputArtifacts" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/OutputArtifact"
          }
        },
        "Commands" : {
          "description" : "The shell commands to run with your compute action in CodePipeline.",
          "type" : "array",
          "uniqueItems" : false,
          "items" : {
            "type" : "string"
          }
        },
        "OutputVariables" : {
          "description" : "The list of variables that are to be exported from the compute action.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        },
        "EnvironmentVariables" : {
          "description" : "The list of environment variables that are input to a compute based action.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/EnvironmentVariable"
          }
        },
        "Region" : {
          "description" : "The action declaration's AWS Region, such as us-east-1.",
          "type" : "string"
        },
        "Namespace" : {
          "description" : "The variable namespace associated with the action. All variables produced as output by this action fall under this namespace.",
          "type" : "string"
        },
        "RoleArn" : {
          "description" : "The ARN of the IAM service role that performs the declared action. This is assumed through the roleArn for the pipeline.",
          "type" : "string",
          "pattern" : "arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*"
        },
        "RunOrder" : {
          "description" : "The order in which actions are run.",
          "type" : "integer"
        },
        "Name" : {
          "description" : "The action declaration's name.",
          "type" : "string"
        },
        "TimeoutInMinutes" : {
          "description" : "A timeout duration in minutes that can be applied against the ActionType’s default timeout value specified in Quotas for AWS CodePipeline. This attribute is available only to the manual approval ActionType.",
          "type" : "integer"
        }
      },
      "required" : [ "ActionTypeId", "Name" ]
    },
    "GitFilePathFilterCriteria" : {
      "description" : "The Git repository file paths specified as filter criteria to start the pipeline.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Includes" : {
          "description" : "The list of patterns of Git repository file paths that, when a commit is pushed, are to be included as criteria that starts the pipeline.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Excludes" : {
          "description" : "The list of patterns of Git repository file paths that, when a commit is pushed, are to be excluded from starting the pipeline.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        }
      }
    },
    "StageDeclaration" : {
      "description" : "Represents information about a stage and its definition.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Blockers" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/BlockerDeclaration"
          }
        },
        "Actions" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/ActionDeclaration"
          }
        },
        "Name" : {
          "description" : "The name of the stage.",
          "type" : "string"
        },
        "OnFailure" : {
          "type" : "object",
          "description" : "The method to use when a stage has not completed successfully",
          "$ref" : "#/definitions/FailureConditions"
        },
        "OnSuccess" : {
          "type" : "object",
          "description" : "The method to use when a stage has completed successfully",
          "$ref" : "#/definitions/SuccessConditions"
        },
        "BeforeEntry" : {
          "type" : "object",
          "description" : "The method to use before stage runs.",
          "$ref" : "#/definitions/BeforeEntryConditions"
        }
      },
      "required" : [ "Actions", "Name" ]
    },
    "InputArtifact" : {
      "description" : "Represents information about an artifact to be worked on, such as a test or build artifact.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "description" : "The name of the artifact to be worked on (for example, \"My App\").",
          "type" : "string"
        }
      },
      "required" : [ "Name" ]
    },
    "ArtifactStore" : {
      "description" : "The S3 bucket where artifacts for the pipeline are stored.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Type" : {
          "description" : "The type of the artifact store, such as S3.",
          "enum" : [ "S3" ],
          "type" : "string"
        },
        "EncryptionKey" : {
          "$ref" : "#/definitions/EncryptionKey"
        },
        "Location" : {
          "description" : "The S3 bucket used for storing the artifacts for a pipeline. You can specify the name of an S3 bucket but not a folder in the bucket. A folder to contain the pipeline artifacts is created for you based on the name of the pipeline. You can use any S3 bucket in the same AWS Region as the pipeline to store your pipeline artifacts.",
          "type" : "string"
        }
      },
      "required" : [ "Type", "Location" ]
    },
    "VariableDeclaration" : {
      "description" : "A variable declared at the pipeline level.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "DefaultValue" : {
          "description" : "The value of a pipeline-level variable.",
          "type" : "string"
        },
        "Description" : {
          "description" : "The description of a pipeline-level variable. It's used to add additional context about the variable, and not being used at time when pipeline executes.",
          "type" : "string"
        },
        "Name" : {
          "description" : "The name of a pipeline-level variable.",
          "type" : "string"
        }
      },
      "required" : [ "Name" ]
    },
    "StageTransition" : {
      "description" : "The name of the pipeline in which you want to disable the flow of artifacts from one stage to another.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "StageName" : {
          "description" : "The name of the stage where you want to disable the inbound or outbound transition of artifacts.",
          "type" : "string"
        },
        "Reason" : {
          "description" : "The reason given to the user that a stage is disabled, such as waiting for manual approval or manual tests. This message is displayed in the pipeline console UI.",
          "type" : "string"
        }
      },
      "required" : [ "StageName", "Reason" ]
    },
    "GitTagFilterCriteria" : {
      "description" : "The Git tags specified as filter criteria for whether a Git tag repository event will start the pipeline.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Includes" : {
          "description" : "The list of patterns of Git tags that, when pushed, are to be included as criteria that starts the pipeline.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Excludes" : {
          "description" : "The list of patterns of Git tags that, when pushed, are to be excluded from starting the pipeline.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        }
      }
    },
    "Tag" : {
      "description" : "A tag is a key-value pair that is used to manage the resource.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Value" : {
          "description" : "The tag's value.",
          "type" : "string"
        },
        "Key" : {
          "description" : "The tag's key.",
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    },
    "GitBranchFilterCriteria" : {
      "description" : "The Git repository branches specified as filter criteria to start the pipeline.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Includes" : {
          "description" : "The list of patterns of Git branches that, when a commit is pushed, are to be included as criteria that starts the pipeline.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Excludes" : {
          "description" : "The list of patterns of Git branches that, when a commit is pushed, are to be excluded from starting the pipeline.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        }
      }
    },
    "OutputArtifact" : {
      "description" : "Represents information about the output of an action.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "description" : "The name of the output of an artifact, such as \"My App\".",
          "type" : "string"
        },
        "Files" : {
          "description" : "The files that you want to associate with the output artifact that will be exported from the compute action.",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        }
      },
      "required" : [ "Name" ]
    },
    "EnvironmentVariable" : {
      "description" : "Represents information about the environment variable of an action.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "description" : "The name of the environment variable.",
          "type" : "string"
        },
        "Value" : {
          "description" : "The value of the environment variable.",
          "type" : "string"
        },
        "Type" : {
          "description" : "The type of the environment variable.",
          "enum" : [ "PLAINTEXT", "SECRETS_MANAGER" ],
          "type" : "string"
        }
      },
      "required" : [ "Name", "Value" ]
    },
    "FailureConditions" : {
      "description" : "The configuration that specifies the result, such as rollback, to occur upon stage failure",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Result" : {
          "type" : "string",
          "description" : "The specified result for when the failure conditions are met, such as rolling back the stage",
          "enum" : [ "ROLLBACK", "RETRY" ]
        },
        "RetryConfiguration" : {
          "description" : "The configuration that specifies the retry configuration for a stage",
          "type" : "object",
          "additionalProperties" : false,
          "properties" : {
            "RetryMode" : {
              "type" : "string",
              "description" : "The specified retry mode type for the given stage. FAILED_ACTIONS will retry only the failed actions. ALL_ACTIONS will retry both failed and successful",
              "enum" : [ "ALL_ACTIONS", "FAILED_ACTIONS" ]
            }
          }
        },
        "Conditions" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/Condition"
          }
        }
      }
    },
    "SuccessConditions" : {
      "description" : "The configuration that specifies the result, such as rollback, to occur upon stage failure",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Conditions" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/Condition"
          }
        }
      }
    },
    "BeforeEntryConditions" : {
      "description" : "The configuration that specifies the rules to run before stage starts.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Conditions" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/Condition"
          }
        }
      }
    },
    "Condition" : {
      "description" : "Represents information about condition.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Result" : {
          "type" : "string",
          "description" : "The specified result for when the failure conditions are met, such as rolling back the stage"
        },
        "Rules" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/RuleDeclaration"
          }
        }
      }
    },
    "RuleDeclaration" : {
      "description" : "Represents information about condition.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RuleTypeId" : {
          "$ref" : "#/definitions/RuleTypeId"
        },
        "Configuration" : {
          "description" : "The rule's configuration. These are key-value pairs that specify input values for a rule.",
          "type" : "object"
        },
        "Commands" : {
          "description" : "The shell commands to run with your compute action in CodePipeline.",
          "type" : "array",
          "uniqueItems" : false,
          "items" : {
            "type" : "string"
          }
        },
        "InputArtifacts" : {
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/InputArtifact"
          }
        },
        "Region" : {
          "description" : "The rule declaration's AWS Region, such as us-east-1.",
          "type" : "string"
        },
        "RoleArn" : {
          "description" : "The ARN of the IAM service role that performs the declared rule. This is assumed through the roleArn for the pipeline.",
          "type" : "string",
          "pattern" : "arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*"
        },
        "Name" : {
          "description" : "The rule declaration's name.",
          "type" : "string"
        }
      }
    },
    "RuleTypeId" : {
      "description" : "Represents information about a rule type.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Owner" : {
          "description" : "The creator of the rule being called. Only AWS is supported.",
          "type" : "string"
        },
        "Category" : {
          "description" : "A category for the provider type for the rule.",
          "type" : "string"
        },
        "Version" : {
          "description" : "A string that describes the rule version.",
          "type" : "string"
        },
        "Provider" : {
          "description" : "The provider of the service being called by the rule.",
          "type" : "string"
        }
      }
    }
  },
  "properties" : {
    "ArtifactStores" : {
      "description" : "A mapping of artifactStore objects and their corresponding AWS Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/ArtifactStoreMap"
      }
    },
    "DisableInboundStageTransitions" : {
      "description" : "Represents the input of a DisableStageTransition action.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/StageTransition"
      }
    },
    "Stages" : {
      "description" : "Represents information about a stage and its definition.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/StageDeclaration"
      }
    },
    "ExecutionMode" : {
      "description" : "The method that the pipeline will use to handle multiple executions. The default mode is SUPERSEDED.",
      "enum" : [ "QUEUED", "SUPERSEDED", "PARALLEL" ],
      "default" : "SUPERSEDED",
      "type" : "string"
    },
    "RestartExecutionOnUpdate" : {
      "description" : "Indicates whether to rerun the CodePipeline pipeline after you update it.",
      "type" : "boolean"
    },
    "Triggers" : {
      "description" : "The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/PipelineTriggerDeclaration"
      }
    },
    "RoleArn" : {
      "description" : "The Amazon Resource Name (ARN) for CodePipeline to use to either perform actions with no actionRoleArn, or to use to assume roles for actions with an actionRoleArn",
      "type" : "string",
      "pattern" : "arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*"
    },
    "Name" : {
      "description" : "The name of the pipeline.",
      "type" : "string"
    },
    "Variables" : {
      "description" : "A list that defines the pipeline variables for a pipeline resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9@\\-_]+.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/VariableDeclaration"
      }
    },
    "Version" : {
      "description" : "The version of the pipeline.",
      "type" : "string"
    },
    "ArtifactStore" : {
      "description" : "The S3 bucket where artifacts for the pipeline are stored.",
      "$ref" : "#/definitions/ArtifactStore"
    },
    "PipelineType" : {
      "description" : "CodePipeline provides the following pipeline types, which differ in characteristics and price, so that you can tailor your pipeline features and cost to the needs of your applications.",
      "type" : "string",
      "enum" : [ "V1", "V2" ]
    },
    "Tags" : {
      "description" : "Specifies the tags applied to the pipeline.",
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "codepipeline:TagResource", "codepipeline:UntagResource" ]
  },
  "required" : [ "Stages", "RoleArn" ],
  "readOnlyProperties" : [ "/properties/Version" ],
  "primaryIdentifier" : [ "/properties/Name" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "writeOnlyProperties" : [ "/properties/RestartExecutionOnUpdate" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iam:GetRole", "iam:PassRole", "codepipeline:GetPipeline", "codepipeline:CreatePipeline", "codepipeline:DisableStageTransition", "codepipeline:GetPipelineState", "codepipeline:TagResource", "codestar-connections:PassConnection" ]
    },
    "read" : {
      "permissions" : [ "codepipeline:GetPipeline", "codepipeline:ListTagsForResource", "codepipeline:GetPipelineState" ]
    },
    "update" : {
      "permissions" : [ "iam:GetRole", "iam:PassRole", "codepipeline:EnableStageTransition", "codepipeline:StartPipelineExecution", "codepipeline:GetPipeline", "codepipeline:UpdatePipeline", "codepipeline:GetPipelineState", "codepipeline:DisableStageTransition", "codepipeline:TagResource", "codepipeline:UntagResource", "codestar-connections:PassConnection" ]
    },
    "delete" : {
      "permissions" : [ "codepipeline:GetPipeline", "codepipeline:DeletePipeline" ]
    },
    "list" : {
      "permissions" : [ "codepipeline:ListPipelines" ]
    }
  }
}