id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
7cfba42d1692-0 | 1. Open a text editor\. Create a sample template by pasting the following into the file\. Save the file as `S3_template.json`\.
```
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a privately accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.",
"Resources": {
"S3Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {}
}
},
"Outputs": {
"BucketName": {
"Value": {
"Ref": "S3Bucket"
},
"Description": "Name of Amazon S3 bucket to hold website content"
}
}
}
```
This template allows AWS CloudFormation to create an S3 bucket that can be used by AWS Service Catalog\.
1. Upload the `S3_template.json` file to your AWS CodeCommit repository\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
121e87661329-0 | 1. As an IT administrator, sign in to the AWS Service Catalog console, go to the **Products** page, and then choose **Upload new product**\.
1. On the **Upload new product** page, complete the following:
1. In **Product name**, enter the name you want to use for your new product\.
1. In **Description**, enter the product catalog description\. This description is shown in the product listing to help the user choose the correct product\.
1. In **Provided by**, enter the name of your IT department or administrator\.
1. Choose **Next**\.
1. \(Optional\) In **Enter support details**, enter contact information for product support, and choose **Next**\.
1. In **Version details**, complete the following:
1. Choose **Upload a template file**\. Browse for your `S3_template.json` file and upload it\.
1. In **Version title**, enter the name of the product version \(for example, **devops S3 v2**\)\.
1. In **Description**, enter details that distinguish this version from other versions\.
1. Choose **Next**\.
1. On the **Review** page, verify that the information is correct, and then choose **Create**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
121e87661329-1 | 1. On the **Review** page, verify that the information is correct, and then choose **Create**\.
1. On the **Products** page, in the browser, copy the URL of your new product\. This contains the product ID\. Copy and retain this product ID\. You use it when you create your pipeline in CodePipeline\.
Here is the URL for a product named `my-product`\. To extract the product ID, copy the value between the equals sign \(`=`\) and the ampersand \(`&`\)\. In this example, the product ID is `prod-example123456`\.
```
https://<region-URL>/servicecatalog/home?region=<region>#/admin-products?productCreated=prod-example123456&createdProductTitle=my-product
```
**Note**
Copy the URL for your product before you navigate away from the page\. Once you navigate away from this page, you must use the CLI to obtain your product ID\.
After a few seconds, your product appears on the **Products** page\. You might need to refresh your browser to see the product in the list\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
2e51e13413cd-0 | 1. To name your pipeline and select parameters for your pipeline, 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 **Getting started**\. Choose **Create pipeline**, and then enter a name for your pipeline\.
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. To add a source stage, do the following:
1. In **Source provider**, choose **AWS CodeCommit**\.
1. In **Repository name** and **Branch name**, enter the repository and branch you want to use for your source action\.
1. Choose **Next**\.
1. In **Add build stage**, choose **Skip build stage**, and then accept the warning message by choosing **Skip** again\.
1. In **Add deploy stage**, complete the following:
1. In **Deploy provider**, choose **AWS Service Catalog**\.
1. For deployment configuration, choose **Enter deployment configuration**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
2e51e13413cd-1 | 1. For deployment configuration, choose **Enter deployment configuration**\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/deploy-servicecatalog-nofile.png)
1. In **Product ID**, paste the product ID you copied from the AWS Service Catalog console\.
1. In **Template file path**, enter the relative path where the template file is stored\.
1. In **Product type**, choose **AWS CloudFormation Template**\.
1. In **Product version name**, enter the name of the product version you specified in AWS Service Catalog\. If you want to have the template change deployed to a new product version, enter a product version name that has not been used for any previous product version in the same product\.
1. For **Input artifact**, choose the source input artifact\.
1. Choose **Next**\.
1. In **Review**, review your pipeline settings, and then choose **Create**\.
1. After your pipeline runs successfully, on the deployment stage, choose **Details**\. This opens your product in AWS Service Catalog\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/deploy-servicecatalog-pipeline.png)
1. Under your product information, choose your version name to open the product template\. View the template deployment\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
2e51e13413cd-2 | 1. Under your product information, choose your version name to open the product template\. View the template deployment\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/deploy-servicecatalog-template-page.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
2fa340561da9-0 | 1. View your pipeline in the CodePipeline console, and on your source stage, choose **Details**\. Your source AWS CodeCommit repository opens in the console\. Choose **Edit**, and make a change in the file \(for example, to the description\)\.
```
"Description": "Name of Amazon S3 bucket to hold and version website content"
```
1. Commit and push your change\. Your pipeline starts after you push the change\. When the run of the pipeline is complete, on the deployment stage, choose **Details** to open your product in AWS Service Catalog\.
1. Under your product information, choose the new version name to open the product template\. View the deployed template change\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/tutorials-S3-servicecatalog-change.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
a0d1e10bb446-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\. You also upload a separate configuration file that specifies your deployment configuration\. Next, you create your pipeline and specify the location of your configuration file\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
7207354a5ba6-0 | 1. Open a text editor\. Create a sample template by pasting the following into the file\. Save the file as `S3_template.json`\.
```
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a privately accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.",
"Resources": {
"S3Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {}
}
},
"Outputs": {
"BucketName": {
"Value": {
"Ref": "S3Bucket"
},
"Description": "Name of Amazon S3 bucket to hold website content"
}
}
}
```
This template allows AWS CloudFormation to create an S3 bucket that can be used by AWS Service Catalog\.
1. Upload the `S3_template.json` file to your AWS CodeCommit repository\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
a7a0237cf2ae-0 | 1. Open a text editor\. Create the configuration file for your product\. The configuration file is used to define your AWS Service Catalog deployment parameters/preferences\. You use this file when you create your pipeline\.
This sample provides a `ProductVersionName` of "devops S3 v2" and a `ProductVersionDescription` of `MyProductVersionDescription`\. If you want to have the template change deployed to a new product version, just enter a product version name that has not been used for any previous product version in the same product\.
Save the file as `sample_config.json`\.
```
{
"SchemaVersion": "1.0",
"ProductVersionName": "devops S3 v2",
"ProductVersionDescription": "MyProductVersionDescription",
"ProductType": "CLOUD_FORMATION_TEMPLATE",
"Properties": {
"TemplateFilePath": "/S3_template.json"
}
}
```
This file creates the product version information for you each time your pipeline runs\.
1. Upload the `sample_config.json` file to your AWS CodeCommit repository\. Make sure you upload this file to your source repository\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
fb64b9a8009d-0 | 1. As an IT administrator, sign in to the AWS Service Catalog console, go to the **Products** page, and then choose **Upload new product**\.
1. On the **Upload new product** page, complete the following:
1. In **Product name**, enter the name you want to use for your new product\.
1. In **Description**, enter the product catalog description\. This description appears in the product listing to help the user choose the correct product\.
1. In **Provided by**, enter the name of your IT department or administrator\.
1. Choose **Next**\.
1. \(Optional\) In **Enter support details**, enter product support contact information, and then choose **Next**\.
1. In **Version details**, complete the following:
1. Choose **Upload a template file**\. Browse for your `S3_template.json` file and upload it\.
1. In **Version title**, enter the name of the product version \(for example, "devops S3 v2"\)\.
1. In **Description**, enter details that distinguish this version from other versions\.
1. Choose **Next**\.
1. On the **Review** page, verify that the information is correct, and then choose **Confirm and upload**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
fb64b9a8009d-1 | 1. On the **Review** page, verify that the information is correct, and then choose **Confirm and upload**\.
1. On the **Products** page, in the browser, copy the URL of your new product\. This contains the product ID\. Copy and retain this product ID\. You use when you create your pipeline in CodePipeline\.
Here is the URL for a product named `my-product`\. To extract the product ID, copy the value between the equals sign \(`=`\) and the ampersand \(`&`\)\. In this example, the product ID is `prod-example123456`\.
```
https://<region-URL>/servicecatalog/home?region=<region>#/admin-products?productCreated=prod-example123456&createdProductTitle=my-product
```
**Note**
Copy the URL for your product before you navigate away from the page\. Once you navigate away from this page, you must use the CLI to obtain your product ID\.
After a few seconds, your product appears on the **Products** page\. You might need to refresh your browser to see the product in the list\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
9c96e637e81c-0 | 1. To name your pipeline and select parameters for your pipeline, 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 **Getting started**\. Choose **Create pipeline**, and then enter a name for your pipeline\.
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. To add a source stage, do the following:
1. In **Source provider**, choose **AWS CodeCommit**\.
1. In **Repository name** and **Branch name**, enter the repository and branch you want to use for your source action\.
1. Choose **Next**\.
1. In **Add build stage**, choose **Skip build stage**, and then accept the warning message by choosing **Skip** again\.
1. In **Add deploy stage**, complete the following:
1. In **Deploy provider**, choose **AWS Service Catalog**\.
1. Choose **Use configuration file**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
9c96e637e81c-1 | 1. In **Deploy provider**, choose **AWS Service Catalog**\.
1. Choose **Use configuration file**\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/deploy-servicecatalog-withfile.png)
1. In **Product ID**, paste the product ID you copied from the AWS Service Catalog console\.
1. In **Configuration file path**, enter the file path of the configuration file in your repository\.
1. Choose **Next**\.
1. In **Review**, review your pipeline settings, and then choose **Create**\.
1. After your pipeline runs successfully, on your deployment stage, choose **Details** to open your product in AWS Service Catalog\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/deploy-servicecatalog-pipeline.png)
1. Under your product information, choose your version name to open the product template\. View the template deployment\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/deploy-servicecatalog-template-page.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
47104ebddc73-0 | 1. View your pipeline in the CodePipeline console, and on the source stage, choose **Details**\. Your source AWS CodeCommit repository opens in the console\. Choose **Edit**, and then make a change in the file \(for example, to the description\)\.
```
"Description": "Name of Amazon S3 bucket to hold and version website content"
```
1. Commit and push your change\. Your pipeline starts after you push the change\. When the run of the pipeline is complete, on the deployment stage, choose **Details** to open your product in AWS Service Catalog\.
1. Under your product information, choose the new version name to open the product template\. View the deployed template change\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/tutorials-S3-servicecatalog-change.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-S3-servicecatalog.md |
a2456facbb1d-0 | Use the following information to help you diagnose and fix common issues that you might encounter when working with CodePipeline and IAM\.
**Topics**
+ [I am not authorized to perform an action in CodePipeline](#security_iam_troubleshoot-no-permissions)
+ [I am not authorized to perform iam:PassRole](#security_iam_troubleshoot-passrole)
+ [I want to view my access keys](#security_iam_troubleshoot-access-keys)
+ [I'm an administrator and want to allow others to access CodePipeline](#security_iam_troubleshoot-admin-delegate)
+ [I want to allow people outside of my AWS account to access my CodePipeline resources](#security_iam_troubleshoot-cross-account-access) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
393a20c73354-0 | If the AWS Management Console tells you that you're not authorized to perform an action, you must contact your administrator for assistance\. Your administrator is the person who provided you with your user name and password\.
The following example error occurs when the `mateojackson` IAM user tries to use the console to view details about a pipeline, but does not have `codepipeline:GetPipeline` permissions\.
```
User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: codepipeline:GetPipeline on resource: my-pipeline
```
In this case, Mateo asks his administrator to update his policies to allow him to access the `my-pipeline` resource using the `codepipeline:GetPipeline` action\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
480cdeb28322-0 | If you receive an error that you're not authorized to perform the `iam:PassRole` action, you must contact your administrator for assistance\. Your administrator is the person who provided you with your user name and password\. Ask that person to update your policies to allow you to pass a role to CodePipeline\.
Some AWS services allow you to pass an existing role to that service, instead of creating a new service role or service\-linked role\. To do this, you must have permissions to pass the role to the service\.
The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in CodePipeline\. However, the action requires the service to have permissions granted by a service role\. Mary does not have permissions to pass the role to the service\.
```
User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole
```
In this case, Mary asks her administrator to update her policies to allow her to perform the `iam:PassRole` action\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
2e7df92271c5-0 | After you create your IAM user access keys, you can view your access key ID at any time\. However, you can't view your secret access key again\. If you lose your secret key, you must create a new access key pair\.
Access keys consist of two parts: an access key ID \(for example, `AKIAIOSFODNN7EXAMPLE`\) and a secret access key \(for example, `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`\)\. Like a user name and password, you must use both the access key ID and secret access key together to authenticate your requests\. Manage your access keys as securely as you do your user name and password\.
**Important**
Do not provide your access keys to a third party, even to help [find your canonical user ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingCanonicalId)\. By doing this, you might give someone permanent access to your account\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
2e7df92271c5-1 | When you create an access key pair, you are prompted to save the access key ID and secret access key in a secure location\. The secret access key is available only at the time you create it\. If you lose your secret access key, you must add new access keys to your IAM user\. You can have a maximum of two access keys\. If you already have two, you must delete one key pair before creating a new one\. To view instructions, see [Managing Access Keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) in the *IAM User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
0bf3b704a98e-0 | To allow others to access CodePipeline, you must create an IAM entity \(user or role\) for the person or application that needs access\. They will use the credentials for that entity to access AWS\. You must then attach a policy to the entity that grants them the correct permissions in CodePipeline\.
To get started right away, see [Creating Your First IAM Delegated User and Group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-delegated-user.html) in the *IAM User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
d6cddae6b1d7-0 | You can create a role that users in other accounts or people outside of your organization can use to access your resources\. You can specify who is trusted to assume the role\. For services that support resource\-based policies or access control lists \(ACLs\), you can use those policies to grant people access to your resources\.
To learn more, consult the following:
+ To learn whether CodePipeline supports these features, see [How AWS CodePipeline works with IAM](security_iam_service-with-iam.md)\.
+ To learn how to provide access to your resources across AWS accounts that you own, see [Providing Access to an IAM User in Another AWS Account That You Own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\.
+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing Access to AWS Accounts Owned by Third Parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\.
+ To learn how to provide access through identity federation, see [Providing Access to Externally Authenticated Users \(Identity Federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/security_iam_troubleshoot.md |
d6cddae6b1d7-1 | + To learn the difference between using 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_troubleshoot.md |
7b4acf31e6dc-0 | You can configure a pipeline in AWS CodePipeline that deploys container applications using a blue/green deployment\. In a blue/green deployment, you can launch a new version of your application alongside the old version, and you can test the new version before you reroute traffic to it\. You can also monitor the deployment process and rapidly roll back if there is an issue\.
The completed pipeline detects changes to your images or task definition file and and uses CodeDeploy to route and deploy traffic to an Amazon ECS cluster and load balancer\. CodeDeploy creates a new listener on your load balancer which can target your new task through a special port\. You can also configure the pipeline to use a source location, such as a CodeCommit repository, where your Amazon ECS task definition is stored\.
Before you create your pipeline, you must have already created the Amazon ECS resources, the CodeDeploy resources, and the load balancer and target group\. You must have already tagged and stored the image in your image repository, and uploaded the task definition and AppSpec file to your file repository\.
**Note**
This topic describes the Amazon ECS to CodeDeploy blue/green deployment action for CodePipeline\. For reference information about Amazon ECS standard deployment actions in CodePipeline, see [Amazon Elastic Container Service](action-reference-ECS.md)\.
**Topics**
+ [Action Type](#action-reference-ECSbluegreen-type)
+ [Configuration Parameters](#action-reference-ECSbluegreen-config) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
7b4acf31e6dc-1 | + [Configuration Parameters](#action-reference-ECSbluegreen-config)
+ [Input Artifacts](#action-reference-ECSbluegreen-input)
+ [Output Artifacts](#action-reference-ECSbluegreen-output)
+ [Action Declaration](#action-reference-ECSbluegreen-example)
+ [See Also](#action-reference-ECSbluegreen-links) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
6c31166d8f37-0 | + Category: `Deploy`
+ Owner: `AWS`
+ Provider: `CodeDeployToECS`
+ Version: `1` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
5c10ad79e589-0 | **ApplicationName**
Required: Yes
The name of the application in CodeDeploy\. Before you create your pipeline, you must have already created the application in CodeDeploy\.
**DeploymentGroupName**
Required: Yes
The deployment group specified for Amazon ECS task sets that you created for your CodeDeploy application\. Before you create your pipeline, you must have already created the deployment group in CodeDeploy\.
**TaskDefinitionTemplateArtifact**
Required: Yes
The name of the input artifact that provides the task definition file to the deployment action\. This is generally the name of the output artifact from the source action\. When you use the console, the default name for the source action output artifact is `SourceArtifact`\.
**AppSpecTemplateArtifact**
Required: Yes
The name of the input artifact that provides the AppSpec file to the deployment action\. This is generally the name of the output artifact from the source action\. When you use the console, the default name for the source action output artifact is `SourceArtifact`\.
**AppSpecTemplatePath**
Required: No | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
5c10ad79e589-1 | **AppSpecTemplatePath**
Required: No
The file name of the AppSpec file stored in the pipeline source file location, such as your pipeline's CodeCommit repository\. The default file name is `appspec.yaml`\. If your AppSpec file has the same name and is stored at the root level in your file repository, you do not need to provide the file name\. If the path is not the default, enter the path and file name\.
**TaskDefinitionTemplatePath**
Required: No
The file name of the task definition stored in the pipeline file source location, such as your pipeline's CodeCommit repository\. The default file name is `taskdef.json`\. If your task definition file has the same name and is stored at the root level in your file repository, you do not need to provide the file name\. If the path is not the default, enter the path and file name\.
**Image<Number>ArtifactName**
Required: No
The name of the input artifact that provides the image to the deployment action\. This is generally the image repository's output artifact, such as output from the Amazon ECR source action\.
Available values for `<Number>` are 1 through 4\.
**Image<Number>ContainerName**
Required: No
The name of the image available from the image repository, such as the Amazon ECR source repository\.
Available values for `<Number>` are 1 through 4\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
9a6ac79e586d-0 | + **Number of Artifacts:** `1 to 5`
+ **Description:** The `CodeDeployToECS` action first looks for the task definition file and the AppSpec file in the source file repository, next looks for the image in the image repository, and then runs the AppSpec commands to deploy the task set and container to the cluster\.
The `CodeDeployToECS` action looks for an `imageDetail.json` file that maps the image URI to the image\. When you commit a change to your Amazon ECR image repository, the pipeline ECR source action creates an `imageDetail.json` file for that commit\. You can also manually add an `imageDetail.json` file for a pipeline where the action is not automated\. For information about the `imageDetail.json` file, see [imageDetail\.json file for Amazon ECS blue/green deployment actions](file-reference.md#file-reference-ecs-bluegreen)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
d514ec20c119-0 | + **Number of Artifacts:** `0`
+ **Description:** Output artifacts do not apply for this action type\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
6c2fa4acc886-0 | ------ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
aed824b85b73-0 | ```
Name: Deploy
Actions:
- Name: Deploy
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: CodeDeployToECS
Version: '1'
RunOrder: 1
Configuration:
AppSpecTemplateArtifact: SourceArtifact
ApplicationName: ecs-cd-application
DeploymentGroupName: ecs-deployment-group
Image1ArtifactName: MyImage
Image1ContainerName: IMAGE1_NAME
TaskDefinitionTemplatePath: taskdef.json
AppSpecTemplatePath: appspec.yaml
TaskDefinitionTemplateArtifact: SourceArtifact
OutputArtifacts: []
InputArtifacts:
- Name: SourceArtifact
- Name: MyImage
Region: us-west-2
Namespace: DeployVariables
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
b726f65bb48c-0 | ```
{
"Name": "Deploy",
"Actions": [
{
"Name": "Deploy",
"ActionTypeId": {
"Category": "Deploy",
"Owner": "AWS",
"Provider": "CodeDeployToECS",
"Version": "1"
},
"RunOrder": 1,
"Configuration": {
"AppSpecTemplateArtifact": "SourceArtifact",
"ApplicationName": "ecs-cd-application",
"DeploymentGroupName": "ecs-deployment-group",
"Image1ArtifactName": "MyImage",
"Image1ContainerName": "IMAGE1_NAME",
"TaskDefinitionTemplatePath": "taskdef.json",
"AppSpecTemplatePath": "appspec.yaml",
"TaskDefinitionTemplateArtifact": "SourceArtifact"
},
"OutputArtifacts": [],
"InputArtifacts": [
{
"Name": "SourceArtifact"
},
{
"Name": "MyImage"
}
], | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
b726f65bb48c-1 | },
{
"Name": "MyImage"
}
],
"Region": "us-west-2",
"Namespace": "DeployVariables"
}
]
}
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
c9e75cc84574-0 | The following related resources can help you as you work with this action\.
+ [Tutorial: Create a pipeline with an Amazon ECR source and ECS\-to\-CodeDeploy deployment](tutorials-ecs-ecr-codedeploy.md) – This tutorial walks you through creation of the CodeDeploy and Amazon ECS resources you need for a blue/green deployment\. The tutorial shows you how to push a Docker image to Amazon ECR and create an Amazon ECS task definition that lists your Docker image name, container name, Amazon ECS service name, and load balancer configuration\. The tutorial then walks you through creating the AppSpec file and pipeline for your deployment\.
**Note**
This topic and tutorial describe the CodeDeploy/ECS blue/green action for CodePipeline\. For information about ECS standard actions in CodePipeline, see [Tutorial: Continuous Deployment with CodePipeline](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cd-pipeline.html)\.
+ *AWS CodeDeploy User Guide* – For information about how to use the load balancer, production listener, target groups, and your Amazon ECS application in a blue/green deployment, see [Tutorial: Deploy an Amazon ECS Service](https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorial-ecs-deployment.html)\. This reference information in the *AWS CodeDeploy User Guide* provides an overview for blue/green deployments with Amazon ECS and AWS CodeDeploy\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
c9e75cc84574-1 | + *Amazon Elastic Container Service Developer Guide* – For information about working with Docker images and containers, ECS services and clusters, and ECS task sets, see [What Is Amazon ECS?](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/action-reference-ECSbluegreen.md |
6a154edbaa61-0 | In this tutorial, you configure a pipeline in AWS CodePipeline that deploys container applications using a blue/green deployment that supports Docker images\. In a blue/green deployment, you can launch the new version of your application alongside the old version and test the new version before you reroute traffic\. You can also monitor the deployment process and rapidly roll back if there is an issue\.
The completed pipeline detects changes to your image, which is stored in an image repository such as Amazon ECR, and uses CodeDeploy to route and deploy traffic to an Amazon ECS cluster and load balancer\. CodeDeploy uses a listener to reroute traffic to the port of the updated container specified in the AppSpec file\. For information about how the load balancer, production listener, target groups, and your Amazon ECS application are used in a blue/green deployment, see [Tutorial: Deploy an Amazon ECS Service](https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorial-ecs-deployment.html)\.
The pipeline is also configured to use a source location, such as CodeCommit, where your Amazon ECS task definition is stored\. In this tutorial, you configure each of these AWS resources and then create your pipeline with stages that contain actions for each resource\.
Your continuous delivery pipeline will automatically build and deploy container images whenever source code is changed or a new base image is uploaded to Amazon ECR\.
This flow uses the following artifacts:
+ A Docker image file that specifies the container name and repository URI of your Amazon ECR image repository\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
6a154edbaa61-1 | This flow uses the following artifacts:
+ A Docker image file that specifies the container name and repository URI of your Amazon ECR image repository\.
+ An Amazon ECS task definition that lists your Docker image name, container name, Amazon ECS service name, and load balancer configuration\.
+ A CodeDeploy AppSpec file that specifies the name of the Amazon ECS task definition file, the name of the updated application's container, and the container port where CodeDeploy reroutes production traffic\. It can also specify optional network configuration and Lambda functions you can run during deployment lifecycle event hooks\.
**Note**
When you commit a change to your Amazon ECR image repository, the pipeline source action creates an `imageDetail.json` file for that commit\. For information about the `imageDetail.json` file, see [imageDetail\.json file for Amazon ECS blue/green deployment actions](file-reference.md#file-reference-ecs-bluegreen)\.
When you create or edit your pipeline and update or specify source artifacts for your deployment stage, make sure to point to the source artifacts with the latest name and version you want to use\. After you set up your pipeline, as you make changes to your image or task definition, you might need to update your source artifact files in your repositories and then edit the deployment stage in your pipeline\.
**Topics**
+ [Prerequisites](#tutorials-ecs-ecr-codedeploy-prereq) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
6a154edbaa61-2 | **Topics**
+ [Prerequisites](#tutorials-ecs-ecr-codedeploy-prereq)
+ [Step 1: Create image and push to an Amazon ECR repository](#tutorials-ecs-ecr-codedeploy-imagerepository)
+ [Step 2: Create task definition and AppSpec source files and push to a CodeCommit repository](#tutorials-ecs-ecr-codedeploy-taskdefinition)
+ [Step 3: Create your Application Load Balancer and target groups](#tutorials-ecs-ecr-codedeploy-loadbal)
+ [Step 4: Create your Amazon ECS cluster and service](#tutorials-ecs-ecr-codedeploy-cluster)
+ [Step 5: Create your CodeDeploy application and deployment group \(ECS compute platform\)](#tutorials-ecs-ecr-codedeploy-deployment)
+ [Step 6: Create your pipeline](#tutorials-ecs-ecr-codedeploy-pipeline)
+ [Step 7: Make a change to your pipeline and verify deployment](#tutorials-ecs-ecr-codedeploy-update) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
e0c3c83e2e06-0 | You must have already created the following resources:
+ A CodeCommit repository\. You can use the AWS CodeCommit repository you created in [Tutorial: Create a simple pipeline \(CodeCommit repository\)](tutorials-simple-codecommit.md)\.
+ Launch an Amazon EC2 Linux instance and install Docker to create an image as shown in this tutorial\. If you already have an image you want to use, you can skip this prerequisite\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
0b963705be64-0 | In this section, you use Docker to create an image and then use the AWS CLI to create an Amazon ECR repository and push the image to the repository\.
**Note**
If you already have an image you want to use, you can skip this step\.
**To create an image**
1. Sign in to your Linux instance where you have Docker installed\.
Pull down an image for `nginx`\. This command provides the `nginx:latest` image from Docker Hub:
```
docker pull nginx
```
1. Run docker images\. You should see the image in the list\.
```
docker images
```
**To create an Amazon ECR repository and push your image**
1. Create an Amazon ECR repository to store your image\. Make a note of the `repositoryUri` in the output\.
```
aws ecr create-repository --repository-name nginx
```
Output:
```
{
"repository": {
"registryId": "aws_account_id",
"repositoryName": "nginx",
"repositoryArn": "arn:aws:ecr:us-east-1:aws_account_id:repository/nginx", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
0b963705be64-1 | "repositoryArn": "arn:aws:ecr:us-east-1:aws_account_id:repository/nginx",
"createdAt": 1505337806.0,
"repositoryUri": "aws_account_id.dkr.ecr.us-east-1.amazonaws.com/nginx"
}
}
```
1. Tag the image with the `repositoryUri` value from the previous step\.
```
docker tag nginx:latest aws_account_id.dkr.ecr.us-east-1.amazonaws.com/nginx:latest
```
1. Run the aws ecr get\-login\-password command, as shown in this example for the `us-west-2` Region\.
```
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin ACCOUNT_ID.dkr.ecr.us-west-2.amazonaws.com/nginx
```
1. Push the image to Amazon ECR using the `repositoryUri` from the earlier step\.
```
docker push aws_account_id.dkr.ecr.us-east-1.amazonaws.com/nginx:latest
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
c1c4040c7b92-0 | In this section, you create a task definition JSON file and register it with Amazon ECS\. You then create an AppSpec file for CodeDeploy and use your Git client to push the files to your CodeCommit repository\.
**To create a task definition for your image**
1. Create a file named `taskdef.json` with the following contents\. For `image`, enter your image name, such as nginx\. This value is updated when your pipeline runs\.
**Note**
Make sure that the execution role specified in the task definition contains the `AmazonECSTaskExecutionRolePolicy`\. For more information, see [Amazon ECS Task Execution IAM Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) in the *Amazon ECS Developer Guide*\.
```
{
"executionRoleArn": "arn:aws:iam::account_ID:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"name": "sample-website",
"image": "nginx",
"essential": true,
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
]
} | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
c1c4040c7b92-1 | "protocol": "tcp",
"containerPort": 80
}
]
}
],
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256",
"memory": "512",
"family": "ecs-demo"
}
```
1. Register your task definition with the `taskdef.json` file\.
```
aws ecs register-task-definition --cli-input-json file://taskdef.json
```
1. After the task definition is registered, edit your file to remove the image name and include the `<IMAGE1_NAME>` placeholder text in the image field\.
```
{
"executionRoleArn": "arn:aws:iam::account_ID:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"name": "sample-website",
"image": "<IMAGE1_NAME>",
"essential": true,
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
c1c4040c7b92-2 | "portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
]
}
],
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256",
"memory": "512",
"family": "ecs-demo"
}
```
**To create an AppSpec file**
+ The AppSpec file is used for CodeDeploy deployments\. The file, which includes optional fields, uses this format:
```
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
TaskDefinition: "task-definition-ARN"
LoadBalancerInfo:
ContainerName: "container-name"
ContainerPort: container-port-number | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a620e392cae0-0 | PlatformVersion: "LATEST"
NetworkConfiguration:
AwsvpcConfiguration:
Subnets: ["subnet-name-1", "subnet-name-2"]
SecurityGroups: ["security-group"]
AssignPublicIp: "ENABLED"
Hooks:
- BeforeInstall: "BeforeInstallHookFunctionName"
- AfterInstall: "AfterInstallHookFunctionName"
- AfterAllowTestTraffic: "AfterAllowTestTrafficHookFunctionName"
- BeforeAllowTraffic: "BeforeAllowTrafficHookFunctionName"
- AfterAllowTraffic: "AfterAllowTrafficHookFunctionName"
```
For more information about the AppSpec file, including examples, see [CodeDeploy AppSpec File Reference](https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file.html)\.
Create a file named `appspec.yaml` with the following contents\. For `TaskDefinition`, do not change the `<TASK_DEFINITION>` placeholder text\. This value is updated when your pipeline runs\.
```
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties: | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a620e392cae0-1 | Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
TaskDefinition: <TASK_DEFINITION>
LoadBalancerInfo:
ContainerName: "sample-website"
ContainerPort: 80
```
**To push files to your CodeCommit repository**
1. Push or upload the files to your CodeCommit repository\. These files are the source artifact created by the **Create pipeline** wizard for your deployment action in CodePipeline\. Your files should look like this in your local directory:
```
/tmp
|my-demo-repo
|-- appspec.yaml
|-- taskdef.json
```
1. Choose the method you want to use to upload your files:
1. To use your git command line from a cloned repository on your local computer:
1. Change directories to your local repository:
```
(For Linux, macOS, or Unix) cd /tmp/my-demo-repo
(For Windows) cd c:\temp\my-demo-repo
```
1. Run the following command to stage all of your files at once:
```
git add -A
```
1. Run the following command to commit the files with a commit message: | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a620e392cae0-2 | ```
git add -A
```
1. Run the following command to commit the files with a commit message:
```
git commit -m "Added task definition files"
```
1. Run the following command to push the files from your local repo to your CodeCommit repository:
```
git push
```
1. To use the CodeCommit console to upload your files:
1. Open the CodeCommit console, and choose your repository from the **Repositories** list\.
1. Choose **Add file**, and then choose **Upload file**\.
1. Choose **Choose file**, and then browse for your file\. Commit the change by entering your user name and email address\. Choose **Commit changes**\.
1. Repeat this step for each file you want to upload\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
79ae48b75239-0 | In this section, you create an Amazon EC2 Application Load Balancer\. You use the subnet names and target group values you create with your load balancer later, when you create your Amazon ECS service\. You can create an Application Load Balancer or a Network Load Balancer\. The load balancer must use a VPC with two public subnets in different Availability Zones\. In these steps, you confirm your default VPC, create a load balancer, and then create two target groups for your load balancer\. For more information, see [Target Groups for Your Network Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html)\.
**To verify your default VPC and public subnets**
1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console\.aws\.amazon\.com/vpc/](https://console.aws.amazon.com/vpc/)\.
1. Verify the default VPC to use\. In the navigation pane, choose **Your VPCs**\. Note which VPC shows **Yes** in the **Default VPC** column\. This is the default VPC\. It contains default subnets for you to select\.
1. Choose **Subnets**\. Choose two subnets that show **Yes** in the **Default subnet** column\.
**Note**
Make a note of your subnet IDs\. You need them later in this tutorial\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
79ae48b75239-1 | **Note**
Make a note of your subnet IDs\. You need them later in this tutorial\.
1. Choose the subnets, and then choose the **Description** tab\. Verify that the subnets you want to use are in different Availability Zones\.
1. Choose the subnets, and then choose the **Route Table** tab\. To verify that each subnet you want to use is a public subnet, confirm that a gateway row is included in the route table\.
**To create an Amazon EC2 Application Load Balancer**
1. Sign in to the AWS Management Console and open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. In the navigation pane, choose **Load Balancers**\.
1. Choose **Create Load Balancer**\.
1. Choose **Application Load Balancer**, and then choose **Create**\.
1. In **Name**, enter the name of your load balancer\.
1. In **Scheme**, choose **internet\-facing**\.
1. In **IP address type**, choose **ipv4**\.
1. Configure two listener ports for your load balancer: | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
79ae48b75239-2 | 1. Configure two listener ports for your load balancer:
1. Under **Load Balancer Protocol**, choose **HTTP**\. Under **Load Balancer Port**, enter **80**\.
1. Choose **Add listener**\.
1. Under **Load Balancer Protocol** for the second listener, choose **HTTP**\. Under **Load Balancer Port**, enter **8080**\.
1. Under **Availability Zones**, in **VPC**, choose the default VPC\. Next, choose the two default subnets you want to use\.
1. Choose **Next: Configure Security Settings**\.
1. Choose **Next: Configure Security Groups**\.
1. Choose **Select an existing security group**, and make a note of the security group ID\.
1. Choose **Next: Configure Routing**\.
1. In **Target group**, choose **New target group** and configure your first target group:
1. In **Name**, enter a target group name \(for example, **target\-group\-1**\)\.
1. In **Target type**, choose **IP**\.
1. In **Protocol** choose **HTTP**\. In **Port**, enter **80**\.
1. Choose **Next: Register Targets**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
79ae48b75239-3 | 1. Choose **Next: Register Targets**\.
1. Choose **Next: Review**, and then choose **Create**\.
**To create a second target group for your load balancer**
1. After your load balancer is provisioned, open the Amazon EC2 console\. In the navigation pane, choose **Target Groups**\.
1. Choose **Create target group**\.
1. In **Name**, enter a target group name \(for example, **target\-group\-2**\)\.
1. In **Target type**, choose **IP**\.
1. In **Protocol** choose **HTTP**\. In **Port**, enter **8080**\.
1. In **VPC**, choose the default VPC\.
1. Choose **Create**\.
**Note**
You must have two target groups created for your load balancer in order for your deployment to run\. You only need to make a note of the ARN of your first target group\. This ARN is used in the `create-service` JSON file in the next step\.
**To update your load balancer to include your second target group**
1. Open the Amazon EC2 console\. In the navigation pane, choose **Load Balancers**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
79ae48b75239-4 | 1. Open the Amazon EC2 console\. In the navigation pane, choose **Load Balancers**\.
1. Choose your load balancer, and then choose the **Listeners** tab\. Choose the listener with port 8080, and then choose **Edit**\.
1. Choose the pencil icon next to **Forward to**\. Choose your second target group, and then choose the check mark\. Choose **Update** to save the updates\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
2c0886d9178b-0 | In this section, you create an Amazon ECS cluster and service where CodeDeploy routes traffic during deployment \(to an Amazon ECS cluster rather than EC2 instances\)\. To create your Amazon ECS service, you must use the subnet names, security group, and target group value you created with your load balancer to create your service\.
**Note**
When you use these steps to create your Amazon ECS cluster, you use the **Networking only** cluster template, which provisions AWS Fargate containers\. AWS Fargate is a technology that manages your container instance infrastructure for you\. You do not need to choose or manually create Amazon EC2 instances for your Amazon ECS cluster\.
**To create an Amazon ECS cluster**
1. Open the Amazon ECS console at [https://console\.aws\.amazon\.com/ecs/](https://console.aws.amazon.com/ecs/)\.
1. In the navigation pane, choose **Clusters**\.
1. Choose **Create cluster**\.
1. Choose the **Networking only** cluster template that uses AWS Fargate, and then choose **Next step**\.
1. Enter a cluster name on the **Configure cluster** page\. You can add an optional tag for your resource\. Choose **Create**\.
**To create an Amazon ECS service**
Use the AWS CLI to create your service in Amazon ECS\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
2c0886d9178b-1 | **To create an Amazon ECS service**
Use the AWS CLI to create your service in Amazon ECS\.
1. Create a JSON file and name it `create-service.json`\. Paste the following into the JSON file\.
For the `taskDefinition` field, when you register a task definition in Amazon ECS, you give it a family\. This is similar to a name for multiple versions of the task definition, specified with a revision number\. In this example, use "`ecs-demo:1`" for the family and revision number in your file\. Use the subnet names, security group, and target group value you created with your load balancer in [Step 3: Create your Application Load Balancer and target groups ](#tutorials-ecs-ecr-codedeploy-loadbal)\.
**Note**
You need to include your target group ARN in this file\. Open the Amazon EC2 console and from the navigation pane, under **LOAD BALANCING**, choose **Target Groups**\. Choose your first target group\. Copy your ARN from the **Description** tab\.
```
{
"taskDefinition": "family:revision-number",
"cluster": "my-cluster",
"loadBalancers": [
{
"targetGroupArn": "target-group-arn",
"containerName": "sample-website",
"containerPort": 80
}
], | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
2c0886d9178b-2 | "containerName": "sample-website",
"containerPort": 80
}
],
"desiredCount": 1,
"launchType": "FARGATE",
"schedulingStrategy": "REPLICA",
"deploymentController": {
"type": "CODE_DEPLOY"
},
"networkConfiguration": {
"awsvpcConfiguration": {
"subnets": [
"subnet-1",
"subnet-2"
],
"securityGroups": [
"security-group"
],
"assignPublicIp": "ENABLED"
}
}
}
```
1. Run the create\-service command, specifying the JSON file:
**Important**
Be sure to include `file://` before the file name\. It is required in this command\.
This example creates a service named `my-service`\.
**Note**
This example command creates a service named my\-service\. If you already have a service with this name, the command returns an error\.
```
aws ecs create-service --service-name my-service --cli-input-json file://create-service.json | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
2c0886d9178b-3 | aws ecs create-service --service-name my-service --cli-input-json file://create-service.json
```
The output returns the description fields for your service\.
1. Run the describe\-services command to verify that your service was created\.
```
aws ecs describe-services --cluster cluster-name --services service-name
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
06033901c15b-0 | When you create a CodeDeploy application and deployment group for the Amazon ECS compute platform, the application is used during a deployment to reference the correct deployment group, target groups, listeners, and traffic rerouting behavior\.
**To create a CodeDeploy application**
1. Open the CodeDeploy console and choose **Create application**\.
1. In **Application name**, enter the name you want to use\.
1. In **Compute platform**, choose **Amazon ECS**\.
1. Choose **Create application**\.
**To create a CodeDeploy deployment group**
1. On your application page's **Deployment groups** tab, choose **Create deployment group**\.
1. In **Deployment group name**, enter a name that describes the deployment group\.
1. In **Service role**, choose a service role that grants CodeDeploy access to Amazon ECS\. To create a new service role, follow these steps:
1. Open the IAM console at [https://console\.aws\.amazon\.com/iam/](https://console.aws.amazon.com/iam/)\)\.
1. From the console dashboard, choose **Roles**\.
1. Choose **Create role**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
06033901c15b-1 | 1. From the console dashboard, choose **Roles**\.
1. Choose **Create role**\.
1. Under **Select type of trusted entity**, select **AWS service**\. Under **Choose a use case**, select **CodeDeploy**\. Under **Select your use case**, select **CodeDeploy \- ECS**\. Choose **Next: Permissions**\. The `AWSCodeDeployRoleForECS` managed policy is already attached to the role\.
1. Choose **Next: Tags**, and **Next: Review**\.
1. Enter a name for the role \(for example, **CodeDeployECSRole**\), and then choose **Create role**\.
1. In **Environment configuration**, choose your Amazon ECS cluster name and service name\.
1. From **Load balancers**, choose the name of the load balancer that serves traffic to your Amazon ECS service\.
1. From **Production listener port**, choose the port and protocol for the listener that serves production traffic to your Amazon ECS service\. From **Test listener port**, choose the port and protocol for the test listener\.
1. From **Target group 1 name** and **Target group 2 name**, choose the target groups used to route traffic during your deployment\. Make sure that these are the target groups you created for your load balancer\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
06033901c15b-2 | 1. Choose **Reroute traffic immediately** to determine how long after a successful deployment to reroute traffic to your updated Amazon ECS task\.
1. Choose **Create deployment group**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-0 | In this section, you create a pipeline with the following actions:
+ A CodeCommit action where the source artifacts are the task definition and the AppSpec file\.
+ A source stage with an Amazon ECR source action where the source artifact is the image file\.
+ A deployment stage with an Amazon ECS deploy action where the deployment runs with a CodeDeploy application and deployment group\.
**To create a two\-stage 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 the **Pipelines** page, choose **Create pipeline**\.
1. In **Step 1: Choose pipeline settings**, in **Pipeline name**, enter **MyImagePipeline**\.
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**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-1 | 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 **AWS CodeCommit**\. In **Repository name**, choose the name of the CodeCommit repository you created in [Step 1: Create a CodeCommit repository](tutorials-simple-codecommit.md#codecommit-create-repository)\. In **Branch name**, choose the name of the branch that contains your latest code update\. Unless you created a different branch on your own, only `master` is available\.
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 **Amazon ECS \(Blue/Green\)**\. In **Application name**, enter or choose the application name from the list, such as `codedeployapp`\. In **Deployment group**, enter or choose the deployment group name from the list, such as `codedeploydeplgroup`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-2 | ![\[The Step 4: Deploy page for an Amazon ECS action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/ECS-deploy-action.png)![\[The Step 4: Deploy page for an Amazon ECS action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The Step 4: Deploy page for an Amazon ECS action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
**Note**
The name "Deploy" is the name given by default to the stage created in the **Step 4: Deploy** step, just as "Source" is the name given to the first stage of the pipeline\.
1. Under **Amazon ECS task definition**, choose **SourceArtifact**\. In the field, enter **taskdef\.json**\.
1. Under **AWS CodeDeploy AppSpec file**, choose **SourceArtifact**\. In the field, enter **appspec\.yaml**\.
**Note**
At this point, do not fill in any information under **Dynamically update task definition image**\.
1. Choose **Next**\.
1. In **Step 5: Review**, review the information, and then choose **Create pipeline**\.
**To add an Amazon ECR source action to your pipeline** | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-3 | **To add an Amazon ECR source action to your pipeline**
View your pipeline and add an Amazon ECR source action to your pipeline\.
1. Choose your pipeline\. In the upper left, choose **Edit**\.
1. In the source stage, choose **Edit stage**\.
1. Add a parallel action by choosing **\+ Add action** next to your CodeCommit source action\.
1. In **Action name**, enter a name \(for example, **Image**\)\.
1. In **Action provider**, choose **Amazon ECR**\.
![\[\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/ECR-source-action.png)
1. In **Repository name**, choose the name of your Amazon ECR repository\.
1. In **Image tag**, specify the image name and version, if different from latest\.
1. In **Output artifacts**, choose the output artifact default \(for example, `MyImage`\) that contains the image name and repository URI information you want the next stage to use\.
1. Choose **Save** on the action screen\. Choose **Done** on the stage screen\. Choose **Save** on the pipeline\. A message shows the Amazon CloudWatch Events rule to be created for the Amazon ECR source action\.
**To wire your source artifacts to the deploy action** | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-4 | **To wire your source artifacts to the deploy action**
1. Choose **Edit** on your Deploy stage and choose the icon to edit the **Amazon ECS \(Blue/Green\)** action\.
1. Scroll to the bottom of the pane\. In **Input artifacts**, choose **Add**\. Add the source artifact from your new Amazon ECR repository \(for example, `MyImage`\)\.
1. In **Task Definition**, choose **SourceArtifact**, and then verify **taskdef\.json** is entered\.
1. In **AWS CodeDeploy AppSpec File**, choose **SourceArtifact**, and then verify **appspec\.yaml** is entered\.
1. In **Dynamically update task definition image**, in **Input Artifact with Image URI**, choose **MyImage**, and then enter the placeholder text that is used in the `taskdef.json` file:** IMAGE1\_NAME**\. Choose **Save**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-5 | ![\[The Step 4: Deploy page for an edited Amazon ECS stage\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/tutorial-ECS-pipeline-edit-deploystage.png)![\[The Step 4: Deploy page for an edited Amazon ECS stage\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The Step 4: Deploy page for an edited Amazon ECS stage\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
1. In the AWS CodePipeline pane, choose **Save pipeline change**, and then choose **Save change**\. View your updated pipeline\.
After this example pipeline is created, the action configuration for the console entries appears in the pipeline structure as follows:
```
"configuration": {
"AppSpecTemplateArtifact": "SourceArtifact",
"AppSpecTemplatePath": "appspec.yaml",
"TaskDefinitionTemplateArtifact": "SourceArtifact",
"TaskDefinitionTemplatePath": "taskdef.json",
"ApplicationName": "codedeployapp",
"DeploymentGroupName": "codedeploydeplgroup",
"Image1ArtifactName": "MyImage", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
a525780b12a0-6 | "DeploymentGroupName": "codedeploydeplgroup",
"Image1ArtifactName": "MyImage",
"Image1ContainerName": "IMAGE1_NAME"
},
```
1. To submit your changes and start a pipeline build, choose **Release change**, and then choose **Release**\.
![\[Completed pipeline with an Amazon ECS Blue/Green stage\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/tutorial-ECS-bluegreen-pipeline.png)![\[Completed pipeline with an Amazon ECS Blue/Green stage\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[Completed pipeline with an Amazon ECS Blue/Green stage\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
1. Choose the deployment action to view it in CodeDeploy and see the progress of the traffic shifting\.
**Note**
You might see a deployment step that shows an optional wait time\. By default, CodeDeploy waits one hour after a successful deployment before it terminates the original task set\. You can use this time to roll back or terminate the task, but your deployment otherwise completes when the task set is terminated\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
1fa297de29ad-0 | Make a change to your image and then push the change to your Amazon ECR repository\. This triggers your pipeline to run\. Verify that your image source change is deployed\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-ecs-ecr-codedeploy.md |
9b04ad5a2d7d-0 | Amazon CloudWatch Events is a web service that monitors your AWS resources and the applications you run on AWS\. You can use Amazon CloudWatch Events to detect and react to changes in the state of a pipeline, stage, or action\. Then, based on rules you create, CloudWatch Events invokes one or more target actions when a pipeline, stage, or action enters the state you specify in a rule\. Depending on the type of state change, you might want to send notifications, capture state information, take corrective action, initiate events, or take other actions\.
Amazon CloudWatch Events are composed of:
+ **Rules\.** An event in Amazon CloudWatch Events is configured by first creating a rule with a selected service as the event source\.
+ **Targets\.** The new rule receives a selected service as the event target\. For a list of services available as Amazon CloudWatch Events targets, see [What Is Amazon CloudWatch Events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html)\.
Examples of Amazon CloudWatch Events rules and targets:
+ A rule that sends a notification when the instance state changes, where an EC2 instance is the event source and Amazon SNS is the event target\.
+ A rule that sends a notification when the build phase changes, where a CodeBuild configuration is the event source and Amazon SNS is the event target\.
+ A rule that detects pipeline changes and invokes an AWS Lambda function\.
To configure AWS CodePipeline as an event source: | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
9b04ad5a2d7d-1 | + A rule that detects pipeline changes and invokes an AWS Lambda function\.
To configure AWS CodePipeline as an event source:
1. Create an Amazon CloudWatch Events rule that uses CodePipeline as an event source\.
1. Create a target for your rule that uses one of the services available as targets in Amazon CloudWatch Events, such as AWS Lambda or Amazon SNS\.
1. Grant permissions to Amazon CloudWatch Events to allow it to invoke the selected target service\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
db64ccd1dbd1-0 | You build rules for detecting and reacting to pipeline state changes using the **Events** window in Amazon CloudWatch\. As you build your rule, the **Event Pattern Preview** box in the console \(or the `--event-pattern` output in the CLI\) displays the event fields, in JSON format\.
You can configure notifications to be sent when the state changes for:
+ Specified pipelines or all your pipelines\. You control this by using `"detail-type":` `"CodePipeline Pipeline Execution State Change"`\.
+ Specified stages or all your stages, within a specified pipeline or all your pipelines\. You control this by using `"detail-type":` `"CodePipeline Stage Execution State Change"`\.
+ Specified actions or all actions, within a specified stage or all stages, within a specified pipeline or all your pipelines\. You control this by using `"detail-type":` `"CodePipeline Action Execution State Change"`\.
Each type of execution state change event emits notifications with specific message content, where:
+ The initial `version` entry shows the version number for the CloudWatch event\.
+ The `version` entry under pipeline `detail` shows the pipeline structure version number\.
+ The `execution-id` entry under pipeline `detail` shows the execution ID for the pipeline execution that caused the state change\. Refer to the GetPipelineExecution API call in the [AWS CodePipeline API Reference](https://docs.aws.amazon.com/codepipeline/latest/APIReference/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
db64ccd1dbd1-1 | **Pipeline execution state change message content: ** When a pipeline execution starts, it emits an event that sends notifications with the following content\. This example is for the pipeline named `"myPipeline"` in the `us-east-1` region\.
```
{
"version": "0",
"id": event_Id,
"detail-type": "CodePipeline Pipeline Execution State Change",
"source": "aws.codepipeline",
"account": Pipeline_Account,
"time": TimeStamp,
"region": "us-east-1",
"resources": [
"arn:aws:codepipeline:us-east-1:account_ID:myPipeline"
],
"detail": {
"pipeline": "myPipeline",
"version": "1",
"state": "STARTED",
"execution-id": execution_Id
}
}
```
**Stage execution state change message content: **When a stage execution starts, it emits an event that sends notifications with the following content\. This example is for the pipeline named `"myPipeline"` in the `us-east-1` region, for the stage `"Prod"`\.
```
{
"version": "0", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
db64ccd1dbd1-2 | ```
{
"version": "0",
"id": event_Id,
"detail-type": "CodePipeline Stage Execution State Change",
"source": "aws.codepipeline",
"account": Pipeline_Account,
"time": TimeStamp,
"region": "us-east-1",
"resources": [
"arn:aws:codepipeline:us-east-1:account_ID:myPipeline"
],
"detail": {
"pipeline": "myPipeline",
"version": "1",
"execution-id": execution_Id,
"stage": "Prod",
"state": "STARTED"
}
}
```
**Action execution state change message content: ** When an action execution starts, it emits an event that sends notifications with the following content\. This example is for the pipeline named `"myPipeline"` in the `us-east-1` region, for the action `"myAction"`\.
```
{
"version": "0",
"id": event_Id,
"detail-type": "CodePipeline Action Execution State Change",
"source": "aws.codepipeline", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
db64ccd1dbd1-3 | "detail-type": "CodePipeline Action Execution State Change",
"source": "aws.codepipeline",
"account": Pipeline_Account,
"time": TimeStamp,
"region": "us-east-1",
"resources": [
"arn:aws:codepipeline:us-east-1:account_ID:myPipeline"
],
"detail": {
"pipeline": "myPipeline",
"version": "1",
"execution-id": execution_Id,
"stage": "Prod",
"action": "myAction",
"state": "STARTED",
"type": {
"owner": "AWS",
"category": "Deploy",
"provider": "CodeDeploy",
"version": 1
}
}
}
```
Valid state values:
**Pipeline\-level states in events**
| Pipeline state | Description |
| --- | --- |
| STARTED | The pipeline execution is currently running\. |
| SUCCEEDED | The pipeline execution was completed successfully\. |
| RESUMED | A failed pipeline execution has been retried in response to the RetryStageExecution API call\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
db64ccd1dbd1-4 | | RESUMED | A failed pipeline execution has been retried in response to the RetryStageExecution API call\. |
| FAILED | The pipeline execution was not completed successfully\. |
| CANCELED | The pipeline execution was canceled because the pipeline structure was updated\. |
| SUPERSEDED | While this pipeline execution was waiting for the next stage to be completed, a newer pipeline execution advanced and continued through the pipeline instead\. |
**Stage\-level states in events**
| Stage state | Description |
| --- | --- |
| STARTED | The stage is currently running\. |
| SUCCEEDED | The stage was completed successfully\. |
| RESUMED | A failed stage has been retried in response to the RetryStageExecution API call\. |
| FAILED | The stage was not completed successfully\. |
| CANCELED | The stage was canceled because the pipeline structure was updated\. |
**Action\-level states in events**
| Action state | Description |
| --- | --- |
| STARTED | The action is currently running\. |
| SUCCEEDED | The action was completed successfully\. |
| FAILED | For Approval actions, the FAILED state means the action was either rejected by the reviewer or failed due to an incorrect action configuration\. |
| CANCELED | The action was canceled because the pipeline structure was updated\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
d4bd7532636d-0 | Before you create event rules for use in your CodePipeline operations, you should do the following:
+ Complete the CloudWatch Events prerequisites\. For this information, see [Regional Endpoints](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/GettingSetup_cwe.html#CWE_Prerequisites)\.
+ Familiarize yourself with events, rules, and targets in CloudWatch Events\. For more information, see [What Is Amazon CloudWatch Events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html)\.
+ Create the target or targets you will use in your event rules, such as an Amazon SNS notification topic\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
454f27f9f2ab-0 | These steps show how to use the CloudWatch console to create a rule to send notifications of changes in CodePipeline\.
**To create a CloudWatch Events rule with CodePipeline as the event 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**\. Under **Event source**, from the **Service Name** drop\-down list, choose **CodePipeline**\.
1. From the **Event Type** drop\-down list, choose the level of state change for the notification\.
+ For a rule that applies to pipeline\-level events, choose **CodePipeline Pipeline Execution State Change**\.
+ For a rule that applies to stage\-level events, choose **CodePipeline Stage Execution State Change**\.
+ For a rule that applies to action\-level events, choose **CodePipeline Action Execution State Change**\.
1. Specify the state changes the rule applies to:
+ For a rule that applies to all state changes, choose **Any state**\.
+ For a rule that applies to some state changes only, choose **Specific state\(s\)**, and then choose one or more state values from the list\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
454f27f9f2ab-1 | + For a rule that applies to some state changes only, choose **Specific state\(s\)**, and then choose one or more state values from the list\.
![\[Image NOT FOUND\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/test-notifications-in-cwe.png)
1. For event patterns that are more detailed than the selectors allow, you can also use the **Edit** option in the **Event Pattern Preview** window to designate an event pattern in JSON format\. The following example shows the JSON structure edited manually to specify a pipeline named "myPipeline\."
![\[A pipeline name can be edited manually in the JSON structure for the rule.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/cloudwatch-rule-event-pattern.png)![\[A pipeline name can be edited manually in the JSON structure for the rule.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[A pipeline name can be edited manually in the JSON structure for the rule.\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)
**Note**
If not otherwise specified, then the event pattern is created for all pipelines/stages/actions and states\.
For more detailed event patterns, you can copy and paste the following example event patterns into the **Edit** window\.
+ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
454f27f9f2ab-2 | For more detailed event patterns, you can copy and paste the following example event patterns into the **Edit** window\.
+
**Example**
Use this sample event pattern to capture failed deploy and build actions across all the pipelines\.
```
{
"source": [
"aws.codepipeline"
],
"detail-type": [
"CodePipeline Action Execution State Change"
],
"detail": {
"state": [
"FAILED"
],
"type": {
"category": ["Deploy", "Build"]
}
}
}
```
+
**Example**
Use this sample event pattern to capture all rejected or failed approval actions across all the pipelines\.
```
{
"source": [
"aws.codepipeline"
],
"detail-type": [
"CodePipeline Action Execution State Change"
],
"detail": {
"state": [
"FAILED"
],
"type": {
"category": ["Approval"]
}
}
}
```
+ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
454f27f9f2ab-3 | "category": ["Approval"]
}
}
}
```
+
**Example**
Use this sample event pattern to capture all the events from the specified pipelines\.
```
{
"source": [
"aws.codepipeline"
],
"detail-type": [
"CodePipeline Pipeline Execution State Change",
"CodePipeline Action Execution State Change",
"CodePipeline Stage Execution State Change"
],
"detail": {
"pipeline": ["myPipeline", "my2ndPipeline"]
}
}
```
1. In the **Targets** area, choose **Add target\***\.
1. In the **Select target type** list, choose the type of target for this rule, and then configure options required by that type\.
1. Choose **Configure details**\.
1. On the **Configure rule details** page, type a name and description for the rule, and then select the **State** box to enable to rule now\.
1. Choose **Create rule**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
fcc3ae8d7e0f-0 | These steps show how to use the CLI to create a CloudWatch Events rule to send notifications of changes in CodePipeline\.
To use the AWS CLI to create a rule, call the put\-rule command, specifying:
+ A name that uniquely identifies the rule you are creating\. This name must be unique across all of the pipelines you create with CodePipeline associated with your AWS account\.
+ The event pattern for the source and detail fields used by the rule\. For more information, see [Amazon CloudWatch Events and Event Patterns](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html)\.
**To create a CloudWatch Events rule with CodePipeline as the event source**
1. Call the put\-rule command to create a rule specifying the event pattern\. \(See the preceding tables for valid states\.\)
The following sample command uses \-\-event\-pattern to create a rule called `“MyPipelineStateChanges”` that emits the CloudWatch event when a pipeline execution fails for the pipeline named "myPipeline\."
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
fcc3ae8d7e0f-1 | ```
aws events put-rule --name "MyPipelineStateChanges" --event-pattern "{\"source\":[\"aws.codepipeline\"],\"detail-type\":[\"CodePipeline Pipeline Execution State Change\"],\"detail\":{\"pipeline\":[\"myPipeline\"],\"state\":[\"FAILED\"]}}"
```
1. Call the put\-targets command to add a target to your new rule, as shown in this example for an Amazon SNS topic:
```
aws events put-targets --rule MyPipelineStateChanges --targets Id=1,Arn=arn:aws:sns:us-west-2:11111EXAMPLE:MyNotificationTopic
```
1. Add permissions for Amazon CloudWatch Events to use the designated target service to invoke the notification\. For more information, see [Using Resource\-Based Policies for Amazon CloudWatch Events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/resource-based-policies-cwe.html)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/detect-state-changes-cloudwatch-events.md |
ef596bf7118f-0 | In this tutorial, you configure a pipeline that continuously delivers your Alexa skill using the Alexa Skills Kit as the deployment provider in your deployment stage\. The completed pipeline detects changes to your skill when you make a change to the source files in your source repository\. The pipeline then uses the Alexa Skills Kit to deploy to the Alexa skill development stage\.
**Note**
To create your custom skill as a Lambda function, see [Host a Custom Skill as an AWS Lambda Function](https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html)\. You can also create a pipeline that uses Lambda source files and a CodeBuild project to deploy changes to Lambda for your skill\. For example, to create a new skill and related Lambda function, you can create an AWS CodeStar project\. See [Create an Alexa Skill Project in AWS CodeStar](https://docs.aws.amazon.com/codestar/latest/userguide/alexa-tutorial.html)\. For that option, the pipeline includes a third build stage with an CodeBuild action and an action in the Deploy stage for AWS CloudFormation\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
3157e5949412-0 | You must already have the following:
+ A CodeCommit repository\. You can use the AWS CodeCommit repository you created in [Tutorial: Create a simple pipeline \(CodeCommit repository\)](tutorials-simple-codecommit.md)\.
+ An Amazon developer account\. This is the account that owns your Alexa skills\. You can create an account for free at [Alexa Skills Kit](https://developer.amazon.com/alexa-skills-kit)\.
+ An Alexa skill\. You can create a sample skill using the [Get Custom Skill Sample Code](https://developer.amazon.com/docs/custom-skills/use-the-alexa-skills-kit-samples.html) tutorial\.
+ Install the ASK CLI and configure it using `ask init` with your AWS credentials\. See [Install and initialize ASK CLI](https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html#install-initialize)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
9848252bad5d-0 | In this section, you create a security profile to use with Login with Amazon \(LWA\)\. If you already have a profile, you can skip this step\.
+ Use the steps in [generate\-lwa\-tokens](https://developer.amazon.com/docs/smapi/ask-cli-command-reference.html#generate-lwa-tokens) to create a Security Profile\.
+ After you create the profile, make a note of the **Client ID** and **Client Secret**\.
+ Make sure you enter the **Allowed Return URLs** as provided in the instructions\. The URLs allow the ASK CLI command to redirect refresh token requests\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
45fe530192ed-0 | In this section, you create and push your Alexa skill source files to the repository that the pipeline uses for your source stage\. For the skill you have created in the Amazon developer console, you produce and push the following:
+ A `skill.json` file\.
+ An `interactionModel/custom` folder\.
**Note**
This directory structure complies with Alexa Skills Kit skill package format requirements, as outlined in [Skill package format](https://developer.amazon.com/docs/smapi/skill-package-api-reference.html#skill-package-format)\. If your directory structure does not use the correct skill package format, changes do not successfully deploy to the Alexa Skills Kit console\.
**To create source files for your skill**
1. Retrieve your skill ID from the Alexa Skills Kit developer console\. Use this command:
```
ask api list-skills
```
Locate your skill by name and then copy the associated ID in the `skillId` field\.
1. Generate a `skill.json` file that contains your skill details\. Use this command:
```
ask api get-skill -s skill-ID > skill.json
```
1. \(Optional\) Create an `interactionModel/custom` folder\.
Use this command to generate the interaction model file within the folder\. For locale, this tutorial uses en\-US as the locale in the file name\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
45fe530192ed-1 | ```
ask api get-model --skill-id skill-ID --locale locale >
./interactionModel/custom/locale.json
```
**To push files to your CodeCommit repository**
1. Push or upload the files to your CodeCommit repository\. These files are the source artifact created by the **Create Pipeline** wizard for your deployment action in AWS CodePipeline\. Your files should look like this in your local directory:
```
skill.json
/interactionModel
/custom
|en-US.json
```
1. Choose the method you want to use to upload your files:
1. To use the Git command line from a cloned repository on your local computer:
1. Run the following command to stage all of your files at once:
```
git add -A
```
1. Run the following command to commit the files with a commit message:
```
git commit -m "Added Alexa skill files"
```
1. Run the following command to push the files from your local repo to your CodeCommit repository:
```
git push
```
1. To use the CodeCommit console to upload your files: | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
45fe530192ed-2 | ```
git push
```
1. To use the CodeCommit console to upload your files:
1. Open the CodeCommit console, and choose your repository from the **Repositories** list\.
1. Choose **Add file**, and then choose **Upload file**\.
1. Choose **Choose file**, and then browse for your file\. Commit the change by entering your user name and email address\. Choose **Commit changes**\.
1. Repeat this step for each file you want to upload\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
dec9f50ab49f-0 | CodePipeline uses a refresh token based on the client ID and secret in your Amazon developer account to authorize actions it performs on your behalf\. In this section, you use the ASK CLI to create the token\. You use these credentials when you use the **Create Pipeline** wizard\.
**To create a refresh token with your Amazon developer account credentials**
1. Use the following command:
```
ask util generate-lwa-tokens
```
1. When prompted, enter your client ID and secret as shown in this example:
```
? Please type in the client ID:
amzn1.application-client.example112233445566
? Please type in the client secret:
example112233445566
```
1. The sign\-in browser page displays\. Sign in with your Amazon developer account credentials\.
1. Return to the command line screen\. The access token and refresh token are generated in the output\. Copy the refresh token returned in the output\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
5b9cc9aa708f-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 Alexa skill files that support your skill\.
+ A deployment stage with an Alexa Skills Kit deploy 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. Choose the AWS Region where you want to create the project and its resources\. The Alexa skill runtime is available only in the following Regions:
+ Asia Pacific \(Tokyo\)
+ Europe \(Ireland\)
+ US East \(N\. Virginia\)
+ US West \(Oregon\)
1. On the **Welcome** page, **Getting started** page, or the **Pipelines** page, choose **Create pipeline**\.
1. In **Step 1: Choose pipeline settings**, in **Pipeline name**, enter **MyAlexaPipeline**\.
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**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
5b9cc9aa708f-1 | 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 **AWS CodeCommit**\. In **Repository name**, choose the name of the CodeCommit repository you created in [Step 1: Create a CodeCommit repository](tutorials-simple-codecommit.md#codecommit-create-repository)\. In **Branch name**, choose the name of the branch that contains your latest code update\. Unless you created a different branch on your own, only `master` is available\.
After you select the repository name and branch, a message shows the Amazon CloudWatch Events rule to be created for this pipeline\.
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 **Alexa Skills Kit**\.
1. In **Alexa skill ID**, enter the skill ID assigned to your skill in the Alexa Skills Kit developer console\.
1. In **Client ID**, enter the ID of the application you registered\.
1. In **Client secret**, enter the secret you chose when you registered\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
5b9cc9aa708f-2 | 1. In **Client secret**, enter the secret you chose when you registered\.
1. In **Refresh token**, enter the token you generated in step 3\.
![\[The Step 4: Deploy page for an Alexa Skills Kit action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/alexa-deploy.png)![\[The Step 4: Deploy page for an Alexa Skills Kit action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The Step 4: Deploy page for an Alexa Skills Kit 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 Alexa Skills Kit action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/images/alexa-deploy-pipeline.png)![\[The completed pipeline for an Alexa Skills Kit action\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/)![\[The completed pipeline for an Alexa Skills Kit 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-alexa-skills-kit.md |
42e74f607c48-0 | Make a change to your skill and then push the change to your repository\. This triggers your pipeline to run\. Verify that your skill is updated in the [Alexa Skills Kit developer console](https://developer.amazon.com/alexa/console/ask)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/tutorials-alexa-skills-kit.md |
437e48c28b16-0 | CodePipeline has quotas for the number of pipelines, stages, actions, and webhooks that an AWS account can have in each AWS Region\. These quotas apply per Region and can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\.
It can take up to two weeks to process requests for a quota increase\.
| Resource | Default |
| --- | --- | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
437e48c28b16-1 | It can take up to two weeks to process requests for a quota increase\.
| Resource | Default |
| --- | --- |
| Length of time before an action times out | Approval action: 7 days AWS CloudFormation deployment action: 3 days CodeBuild build action and test action: 8 hours CodeDeploy and CodeDeploy ECS \(blue/green\) deployment actions: 5 days AWS Lambda invoke action: 24 hours While the action is running, CodePipeline periodically contacts Lambda for a status\. The Lambda function replies with a status, where the action execution is either successful, failed, or still in progress\. After 24 hours, if the Lambda function has either sent no reply or replied that the action execution is still in progress, the CodePipeline action times out\. If the action times out, CodePipeline sets the Lambda invoke action state to failed\. Lambda has a separate timeout for Lambda functions that is not related to the CodePipeline action timeout\. Amazon S3 deployment action: 20 minutes If the upload to S3 times out during deployment of a large ZIP file, the action fails with a timeout error\. Try breaking up the ZIP file into smaller files\. Step Functions invoke action: 7 days Custom actions: 24 hours All other actions: 1 hour The Amazon ECS deployment action timeout is configurable up to one hour \(the default timeout\)\. |
| Maximum number of total pipelines per Region in an AWS account | 300 Pipelines configured for either polling or event\-based change detection are counted toward this quota\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
437e48c28b16-2 | | Maximum number of total pipelines per Region in an AWS account | 300 Pipelines configured for either polling or event\-based change detection are counted toward this quota\. |
| Maximum number of pipelines set to polling for source changes, per AWS Region | 60 We recommend that you configure your pipeline to use event\-based change detection, such as webhooks or Amazon CloudWatch Events\. For more information, see [ Change detection methods to start pipelines](pipelines-about-starting.md#change-detection-methods)\.1 |
| Maximum number of webhooks per Region in an AWS account | 300 |
| Number of custom actions per Region in an AWS account | 50 |
| 1Based on your source provider, use the following instructions to update your polling pipelines to use event\-based change detection:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/limits.html) |
The following quotas in AWS CodePipeline apply to Region availability, naming constraints, and allowed artifact sizes\. These quotas are fixed and cannot be changed\.
For information about structural requirements, see [CodePipeline pipeline structure reference](reference-pipeline-structure.md)\.
| | |
| --- |--- | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
437e48c28b16-3 | | | |
| --- |--- |
| AWS Regions where you can create a pipeline | US East \(Ohio\) US East \(N\. Virginia\) US West \(N\. California\) US West \(Oregon\) Canada \(Central\) Europe \(Stockholm\) Europe \(Ireland\) Europe \(London\) Europe \(Paris\) Europe \(Frankfurt\) Asia Pacific \(Mumbai\) Asia Pacific \(Tokyo\) Asia Pacific \(Seoul\) Asia Pacific \(Singapore\) Asia Pacific \(Sydney\) South America \(São Paulo\) AWS GovCloud \(US\-West\) |
| Characters allowed in an action name | Action names cannot exceed 100 characters\. Allowed characters include: Lowercase letters `a` through `z`, inclusive\. Uppercase letters `A` through `Z`, inclusive\. Numbers `0` through `9`, inclusive\. Special characters `.` \(period\), `@` \(at sign\), `-` \(minus sign\), and `_` \(underscore\)\. Any other characters, such as spaces, are not allowed\. |
| Characters allowed in action types | Action type names cannot exceed 25 characters\. Allowed characters include: Lowercase letters a through z, inclusive\. Uppercase letters A through Z, inclusive\. Numbers 0 through 9, inclusive\. Special characters \. \(period\), @ \(at sign\), \- \(minus sign\), and \_ \(underscore\)\. Any other characters, such as spaces, are not allowed\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
437e48c28b16-4 | | Characters allowed in partner action names | Partner action names must follow the same naming conventions and restrictions as other action names in CodePipeline\. Specifically, they cannot exceed 100 characters\. Allowed characters include: Lowercase letters a through z, inclusive\.Uppercase letters A through Z, inclusive\.Numbers 0 through 9, inclusive\.Special characters \. \(period\), @ \(at sign\), \- \(minus sign\), and \_ \(underscore\)\.Any other characters, such as spaces, are not allowed\. |
| Characters allowed in a pipeline name | Pipeline names cannot exceed 100 characters\. Allowed characters include: Lowercase letters a through z, inclusive\. Uppercase letters A through Z, inclusive\. Numbers 0 through 9, inclusive\. Special characters \. \(period\), @ \(at sign\),\- \(minus sign\), and \_ \(underscore\)\. Any other characters, such as spaces, are not allowed\. |
| Characters allowed in a stage name | Stage names cannot exceed 100 characters\. Allowed characters include: Lowercase letters a through z, inclusive\. Uppercase letters A through Z, inclusive\. Numbers 0 through 9, inclusive\. Special characters \. \(period\), @ \(at sign\), \- \(minus sign\), and \_ \(underscore\)\. Any other characters, such as spaces, are not allowed\. |
| Maximum length of the action configuration key \(for example, the CodeBuild configuration keys are `ProjectName`, `PrimarySource`, and `EnvironmentVariables`\) | 50 characters | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
437e48c28b16-5 | | Maximum length of the action configuration value \(for example, the value of the `RepositoryName` configuration in the CodeCommit action configuration should be less than 1000 characters: `"RepositoryName": "my-repo-name-less-than-1000-characters"`\) | 1000 characters |
| Maximum number of actions per pipeline | 500 |
| Maximum number of months that pipeline execution history information is retained | 12 |
| Maximum number of parallel actions in a stage | 50 |
| Maximum number of sequential actions in a stage | 50 |
| Maximum size of artifacts in a source stage | Artifacts stored in Amazon S3 buckets: 5 GB Artifacts stored in CodeCommit or GitHub repositories: 1 GB Exception: If you are using AWS Elastic Beanstalk to deploy applications, the maximum artifact size is always 512 MB\. Exception: If you are using AWS CloudFormation to deploy applications, the maximum artifact size is always 256 MB\. Exception: If you are using the `CodeDeployToECS` action to deploy applications, the maximum artifact size is always 3 MB\. |
| Maximum size of the image definitions JSON file used in pipelines deploying Amazon ECS containers and images | 100 KB |
| Maximum size of input artifacts for AWS CloudFormation actions | 256 MB |
| Maximum size of input artifacts for the CodeDeployToECS action | 3 MB | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
437e48c28b16-6 | | Maximum size of input artifacts for the CodeDeployToECS action | 3 MB |
| Maximum size of the JSON object that can be stored in the `ParameterOverrides` property | For a CodePipeline deploy action with AWS CloudFormation as the provider, the ParameterOverrides property is used to store a JSON object that specifies values for the AWS CloudFormation template configuration file\. There is a maximum size limit of 1 kilobyte for the JSON object that can be stored in the ParameterOverrides property\. |
| Number of actions in a stage | Minimum of 1, maximum of 50 |
| Number of artifacts allowed for each action | For the number of input and output artifacts allowed for each action, see the [Number of input and output artifacts for each action type](reference-pipeline-structure.md#reference-action-artifacts) |
| Number of stages in a pipeline | Minimum of 2, maximum of 50 |
| Pipeline tags | Tags are case sensitive\. Maximum of 50 per resource\. |
| Pipeline tag key names | Any combination of Unicode letters, numbers, spaces, and allowed characters in UTF\-8 between 1 and 128 characters in length\. Allowed characters are \+ \- = \. \_ : / @ Tag key names must be unique, and each key can have only one value\. A tag cannot: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codepipeline/latest/userguide/limits.html) | | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-codepipeline-user-guide/doc_source/limits.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.