id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
6e7204517b57-1
+ [Step 2: Create or use an IAM user](#create-iam-user) + [Step 3: Use an IAM managed policy to assign CodePipeline permissions to the IAM user](#assign-permissions) + [Step 4: Install the AWS CLI](#install-cli) + [Step 5: Open the console for CodePipeline](#open-codepipeline-console) + [Next steps](#next-steps)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
1fa974754f94-0
Create an AWS account, if you haven't done so already, by going to [https://aws\.amazon\.com/](https://aws.amazon.com/) and choosing **Sign Up**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
c96eac0f15e5-0
Create an IAM user or use an existing one in your AWS account\. Make sure that you have an AWS access key ID and an AWS secret access key associated with that IAM user\. For more information, see [Creating an IAM User in Your AWS Account](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SettingUpUser.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
84a45e96ac87-0
You must give the IAM user permissions to interact with CodePipeline\. The quickest way to do this is to apply the `AWSCodePipelineFullAccess` managed policy to the IAM user\. **Note** The `AWSCodePipelineFullAccess` policy includes permissions that allow the console user to pass an IAM role to CodePipeline or other AWS services\. This allows the service to assume the role and perform actions on your behalf\. When you attach the policy to a user, role, or group, the `iam:PassRole` permissions are applied\. Make sure the policy is only applied to trusted users\. When users with these permissions use the console to create or edit a pipeline, the following choices are available: Create a CodePipeline service role or choose an existing one and pass the role to CodePipeline Might choose to create a CloudWatch Events rule for change detection and pass the CloudWatch Events service role to CloudWatch Events For more information, see [Granting a User Permissions to Pass a Role to an AWS Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html)\. **To grant permissions to an IAM user using the AWS Management Console** 1. Sign in to the AWS Management Console and open the IAM console at [https://console\.aws\.amazon\.com/iam/](https://console.aws.amazon.com/iam/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
84a45e96ac87-1
1. In the IAM console, in the navigation pane, choose **Policies**, and then choose the `AWSCodePipelineFullAccess` managed policy from the list of policies\. 1. On the **Summary** page, choose the **Policy Usage** tab, and then choose **Attach**\. 1. On the **Attach Policy** page, select the check box next to the IAM users or groups, and then choose **Attach Policy**\. **Note** The `AWSCodePipelineFullAccess` policy provides access to all CodePipeline actions and resources that the IAM user has access to, as well as all possible actions when creating stages in a pipeline, such as creating stages that include CodeDeploy, Elastic Beanstalk, or Amazon S3\. As a best practice, you should grant individuals only the permissions they need to perform their duties\. For more information about how to restrict IAM users to a limited set of CodePipeline actions and resources, see [Remove permissions from the CodePipeline service role](security-iam.md#remove-permissions-from-policy)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
54eba831e5c0-0
To call CodePipeline commands from the AWS CLI on a local development machine, you must install the AWS CLI\. This step is optional if you intend to get started using only the steps in this guide for the CodePipeline console\. **To install and configure the AWS CLI** 1. On your local machine, download and install the AWS CLI\. This will enable you to interact with CodePipeline from the command line\. For more information, see [Getting Set Up with the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html)\. **Note** CodePipeline works only with AWS CLI versions 1\.7\.38 and later\. To determine which version of the AWS CLI that you may have installed, run the command aws \-\-version\. To upgrade an older version of the AWS CLI to the latest version, follow the instructions in [Uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-uninstall.html), and then follow the instructions in [Installing the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)\. 1. Configure the AWS CLI with the configure command, as follows: ``` aws configure ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
54eba831e5c0-1
``` aws configure ``` When prompted, specify the AWS access key and AWS secret access key of the IAM user that you will use with CodePipeline\. When prompted for the default region name, specify the region where you will create the pipeline, such as `us-east-2`\. When prompted for the default output format, specify `json`\. For example: ``` AWS Access Key ID [None]: Type your target AWS access key ID here, and then press Enter AWS Secret Access Key [None]: Type your target AWS secret access key here, and then press Enter Default region name [None]: Type us-east-2 here, and then press Enter Default output format [None]: Type json here, and then press Enter ``` **Note** For more information about IAM, access keys, and secret keys, see [Managing Access Keys for IAM Users](https://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.html) and [How Do I Get Credentials?](https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_Introduction.html#IAM_SecurityCredentials)\. For more information about the Regions and endpoints available for CodePipeline, see [AWS CodePipeline endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/codepipeline.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
c52f55cf3876-0
+ Sign in to the AWS Management Console and open the CodePipeline console at [http://console\.aws\.amazon\.com/codesuite/codepipeline/home](http://console.aws.amazon.com/codesuite/codepipeline/home)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
8ff605fac8f3-0
You have completed the prerequisites\. You can begin using CodePipeline\. To start working with CodePipeline, see the [CodePipeline tutorials](tutorials.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/getting-started-codepipeline.md
2e891dd35918-0
You can use AWS CodePipeline to configure a continuous integration flow in which your app is built and tested each time a commit is pushed to its repository\. This tutorial shows how to create and configure a pipeline to build and test your Android app with source code in a GitHub repository\. The pipeline detects the arrival of a new commit through [webhooks that CodePipeline configures for your GitHub repository](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-webhooks-migration.html), and then uses [CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html) to build the app and [Device Farm](https://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html) to test it\. **Important** Many of the actions you add to your pipeline in this procedure involve AWS resources that you need to create before you create the pipeline\. AWS resources for your source actions must always be created in the same AWS Region where you create your pipeline\. For example, if you create your pipeline in the US East \(Ohio\) Region, your CodeCommit repository must be in the US East \(Ohio\) Region\. You can add cross\-region actions when you create your pipeline\. AWS resources for cross\-region actions must be in the same AWS Region where you plan to execute the action\. For more information, see [Add a cross\-Region action in CodePipeline](actions-create-cross-region.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
2e891dd35918-1
You can try this out using your existing Android app and test definitions, or you can use the [sample app and test definitions provided by Device Farm](https://github.com/aws-samples/aws-device-farm-sample-app-for-android)\. ![\[The Step 2: Source page in the CodePipeline pipeline wizard\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/codepipeline-push-build-test-GitHub.png)![\[The Step 2: Source page in the CodePipeline pipeline wizard\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The Step 2: Source page in the CodePipeline pipeline wizard\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/) **** | | | | | | | --- |--- |--- |--- |--- | | Configure | Add definitions | Push | Build and Test | Report | | Configure pipeline resources | Add build and test definitions to your package | Push a package to your repository | App build and test build output artifact kicked off automatically | View test results | **Before you begin** 1. Sign in to the AWS Device Farm console and choose **Create a new project**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
2e891dd35918-2
**Before you begin** 1. Sign in to the AWS Device Farm console and choose **Create a new project**\. 1. Choose your project\. In the browser, copy the URL of your new project\. The URL contains the project ID\. 1. Copy and retain this project ID\. You use it when you create your pipeline in CodePipeline\. Here is an example URL for a project\. To extract the project ID, copy the value after `projects/`\. In this example, the project ID is `eec4905f-98f8-40aa-9afc-4c1cfexample`\. ``` https://<region-URL>/devicefarm/home?region=us-west-2#/projects/eec4905f-98f8-40aa-9afc-4c1cfexample/runs ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-0
1. Add and commit a file called [https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) in the root of your app code, and push it to your repository\. CodeBuild uses this file to perform commands and access artifacts required to build your app\. ``` version: 0.2 phases: build: commands: - chmod +x ./gradlew - ./gradlew assembleDebug artifacts: files: - './android/app/build/outputs/**/*.apk' discard-paths: yes ``` 1. \(Optional\) If you [use Calabash or Appium to test your app](https://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-intro.html), add the test definition file to your repository\. In a later step, you can configure Device Farm to use the definitions to carry out your test suite\. If you use Device Farm built\-in tests, you can skip this step\. 1. To create your pipeline and add a source stage, do the following:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-1
If you use Device Farm built\-in tests, you can skip this step\. 1. To create your pipeline and add a source stage, do the following: 1. Sign in to the AWS Management Console and open the CodePipeline console at [https://console\.aws\.amazon\.com/codepipeline/](https://console.aws.amazon.com/codepipeline/)\. 1. Choose **Create pipeline**\. On the **Step 1: Choose pipeline settings** page, in **Pipeline name**, enter the name for your pipeline\. 1. In **Service role**, leave **New service role** selected, and leave **Role name** unchanged\. You can also choose to use an existing service role, if you have one\. **Note** If you use a CodePipeline service role that was created before July 2018, you need to add permissions for Device Farm\. To do this, open the IAM console, find the role, and then add the following permissions to the role's policy\. For more information, see [Add permissions to the CodePipeline service role](security-iam.md#how-to-update-role-new-services)\. ``` { "Effect": "Allow", "Action": [ "devicefarm:ListProjects", "devicefarm:ListDevicePools", "devicefarm:GetRun",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-2
"devicefarm:ListDevicePools", "devicefarm:GetRun", "devicefarm:GetUpload", "devicefarm:CreateUpload", "devicefarm:ScheduleRun" ], "Resource": "*" } ``` 1. Leave the settings under **Advanced settings** at their defaults, and then choose **Next**\. 1. On the **Step 2: Add source stage** page, in **Source provider**, choose **GitHub**, and then choose **Connect to GitHub**\. 1. In the browser window, choose **Authorize aws\-codesuite**\. This allows your pipeline to make your repository a source, and to use webhooks that detect when new code is pushed to the repository\. 1. In **Repository**, choose the source repository\. 1. In **Branch**, choose the branch that you want to use\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/codepipeline-add-source.png) 1. Choose **Next**\. 1. In **Add build stage**, add a build stage:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-3
1. Choose **Next**\. 1. In **Add build stage**, add a build stage: 1. In **Build provider**, choose **AWS CodeBuild**\. Allow **Region** to default to the pipeline Region\. 1. Choose **Create project**\. 1. In **Project name**, enter a name for this build project\. 1. In **Environment image**, choose **Managed image**\. For **Operating system**, choose **Ubuntu**\. 1. For **Runtime**, choose **Standard**\. For **Image**, choose **aws/codebuild/standard:1\.0**\. CodeBuild uses this OS image, which has Android Studio installed, to build your app\. 1. For **Service role**, choose your existing CodeBuild service role or create a new one\. 1. For **Build specifications**, choose **Use a buildspec file**\. 1. Choose **Continue to CodePipeline**\. This returns to the CodePipeline console and creates a CodeBuild project that uses the `buildspec.yml` in your repository for configuration\. The build project uses a service role to manage AWS service permissions\. This step might take a couple of minutes\. 1. Choose **Next**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-4
1. Choose **Next**\. 1. On the **Step 4: Add deploy stage** page, choose **Skip deploy stage**, and then accept the warning message by choosing **Skip** again\. Choose **Next**\. 1. On **Step 5: Review**, choose **Create pipeline**\. You should see a diagram that shows the source and build stages\. ![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/codepipeline-view-pipeline.png) 1. Add a Device Farm test action to your pipeline: 1. In the upper right, choose **Edit**\. 1. At the bottom of the diagram, choose **\+ Add stage**\. In **Stage name**, enter a name, such as **Test**\. 1. Choose **\+ Add action group**\. 1. In **Action name**, enter a name\. 1. In **Action provider**, choose **AWS Device Farm**\. Allow **Region** to default to the pipeline Region\. 1. In **Input artifacts**, choose the input artifact that matches the output artifact of the stage that comes before the test stage, such as `BuildArtifact`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-5
In the AWS CodePipeline console, you can find the name of the output artifact for each stage by hovering over the information icon in the pipeline diagram\. If your pipeline tests your app directly from the **Source** stage, choose **SourceArtifact**\. If the pipeline includes a **Build** stage, choose **BuildArtifact**\. 1. In **ProjectId**, enter your Device Farm project ID\. Use the steps at the start of this tutorial to retrieve your project ID\. 1. In **DevicePoolArn**, enter the ARN for the device pool\. 1. In **AppType**, enter **Android**\. ![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/codepipeline-choose-test-provider.png) The following is a list of valid values for **AppType**: + **iOS** + **Android** + **Web** 1. In **App**, enter the path of the compiled app package\. The path is relative to the root of the input artifact for the test stage\. Typically, this path is similar to `app-release.apk`\. 1. In **TestType**, enter your type of test, and then in **Test**, enter the path of the test definition file\. The path is relative to the root of the input artifact for your test\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-6
The following is a list of valid values for **TestType**: + **APPIUM\_JAVA\_JUNIT** + **APPIUM\_JAVA\_TESTNG** + **APPIUM\_PYTHON** + **APPIUM\_WEB\_JAVA\_JUNIT** + **APPIUM\_WEB\_JAVA\_TESTNG** + **APPIUM\_WEB\_PYTHON** + **BUILTIN\_EXPLORER** + **BUILTIN\_FUZZ** + **CALABASH** + **INSTRUMENTATION** + **UIAUTOMATION** + **UIAUTOMATOR** + **WEB\_PERFORMANCE\_PROFILE** + **XCTEST** + **XCTEST\_UI** **Note** Custom environment nodes are not supported\. 1. In the remaining fields, provide the configuration that is appropriate for your test and application type\. 1. \(Optional\) In **Advanced**, provide configuration information for your test run\. 1. Choose **Save**\. 1. On the stage you are editing, choose **Done**\. In the AWS CodePipeline pane, choose **Save**, and then choose **Save** on the warning message\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
42cd25381349-7
1. To submit your changes and start a pipeline build, choose **Release change**, and then choose **Release**\. ![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/codepipeline-android-final-view-pipeline.png)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-codebuild-devicefarm.md
90bbe99e3c0e-0
To get started with CodePipeline: 1. **Learn** how CodePipeline works by reading the [CodePipeline concepts](concepts.md) section\. 1. **Prepare** to use CodePipeline by following the steps in [Getting started with CodePipeline](getting-started-codepipeline.md)\. 1. **Experiment** with CodePipeline by following the steps in the [CodePipeline tutorials](tutorials.md) tutorials\. 1. **Use** CodePipeline for your new or existing projects by following the steps in [Create a pipeline in CodePipeline](pipelines-create.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-get-started.md
ac7829598464-0
CodePipeline integrates with development tools to check for code changes and then build and deploy through all of the stages of the continuous delivery process\. Stages use input and output artifacts that are stored in the Amazon S3 artifact bucket you chose when you created the pipeline\. CodePipeline zips and transfers the files for input or output artifacts as appropriate for the action type in the stage\. For example: 1. CodePipeline triggers your pipeline to run when there is a commit to the source repository, providing the output artifact \(any files to be built\) from the **Source** stage\. 1. The output artifact \(any files to be built\) from the previous step is ingested as an input artifact to the **Build** stage\. An output artifact \(the built application\) from the **Build** stage can be an updated application or an updated Docker image built to a container\. 1. The output artifact from the previous step \(the built application\) is ingested as an input artifact to the **Deploy** stage, such as staging or production environments in the AWS Cloud\. You can deploy applications to a deployment fleet, or you can deploy container\-based applications to tasks running in ECS clusters\. When you create or edit an action, you designate the input and output artifact or artifacts for the action\. In this example for a two\-stage pipeline with a **Source** and **Deploy** stage, in **Edit Action**, you choose the artifact name of the source action for the input artifact for the deploy action\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-introducing-artifacts.md
ac7829598464-1
![\[A high-level artifacts workflow in CodePipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/example-artifact-dropdown.png)![\[A high-level artifacts workflow in CodePipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[A high-level artifacts workflow in CodePipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/) The following diagram shows a high\-level artifact workflow between stages in CodePipeline\. ![\[A high-level artifacts workflow in CodePipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/Hi-Level-PipelineFlow.png)![\[A high-level artifacts workflow in CodePipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[A high-level artifacts workflow in CodePipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-introducing-artifacts.md
ac7829598464-2
+ When you use the console to create your first pipeline, CodePipeline creates an Amazon S3 bucket in the same AWS Region to store items for all pipelines\. Every time you use the console to create another pipeline in that Region, CodePipeline creates a folder for that pipeline in the bucket\. It uses that folder to store artifacts for your pipeline as the automated release process runs\. This bucket is named codepipeline\-*region*\-*12345EXAMPLE*, where *region* is the AWS Region in which you created the pipeline, and *12345EXAMPLE* is a 12\-digit random number that ensures the bucket name is unique\. **Note** CodePipeline truncates artifact names, which can cause some bucket names to appear similar\. Even though the artifact name appears to be truncated, CodePipeline maps to the artifact bucket in a way that is not affected by artifacts with truncated names\. The pipeline can function normally\. This is not an issue with the folder or artifacts\. There is a 100\-character limit to pipeline names\. Although the artifact folder name might appear to be shortened, it is still unique for your pipeline\. When you create or edit a pipeline, you must have an artifact bucket in the pipeline Region and you must have one artifact bucket per Region where you plan to execute an action\. If you use the console to create a pipeline or cross\-Region actions, default artifact buckets are configured by CodePipeline in the Regions where you have actions\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-introducing-artifacts.md
ac7829598464-3
If you use the AWS CLI to create a pipeline, you can store the artifacts for that pipeline in any Amazon S3 bucket as long as that bucket is in the same AWS Region as the pipeline\. You might do this if you are concerned about exceeding the limits of Amazon S3 buckets allowed for your account\. If you use the AWS CLI to create or edit a pipeline, and you add a cross\-Region action \(an action with an AWS provider in a Region different from your pipeline\), you must provide an artifact bucket for each additional Region where you plan to execute an action\. + Every action has a type\. Depending on the type, the action might have one or both of the following: + An input artifact, which is the artifact it consumes or works on over the course of the action run\. + An output artifact, which is the output of the action\. Every output artifact in the pipeline must have a unique name\. Every input artifact for an action must match the output artifact of an action earlier in the pipeline, whether that action is immediately before the action in a stage or runs in a stage several stages earlier\. An artifact can be worked on by more than one action\. The following shows how input artifacts and output artifacts are produced and consumed in a pipeline:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-introducing-artifacts.md
ac7829598464-4
An artifact can be worked on by more than one action\. The following shows how input artifacts and output artifacts are produced and consumed in a pipeline: ![\[Input artifacts and output artifacts are produced and consumed in a pipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/codepipeline-artifactsexplained.png)![\[Input artifacts and output artifacts are produced and consumed in a pipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[Input artifacts and output artifacts are produced and consumed in a pipeline.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-introducing-artifacts.md
b8ce479d531a-0
We welcome your feedback\. To contact us, visit [the CodePipeline forum](https://forums.aws.amazon.com/forum.jspa?forumID=197)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/welcome-contact-us.md
fa72b4795259-0
+ **Create a Pipeline Using the CodePipeline Console** Learn how to use the CodePipeline console to create a pipeline that uses CodeDeploy and Amazon S3\. [![AWS Videos](http://img.youtube.com/vi/glVR2zjq1j4/0.jpg)](http://www.youtube.com/watch?v=glVR2zjq1j4) *Published March 2016* *Duration: 8:53*
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/integrations-community-videos.md
eccbd753fc46-0
In this tutorial, you configure a pipeline that continuously delivers configuration files using AWS AppConfig as the deployment action provider in your deployment stage\. **Topics** + [Prerequisites](#tutorials-AppConfig-prereq) + [Step 1: Create your AWS AppConfig resources](#tutorials-AppConfig-application) + [Step 2: Upload files to your S3 source bucket](#tutorials-AppConfig-bucket) + [Step 3: Create your pipeline](#tutorials-AppConfig-pipeline) + [Step 4: Make a change to any source file and verify deployment](#tutorials-AppConfig-verify)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
be79911a226b-0
Before you begin, you must complete the following: + Create or use an Amazon S3 bucket with versioning enabled\. Follow the instructions in [Step 1: Create an S3 bucket for your application](tutorials-simple-s3.md#s3-create-s3-bucket) to create an S3 bucket\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
3816084931d3-0
In this section, you create the following resources: + An *application* in AWS AppConfig is a logical unit of code that provides capabilities for your customers\. + An *environment* in AWS AppConfig is a logical deployment group of AppConfig targets, such as applications in a beta or production environment\. + A *configuration profile* is a collection of settings that influence the behavior of your application\. The configuration profile enables AWS AppConfig to access your configuration in its stored location\. + \(Optional\) A *deployment strategy* in AWS AppConfig defines the behavior of a configuration deployment, such as what percentage of clients should receive the new deployed config at any given time during a deployment\. **To create an application, environment, configuration profile, and deployment strategy** 1. Sign in to the AWS Management Console\. 1. Use the steps in the following topics to create your resources in AWS AppConfig\. + [Create an application](https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-creating-application.html)\. + [Create an environment](https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-creating-environment.html)\. + [Create an AWS CodePipeline configuration profile](https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-creating-configuration-and-profile.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
3816084931d3-1
+ \(Optional\) [Choose a predefined deployment strategy or create your own](https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-creating-deployment-strategy.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
f03f1eaecce1-0
In this section, zip and push your source files to the bucket that the pipeline uses for your source stage\. **To create configuration files** 1. Create a `configuration.json` file for each configuration in each Region\. Include the following contents: ``` Hello World! ``` 1. In the Amazon S3 console for your bucket, choose **Upload**, and follow the instructions to upload your \.zip file\. **To zip and upload source files** 1. Create a \.zip file with your files and name the \.zip file `configuration-files.zip`\. As an example, your \.zip file can use the following structure: ``` . └── appconfig-configurations └── MyConfigurations β”œβ”€β”€ us-east-1 β”‚ └── configuration.json └── us-west-2 └── configuration.json ``` 1. In the Amazon S3 console for your bucket, choose **Upload**, and follow the instructions to upload your \.zip file\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
c33f1d7750c1-0
In this section, you create a pipeline with the following actions: + A source stage with a CodeCommit action where the source artifacts are the files for your website\. + A deployment stage with an Amazon S3 deployment action\. **To create a pipeline with the wizard** 1. Sign in to the AWS Management Console and open the CodePipeline console at [http://console\.aws\.amazon\.com/codesuite/codepipeline/home](http://console.aws.amazon.com/codesuite/codepipeline/home)\. 1. On the **Welcome** page, **Getting started** page, or **Pipelines** page, choose **Create pipeline**\. 1. In **Step 1: Choose pipeline settings**, in **Pipeline name**, enter **MyS3DeployPipeline**\. 1. In **Service role**, choose **New service role** to allow CodePipeline to create a service role in IAM\. 1. Leave the settings under **Advanced settings** at their defaults, and then choose **Next**\. 1. In **Step 2: Add source stage**, in **Source provider**, choose **Amazon S3**\. In **Bucket**, choose the name of your S3 source bucket\. In **S3 object key**, enter the name of your \.zip file: `configuration-files.zip`\. Choose **Next**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
c33f1d7750c1-1
Choose **Next**\. 1. In **Step 3: Add build stage**, choose **Skip build stage**, and then accept the warning message by choosing **Skip** again\. Choose **Next**\. 1. In **Step 4: Add deploy stage**: 1. In **Deploy provider**, choose **AWS AppConfig**\. 1. In **Application**, choose the name of the application you created in AWS AppConfig\. The field shows the ID for your application\. 1. In **Environment**, choose the name of the environment you created in AWS AppConfig\. The field shows the ID for your environment\. 1. In **Configuration profile**, choose the name of the configuration profile you created in AWS AppConfig\. The field shows the ID for your configuration profile\. 1. In **Deployment strategy**, choose the name of your deployment strategy\. This can be either a deployment strategy you created in AppConfig or one you have chosen from predefined deployment strategies in AppConfig\. The field shows the ID for your deployment strategy\. 1. In **Input artifact configuration path**, enter the file path\. Make sure that your input artifact configuration path matches the directory structure in your S3 bucket\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
c33f1d7750c1-2
1. In **Input artifact configuration path**, enter the file path\. Make sure that your input artifact configuration path matches the directory structure in your S3 bucket\. ![\[The action page for an AWS AppConfig action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/appconfig-deploy-action.png)![\[The action page for an AWS AppConfig action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The action page for an AWS AppConfig action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/) 1. Choose **Next**\. 1. In **Step 5: Review**, review the information, and then choose **Create pipeline**\. ![\[The completed pipeline for an AWS AppConfig action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/appconfig-pipeline.png)![\[The completed pipeline for an AWS AppConfig action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The completed pipeline for an AWS AppConfig action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
270f38700ea9-0
Make a change to your source files and upload the change to your bucket\. This triggers your pipeline to run\. Verify that your configuration is available by viewing the version\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-AppConfig.md
5ac22975e420-0
AWS Identity and Access Management \(IAM\) is an AWS service that helps an administrator securely control access to AWS resources\. IAM administrators control who can be *authenticated* \(signed in\) and *authorized* \(have permissions\) to use CodePipeline resources\. IAM is an AWS service that you can use with no additional charge\. **Topics** + [Audience](#security_iam_audience) + [Authenticating with identities](#security_iam_authentication) + [Managing access using policies](#security_iam_access-manage) + [How AWS CodePipeline works with IAM](security_iam_service-with-iam.md) + [AWS CodePipeline identity\-based policy examples](security_iam_id-based-policy-examples.md) + [AWS CodePipeline resource\-based policy examples](security_iam_resource-based-policy-examples.md) + [Troubleshooting AWS CodePipeline identity and access](security_iam_troubleshoot.md) + [CodePipeline permissions reference](permissions-reference.md) + [Manage the CodePipeline service role](#how-to-custom-role)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
fc8b3845b0fd-0
How you use AWS Identity and Access Management \(IAM\) differs, depending on the work you do in CodePipeline\. **Service user** – If you use the CodePipeline service to do your job, then your administrator provides you with the credentials and permissions that you need\. As you use more CodePipeline features to do your work, you might need additional permissions\. Understanding how access is managed can help you request the right permissions from your administrator\. If you cannot access a feature in CodePipeline, see [Troubleshooting AWS CodePipeline identity and access](security_iam_troubleshoot.md)\. **Service administrator** – If you're in charge of CodePipeline resources at your company, you probably have full access to CodePipeline\. It's your job to determine which CodePipeline features and resources your employees should access\. You must then submit requests to your IAM administrator to change the permissions of your service users\. Review the information on this page to understand the basic concepts of IAM\. To learn more about how your company can use IAM with CodePipeline, see [How AWS CodePipeline works with IAM](security_iam_service-with-iam.md)\. **IAM administrator** – If you're an IAM administrator, you might want to learn details about how you can write policies to manage access to CodePipeline\. To view example CodePipeline identity\-based policies that you can use in IAM, see [AWS CodePipeline identity\-based policy examples](security_iam_id-based-policy-examples.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
eae2420cff87-0
Authentication is how you sign in to AWS using your identity credentials\. For more information about signing in using the AWS Management Console, see [The IAM Console and Sign\-in Page](https://docs.aws.amazon.com/IAM/latest/UserGuide/console.html) in the *IAM User Guide*\. You must be *authenticated* \(signed in to AWS\) as the AWS account root user, an IAM user, or by assuming an IAM role\. You can also use your company's single sign\-on authentication, or even sign in using Google or Facebook\. In these cases, your administrator previously set up identity federation using IAM roles\. When you access AWS using credentials from another company, you are assuming a role indirectly\. To sign in directly to the [AWS Management Console](https://console.aws.amazon.com/), use your password with your root user email or your IAM user name\. You can access AWS programmatically using your root user or IAM user access keys\. AWS provides SDK and command line tools to cryptographically sign your request using your credentials\. If you don’t use AWS tools, you must sign the request yourself\. Do this using *Signature Version 4*, a protocol for authenticating inbound API requests\. For more information about authenticating requests, see [Signature Version 4 Signing Process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *AWS General Reference*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
eae2420cff87-1
Regardless of the authentication method that you use, you might also be required to provide additional security information\. For example, AWS recommends that you use multi\-factor authentication \(MFA\) to increase the security of your account\. To learn more, see [Using Multi\-Factor Authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
f01f241d2e2f-0
When you first create an AWS account, you begin with a single sign\-in identity that has complete access to all AWS services and resources in the account\. This identity is called the AWS account *root user* and is accessed by signing in with the email address and password that you used to create the account\. We strongly recommend that you do not use the root user for your everyday tasks, even the administrative ones\. Instead, adhere to
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
f01f241d2e2f-1
even the administrative ones\. Instead, adhere to the [best practice of using the root user only to create your first IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)\. Then securely lock away the root user credentials and use them to perform only a few account and service management tasks\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
fc8fad8105d0-0
An *[IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)* is an identity within your AWS account that has specific permissions for a single person or application\. An IAM user can have long\-term credentials such as a user name and password or a set of access keys\. To learn how to generate access keys, see [Managing Access Keys for IAM Users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) in the *IAM User Guide*\. When you generate access keys for an IAM user, make sure you view and securely save the key pair\. You cannot recover the secret access key in the future\. Instead, you must generate a new access key pair\. An [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) is an identity that specifies a collection of IAM users\. You can't sign in as a group\. You can use groups to specify permissions for multiple users at a time\. Groups make permissions easier to manage for large sets of users\. For example, you could have a group named *IAMAdmins* and give that group permissions to administer IAM resources\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
fc8fad8105d0-1
Users are different from roles\. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it\. Users have permanent long\-term credentials, but roles provide temporary credentials\. To learn more, see [When to Create an IAM User \(Instead of a Role\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
f5b29f24cec0-0
An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* is an identity within your AWS account that has specific permissions\. It is similar to an IAM user, but is not associated with a specific person\. You can temporarily assume an IAM role in the AWS Management Console by [switching roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)\. You can assume a role by calling an AWS CLI or AWS API operation or by using a custom URL\. For more information about methods for using roles, see [Using IAM Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*\. IAM roles with temporary credentials are useful in the following situations: + **Temporary IAM user permissions** – An IAM user can assume an IAM role to temporarily take on different permissions for a specific task\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
f5b29f24cec0-1
+ **Temporary IAM user permissions** – An IAM user can assume an IAM role to temporarily take on different permissions for a specific task\. + **Federated user access** – Instead of creating an IAM user, you can use existing identities from AWS Directory Service, your enterprise user directory, or a web identity provider\. These are known as *federated users*\. AWS assigns a role to a federated user when access is requested through an [identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)\. For more information about federated users, see [Federated Users and Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html#intro-access-roles) in the *IAM User Guide*\. + **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM Roles Differ from Resource\-based Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
f5b29f24cec0-2
+ **AWS service access** – A service role is an IAM role that a service assumes to perform actions in your account on your behalf\. When you set up some AWS service environments, you must define a role for the service to assume\. This service role must include all the permissions that are required for the service to access the AWS resources that it needs\. Service roles vary from service to service, but many allow you to choose your permissions as long as you meet the documented requirements for that service\. Service roles provide access only within your account and cannot be used to grant access to services in other accounts\. You can create, modify, and delete a service role from within IAM\. For example, you can create a role that allows Amazon Redshift to access an Amazon S3 bucket on your behalf and then load data from that bucket into an Amazon Redshift cluster\. For more information, see [Creating a Role to Delegate Permissions to an AWS Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
f5b29f24cec0-3
+ **Applications running on Amazon EC2** – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests\. This is preferable to storing access keys within the EC2 instance\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials\. For more information, see [Using an IAM Role to Grant Permissions to Applications Running on Amazon EC2 Instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\. To learn whether to use IAM roles, see [When to Create an IAM Role \(Instead of a User\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose_role) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
8ae3bd8c8912-0
You control access in AWS by creating policies and attaching them to IAM identities or AWS resources\. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions\. AWS evaluates these policies when an entity \(root user, IAM user, or IAM role\) makes a request\. Permissions in the policies determine whether the request is allowed or denied\. Most policies are stored in AWS as JSON documents\. For more information about the structure and contents of JSON policy documents, see [Overview of JSON Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*\. An IAM administrator can use policies to specify who has access to AWS resources, and what actions they can perform on those resources\. Every IAM entity \(user or role\) starts with no permissions\. In other words, by default, users can do nothing, not even change their own password\. To give a user permission to do something, an administrator must attach a permissions policy to a user\. Or the administrator can add the user to a group that has the intended permissions\. When an administrator gives permissions to a group, all users in that group are granted those permissions\. IAM policies define permissions for an action regardless of the method that you use to perform the operation\. For example, suppose that you have a policy that allows the `iam:GetRole` action\. A user with that policy can get role information from the AWS Management Console, the AWS CLI, or the AWS API\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
95800edaa6e5-0
Identity\-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, role, or group\. These policies control what actions that identity can perform, on which resources, and under what conditions\. To learn how to create an identity\-based policy, see [Creating IAM Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*\. Identity\-based policies can be further categorized as *inline policies* or *managed policies*\. Inline policies are embedded directly into a single user, group, or role\. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your AWS account\. Managed policies include AWS managed policies and customer managed policies\. To learn how to choose between a managed policy or an inline policy, see [Choosing Between Managed Policies and Inline Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#choosing-managed-or-inline) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
8847497f4c85-0
Resource\-based policies are JSON policy documents that you attach to a resource such as an Amazon S3 bucket\. Service administrators can use these policies to define what actions a specified principal \(account member, user, or role\) can perform on that resource and under what conditions\. Resource\-based policies are inline policies\. There are no managed resource\-based policies\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
ef318fc3c73b-0
AWS supports additional, less\-common policy types\. These policy types can set the maximum permissions granted to you by the more common policy types\. + **Permissions boundaries** – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity\-based policy can grant to an IAM entity \(IAM user or role\)\. You can set a permissions boundary for an entity\. The resulting permissions are the intersection of entity's identity\-based policies and its permissions boundaries\. Resource\-based policies that specify the user or role in the `Principal` field are not limited by the permissions boundary\. An explicit deny in any of these policies overrides the allow\. For more information about permissions boundaries, see [Permissions Boundaries for IAM Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
ef318fc3c73b-1
+ **Service control policies \(SCPs\)** – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit \(OU\) in AWS Organizations\. AWS Organizations is a service for grouping and centrally managing multiple AWS accounts that your business owns\. If you enable all features in an organization, then you can apply service control policies \(SCPs\) to any or all of your accounts\. The SCP limits permissions for entities in member accounts, including each AWS account root user\. For more information about Organizations and SCPs, see [How SCPs Work](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html) in the *AWS Organizations User Guide*\. + **Session policies** – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user\. The resulting session's permissions are the intersection of the user or role's identity\-based policies and the session policies\. Permissions can also come from a resource\-based policy\. An explicit deny in any of these policies overrides the allow\. For more information, see [Session Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
96748a2c25c0-0
The CodePipeline service role is configured with one or more policies that control access to the AWS resources used by the pipeline\. You might want to attach more policies to this role, edit the policy attached to the role, or configure policies for other service roles in AWS\. You might also want to attach a policy to a role when you configure cross\-account access to your pipeline\. **Important** Modifying a policy statement or attaching another policy to the role can prevent your pipelines from functioning\. Be sure that you understand the implications before you modify the service role for CodePipeline in any way\. Make sure you test your pipelines after you make any change to the service role\. **Note** In the console, service roles created before September 2018 are created with the name `oneClick_AWS-CodePipeline-Service_ID-Number`\. Service roles created after September 2018 use the service role name format `AWSCodePipelineServiceRole-Region-Pipeline_Name`\. For example, for a pipeline named `MyFirstPipeline` created in the console in `eu-west-2`, the service role is named `AWSCodePipelineServiceRole-eu-west-2-MyFirstPipeline`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
259b3f4c1618-0
You can edit the service role statement to remove access to resources you do not use\. For example, if none of your pipelines include Elastic Beanstalk, you can edit the policy statement to remove the section that grants access to Elastic Beanstalk resources\. Similarly, if none of your pipelines includes CodeDeploy, you can edit the policy statement to remove the section that grants access to CodeDeploy resources: ``` { "Action": [ "codedeploy:CreateDeployment", "codedeploy:GetApplicationRevision", "codedeploy:GetDeployment", "codedeploy:GetDeploymentConfig", "codedeploy:RegisterApplicationRevision" ], "Resource": "*", "Effect": "Allow" }, ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-0
You must update your service role policy statement with permissions for an AWS service not already included in the default service role policy statement before you can use it in your pipelines\. This is especially important if the service role you use for your pipelines was created before support was added to CodePipeline for an AWS service\. The following table shows when support was added for other AWS services\. **** | AWS Service | CodePipeline Support Date | | --- | --- | | CodeBuild batch builds | July 30, 2020 | | AWS AppConfig | June 22, 2020 | | AWS Step Functions | May 27, 2020 | | AWS CodeStar Connections | December 18, 2019 | | The CodeDeployToECS action | November 27, 2018 | | Amazon ECR | November 27, 2018 | | AWS Service Catalog | October 16, 2018 | | AWS Device Farm | July 19, 2018 | | Amazon ECS | December 12, 2017 | | CodeCommit | April 18, 2016 | | AWS OpsWorks | June 2, 2016 | | AWS CloudFormation | November 3, 2016 | | AWS CodeBuild | December 1, 2016 | Follow these steps to add permissions for a supported service:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-1
| AWS CodeBuild | December 1, 2016 | Follow these steps to add permissions for a supported service: 1. Sign in to the AWS Management Console and open the IAM console at [https://console\.aws\.amazon\.com/iam/](https://console.aws.amazon.com/iam/)\. 1. In the IAM console, in the navigation pane, choose **Roles**, and then choose your `AWS-CodePipeline-Service` role from the list of roles\. 1. On the **Permissions** tab, in **Inline Policies**, in the row for your service role policy, choose **Edit Policy**\. **Note** Your service role has a name in a format similar to `oneClick_AWS-CodePipeline-1111222233334`\. 1. Add the required permissions in the **Policy Document** box\. **Note** When you create IAM policies, follow the standard security advice of granting least privilegeβ€”that is, granting only the permissions required to perform a task\. Some API calls support resource\-based permissions and allow access to be limited\. For example, in this case, to limit permissions when calling `DescribeTasks` and `ListTasks`, you can replace the wildcard character \(\*\) with a resource ARN or with a resource ARN that contains a wildcard character \(\*\)\. For example, for CodeCommit support, add the following to your policy statement:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-2
For example, for CodeCommit support, add the following to your policy statement: ``` { "Action": [ "codecommit:GetBranch", "codecommit:GetCommit", "codecommit:UploadArchive", "codecommit:GetUploadArchiveStatus", "codecommit:CancelUploadArchive" ], "Resource": "*", "Effect": "Allow" }, ``` For AWS OpsWorks support, add the following to your policy statement: ``` { "Action": [ "opsworks:CreateDeployment", "opsworks:DescribeApps", "opsworks:DescribeCommands", "opsworks:DescribeDeployments", "opsworks:DescribeInstances", "opsworks:DescribeStacks", "opsworks:UpdateApp", "opsworks:UpdateStack" ], "Resource": "*", "Effect": "Allow" }, ``` For AWS CloudFormation support, add the following to your policy statement: ``` { "Action": [
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-3
For AWS CloudFormation support, add the following to your policy statement: ``` { "Action": [ "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:DescribeStacks", "cloudformation:UpdateStack", "cloudformation:CreateChangeSet", "cloudformation:DeleteChangeSet", "cloudformation:DescribeChangeSet", "cloudformation:ExecuteChangeSet", "cloudformation:SetStackPolicy", "cloudformation:ValidateTemplate", "iam:PassRole" ], "Resource": "*", "Effect": "Allow" }, ``` For CodeBuild support, add the following to your policy statement: ``` { "Action": [ "codebuild:BatchGetBuilds", "codebuild:StartBuild" ], "Resource": "*", "Effect": "Allow" }, ``` **Note** Support for batch builds was added at a later date\. See step 11 for the permissions to add to the service role for batch builds\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-4
Support for batch builds was added at a later date\. See step 11 for the permissions to add to the service role for batch builds\. For AWS Device Farm support, add the following to your policy statement: ``` { "Action": [ "devicefarm:ListProjects", "devicefarm:ListDevicePools", "devicefarm:GetRun", "devicefarm:GetUpload", "devicefarm:CreateUpload", "devicefarm:ScheduleRun" ], "Resource": "*", "Effect": "Allow" }, ``` For AWS Service Catalog support, add the following to your policy statement: ``` { "Effect": "Allow", "Action": [ "servicecatalog:ListProvisioningArtifacts", "servicecatalog:CreateProvisioningArtifact", "servicecatalog:DescribeProvisioningArtifact", "servicecatalog:DeleteProvisioningArtifact", "servicecatalog:UpdateProduct" ], "Resource": "*" }, { "Effect": "Allow", "Action": [
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-5
}, { "Effect": "Allow", "Action": [ "cloudformation:ValidateTemplate" ], "Resource": "*" } ``` 1. For Amazon ECR support, add the following to your policy statement: ``` { "Action": [ "ecr:DescribeImages" ], "Resource": "*", "Effect": "Allow" }, ``` 1. For Amazon ECS, the following are the minimum permissions needed to create pipelines with an Amazon ECS deploy action\. ``` { "Action": [ "ecs:DescribeServices", "ecs:DescribeTaskDefinition", "ecs:DescribeTasks", "ecs:ListTasks", "ecs:RegisterTaskDefinition", "ecs:UpdateService" ], "Resource": "*", "Effect": "Allow" }, ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-6
], "Resource": "*", "Effect": "Allow" }, ``` 1. For the `CodeDeployToECS` action \(blue/green deployments\), the following are the minimum permissions needed to create pipelines with a CodeDeploy to Amazon ECS blue/green deployment action\. ``` { "Action": [ "codedeploy:CreateDeployment", "codedeploy:GetDeployment", "codedeploy:GetApplication", "codedeploy:GetApplicationRevision", "codedeploy:RegisterApplicationRevision", "codedeploy:GetDeploymentConfig", "ecs:RegisterTaskDefinition", "iam:PassRole" ], "Resource": "*", "Effect": "Allow" }, ``` 1. For AWS CodeStar connections, the following permission is required to create pipelines with a source that uses a connection, such as Bitbucket\. ``` { "Action": [ "codestar-connections:UseConnection" ], "Resource": "*", "Effect": "Allow"
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-7
], "Resource": "*", "Effect": "Allow" }, ``` For more information about the IAM permissions for connections, see [Connections permissions reference](https://docs.aws.amazon.com/dtconsole/latest/userguide/security-iam.html#permissions-reference-connections)\. 1. For the `StepFunctions` action, the following are the minimum permissions needed to create pipelines with a Step Functions invoke action\. ``` { "Action": [ "states:DescribeStateMachine", "states:DescribeExecution", "states:StartExecution" ], "Resource": "*", "Effect": "Allow" }, ``` 1. For the `AppConfig` action, the following are the minimum permissions needed to create pipelines with an AWS AppConfig invoke action\. ``` { "Action": [ "appconfig:StartDeployment", "appconfig:GetDeployment", "appconfig:StopDeployment" ], "Resource": "*", "Effect": "Allow" }, ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
011d6b90e9a5-8
], "Resource": "*", "Effect": "Allow" }, ``` 1. For CodeBuild support for batch builds, add the following to your policy statement: ``` { "Action": [ "codebuild:BatchGetBuildBatches", "codebuild:StartBuildBatch" ], "Resource": "*", "Effect": "Allow" }, ``` 1. Choose **Validate Policy** to ensure the policy contains no errors\. When the policy is error\-free, choose **Apply Policy**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security-iam.md
d50ee1f282b7-0
To use AWS CloudFormation to create a rule, use the template snippet as shown here\. **To update your pipeline AWS CloudFormation template and create CloudWatch Events rule** 1. In the template, under `Resources`, use the `AWS::IAM::Role` AWS CloudFormation resource to configure the IAM role that allows your event to start your pipeline\. This entry creates a role that uses two policies: + The first policy allows the role to be assumed\. + The second policy provides permissions to start the pipeline\. **Why am I making this change?** We must create a role that can be assumed by CloudWatch Events to start an execution in our pipeline\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
5c0904b8962e-0
``` AmazonCloudWatchEventRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: Service: - events.amazonaws.com Action: sts:AssumeRole Path: / Policies: - PolicyName: cwe-pipeline-execution PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: codepipeline:StartPipelineExecution Resource: !Join [ '', [ 'arn:aws:codepipeline:', !Ref 'AWS::Region', ':', !Ref 'AWS::AccountId', ':', !Ref AppPipeline ] ] ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
e624f1c81a7e-0
``` "AmazonCloudWatchEventRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "events.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] }, "Path": "/", "Policies": [ { "PolicyName": "cwe-pipeline-execution", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "codepipeline:StartPipelineExecution", "Resource": { "Fn::Join": [ "", [ "arn:aws:codepipeline:", { "Ref": "AWS::Region" }, ":", {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
e624f1c81a7e-1
{ "Ref": "AWS::Region" }, ":", { "Ref": "AWS::AccountId" }, ":", { "Ref": "AppPipeline" } ] ... ``` ------ 1. In the template, under `Resources`, use the `AWS::Events::Rule` AWS CloudFormation resource to add a CloudWatch Events rule for the Amazon ECR source\. This event pattern creates an event that monitors push changes to your repository When CloudWatch Events detects a repository state change, the rule invokes `StartPipelineExecution` on your target pipeline\. **Why am I making this change? ** We must create an event with a rule that specifies how an image push must be made, and a target that names the pipeline to be triggered by the event\. This snippet uses an image named `cwe-test` with a tag of `latest`\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
de6e5a0314e5-0
``` AmazonCloudWatchEventRule: Type: 'AWS::Events::Rule' Properties: EventPattern: detail: action-type: [PUSH] image-tag: [latest] repository-name: [cwe-test] result: [SUCCESS] detail-type: [ECR Image Action] source: [aws.ecr] Targets: - Arn: !Join - '' - - 'arn:aws:codepipeline:' - !Ref 'AWS::Region' - ':' - !Ref 'AWS::AccountId' - ':' - !Ref AppPipeline RoleArn: !GetAtt - AmazonCloudWatchEventRole - Arn Id: codepipeline-AppPipeline ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
4940d070143b-0
``` { "AmazonCloudWatchEventRule": { "Type": "AWS::Events::Rule", "Properties": { "EventPattern": { "detail": { "action-type": ["PUSH"], "image-tag": ["latest"], "repository-name": ["cwe-test"], "result": ["SUCCESS"] }, "detail-type": ["ECR Image Action"], "source": ["aws.ecr"] }, "Targets": [ { "Arn": { "Fn::Join": [ "", [ "arn:aws:codepipeline:", { "Ref": "AWS::Region" }, ":", { "Ref": "AWS::AccountId" }, ":", { "Ref": "AppPipeline" } ] ] }, "RoleArn": { "Fn::GetAtt": [
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
4940d070143b-1
] ] }, "RoleArn": { "Fn::GetAtt": [ "AmazonCloudWatchEventRole", "Arn" ] }, "Id": "codepipeline-AppPipeline" } ] } } }, ``` ------ **Note** To view the full event pattern supported for Amazon ECR events, see [Amazon ECR Events and EventBridge](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr-eventbridge.html) or [Amazon Elastic Container Registry Events](https://docs.aws.amazon.com/eventbridge/latest/userguide/event-types.html#ecr-event-types)\. 1. Save the updated template to your local computer, and then open the AWS CloudFormation console\. 1. Choose your stack, and then choose **Create Change Set for Current Stack**\. 1. Upload the template, and then view the changes listed in AWS CloudFormation\. These are the changes to be made to the stack\. You should see your new resources in the list\. 1. Choose **Execute**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-cfn.md
0aa84510632d-0
For approval actions that use Amazon SNS notifications, JSON data about the action is created and published to Amazon SNS when the pipeline stops\. You can use the JSON output to send messages to Amazon SQS queues or invoke functions in AWS Lambda\. **Note** This guide does not address how to configure notifications using JSON\. For information, see [Sending Amazon SNS Messages to Amazon SQS Queues](https://docs.aws.amazon.com/sns/latest/dg/SendMessageToSQS.html) and [Invoking Lambda Functions Using Amazon SNS Notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon SNS Developer Guide*\. The following example shows the structure of the JSON output available with CodePipeline approvals\. ``` { "region": "us-east-2", "consoleLink": "https://console.aws.amazon.com/codepipeline/home?region=us-east-2#/view/MyFirstPipeline", "approval": { "pipelineName": "MyFirstPipeline", "stageName": "MyApprovalStage", "actionName": "MyApprovalAction", "token": "1a2b3c4d-573f-4ea7-a67E-XAMPLETOKEN",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-json-format.md
0aa84510632d-1
"token": "1a2b3c4d-573f-4ea7-a67E-XAMPLETOKEN", "expires": "2016-07-07T20:22Z", "externalEntityLink": "http://example.com", "approvalReviewLink": "https://console.aws.amazon.com/codepipeline/home?region=us-east-2#/view/MyFirstPipeline/MyApprovalStage/MyApprovalAction/approve/1a2b3c4d-573f-4ea7-a67E-XAMPLETOKEN", "customData": "Review the latest changes and approve or reject within seven days." } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-json-format.md
0e737cdb4e01-0
When a pipeline execution starts, it runs a revision through every stage and action in the pipeline\. There are two ways to start a pipeline execution in AWS CodePipeline: + **Automatically**: Using change detection methods that you specify, you can make your pipeline start when a change is made to a repository\. You can also make your pipeline start on a schedule\. The following are the automatic change detection methods: + When you use the console to create a pipeline that has a CodeCommit source repository or S3 source bucket, CodePipeline creates an Amazon CloudWatch Events rule that starts your pipeline when the source changes\. This is the recommended change detection method\. If you use the AWS CLI to create the pipeline, the change detection method defaults to starting the pipeline by periodically checking the source \(CodeCommit, Amazon S3, and GitHub source providers only\)\. We recommend that you disable periodic checks and create the rule manually\. For more information, see [ Use CloudWatch Events to start a pipeline \(CodeCommit source\)](triggering.md)\. + When you use the console to create a pipeline that has a GitHub repository, CodePipeline creates a webhook that starts your pipeline when the source changes\. This is the recommended change detection method\. If you use the AWS CLI to create the pipeline, the change detection method defaults to starting the pipeline by periodically checking the source\. We recommend that you disable periodic checks and create the webhook\. For more information, see [Use webhooks to start a pipeline \(GitHub source\)](pipelines-webhooks.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-about-starting.md
0e737cdb4e01-1
+ Most source actions in CodePipeline, such as GitHub, require either a configured change detection resource \(such as a webhook or CloudWatch Events rule\) or use the option to poll the repository for source changes\. For pipelines with a Bitbucket Cloud source action, you do not have to set up a webhook or default to polling\. The connections action manages your source change detection for you\. + **Manually**: You can use the console or the AWS CLI to start a pipeline manually\. For information, see [Start a pipeline manually in AWS CodePipeline](pipelines-rerun-manually.md)\. By default, pipelines are configured to start automatically using change detection methods\. **Note** Your pipeline runs only when something changes in the source repository and branch that you have defined\. **Topics** + [Change detection methods to start pipelines](#change-detection-methods) + [Use CloudWatch Events to start a pipeline \(CodeCommit source\)](triggering.md) + [Use CloudWatch Events to start a pipeline \(Amazon S3 source\)](create-cloudtrail-S3-source.md) + [Use webhooks to start a pipeline \(GitHub source\)](pipelines-webhooks.md) + [Use CloudWatch Events to start a pipeline \(Amazon ECR source\)](create-cwe-ecr-source.md) + [Use periodic checks to start a pipeline](run-automatically-polling.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-about-starting.md
0e737cdb4e01-2
+ [Use periodic checks to start a pipeline](run-automatically-polling.md) + [Start a pipeline manually in AWS CodePipeline](pipelines-rerun-manually.md) + [Use Amazon CloudWatch Events to start a pipeline on a schedule](pipelines-trigger-source-schedule.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-about-starting.md
56cf91762852-0
When you create or update a pipeline, you specify the method to use to react to source repository changes\. Your choice determines how your pipeline is started\. **** [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-about-starting.html) If you have a pipeline that uses polling, you can update it to use the recommended detection method\. For more information, see [Update polling pipelines to the recommended change detection method](trigger-S3-migration-cwe.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-about-starting.md
67917ef2bbc3-0
Executes an operation on an AWS CloudFormation stack\. A stack is a collection of AWS resources that you can manage as a single unit\. The resources in a stack are defined by the stack's AWS CloudFormation template\. A change set creates a comparison that can be viewed without altering the original stack\. For information about the types of AWS CloudFormation actions that can be performed on stacks and change sets, see the `ActionMode` parameter\. **Topics** + [Action type](#action-reference-CloudFormation-type) + [Configuration parameters](#action-reference-CloudFormation-config) + [Input artifacts](#action-reference-CloudFormation-input) + [Output artifacts](#action-reference-CloudFormation-output) + [Output variables](#action-reference-CloudFormation-variables) + [Action declaration](#action-reference-CloudFormation-example) + [See also](#action-reference-CloudFormation-links)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
e9108b9a26aa-0
+ Category: `Deploy` + Owner: `AWS` + Provider: `CloudFormation` + Version: `1`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-0
**ActionMode** Required: Yes `ActionMode` is the name of the action AWS CloudFormation performs on a stack or change set\. The following action modes are available: + `CHANGE_SET_EXECUTE` executes a change set for the resource stack that is based on a set of specified resource updates\. With this action, AWS CloudFormation starts to alter the stack\. + `CHANGE_SET_REPLACE` creates the change set, if it doesn't exist, based on the stack name and template that you submit\. If the change set exists, AWS CloudFormation deletes it, and then creates a new one\. + `CREATE_UPDATE` creates the stack if it doesn't exist\. If the stack exists, AWS CloudFormation updates the stack\. Use this action to update existing stacks\. Unlike `REPLACE_ON_FAILURE`, if the stack exists and is in a failed state, CodePipeline won't delete and replace the stack\. + `DELETE_ONLY` deletes a stack\. If you specify a stack that doesn't exist, the action is completed successfully without deleting a stack\. + `REPLACE_ON_FAILURE` creates a stack, if it doesn't exist\. If the stack exists and is in a failed state, AWS CloudFormation deletes the stack, and then creates a new stack\. If the stack isn't in a failed state, AWS CloudFormation updates it\. The stack is in a failed state when any of the following status types are displayed in AWS CloudFormation: + `ROLLBACK_FAILED`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-1
The stack is in a failed state when any of the following status types are displayed in AWS CloudFormation: + `ROLLBACK_FAILED` + `CREATE_FAILED` + `DELETE_FAILED` + `UPDATE_ROLLBACK_FAILED` Use this action to automatically replace failed stacks without recovering or troubleshooting them\. **Important** We recommend that you use `REPLACE_ON_FAILURE` for testing purposes only because it might delete your stack\. **StackName** Required: Yes `StackName` is the name of an existing stack or a stack that you want to create\. **Capabilities** Required: Conditional Use of `Capabilities` acknowledges that the template might have the capabilities to create and update some resources on its own, and that these capabilities are determined based on the types of resources in the template\. This property is required if you have IAM resources in your stack template or you create a stack directly from a template containing macros\. In order for the AWS CloudFormation action to successfully operate in this way, you must explicitly acknowledge that you would like it to do so with one of the following capabilities: + `CAPABILITY_IAM` + `CAPABILITY_NAMED_IAM` + `CAPABILITY_AUTO_EXPAND`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-2
+ `CAPABILITY_IAM` + `CAPABILITY_NAMED_IAM` + `CAPABILITY_AUTO_EXPAND` You can specify more than one capability by using a comma \(no space\) between capabilities\. The example in [Action declaration](#action-reference-CloudFormation-example) shows an entry with both the CAPABILITY\_IAM and CAPABILITY\_AUTO\_EXPAND properties\. For more information about `Capabilities`, see the properties under [UpdateStack](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html) in the *AWS CloudFormation API Reference*\. **ChangeSetName** Required: Conditional `ChangeSetName` is the name of an existing change set or a new change set that you want to create for the specified stack\. This property is required for the following action modes: CHANGE\_SET\_REPLACE and CHANGE\_SET\_EXECUTE\. For all other action modes, this property is ignored\. **RoleArn** Required: Conditional The `RoleArn` is the ARN of the IAM service role that AWS CloudFormation assumes when it operates on resources in the specified stack\. `RoleArn` is not applied when executing a change set\. If you do not use CodePipeline to create the change set, make sure that the change set or stack has an associated role\. This property is required for the following action modes: + CREATE\_UPDATE + REPLACE\_ON\_FAILURE
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-3
This property is required for the following action modes: + CREATE\_UPDATE + REPLACE\_ON\_FAILURE + DELETE\_ONLY + CHANGE\_SET\_REPLACE **TemplatePath** Required: Conditional `TemplatePath` represents the AWS CloudFormation template file\. You include the file in an input artifact to this action\. The file name follows this format: `Artifactname::TemplateFileName` `Artifactname` is the input artifact name as it appears in CodePipeline\. For example, a source stage with the artifact name of `SourceArtifact` and a `template-export.json` file name creates a `TemplatePath` name, as shown in this example: ``` "TemplatePath": "SourceArtifact::template-export.json" ``` This property is required for the following action modes: + CREATE\_UPDATE + REPLACE\_ON\_FAILURE + CHANGE\_SET\_REPLACE For all other action modes, this property is ignored\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-4
+ REPLACE\_ON\_FAILURE + CHANGE\_SET\_REPLACE For all other action modes, this property is ignored\. The AWS CloudFormation template file containing the template body has a minimum length of 1 byte and a maximum length of 51,200 bytes\. For AWS CloudFormation deployment actions in CodePipeline, the maximum input artifact size is always 256 MB\. For more information, see [Quotas in AWS CodePipeline](limits.md) and [AWS CloudFormation Limits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html)\. **OutputFileName** Required: No Use `OutputFileName` to specify an output file name, such as `CreateStackOutput.json`, that CodePipeline adds to the pipeline output artifact for this action\. The JSON file contains the contents of the `Outputs` section from the AWS CloudFormation stack\. If you don't specify a name, CodePipeline doesn't generate an output file or artifact\. **ParameterOverrides** Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-5
**ParameterOverrides** Required: No Parameters are defined in your stack template and allow you to provide values for them at the time of stack creation or update\. You can use a JSON object to set parameter values in your template\. \(These values override those set in the template configuration file\.\) For more information about using parameter overrides, see [Configuration Properties \(JSON Object\)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html#w4363ab1c13c13b9)\. We recommend that you use the template configuration file for most of your parameter values\. Use parameter overrides only for values that aren't known until the pipeline is running\. For more information, see [Using Parameter Override Functions with CodePipeline Pipelines](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-parameter-override-functions.html) in the *AWS CloudFormation User Guide*\. All parameter names must be present in the stack template\. **TemplateConfiguration** Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
2097ad0c40a8-6
All parameter names must be present in the stack template\. **TemplateConfiguration** Required: No `TemplateConfiguration` is the template configuration file\. You include the file in an input artifact to this action\. It can contain template parameter values and a stack policy\. For more information about the template configuration file format, see [AWS CloudFormation Artifacts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-cfn-artifacts.html)\. The template configuration file name follows this format: `Artifactname::TemplateConfigurationFileName` `Artifactname` is the input artifact name as it appears in CodePipeline\. For example, a source stage with the artifact name of `SourceArtifact` and a `test-configuration.json` file name creates a `TemplateConfiguration` name as shown in this example: ``` "TemplateConfiguration": "SourceArtifact::test-configuration.json" ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
7b2701bb3fc2-0
+ **Number of Artifacts:** `0 to 10` + **Description:** As input, the AWS CloudFormation action optionally accepts artifacts for these purposes: + To provide the stack template file to execute\. \(See the `TemplatePath` parameter\.\) + To provide the template configuration file to use\. \(See the `TemplateConfiguration` parameter\.\) For more information about the template configuration file format, see [AWS CloudFormation Artifacts](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-cfn-artifacts.html)\. + To provide the artifact for a Lambda function to be deployed as part of the AWS CloudFormation stack\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
95930b1f006f-0
+ **Number of Artifacts:** `0 to 1` + **Description:** If the `OutputFileName` parameter is specified, there is an output artifact produced by this action that contains a JSON file with the specified name\. The JSON file contains the contents of the Outputs section from the AWS CloudFormation stack\. For more information about the outputs section you can create for your AWS CloudFormation action, see [Outputs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
de6075ff1708-0
When configured, this action produces variables that can be referenced by the action configuration of a downstream action in the pipeline\. You configure an action with a namespace to make those variables available to the configuration of downstream actions\. For AWS CloudFormation actions, variables are produced from any values designated in the `Outputs` section of a stack template\. Note that the only CloudFormation action modes that generate outputs are those that result in creating or updating a stack, such as stack creation, stack updates, and change set execution\. The corresponding action modes that generate variables are: + CREATE\_UPDATE + REPLACE\_ON\_FAILURE + ALWAYS\_REPLACE + CHANGE\_SET\_EXECUTE For more information, see [Variables](reference-variables.md)\. For a tutorial that shows you how to create a pipeline with a CloudFormation deployment action in a pipeline that uses CloudFormation output variables, see [Tutorial: Create a pipeline that uses variables from AWS CloudFormation deployment actions](tutorials-cloudformation-action.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
f3152f9e263b-0
------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
54d00916429c-0
``` Name: ExecuteChangeSet ActionTypeId: Category: Deploy Owner: AWS Provider: CloudFormation Version: '1' RunOrder: 2 Configuration: ActionMode: CHANGE_SET_EXECUTE Capabilities: CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND ChangeSetName: pipeline-changeset ParameterOverrides: '{"ProjectId": "my-project","CodeDeployRole": "CodeDeploy_Role_ARN"}' RoleArn: CloudFormation_Role_ARN StackName: my-project--lambda TemplateConfiguration: 'my-project--BuildArtifact::template-configuration.json' TemplatePath: 'my-project--BuildArtifact::template-export.yml' OutputArtifacts: [] InputArtifacts: - Name: my-project-BuildArtifact ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
adf40cea27a3-0
``` { "Name": "ExecuteChangeSet", "ActionTypeId": { "Category": "Deploy", "Owner": "AWS", "Provider": "CloudFormation", "Version": "1" }, "RunOrder": 2, "Configuration": { "ActionMode": "CHANGE_SET_EXECUTE", "Capabilities": "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND", "ChangeSetName": "pipeline-changeset", "ParameterOverrides": "{\"ProjectId\": \"my-project\",\"CodeDeployRole\": \"CodeDeploy_Role_ARN\"}", "RoleArn": "CloudFormation_Role_ARN", "StackName": "my-project--lambda", "TemplateConfiguration": "my-project--BuildArtifact::template-configuration.json", "TemplatePath": "my-project--BuildArtifact::template-export.yml" }, "OutputArtifacts": [], "InputArtifacts": [ { "Name": "my-project-BuildArtifact" } ] },
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
adf40cea27a3-1
{ "Name": "my-project-BuildArtifact" } ] }, ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
b42b8b47a07e-0
The following related resources can help you as you work with this action\. + [Configuration Properties Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html) – This reference chapter in the *AWS CloudFormation User Guide* provides more descriptions and examples for these CodePipeline parameters\. + [AWS CloudFormation API Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/) – The [CreateStack](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html) parameter in the *AWS CloudFormation API Reference* describes stack parameters for AWS CloudFormation templates\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CloudFormation.md
209ba33415bc-0
By default, a pipeline starts automatically when it is created and any time a change is made in a source repository\. However, you might want to rerun the most recent revision through the pipeline a second time\. You can use the CodePipeline console or the AWS CLI and start\-pipeline\-execution command to manually rerun the most recent revision through your pipeline\. **Topics** + [Start a pipeline manually \(console\)](#pipelines-rerun-manually-console) + [Start a pipeline manually \(CLI\)](#pipelines-rerun-manually-cli)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-rerun-manually.md
9e50187137b2-0
**To manually start a pipeline and run the most recent revision through a pipeline** 1. Sign in to the AWS Management Console and open the CodePipeline console at [http://console\.aws\.amazon\.com/codesuite/codepipeline/home](http://console.aws.amazon.com/codesuite/codepipeline/home)\. 1. In **Name**, choose the name of the pipeline you want to start\. 1. On the pipeline details page, choose **Release change**\. This starts the most recent revision available in each source location specified in a source action through the pipeline\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-rerun-manually.md
f776d097a137-0
**To manually start a pipeline and run the most recent version of an artifact through a pipeline** 1. Open a terminal \(Linux, macOS, or Unix\) or command prompt \(Windows\) and use the AWS CLI to run the start\-pipeline\-execution command, specifying the name of the pipeline you want to start\. For example, to start running the last change through a pipeline named *MyFirstPipeline*: ``` aws codepipeline start-pipeline-execution --name MyFirstPipeline ``` 1. To verify success, view the returned object\. This command returns an execution ID, similar to the following: ``` { "pipelineExecutionId": "c53dbd42-This-Is-An-Example" } ``` **Note** After you have started the pipeline, you can monitor its progress in the CodePipeline console or by running the get\-pipeline\-state command\. For more information, see [View pipeline details and history \(console\)](pipelines-view-console.md) and [View pipeline details and history \(CLI\)](pipelines-view-cli.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-rerun-manually.md
88cff7696693-0
AWS Service Catalog enables you to create and provision products based on AWS CloudFormation templates\. This tutorial shows you how to create and configure a pipeline to deploy your product template to AWS Service Catalog and deliver changes you have made in your source repository \(already created in GitHub, CodeCommit, or Amazon S3\)\. **Note** When Amazon S3 is the source provider for your pipeline, you must upload to your bucket all source files packaged as a single \.zip file\. Otherwise, the source action fails\. First, you create a product in AWS Service Catalog, and then you create a pipeline in AWS CodePipeline\. This tutorial provides two options for setting up the deployment configuration: + Create a product in AWS Service Catalog and upload a template file to your source repository\. Provide product version and deployment configuration in the CodePipeline console \(without a separate configuration file\)\. See [Option 1: Deploy to AWS Service Catalog without a configuration file](#tutorials-S3-servicecatalog-ex1-configure)\. **Note** The template file can be created in YAML or JSON format\. + Create a product in AWS Service Catalog and upload a template file to your source repository\. Provide product version and deployment configuration in a separate configuration file\. See [Option 2: Deploy to AWS Service Catalog using a configuration file](#tutorials-S3-servicecatalog-ex2-configure)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md
10ab649db370-0
In this example, you upload the sample AWS CloudFormation template file for an S3 bucket, and then create your product in AWS Service Catalog\. Next, you create your pipeline and specify deployment configuration in the CodePipeline console\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md