id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
71b51942c6ed-2
] } ] } ``` 1. Use the following command to attach the new `CodePipeline-Permissions-Policy-for-CWE` permissions policy to the `Role-for-MyRule` role you created\. ``` aws iam put-role-policy --role-name Role-for-MyRule --policy-name CodePipeline-Permissions-Policy-For-CWE --policy-document file://permissionspolicyforCWE.json ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-trigger-source-schedule.md
d1a6af7adb37-0
An AWS CodePipeline action that does the following: + Starts an AWS Step Functions state machine execution from your pipeline\. + Provides an initial state to the state machine through either a property in the action configuration or a file located in a pipeline artifact to be passed as input\. + Optionally sets an execution ID prefix for identifying executions originating from the action\. + Supports [Standard and Express](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html) state machines\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
36e22c9dde4c-0
+ Category: `Invoke` + Owner: `AWS` + Provider: `StepFunctions` + Version: `1`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
dae08f0177d7-0
**StateMachineArn** Required: Yes The Amazon Resource Name \(ARN\) for the state machine to be invoked\. **ExecutionNamePrefix** Required: No By default, the action execution ID is used as the state machine execution name\. If a prefix is provided, it is prepended to the action execution ID with a hyphen and together used as the state machine execution name\. ``` myPrefix-1624a1d1-3699-43f0-8e1e-6bafd7fde791 ``` For an express state machine, the name should only contain 0\-9, A\-Z, a\-z, \- and \_\. **InputType** Required: No + **Literal** \(default\): When specified, the value in the **Input** field is passed directly to the state machine input\. Example entry for the **Input** field when **Literal** is selected: ``` {"action": "test"} ``` + **FilePath**: The contents of a file in the input artifact specified by the **Input** field is used as the input for the state machine execution\. An input artifact is required when **InputType** is set to **FilePath**\. Example entry for the **Input** field when **FilePath** is selected:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
dae08f0177d7-1
Example entry for the **Input** field when **FilePath** is selected: ``` assets/input.json ``` **Input** Required: Conditional + **Literal**: When **InputType** is set to **Literal** \(default\), this field is optional\. If provided, the **Input** field is used directly as the input for the state machine execution\. Otherwise, the state machine is invoked with an empty JSON object `{}`\. + **FilePath**: When **InputType** is set to **FilePath**, this field is required\. An input artifact is also required when **InputType** is set to **FilePath**\. The contents of the file in the input artifact specified are used as the input for the state machine execution\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
14cdc39e8280-0
+ **Number of Artifacts:** `0 to 1` + **Description:** If **InputType** is set to **FilePath**, this artifact is required and is used to source the input for the state machine execution\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
ef8e18a0bd5f-0
+ **Number of Artifacts:** `0 to 1` + **Description:** + **Standard State Machines**: If provided, the output artifact is populated with the output of the state machine\. This is obtained from the `output` property of the [Step Functions DescribeExecution API](https://docs.aws.amazon.com/step-functions/latest/apireference/API_DescribeExecution.html) response after the state machine execution completes successfully\. + **Express State Machines**: Not supported\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
8fbb53b83bb7-0
This action produces output variables that can be referenced by the action configuration of a downstream action in the pipeline\. For more information, see [Variables](reference-variables.md)\. **StateMachineArn** The ARN of the state machine\. **ExecutionArn** The ARN of the execution of the state machine\. Standard state machines only\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
663bfa334e53-0
------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
7fd331b54bcd-0
``` Name: ActionName ActionTypeId: Category: Invoke Owner: AWS Version: 1 Provider: StepFunctions OutputArtifacts: - Name: myOutputArtifact Configuration: StateMachineArn: arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine ExecutionNamePrefix: my-prefix ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
0e29905b2ba5-0
``` { "Name": "ActionName", "ActionTypeId": { "Category": "Invoke", "Owner": "AWS", "Version": 1, "Provider": "StepFunctions" }, "OutputArtifacts": [ { "Name": "myOutputArtifact" } ], "Configuration": { "StateMachineArn": "arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine", "ExecutionNamePrefix": "my-prefix" } } ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
44dc5c9e0215-0
------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
d37882f6f61c-0
``` Name: ActionName ActionTypeId: Category: Invoke Owner: AWS Version: 1 Provider: StepFunctions OutputArtifacts: - Name: myOutputArtifact Configuration: StateMachineArn: arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine ExecutionNamePrefix: my-prefix Input: '{"action": "test"}' ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
121e06082eb0-0
``` { "Name": "ActionName", "ActionTypeId": { "Category": "Invoke", "Owner": "AWS", "Version": 1, "Provider": "StepFunctions" }, "OutputArtifacts": [ { "Name": "myOutputArtifact" } ], "Configuration": { "StateMachineArn": "arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine", "ExecutionNamePrefix": "my-prefix", "Input": "{\"action\": \"test\"}" } } ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
fd12b495196a-0
------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
5690f5b59da6-0
``` Name: ActionName InputArtifacts: - Name: myInputArtifact ActionTypeId: Category: Invoke Owner: AWS Version: 1 Provider: StepFunctions OutputArtifacts: - Name: myOutputArtifact Configuration: StateMachineArn: 'arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine' ExecutionNamePrefix: my-prefix InputType: FilePath Input: assets/input.json ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
fe4566b8f3f4-0
``` { "Name": "ActionName", "InputArtifacts": [ { "Name": "myInputArtifact" } ], "ActionTypeId": { "Category": "Invoke", "Owner": "AWS", "Version": 1, "Provider": "StepFunctions" }, "OutputArtifacts": [ { "Name": "myOutputArtifact" } ], "Configuration": { "StateMachineArn": "arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine", "ExecutionNamePrefix": "my-prefix", "InputType": "FilePath", "Input": "assets/input.json" } } ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
058ed8bd1ed6-0
During a release, CodePipeline executes the configured state machine using the input as specified in the action configuration\. When **InputType** is set to **Literal**, the content of the **Input** action configuration field is used as the input for the state machine\. When literal input is not provided, the state machine execution uses an empty JSON object `{}`\. For more information about running a state machine execution without input, see the [Step Functions StartExecution API](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html)\. When **InputType** is set to **FilePath**, the action unzips the input artifact and uses the content of the file specified in the **Input** action configuration field as the input for the state machine\. When **FilePath** is specified, the **Input** field is required and an input artifact must exist; otherwise, the action fails\. After a successful start execution, behavior will diverge for the two state machine types, *standard* and *express*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
c8a9ce2295d7-0
If the standard state machine execution was successfully started, CodePipeline polls the `DescribeExecution` API until the execution reaches a terminal status\. If the execution completes successfully, the action succeeds; otherwise, it fails\. If an output artifact is configured, the artifact will contain the return value of the state machine\. This is obtained from the `output` property of the [Step Functions DescribeExecution API](https://docs.aws.amazon.com/step-functions/latest/apireference/API_DescribeExecution.html) response after the state machine execution completes successfully\. Note that there are output length constraints enforced on this API\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
9c17fe9a7663-0
+ If the action fails to start a state machine execution, the action execution fails\. + If the state machine execution fails to reach a terminal status before the CodePipeline Step Functions action reaches its timeout \(default of 7 days\), the action execution fails\. The state machine might continue despite this failure\. For more information about state machine execution timeouts in Step Functions, see [Standard vs\. Express Workflows](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html)\. **Note** You can request a quota increase for the invoke action timeout for the account with the action\. However, the quota increase applies to all actions of this type in all Regions for that account\. + If the state machine execution reaches a terminal status of FAILED, TIMED\_OUT, or ABORTED, the action execution fails\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
fdeee4167ccd-0
If the express state machine execution was successfully started, the invoke action execution completes successfully\. Considerations for actions configured for express state machines: + You cannot designate an output artifact\. + The action does not wait for the state machine execution to complete\. + After the action execution is started in CodePipeline, the action execution succeeds even if the state machine execution fails\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
d71f69dde75e-0
+ If CodePipeline fails to start a state machine execution, the action execution fails\. Otherwise, the action succeeds immediately\. The action succeeds in CodePipeline regardless of how long the state machine execution takes to complete or its outcome\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
e34f788ed533-0
The following related resources can help you as you work with this action\. + [AWS Step Functions Developer Guide](https://docs.aws.amazon.com/step-functions/latest/dg/) – For information about state machines, executions, and inputs for state machines, see the *AWS Step Functions Developer Guide*\. + [Tutorial: Use an AWS Step Functions invoke action in a pipeline](tutorials-step-functions.md) – This tutorial gets you started with a sample standard state machine and shows you how to use the console to update a pipeline by adding a Step Functions invoke action\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-StepFunctions.md
b3829583ae2b-0
CodePipeline is a *continuous delivery* service that automates the building, testing, and deployment of your software into production\. [Continuous delivery](https://aws.amazon.com/devops/continuous-delivery/) is a software development methodology where the release process is automated\. Every software change is automatically built, tested, and deployed to production\. Before the final push to production, a person, an automated test, or a business rule decides when the final push should occur\. Although every successful software change can be immediately released to production with continuous delivery, not all changes need to be released right away\. [Continuous integration](https://aws.amazon.com/devops/continuous-integration/) is a software development practice where members of a team use a version control system and frequently integrate their work to the same location, such as a master branch\. Each change is built and verified to detect integration errors as quickly as possible\. Continuous integration is focused on automatically building and testing code, as compared to *continuous delivery*, which automates the entire software release process up to production\. For more information, see [Practicing Continuous Integration and Continuous Delivery on AWS: Accelerating Software Delivery with DevOps](https://d0.awsstatic.com/whitepapers/DevOps/practicing-continuous-integration-continuous-delivery-on-AWS.pdf)\. You can use the CodePipeline console, the AWS Command Line Interface \(AWS CLI\), the AWS SDKs, or any combination of these to create and manage your pipelines\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/concepts-continuous-delivery-integration.md
fc07b2d751cf-0
Monitoring is an important part of maintaining the reliability, availability, and performance of AWS CodePipeline\. You should collect monitoring data from all parts of your AWS solution so that you can more easily debug a multi\-point failure, if one occurs\. Before you start monitoring, you should create a monitoring plan that answers the following questions: + What are your monitoring goals? + Which resources will you monitor? + How often will you monitor these resources? + Which monitoring tools are available for you to use? + Who will perform the monitoring tasks? + Who should be notified if something goes wrong? You can use the following tools to monitor your CodePipeline pipelines and their resources: + **Amazon CloudWatch Events** — Use Amazon CloudWatch Events to detect and react to pipeline execution state changes \(for example, send an Amazon SNS notification or invoke a Lambda function\)\. + **AWS CloudTrail** — Use CloudTrail to capture API calls made by or on behalf of CodePipeline in your AWS account and deliver the log files to an Amazon S3 bucket\. You can choose to have CloudWatch publish Amazon SNS notifications when new log files are delivered so you can take quick action\. + **Console and CLI** — You can use the CodePipeline console and CLI to view details about the status of a pipeline or a particular pipeline execution\. **Topics** + [Detect and react to changes in pipeline state with CloudWatch Events](detect-state-changes-cloudwatch-events.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/monitoring.md
fc07b2d751cf-1
**Topics** + [Detect and react to changes in pipeline state with CloudWatch Events](detect-state-changes-cloudwatch-events.md) + [Events placeholder bucket reference](reference-ct-placeholder-buckets.md) + [Logging API calls with AWS CloudTrail](monitoring-cloudtrail-logs.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/monitoring.md
72e6c4f9f990-0
Before IAM users in your organization can approve or reject approval actions, they must be granted permissions to access pipelines and to update the status of approval actions\. You can grant permission to access all pipelines and approval actions in your account by attaching the `AWSCodePipelineApproverAccess` managed policy to an IAM user, role, or group; or you can to grant limited permissions by specifying the individual resources that can be accessed by an IAM user, role, or group\. **Note** The permissions described in this topic grant very limited access\. To enable a user, role, or group to do more than approve or reject approval actions, you can attach other managed policies\. For information about the managed policies available for CodePipeline, see [AWS managed \(predefined\) policies for CodePipeline](managed-policies.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-iam-permissions.md
d9ccb41bb5c1-0
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 navigation pane, choose **Groups**, **Roles**, or **Users**\. 1. Choose the group, role or IAM user to grant permissions to\. 1. Choose the **Permissions** tab\. 1. Choose **Add permissions**, and then choose **Attach existing policies directly **\. 1. Select the check box next to `AWSCodePipelineApproverAccess` managed policy, and then choose **Next: Review**\. 1. Choose **Add permissions**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-iam-permissions.md
c56479bafcce-0
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/)\. **Important** Make sure you are signed in to the AWS Management Console with the same account information you used in [Getting started with CodePipeline](getting-started-codepipeline.md)\. 1. In the navigation pane, choose **Groups** or **Users**, as appropriate\. 1. Browse to and choose the user or group you want to change\. 1. Do one of the following: + If you chose **Groups**, choose the **Permissions** tab, and expand **Inline Policies**\. If no inline policies have been created yet, choose **click here**\. Choose **Custom Policy**, and then choose **Select**\. In **Policy Name**, enter a name for this policy\. Continue to the next step to paste the policy in the **Policy Document** box\. + If you chose **Users**, choose the **Permissions** tab, and choose **Add inline policy**\. Choose the **JSON** tab\. Continue to the next step to paste the policy\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-iam-permissions.md
c56479bafcce-1
1. Paste the policy into the policy box\. Specify the individual resources an IAM user can access\. For example, the following policy grants users the authority to approve or reject only the action named `MyApprovalAction` in the `MyFirstPipeline` pipeline in the US East \(Ohio\) Region \(us\-east\-2\): ``` { "Version": "2012-10-17", "Statement": [ { "Action": [ "codepipeline:ListPipelines" ], "Resource": [ "*" ], "Effect": "Allow" }, { "Action": [ "codepipeline:GetPipeline", "codepipeline:GetPipelineState", "codepipeline:GetPipelineExecution" ], "Effect": "Allow", "Resource": "arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline" }, { "Action": [ "codepipeline:PutApprovalResult" ], "Effect": "Allow",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-iam-permissions.md
c56479bafcce-2
"codepipeline:PutApprovalResult" ], "Effect": "Allow", "Resource": "arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline/MyApprovalStage/MyApprovalAction" } ] } ``` **Note** The `codepipeline:ListPipelines` permission is required only if IAM users need to access the CodePipeline dashboard to view this list of pipelines\. If console access is not required, you can omit `codepipeline:ListPipelines`\. 1. Do one of the following: + If you chose **Groups**, choose **Validate Policy**\. Correct any errors displayed in a red box at the top of the page\. Choose **Apply Policy**\. + If you chose **Users**, choose **Review policy**\. In **Name**, enter a name for this policy\. Choose **Create policy**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/approvals-iam-permissions.md
ee1e79d992cc-0
Allows you to run builds and tests as part of your pipeline\. When you run a CodeBuild build or test action, commands specified in the build spec are run inside of a CodeBuild container\. All artifacts that are specified as input artifacts to a CodeBuild action are available inside of the container running the commands\. CodeBuild can provide either a build or test action\. For more information, see the [AWS CodeBuild User Guide](https://docs.aws.amazon.com/codebuild/latest/userguide/)\. When you use the CodePipeline wizard in the console to create a build project, the CodeBuild build project shows the source provider is CodePipeline\. When you create a build project in the CodeBuild console, you cannot specify CodePipeline as the source provider, but adding the build action to your pipeline adjusts the source in the CodeBuild console\. For more information, see [ProjectSource](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSource.html) in the *AWS CodeBuild API Reference*\. **Topics** + [Action type](#action-reference-CodeBuild-type) + [Configuration parameters](#action-reference-CodeBuild-config) + [Input artifacts](#action-reference-CodeBuild-input) + [Output artifacts](#action-reference-CodeBuild-output) + [Output variables](#action-reference-CodeBuild-variables)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
ee1e79d992cc-1
+ [Output variables](#action-reference-CodeBuild-variables) + [Action declaration \(CodeBuild example\)](#action-reference-CodeBuild-example) + [See also](#action-reference-CodeBuild-links)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
5ed818927ce3-0
+ Category: `Build` or `Test` + Owner: `AWS` + Provider: `CodeBuild` + Version: `1`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
a96fc92e158e-0
**ProjectName** Required: Yes `ProjectName` is the name of the build project in CodeBuild\. **PrimarySource** Required: Conditional The value of the `PrimarySource` parameter must be the name of one of the input artifacts to the action\. CodeBuild looks for the build spec file and runs the build spec commands in the directory that contains the unzipped version of this artifact\. This parameter is required if multiple input artifacts are specified for a CodeBuild action\. When there is only one source artifact for the action, the `PrimarySource` artifact defaults to that artifact\. **BatchEnabled** Required: No The Boolean value of the `BatchEnabled` parameter allows the action to run multiple builds in the same build execution\. When this option is enabled, the `CombineArtifacts` option is available\. For pipeline examples with batch builds enabled, see[CodePipeline integration with CodeBuild and batch builds](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-pipeline-batch.html)\. **CombineArtifacts** Required: No The Boolean value of the `CombineArtifacts` parameter combines all build artifacts from a batch build into a single artifact file for the build action\. To use this option, the `BatchEnabled` parameter must be enabled\. **EnvironmentVariables** Required: No
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
a96fc92e158e-1
To use this option, the `BatchEnabled` parameter must be enabled\. **EnvironmentVariables** Required: No The value of this parameter is used to set environment variables for the CodeBuild action in your pipeline\. The value for the `EnvironmentVariables` parameter takes the form of a JSON array of environment variable objects\. See the example parameter in [Action declaration \(CodeBuild example\)](#action-reference-CodeBuild-example)\. Each object has three parts, all of which are strings: + `name`: The name or key of the environment variable\. + `value`: The value of the environment variable\. When using the `PARAMETER_STORE` or `SECRETS_MANAGER` type, this value must be the name of a parameter you have already stored in AWS Systems Manager Parameter Store or a secret you have already stored in AWS Secrets Manager, respectively\. **Note** We strongly discourage the use of environment variables to store sensitive values, especially AWS secret key IDs and secret access keys\. When you use the CodeBuild console or AWS CLI, environment variables are displayed in plain text\. For sensitive values, we recommend that you use the `SECRETS_MANAGER` type instead\. + `type`: \(Optional\) The type of environment variable\. Valid values are `PARAMETER_STORE`, `SECRETS_MANAGER`, or `PLAINTEXT`\. When not specified, this defaults to `PLAINTEXT`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
a96fc92e158e-2
When you enter the `name`, `value`, and `type` for your environment variables configuration, especially if the environment variable contains CodePipeline output variable syntax, do not exceed the 1000\-character limit for the configuration’s value field\. A validation error is returned when this limit is exceeded\. For more information, see [ EnvironmentVariable](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
584a7a1119c1-0
+ **Number of Artifacts:** `1 to 5` + **Description:** CodeBuild looks for the build spec file and runs the build spec commands from the directory of the primary source artifact\. When more than one input source is specified for the CodeBuild action, this artifact must be set using the `PrimarySource` action configuration parameter in CodePipeline\. Each input artifact is extracted to its own directory, the locations of which are stored in environment variables\. The directory for the primary source artifact is made available with `$CODEBUILD_SRC_DIR`\. The directories for all other input artifacts are made available with `$CODEBUILD_SRC_DIR_yourInputArtifactName`\. **Note** The artifact configured in your CodeBuild project becomes the input artifact used by the CodeBuild action in your pipeline\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
d49264eed5d5-0
+ **Number of Artifacts:** `0 to 5` + **Description:** These can be used to make the artifacts that are defined in the CodeBuild build spec file available to subsequent actions in the pipeline\. When only one output artifact is defined, this artifact can be defined directly under the `artifacts` section of the build spec file\. When more than one output artifact is specified, all artifacts referenced must be defined as secondary artifacts in the build spec file\. The names of the output artifacts in CodePipeline must match the artifact identifiers in the build spec file\. **Note** The artifact configured in your CodeBuild project becomes the CodePipeline input artifact in your pipeline action\. If the `CombineArtifacts` parameter is selected for batch builds, the output artifact location contains the combined artifacts from multiple builds that were run in the same execution\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
7f191729172b-0
This action will produce as variables all environment variables that were exported as part of the build\. See [https://docs\.aws\.amazon\.com/codebuild/latest/userguide/build\-spec\-ref\.html\#exported\-variables\-build\-spec](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#exported-variables-build-spec) for more details on how to export environment variables\. For more information about variables in CodePipeline, see [Variables](reference-variables.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
be3891cdfd5b-0
------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
e960f9bd82b4-0
``` Name: Build Actions: - Name: PackageExport ActionTypeId: Category: Build Owner: AWS Provider: CodeBuild Version: '1' RunOrder: 1 Configuration: BatchEnabled: 'true' CombineArtifacts: 'true' ProjectName: my-build-project PrimarySource: MyApplicationSource1 EnvironmentVariables: '[{"name":"TEST_VARIABLE","value":"TEST_VALUE","type":"PLAINTEXT"},{"name":"ParamStoreTest","value":"PARAMETER_NAME","type":"PARAMETER_STORE"}]' OutputArtifacts: - Name: MyPipeline-BuildArtifact InputArtifacts: - Name: MyApplicationSource1 - Name: MyApplicationSource2 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
cf94251f7db6-0
``` { "Name": "Build", "Actions": [ { "Name": "PackageExport", "ActionTypeId": { "Category": "Build", "Owner": "AWS", "Provider": "CodeBuild", "Version": "1" }, "RunOrder": 1, "Configuration": { "BatchEnabled": "true", "CombineArtifacts": "true", "ProjectName": "my-build-project", "PrimarySource": "MyApplicationSource1", "EnvironmentVariables": "[{\"name\":\"TEST_VARIABLE\",\"value\":\"TEST_VALUE\",\"type\":\"PLAINTEXT\"},{\"name\":\"ParamStoreTest\",\"value\":\"PARAMETER_NAME\",\"type\":\"PARAMETER_STORE\"}]" }, "OutputArtifacts": [ { "Name": "MyPipeline-BuildArtifact" } ], "InputArtifacts": [ { "Name": "MyApplicationSource1"
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
cf94251f7db6-1
], "InputArtifacts": [ { "Name": "MyApplicationSource1" }, { "Name": "MyApplicationSource2" } ] } ] } ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
c02371394e28-0
The following related resources can help you as you work with this action\. + [AWS CodeBuild User Guide](https://docs.aws.amazon.com/codebuild/latest/userguide/) – For an example pipeline with a CodeBuild action, see [Use CodePipeline with CodeBuild to Test Code and Run Builds](https://docs.aws.amazon.com/codebuild/latest/userguide/how-to-create-pipeline.html)\. For examples of projects with multiple input and output CodeBuild artifacts, see [CodePipeline Integration with CodeBuild and Multiple Input Sources and Output Artifacts Sample ](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-pipeline-multi-input-output.html) and [Multiple Input Sources and Output Artifacts Sample](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html) \. + [Tutorial: Create a pipeline that builds and tests your Android app when a commit is pushed to your GitHub repository](tutorials-codebuild-devicefarm.md) – This tutorial provides a sample build spec file and sample application to create a pipeline with a GitHub source that builds and tests an Android app with CodeBuild and AWS Device Farm\. + [Build Specification Reference for CodeBuild ](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) – This reference topic provides definitions and examples for understanding CodeBuild build spec files\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-CodeBuild.md
79cf65a9955d-0
**To create a CloudWatch Events rule for use in CodePipeline operations \(Amazon ECR source\)** 1. Open the CloudWatch console at [https://console\.aws\.amazon\.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/)\. 1. In the navigation pane, choose **Events**\. 1. Choose **Create rule**, and then under **Event source**, from **Service Name**, choose **EC2 Container Registry**\. 1. In **Event Source**, choose **Event Pattern**\. Choose **Edit**, and then paste the following example event pattern in the **Event Source** window for a `cwe-test` repository with an image tag of `cli-testing`: ``` { "detail-type": [ "ECR Image Action" ], "source": [ "aws.ecr" ], "detail": { "action-type": [ "PUSH" ], "image-tag": [ "latest" ], "repository-name": [ "cwe-test" ], "result": [ "SUCCESS" ] } }
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-console.md
79cf65a9955d-1
], "result": [ "SUCCESS" ] } } ``` **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. Choose **Save**\. In the **Event Pattern Preview** pane, view the rule\. 1. In **Targets**, choose **CodePipeline**\. 1. Enter the pipeline ARN for the pipeline to be started when triggered by this rule\. **Note** You can find the pipeline ARN in the metadata output after you run the get\-pipeline command\. The pipeline ARN is constructed in this format: arn:aws:codepipeline:*region*:*account*:*pipeline\-name* Sample pipeline ARN: `arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-console.md
79cf65a9955d-2
`arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline` 1. Create or specify an IAM service role that grants Amazon CloudWatch Events permissions to invoke the target associated with your Amazon CloudWatch Events rule \(in this case, the target is CodePipeline\)\. + Choose **Create a new role for this specific resource** to create a service role that gives Amazon CloudWatch Events permissions to your start your pipeline executions when triggered\. + Choose **Use existing role** to enter a service role that gives Amazon CloudWatch Events permissions to your start your pipeline executions when triggered\. 1. Review your rule setup to make sure it meets your requirements\. 1. Choose **Configure details**\. 1. On the **Configure rule details** page, enter a name and description for the rule, and then choose **State** to enable the rule\. 1. If you're satisfied with the rule, choose **Create rule**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cwe-ecr-source-console.md
b64f0231d918-0
You can use AWS Step Functions to create and configure state machines\. This tutorial shows you how to add an invoke action to a pipeline that activates state machine executions from your pipeline\. In this tutorial, you do the following tasks: + Create a standard state machine in AWS Step Functions\. + Enter the state machine input JSON directly\. You can also upload the state machine input file to an Amazon Simple Storage Service \(Amazon S3\) bucket\. + Update your pipeline by adding the state machine action\. **Topics** + [Prerequisite: Create or choose a simple pipeline](#tutorials-step-functions-prereq) + [Step 1: Create the sample state machine](#tutorials-step-functions-sample) + [Step 2: Add a Step Functions invoke action to your pipeline](#tutorials-step-functions-pipeline)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
05c25c6fed08-0
In this tutorial, you add an invoke action to an existing pipeline\. You can use the pipeline you created in [Tutorial: Create a simple pipeline \(S3 bucket\)](tutorials-simple-s3.md) or [Tutorial: Create a simple pipeline \(CodeCommit repository\)](tutorials-simple-codecommit.md)\. You use an existing pipeline with a source action and at least a two\-stage structure, but you do not use source artifacts for this example\. **Note** You might need to update the service role used by your pipeline with additional permissions required to run this action\. To do this, open the AWS Identity and Access Management \(IAM\) console, find the role, and then add the 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)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
02bb12b07e9b-0
In the Step Functions console, create a state machine using the `HelloWorld` sample template\. For instructions, see [Create a State Machine](https://docs.aws.amazon.com/step-functions/latest/dg/getting-started.html#create-state-machine) in the *AWS Step Functions Developer Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
57182f06cafc-0
Add a Step Functions invoke action to your pipeline as follows: 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)\. The names of all pipelines associated with your AWS account are displayed\. 1. In **Name**, choose the name of the pipeline you want to edit\. This opens a detailed view of the pipeline, including the state of each of the actions in each stage of the pipeline\. 1. On the pipeline details page, choose **Edit**\. 1. On the second stage of your simple pipeline, choose **Edit stage**\. Choose **Delete**\. This deletes the second stage now that you no longer need it\. 1. At the bottom of the diagram, choose **\+ Add stage**\. 1. In **Stage name**, enter a name for the stage, such as **Invoke**, and then choose **Add stage**\. 1. Choose **\+ Add action group**\. 1. In **Action name**, enter a name, such as **Invoke**\. 1. In **Action provider**, choose **AWS Step Functions**\. Allow **Region** to default to the pipeline Region\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
57182f06cafc-1
1. In **Action provider**, choose **AWS Step Functions**\. Allow **Region** to default to the pipeline Region\. 1. In **Input artifacts**, choose `SourceArtifact`\. 1. In **State machine ARN**, choose the Amazon Resource Name \(ARN\) for the state machine that you created earlier\. 1. \(Optional\) In **Execution name prefix**, enter a prefix to be added to the state machine execution ID\. 1. In **Input type**, choose **Literal**\. 1. In **Input**, enter the input JSON that the `HelloWorld` sample state machine expects\. **Note** The input to the state machine execution is different from the term used in CodePipeline to describe input artifacts for actions\. For this example, enter the following JSON: ``` {"IsHelloWorldExample": true} ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
57182f06cafc-2
``` {"IsHelloWorldExample": true} ``` ![\[Console screenshot showing details of adding Step Functions invoke action.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/stepfunctions-edit-action.png)![\[Console screenshot showing details of adding Step Functions invoke action.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[Console screenshot showing details of adding Step Functions invoke action.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/) 1. Choose **Done**\. 1. On the stage that you're editing, choose **Done**\. In the AWS CodePipeline pane, choose **Save**, and then choose **Save** on the warning message\. 1. To submit your changes and start a pipeline execution, choose **Release change**, and then choose **Release**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
57182f06cafc-3
1. To submit your changes and start a pipeline execution, choose **Release change**, and then choose **Release**\. ![\[Console screenshot showing successfully completed pipeline with pipeline execution ID.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/stepfunctions-pipelines.png)![\[Console screenshot showing successfully completed pipeline with pipeline execution ID.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[Console screenshot showing successfully completed pipeline with pipeline execution ID.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/) 1. On your completed pipeline, choose **AWS Step Functions** in your invoke action\. In the AWS Step Functions console, view your state machine execution ID\. The ID shows your state machine name `HelloWorld` and the state machine execution ID with the prefix `my-prefix`\. ``` arn:aws:states:us-west-2:account-ID:execution:HelloWorld:my-prefix-0d9a0900-3609-4ebc-925e-83d9618fcca1 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-step-functions.md
12485194c0a7-0
To use AWS CloudFormation to create a rule, update your template as shown here\.<a name="proc-cfn-event-s3-createrule"></a> **To create a CloudWatch Events rule with Amazon S3 as the event source and CodePipeline as the target and apply the permissions policy** 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?** Adding `AWS::IAM::Role` resource enables AWS CloudFormation to create permissions for Amazon CloudWatch Events\. This resource is added to your AWS CloudFormation stack\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
5c99da50968a-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-cloudtrail-S3-source-cfn.md
20ccfb0f8525-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-cloudtrail-S3-source-cfn.md
20ccfb0f8525-1
{ "Ref": "AWS::Region" }, ":", { "Ref": "AWS::AccountId" }, ":", { "Ref": "AppPipeline" } ] ] ... ``` ------ 1. Use the `AWS::Events::Rule` AWS CloudFormation resource to add a CloudWatch Events rule\. This event pattern creates an event that monitors `CopyObject`, `PutObject` and `CompleteMultipartUpload` on your Amazon S3 source bucket\. In addition, include a target of your pipeline\. When `CopyObject`, `PutObject`, or `CompleteMultipartUpload` occurs, this rule invokes `StartPipelineExecution` on your target pipeline\. **Why am I making this change?** Adding the `AWS::Events::Rule` resource enables AWS CloudFormation to create the event\. This resource is added to your AWS CloudFormation stack\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
36344124e18a-0
``` AmazonCloudWatchEventRule: Type: AWS::Events::Rule Properties: EventPattern: source: - aws.s3 detail-type: - 'AWS API Call via CloudTrail' detail: eventSource: - s3.amazonaws.com eventName: - CopyObject - PutObject - CompleteMultipartUpload requestParameters: bucketName: - !Ref SourceBucket key: - !Ref SourceObjectKey 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-cloudtrail-S3-source-cfn.md
7e8ae8a47468-0
``` "AmazonCloudWatchEventRule": { "Type": "AWS::Events::Rule", "Properties": { "EventPattern": { "source": [ "aws.s3" ], "detail-type": [ "AWS API Call via CloudTrail" ], "detail": { "eventSource": [ "s3.amazonaws.com" ], "eventName": [ "CopyObject", "PutObject", "CompleteMultipartUpload" ], "requestParameters": { "bucketName": [ { "Ref": "SourceBucket" } ], "key": [ { "Ref": "SourceObjectKey" } ] } } }, "Targets": [ { "Arn": { "Fn::Join": [ "", [ "arn:aws:codepipeline:", { "Ref": "AWS::Region"
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
7e8ae8a47468-1
[ "arn:aws:codepipeline:", { "Ref": "AWS::Region" }, ":", { "Ref": "AWS::AccountId" }, ":", { "Ref": "AppPipeline" } ] ] }, "RoleArn": { "Fn::GetAtt": [ "AmazonCloudWatchEventRole", "Arn" ] }, "Id": "codepipeline-AppPipeline" } ] } } }, ... ``` ------ 1. Add this snippet to your first template to allow cross\-stack functionality: ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
a3f9aabf8958-0
``` Outputs: SourceBucketARN: Description: "S3 bucket ARN that Cloudtrail will use" Value: !GetAtt SourceBucket.Arn Export: Name: SourceBucketARN ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
e97f18c6c160-0
``` "Outputs" : { "SourceBucketARN" : { "Description" : "S3 bucket ARN that Cloudtrail will use", "Value" : { "Fn::GetAtt": ["SourceBucket", "Arn"] }, "Export" : { "Name" : "SourceBucketARN" } } ... ``` ------ 1. Save your updated template to your local computer, and open the AWS CloudFormation console\. 1. Choose your stack, and then choose **Create Change Set for Current Stack**\. 1. Upload your updated template, and then view the changes listed in AWS CloudFormation\. These are the changes that will be made to the stack\. You should see your new resources in the list\. 1. Choose **Execute**\.<a name="proc-cfn-flag-s3"></a> **To edit your pipeline's PollForSourceChanges parameter** **Important**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
e97f18c6c160-1
**To edit your pipeline's PollForSourceChanges parameter** **Important** When you create a pipeline with this method, the `PollForSourceChanges` parameter defaults to true if it is not explicitly set to false\. When you add event\-based change detection, you must add the parameter to your output and set it to false to disable polling\. Otherwise, your pipeline starts twice for a single source change\. For details, see [Default settings for the PollForSourceChanges parameter](reference-pipeline-structure.md#PollForSourceChanges-defaults)\. + In the template, change `PollForSourceChanges` to `false`\. If you did not include `PollForSourceChanges` in your pipeline definition, add it and set it to `false`\. **Why am I making this change?** Changing `PollForSourceChanges` to `false` turns off periodic checks so you can use event\-based change detection only\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
07b9171e785e-0
``` Name: Source Actions: - Name: SourceAction ActionTypeId: Category: Source Owner: AWS Version: 1 Provider: S3 OutputArtifacts: - Name: SourceOutput Configuration: S3Bucket: !Ref SourceBucket S3ObjectKey: !Ref SourceObjectKey PollForSourceChanges: false RunOrder: 1 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
d32e7b08a00a-0
``` { "Name": "SourceAction", "ActionTypeId": { "Category": "Source", "Owner": "AWS", "Version": 1, "Provider": "S3" }, "OutputArtifacts": [ { "Name": "SourceOutput" } ], "Configuration": { "S3Bucket": { "Ref": "SourceBucket" }, "S3ObjectKey": { "Ref": "SourceObjectKey" }, "PollForSourceChanges": false }, "RunOrder": 1 } ``` ------<a name="proc-cfn-event-s3-createtrail"></a> **To create a second template for your Amazon S3 pipeline's CloudTrail resources** + In a separate template, under `Resources`, use the `AWS::S3::Bucket`, `AWS::S3::BucketPolicy`, and `AWS::CloudTrail::Trail` AWS CloudFormation resources to provide a simple bucket definition and trail for CloudTrail\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
d32e7b08a00a-1
**Why am I making this change? ** Given the current limit of five trails per account, the CloudTrail trail must be created and managed separately\. \(See [Limits in AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html)\.\) However, you can include many Amazon S3 buckets on a single trail, so you can create the trail once and then add Amazon S3 buckets for other pipelines as necessary\. Paste the following into your second sample template file\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
3b5eb62745c9-0
``` ###################################################################################
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
2c6ed315fa35-0
################################################################################### Parameters: SourceObjectKey: Description: 'S3 source artifact' Type: String Default: SampleApp_Linux.zip Resources: AWSCloudTrailBucketPolicy: Type: AWS::S3::BucketPolicy Properties: Bucket: !Ref AWSCloudTrailBucket PolicyDocument: Version: 2012-10-17 Statement: - Sid: AWSCloudTrailAclCheck Effect: Allow Principal: Service: - cloudtrail.amazonaws.com Action: s3:GetBucketAcl Resource: !GetAtt AWSCloudTrailBucket.Arn - Sid: AWSCloudTrailWrite Effect: Allow Principal: Service: - cloudtrail.amazonaws.com Action: s3:PutObject
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
2c6ed315fa35-1
Principal: Service: - cloudtrail.amazonaws.com Action: s3:PutObject Resource: !Join [ '', [ !GetAtt AWSCloudTrailBucket.Arn, '/AWSLogs/', !Ref 'AWS::AccountId', '/*' ] ] Condition: StringEquals: s3:x-amz-acl: bucket-owner-full-control AWSCloudTrailBucket: Type: AWS::S3::Bucket DeletionPolicy: Retain AwsCloudTrail: DependsOn: - AWSCloudTrailBucketPolicy Type: AWS::CloudTrail::Trail Properties: S3BucketName: !Ref AWSCloudTrailBucket EventSelectors: - DataResources: - Type: AWS::S3::Object Values: - !Join [ '', [ !ImportValue SourceBucketARN, '/', !Ref SourceObjectKey ] ] ReadWriteType: WriteOnly IncludeGlobalServiceEvents: true IsLogging: true IsMultiRegionTrail: true ... ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
538248b62ab0-0
``` { "Parameters": { "SourceObjectKey": { "Description": "S3 source artifact", "Type": "String", "Default": "SampleApp_Linux.zip" } }, "Resources": { "AWSCloudTrailBucket": { "Type": "AWS::S3::Bucket", "DeletionPolicy": "Retain" }, "AWSCloudTrailBucketPolicy": { "Type": "AWS::S3::BucketPolicy", "Properties": { "Bucket": { "Ref": "AWSCloudTrailBucket" }, "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Sid": "AWSCloudTrailAclCheck", "Effect": "Allow", "Principal": { "Service": [ "cloudtrail.amazonaws.com" ] }, "Action": "s3:GetBucketAcl", "Resource": { "Fn::GetAtt": [
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
538248b62ab0-1
"Action": "s3:GetBucketAcl", "Resource": { "Fn::GetAtt": [ "AWSCloudTrailBucket", "Arn" ] } }, { "Sid": "AWSCloudTrailWrite", "Effect": "Allow", "Principal": { "Service": [ "cloudtrail.amazonaws.com" ] }, "Action": "s3:PutObject", "Resource": { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "AWSCloudTrailBucket", "Arn" ] }, "/AWSLogs/", { "Ref": "AWS::AccountId" }, "/*" ] ] }, "Condition": { "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control" } } } ] } }
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
538248b62ab0-2
} } } ] } } }, "AwsCloudTrail": { "DependsOn": [ "AWSCloudTrailBucketPolicy" ], "Type": "AWS::CloudTrail::Trail", "Properties": { "S3BucketName": { "Ref": "AWSCloudTrailBucket" }, "EventSelectors": [ { "DataResources": [ { "Type": "AWS::S3::Object", "Values": [ { "Fn::Join": [ "", [ { "Fn::ImportValue": "SourceBucketARN" }, "/", { "Ref": "SourceObjectKey" } ] ] } ] } ], "ReadWriteType": "WriteOnly" } ], "IncludeGlobalServiceEvents": true, "IsLogging": true,
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
538248b62ab0-3
} ], "IncludeGlobalServiceEvents": true, "IsLogging": true, "IsMultiRegionTrail": true } } } } ... ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/create-cloudtrail-S3-source-cfn.md
f74becf13236-0
**Important** If you use the console to create or edit your pipeline, your CloudWatch Events rule is created for you\. **To create a CloudWatch Events rule for use in CodePipeline operations** 1. Open the CloudWatch console at [https://console\.aws\.amazon\.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/)\. 1. In the navigation pane, choose **Events**\. 1. Choose **Create rule**, and then under **Event source**, from **Service Name**, choose **CodeCommit**\. The service name that you choose owns the event resource\. For example, choose CodeCommit to trigger a pipeline when there are changes to the CodeCommit repository associated with a pipeline\. 1. From **Event Type**, choose **CodeCommit Repository State Change**\. ![\[Create repository state change rule\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/test-repoevent-cptarget.png)![\[Create repository state change rule\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[Create repository state change rule\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/) 1. To make a rule that applies to all repositories, choose **Any resource**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-trigger-source-repo-changes-console.md
f74becf13236-1
1. To make a rule that applies to all repositories, choose **Any resource**\. To make a rule that applies to one or more repositories, choose **Specific resource\(s\) by ARN**, and then enter the ARN\. **Note** You can find the ARN for a CodeCommit repository on the **Settings** page in the CodeCommit console\. To specify the branch to associate with the repository, choose **Edit**, and enter the resource type branch and branch name\. Use the event pattern options for `detail`\. The preceding example shows the detail options for a CodeCommit repository branch named `master`\. The following is a sample CodeCommit event pattern in the **Event** window for a `MyTestRepo` repository with a branch named `master`: ``` { "source": [ "aws.codecommit" ], "detail-type": [ "CodeCommit Repository State Change" ], "resources": [ "arn:aws:codecommit:us-west-2:80398EXAMPLE:MyTestRepo" ], "detail": { "referenceType": [ "branch" ], "referenceName": [ "master" ] } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-trigger-source-repo-changes-console.md
f74becf13236-2
"referenceName": [ "master" ] } } ``` Choose **Save**\. In the **Event Pattern Preview** pane, view the rule\. 1. In **Targets**, choose **CodePipeline**\. 1. Enter the pipeline ARN for the pipeline to be started when triggered by this rule\. **Note** You can find the pipeline ARN under **Settings** in the console\. See [View the pipeline ARN and service role ARN \(console\)](pipelines-view-console.md#pipelines-settings-console)\. The pipeline ARN is constructed in this format: arn:aws:codepipeline:*region*:*account*:*pipeline\-name* Sample pipeline ARN: `arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline` 1. Create or specify an IAM service role that grants Amazon CloudWatch Events permissions to invoke the target associated with your Amazon CloudWatch Events rule \(in this case, the target is CodePipeline\)\. + Choose **Create a new role for this specific resource** to create a service role that gives Amazon CloudWatch Events permissions to your start your pipeline executions when triggered\. + Choose **Use existing role** to enter a service role that gives Amazon CloudWatch Events permissions to your start your pipeline executions when triggered\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-trigger-source-repo-changes-console.md
f74becf13236-3
+ Choose **Use existing role** to enter a service role that gives Amazon CloudWatch Events permissions to your start your pipeline executions when triggered\. 1. Review your rule setup to make sure it meets your requirements\. 1. Choose **Configure details**\. 1. On the **Configure rule details** page, enter a name and description for the rule, and then choose **State** to enable the rule\. 1. If you're satisfied with the rule, choose **Create rule**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/pipelines-trigger-source-repo-changes-console.md
6795e155c3b9-0
In this section, you can find example user policies that grant permissions for various CodePipeline actions\. These policies work when you are using the CodePipeline API, AWS SDKs, or the AWS CLI\. When you are using the console, you must grant additional permissions specific to the console\. For more information, see [Permissions required to use the CodePipeline console](security-iam-permissions-console.md)\. **Note** All examples use the US West \(Oregon\) Region \(`us-west-2`\) and contain fictitious account IDs\. **Examples** + [Example 1: Grant permissions to get the state of a pipeline](#identity-based-policies-example-1) + [Example 2: Grant permissions to enable and disable transitions between stages](#identity-based-policies-example-2) + [Example 3: Grant permissions to get a list of all available action types](#identity-based-policies-example-3) + [Example 4: Grant permissions to approve or reject manual approval actions](#identity-based-policies-example-4) + [Example 5: Grant permissions to poll for jobs for a custom action](#identity-based-policies-example-5) + [Example 6: Attach or edit a policy for Jenkins integration with AWS CodePipeline](#identity-based-policies-example-6) + [Example 7: Configure cross\-account access to a pipeline](#identity-based-policies-example-7)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
6795e155c3b9-1
+ [Example 7: Configure cross\-account access to a pipeline](#identity-based-policies-example-7) + [Example 8: Use AWS resources associated with another account in a pipeline](#identity-based-policies-example-8)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
b4e2d1ad9c30-0
The following example grants permissions to get the state of the pipeline named `MyFirstPipeline`: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codepipeline:GetPipelineState" ], "Resource": "arn:aws:codepipeline:us-west-2:111222333444:MyFirstPipeline" } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
b8880c7ed7b4-0
The following example grants permissions to disable and enable transitions between all stages in the pipeline named `MyFirstPipeline`: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codepipeline:DisableStageTransition", "codepipeline:EnableStageTransition" ], "Resource": "arn:aws:codepipeline:us-west-2:111222333444:MyFirstPipeline/*" } ] } ``` To allow the user to disable and enable transitions for a single stage in a pipeline, you must specify the stage\. For example, to allow the user to enable and disable transitions for a stage named `Staging` in a pipeline named `MyFirstPipeline`: ``` "Resource": "arn:aws:codepipeline:us-west-2:111222333444:MyFirstPipeline/Staging" ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
be44e9843090-0
The following example grants permissions to get a list of all available action types available for pipelines in the `us-west-2` Region: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codepipeline:ListActionTypes" ], "Resource": "arn:aws:codepipeline:us-west-2:111222333444:actiontype:*" } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
2cdc9822dbe4-0
The following example grants permissions to approve or reject manual approval actions in a stage named `Staging` in a pipeline named `MyFirstPipeline`: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codepipeline:PutApprovalResult" ], "Resource": "arn:aws:codepipeline:us-west-2:111222333444:MyFirstPipeline/Staging/*" } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
7db43299bcbc-0
The following example grants permissions to poll for jobs for the custom action named `TestProvider`, which is a `Test` action type in its first version, across all pipelines: **Note** The job worker for a custom action might be configured under a different AWS account or require a specific IAM role in order to function\. ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codepipeline:PollForJobs" ], "Resource": [ "arn:aws:codepipeline:us-west-2:111222333444:actionType:Custom/Test/TestProvider/1" ] } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
53f72d0fdc4b-0
If you configure a pipeline to use Jenkins for build or test, create a separate IAM user for that integration and attach an IAM policy that has the minimum permissions required for integration between Jenkins and CodePipeline\. This policy is the same as the `AWSCodePipelineCustomActionAccess` managed policy\. The following example shows a policy to attach to an IAM user for Jenkins integration: ``` { "Statement": [ { "Action": [ "codepipeline:AcknowledgeJob", "codepipeline:GetJobDetails", "codepipeline:PollForJobs", "codepipeline:PutJobFailureResult", "codepipeline:PutJobSuccessResult" ], "Effect": "Allow", "Resource": "*" } ], "Version": "2012-10-17" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
c499256841fe-0
You can configure access to pipelines for users and groups in another AWS account\. The recommended way is to create a role in the account where the pipeline was created\. The role should allow users from the other AWS account to assume that role and access the pipeline\. For more information, see [Walkthrough: Cross\-Account Access Using Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/walkthru_cross-account-with-roles.html)\. The following example shows a policy in the 80398EXAMPLE account that allows users to view, but not change, the pipeline named `MyFirstPipeline` in the CodePipeline console\. This policy is based on the `AWSCodePipelineReadOnlyAccess` managed policy, but because it is specific to the `MyFirstPipeline` pipeline, it cannot use the managed policy directly\. If you do not want to restrict the policy to a specific pipeline, consider using one of the managed policies created and maintained by CodePipeline\. For more information, see [Working with Managed Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-using.html)\. You must attach this policy to an IAM role you create for access, for example, a role named `CrossAccountPipelineViewers`: ``` { "Statement": [ { "Action": [ "codepipeline:GetPipeline", "codepipeline:GetPipelineState",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
c499256841fe-1
"Action": [ "codepipeline:GetPipeline", "codepipeline:GetPipelineState", "codepipeline:ListActionTypes", "codepipeline:ListPipelines", "iam:ListRoles", "s3:GetBucketPolicy", "s3:GetObject", "s3:ListAllMyBuckets", "s3:ListBucket", "codedeploy:GetApplication", "codedeploy:GetDeploymentGroup", "codedeploy:ListApplications", "codedeploy:ListDeploymentGroups", "elasticbeanstalk:DescribeApplications", "elasticbeanstalk:DescribeEnvironments", "lambda:GetFunctionConfiguration", "lambda:ListFunctions" ], "Effect": "Allow", "Resource": "arn:aws:codepipeline:us-east-2:80398EXAMPLE:MyFirstPipeline" } ], "Version": "2012-10-17" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
c499256841fe-2
} ], "Version": "2012-10-17" } ``` After you create this policy, create the IAM role in the 80398EXAMPLE account and attach the policy to that role\. In the role's trust relationships, you must add the AWS account that assumes this role\. The following example shows a policy that allows users from the *111111111111* AWS account to assume roles defined in the 80398EXAMPLE account: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111111111111:root" }, "Action": "sts:AssumeRole" } ] } ``` The following example shows a policy created in the *111111111111* AWS account that allows users to assume the role named `CrossAccountPipelineViewers` in the 80398EXAMPLE account: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
c499256841fe-3
"Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam::80398EXAMPLE:role/CrossAccountPipelineViewers" } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-0
You can configure policies that allow a user to create a pipeline that uses resources in another AWS account\. This requires configuring policies and roles in both the account that creates the pipeline \(AccountA\) and the account that created the resources to be used in the pipeline \(AccountB\)\. You must also create a customer managed key in AWS Key Management Service to use for cross\-account access\. For more information and step\-by\-step examples, see [Create a pipeline in CodePipeline that uses resources from another AWS account](pipelines-create-cross-account.md) and [Data protection configuration](data-protection.md#security-configuration)\. The following example shows a policy configured by AccountA for an S3 bucket used to store pipeline artifacts\. The policy grants access to AccountB\. In the following example, the ARN for AccountB is `012ID_ACCOUNT_B`\. The ARN for the S3 bucket is `codepipeline-us-east-2-1234567890`\. Replace these ARNs with the ARNs for the S3 bucket and the account you want to allow access: ``` { "Version": "2012-10-17", "Id": "SSEAndSSLPolicy", "Statement": [ { "Sid": "DenyUnEncryptedObjectUploads", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-1
"Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::codepipeline-us-east-2-1234567890/*", "Condition": { "StringNotEquals": { "s3:x-amz-server-side-encryption": "aws:kms" } } }, { "Sid": "DenyInsecureConnections", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": "arn:aws:s3:::codepipeline-us-east-2-1234567890/*", "Condition": { "Bool": { "aws:SecureTransport": false } } }, { "Sid": "", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::012ID_ACCOUNT_B:root" }, "Action": [ "s3:Get*", "s3:Put*"
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-2
}, "Action": [ "s3:Get*", "s3:Put*" ], "Resource": "arn:aws:s3:::codepipeline-us-east-2-1234567890/*" }, { "Sid": "", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::012ID_ACCOUNT_B:root" }, "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::codepipeline-us-east-2-1234567890" } ] } ``` The following example shows a policy configured by AccountA that allows AccountB to assume a role\. This policy must be applied to the service role for CodePipeline \(`AWS-CodePipeline-Service`\)\. For more information about how to apply policies to roles in IAM, see [Modifying a Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-managingrole-editing.html)\. In the following example, `012ID_ACCOUNT_B` is the ARN for AccountB: ``` { "Version": "2012-10-17",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-3
``` { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": [ "arn:aws:iam::012ID_ACCOUNT_B:role/*" ] } } ``` The following example shows a policy configured by AccountB and applied to the [EC2 instance role](https://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-create-iam-instance-profile.html) for CodeDeploy\. This policy grants access to the S3 bucket used by AccountA to store pipeline artifacts \(*codepipeline\-us\-east\-2\-1234567890*\): ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:Get*" ], "Resource": [ "arn:aws:s3:::codepipeline-us-east-2-1234567890/*" ] }, { "Effect": "Allow", "Action": [
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-4
] }, { "Effect": "Allow", "Action": [ "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::codepipeline-us-east-2-1234567890" ] } ] } ``` The following example shows a policy for AWS KMS where ***arn:aws:kms:us\-east\-1:012ID\_ACCOUNT\_A:key/2222222\-3333333\-4444\-556677EXAMPLE*** is the ARN of the customer managed key created in AccountA and configured to allow AccountB to use it: ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kms:DescribeKey", "kms:GenerateDataKey*", "kms:Encrypt", "kms:ReEncrypt*", "kms:Decrypt" ], "Resource": [
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-5
"kms:Decrypt" ], "Resource": [ "arn:aws:kms:us-east-1:012ID_ACCOUNT_A:key/2222222-3333333-4444-556677EXAMPLE" ] } ] } ``` The following example shows an inline policy for an IAM role \(`CrossAccount_Role`\) created by AccountB that allows access to CodeDeploy actions required by the pipeline in AccountA\. ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codedeploy:CreateDeployment", "codedeploy:GetDeployment", "codedeploy:GetDeploymentConfig", "codedeploy:GetApplicationRevision", "codedeploy:RegisterApplicationRevision" ], "Resource": "*" } ] } ``` The following example shows an inline policy for an IAM role \(`CrossAccount_Role`\) created by AccountB that allows access to the S3 bucket to download input artifacts and upload output artifacts: ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
cd904eb33ee4-6
``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject*", "s3:PutObject", "s3:PutObjectAcl" ], "Resource": [ "arn:aws:s3:::codepipeline-us-east-2-1234567890/*" ] } ] } ``` For more information about how to edit a pipeline for cross\-account access to resources, see [Step 2: Edit the pipeline ](pipelines-create-cross-account.md#pipelines-create-cross-account-create)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/customer-managed-policies.md
110a1e092b6a-0
In this tutorial, you use CodePipeline to deploy code maintained in a CodeCommit repository to a single Amazon EC2 instance\. Your pipeline is triggered when you push a change to the CodeCommit repository\. The pipeline deploys your changes to an Amazon EC2 instance using CodeDeploy as the deployment service\. The pipeline has two stages: + A source stage \(**Source**\) for your CodeCommit source action\. + A deployment stage \(**Deploy**\) for your CodeDeploy deployment action\. The easiest way to get started with AWS CodePipeline is to use the **Create Pipeline** wizard in the CodePipeline console\. **Note** Before you begin, make sure you've set up your Git client to work with CodeCommit\. For instructions, see [Setting up for CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-simple-codecommit.md
4c224de07d85-0
First, you create a repository in CodeCommit\. Your pipeline gets source code from this repository when it runs\. You also create a local repository where you maintain and update code before you push it to the CodeCommit repository\. **To create a CodeCommit repository** 1. Open the CodeCommit console at [https://console\.aws\.amazon\.com/codecommit/](https://console.aws.amazon.com/codecommit/)\. 1. In the Region selector, choose the AWS Region where you want to create the repository and pipeline\. For more information, see [AWS Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html)\. 1. On the **Repositories** page, choose **Create repository**\. 1. On the **Create repository** page, in **Repository name**, enter a name for your repository \(for example, **MyDemoRepo**\)\. 1. Choose **Create**\. **Note** The remaining steps in this tutorial use **MyDemoRepo** for the name of your CodeCommit repository\. If you choose a different name, be sure to use it throughout this tutorial\. **To set up a local repository** In this step, you set up a local repository to connect to your remote CodeCommit repository\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-simple-codecommit.md