{"id":5858,"date":"2020-06-25T12:58:29","date_gmt":"2020-06-25T11:58:29","guid":{"rendered":"https:\/\/lcloud.pl\/?p=5858"},"modified":"2024-12-10T15:43:24","modified_gmt":"2024-12-10T14:43:24","slug":"multi-region-deployment","status":"publish","type":"post","link":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/","title":{"rendered":"Multi-region deployment using AWS CodePipeline"},"content":{"rendered":"<h5 style=\"text-align: justify;\"><span style=\"color: #199ad8;\"><strong><span style=\"font-size: 24px;\">The implementation process is one of the key stages of the software cycle and is associated with its installation and adaptation to the needs of the user. In order to improve the entire process, AWS has prepared services related to the <a style=\"color: #199ad8;\" href=\"https:\/\/lcloud.pl\/en\/security-management-using-devops\/\">DevOps<\/a> culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3 or AWS CodePipeline, which is the main character of this entry.<\/span><\/strong><\/span><\/h5>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\"><a href=\"https:\/\/aws.amazon.com\/codedeploy\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5855 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/AWS-codedeploy.png\" alt=\"\" width=\"74\" height=\"75\" \/><\/a><span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/aws.amazon.com\/codedeploy\/\">AWS CodeDeploy<\/a><\/span> &#8211; is a service that automates the implementation of software for various computing services, such as Amazon EC2, AWS Lambda and on-premise servers.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\"><a href=\"https:\/\/aws.amazon.com\/cloudformation\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5853 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/aws-cloudformation.png\" alt=\"\" width=\"75\" height=\"75\" \/><\/a><span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/aws.amazon.com\/cloudformation\/\">AWS CloudFormation<\/a><\/span> &#8211; provides a common language to describe and provide all infrastructure resources in a cloud environment.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\"><a href=\"https:\/\/aws.amazon.com\/s3\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5851 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/amazon-s3-1.png\" alt=\"\" width=\"74\" height=\"75\" \/><\/a><span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/aws.amazon.com\/s3\/\">Amazon S3<\/a><\/span> &#8211; is a simple web service interface that can be used to store and retrieve any amount of data, at any time and from anywhere on the network.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\"><a href=\"https:\/\/aws.amazon.com\/codepipeline\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5857 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/aws-codepipeline.png\" alt=\"\" width=\"74\" height=\"74\" \/><\/a><span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/aws.amazon.com\/codepipeline\/\">AWS CodePipeline<\/a><\/span> &#8211; is a fully managed service that allows automation of pipelines for fast and reliable updates of applications and infrastructure. Thanks to the ability to support actions between AWS regions, it enables the application to be implemented with a single pipeline in many regions. This affects not only the availability of the application but also the delays associated with it.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #199ad8;\"><b>How AWS CodePipeline works?<\/b><\/span><\/h4>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #979797;\"><span style=\"font-weight: 400;\">The service divides the entire workflow into individual stages. An example would be the building phase, during which the written code is run and tested. Another example is the deployment stage, where updates are implemented in a production environment. Each element of the process can be marked for better tracking, control and reporting of its progress.<\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400; color: #979797;\">Each pipeline contains at least one action (action performed on the artifact). Pipeline activities are performed in a specific order; sequentially or in parallel &#8211; according to the configuration at a given stage. A detailed description of how AWS CodePipeline works can be found in the <\/span><span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/docs.aws.amazon.com\/codepipeline\/latest\/userguide\/concepts.html#concepts-how-it-works\"><span style=\"font-weight: 400;\">runbook<\/span><\/a><\/span><span style=\"font-weight: 400; color: #979797;\">.<\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px;\"><span style=\"color: #979797;\">In this post we will show:<\/span>\u00a0<\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">How to create a software delivery continuity pipeline with the help of AWS CodePipeline, provided by AWS CloudFormation.<\/span><\/li>\n<li><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">How to configure the action pipeline and run it in a different region than it was configured.<\/span><\/li>\n<li><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">How to implement an example application in many regions with the help of AWS CodeDeploy.<\/span><\/li>\n<\/ol>\n<h4><\/h4>\n<h4 style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #199ad8;\"><b>High-level deployment architecture<\/b><\/span><\/h4>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/lcloud.pl\/wp-content\/uploads\/high-level-deployment-architecture.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5845 size-medium\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/high-level-deployment-architecture-300x267.png\" alt=\"\" width=\"300\" height=\"267\" \/><\/a><span style=\"font-size: 22px; color: #979797;\">The diagram illustrates (in general terms) the process of implementing an architecture for the needs of the deployment process. The first phase is loading the latest version of the application code into the Amazon S3 service. Each new update loaded into the bucket starts the AWS CodePipeline service.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">For each CodePipeline Action in AWS CodeDeploy, the application code from Amazon S3 is replicated to the artifact store in the region for the given action. Each action implements the latest version of the application to the Amazon EC2 instance in the region<\/span>.<\/span><\/p>\n<p style=\"text-align: justify;\"><strong><span style=\"font-size: 22px; color: #979797;\">To create a pipeline in many regions, follow these steps:<\/span><\/strong><\/p>\n<ol style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Configure the resources that will be needed for implementation with the help of AWS CodeDeploy.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Configure &#8220;artifact stores&#8221; (S3 buckets) for AWS CodePipeline in each region.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Create an AWS CloudFormation for AWS CodePipeline.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Check deployments carried out by pipeline in the AWS Management Console.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Check the correctness of implemented deployments.<\/span><\/li>\n<\/ol>\n<h4 style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #199ad8;\"><b>What&#8217;s next?\u00a0<\/b><\/span><\/h4>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">The first step is to install the AWS CodeDeploy agent on the instances. The agent is a software package enabling deployments. At this stage you need to do 2 things:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">create Amazon EC2 instances and install the AWS CodeDeploy agent,<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">create AWS CodeDeploy applications.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">To improve this performance, you can use the AWS CloudFormation template.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"color: #199ad8;\"><b>ATTENTION!<\/b><\/span><span style=\"font-weight: 400; color: #979797;\"> Before you get started, it&#8217;s a good idea to make sure your keys are properly configured to allow SSH access to Amazon EC2 instances in your region. Detailed instructions on how to do this can be found <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/ec2-key-pairs.html\">here<\/a><\/span>.<\/span><\/span><\/p>\n<h4 style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #199ad8;\"><b>Phase 1<\/b><\/span><\/h4>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">To run Amazon EC2 and AWS CodeDeploy instances, you can use AWS CloudFormation templates prepared by AWS (available in the links below):<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\"><span style=\"font-size: 22px; color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/github.com\/aws-samples\/aws-codepipeline-cross-region-continuous-deployment\/blob\/master\/cfn-templates\/code-deploy\/codedeploy-us-west-2.json\"><span style=\"font-weight: 400;\">us-west-2 template<\/span><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-size: 22px; color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/github.com\/aws-samples\/aws-codepipeline-cross-region-continuous-deployment\/blob\/master\/cfn-templates\/code-deploy\/codedeploy-ap-southeast-2.json\"><span style=\"font-weight: 400;\">ap-southeast-2 template<\/span><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-size: 22px; color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/github.com\/aws-samples\/aws-codepipeline-cross-region-continuous-deployment\/blob\/master\/cfn-templates\/code-deploy\/codedeploy-us-east-1.json\"><span style=\"font-weight: 400;\">us-east-1 template<\/span><\/a><\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400; color: #979797;\">In the AWS console, on the <\/span><span style=\"color: #199ad8;\"><b>Specify Details<\/b><\/span><span style=\"font-weight: 400; color: #979797;\"> page, do the following:<\/span><\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">In<\/span>\u00a0<span style=\"color: #199ad8;\"><strong>Stack name<\/strong><\/span><span style=\"color: #979797;\">, enter a name for the stack (for example,\u00a0USEast1CodeDeploy).<\/span><\/span><\/li>\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">In<\/span>\u00a0<span style=\"color: #199ad8;\"><strong>ApplicationName<\/strong><\/span><span style=\"color: #979797;\">, enter a name for the application (for example,\u00a0CrossRegionActionSupport).<\/span><\/span><\/li>\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">In\u00a0<\/span><span style=\"color: #199ad8;\"><strong>DeploymentGroupName<\/strong><\/span><span style=\"color: #979797;\">, enter a name for the deployment group (for example,\u00a0CrossRegionActionSupportDeploymentGroup).<\/span><\/span><\/li>\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">In<\/span>\u00a0<span style=\"color: #199ad8;\"><strong>EC2KeyPairName<\/strong><\/span><span style=\"color: #979797;\">, if you already have a key pair to use with Amazon EC2 instances in that region, choose an existing key pair, and then select your key pair. For more information, see<\/span><span style=\"color: #199ad8;\">\u00a0<a style=\"color: #199ad8;\" href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/ec2-key-pairs.html\">Amazon EC2 Key Pairs<\/a><\/span><span style=\"color: #979797;\">.<\/span><\/span><\/li>\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">In\u00a0<\/span><span style=\"color: #199ad8;\"><strong>EC2TagKeyName<\/strong><\/span><span style=\"color: #979797;\">, enter Name.<\/span><\/span><\/li>\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">In\u00a0<\/span><span style=\"color: #199ad8;\"><strong>EC2TagValue<\/strong><\/span><span style=\"color: #979797;\">, enter\u00a0NVirginiaCrossRegionInstance.<\/span><\/span><\/li>\n<li><span style=\"font-size: 22px;\"><span style=\"color: #979797;\">Choose<\/span>\u00a0<span style=\"color: #199ad8;\"><strong>Next<\/strong><\/span><span style=\"color: #979797;\">.<\/span><\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5830 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/etap-1.gif\" alt=\"\" width=\"1200\" height=\"433\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400;\"><span style=\"color: #979797;\">Creating resources can take several minutes. Progress can be observed in the console in the <span style=\"color: #199ad8;\"><b>Events<\/b><\/span> tab. When the stack is created, the &#8220;CREATE_COMPLETE&#8221; message will appear in the <span style=\"color: #199ad8;\"><b>Status<\/b><\/span> column.<\/span><\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Newly created instances should be visible in each of the regions in which deployment was carried out.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5828 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/etap-1.1.gif\" alt=\"\" width=\"1200\" height=\"336\" \/><b style=\"color: #199ad8; font-size: 22px;\"><\/b><\/p>\n<p style=\"text-align: justify;\"><b style=\"color: #199ad8; font-size: 22px;\">Phase 2<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Configure artifact stores for AWS CodePipeline. Amazon S3 uses buckets as storage for artifacts. Buckets are regional and versioned. All artifacts are copied to the region where the pipeline action is to be performed.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #979797;\"><span style=\"font-weight: 400;\">To create such storage using AWS CloudFormation, you must download a template for each region.<\/span><\/span><\/p>\n<p><span style=\"font-size: 22px; color: #979797;\">On the <span style=\"color: #199ad8;\"><strong>Specify Details<\/strong><\/span> page, do the following:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 22px; color: #979797;\">In <strong><span style=\"color: #199ad8;\">Stack name<\/span><\/strong>, enter a name for the stack (for example, artifactstore).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In <strong><span style=\"color: #199ad8;\">ArtifactStoreBucketNamePrefix<\/span><\/strong>, enter a prefix string of up to 30 characters. Use only lowercase letters, numbers, periods, and hyphens (for example, useast1).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">Choose <strong><span style=\"color: #199ad8;\">Next<\/span><\/strong>.<\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400; color: #979797;\">As before, the creation of resources may take several minutes, and the progress of the operation is visible in the <span style=\"color: #199ad8;\"><b>Events<\/b><\/span> tab in the AWS console. <\/span><span style=\"font-weight: 400; color: #979797;\">\u00a0<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5832 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/etap-2.gif\" alt=\"\" width=\"1200\" height=\"458\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Remember to copy Amazon S3 bucket names from all regions. They will be needed in the next steps.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #199ad8;\"><strong><span style=\"font-size: 22px;\">IMPORTANT!<\/span><\/strong><\/span> <span style=\"font-weight: 400; font-size: 22px;\"><span style=\"color: #979797;\">All buckets, including the bucket for Source action in pipelines, must be able to track versions uploaded and processed by AWS CodePipeline.<\/span><\/span><\/p>\n<h4 style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #199ad8;\"><b>Phase 3<\/b><\/span><\/h4>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Use the AWS CloudFormation template to define resources:<\/span><\/p>\n<ul>\n<li style=\"text-align: justify;\"><span style=\"color: #979797; font-size: 22px;\">Amazon S3 Bucket (source bucket for application source code),<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"color: #979797; font-size: 22px;\">AWS CodePipeline for which you must define the appropriate actions within the pipeline phases: Source action (S3) and the appropriate number of Deploy action (CodeDeploy type) for each region.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400;\"><span style=\"color: #979797;\">To create a new bucket S3, you must start the console, and then select the AWS CloudFormation service, <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/github.com\/aws-samples\/aws-codepipeline-cross-region-continuous-deployment\/blob\/master\/cfn-templates\/source-bucket-creation.yaml\">download the template<\/a><\/span> and run it in the main region.<\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: 22px; color: #979797;\">On the <span style=\"color: #199ad8;\"><strong>Specify Details<\/strong><\/span> page, do the following:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 22px; color: #979797;\">In <span style=\"color: #199ad8;\"><strong>Stack name<\/strong><\/span>, enter a name for the stack (for example, code-pipeline-us-west2-source-bucket).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In <span style=\"color: #199ad8;\"><strong>SourceCodeBucketNamePrefix<\/strong><\/span>, enter a prefix string of up to 30 characters. Use only lowercase letters, numbers, periods, and hyphens (for example, uswest2).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">Choose <strong><span style=\"color: #199ad8;\">Next<\/span><\/strong>.<\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400;\"><span style=\"color: #979797;\">Creating resources can take several minutes, and progress is visible in the <span style=\"color: #199ad8;\"><b>Events<\/b><\/span> tab of the AWS console.\u00a0<\/span><\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5834 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/etap-3.gif\" alt=\"\" width=\"1200\" height=\"457\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400; color: #979797;\">When the creation process is completed, download the sample application from <\/span><span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/github.com\/aws-samples\/aws-codepipeline-cross-region-continuous-deployment\/blob\/master\/s3-app-linux.zip\"><span style=\"font-weight: 400;\">s3-app-linux.zip<\/span><\/a><\/span><span style=\"font-weight: 400; color: #979797;\"> and load it into the source code bucket.<\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">To create a new pipeline in AWS CodePipeline:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400;\"><span style=\"color: #979797;\">In the console, run the <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/github.com\/aws-samples\/aws-codepipeline-cross-region-continuous-deployment\/blob\/master\/cfn-templates\/cross-region-code-pipeline.yaml\">downloaded AWS CloudFormation template<\/a><\/span> in the main region, us-west-2.<\/span>\u00a0<\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px; color: #979797;\">On the\u00a0<span style=\"color: #199ad8;\"><strong>Specify Details<\/strong><\/span>\u00a0page, do the following:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>Stack name<\/strong><\/span>, enter a name for the stack (for example, CrossRegionCodePipeline).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>ApplicationName<\/strong><\/span>, enter a name for the application (for example,\u00a0CrossRegionActionSupport).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>APSouthEast2ArtifactStoreBucket<\/strong><\/span>, enter cross-region-artifact-store-bucket-ap-southeast-2 or enter the name you provided in step 2 for the S3 bucket created in ap-southeast-2.<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>DeploymentGroupName<\/strong><\/span>, enter a name for the deployment group (for example,\u00a0CrossRegionActionSupportDeploymentGroup).<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>S3SourceBucketName<\/strong><\/span>, enter code-pipeline-us-west-2-source-bucket or enter the name you provided in step 3.<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>USEast1ArtifactStoreBucket<\/strong><\/span>, enter cross-region-artifact-store-bucket-us-east-1 or enter the name you provided in step 2 for the S3 bucket created in us-east-1.<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>USWest2ArtifactStoreBucket<\/strong><\/span>, enter cross-region-artifact-store-bucket-us-west-2 or enter the name you provided in step 2 for the S3 bucket created in us-west-2.<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">In\u00a0<span style=\"color: #199ad8;\"><strong>S3SourceBucketKey<\/strong><\/span>, enter s3-app-linux.zip.<\/span><\/li>\n<li><span style=\"font-size: 22px; color: #979797;\">Choose\u00a0<span style=\"color: #199ad8;\"><strong>Next<\/strong><\/span>.<\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5838 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/pipeline-maker-3.gif\" alt=\"\" width=\"1200\" height=\"638\" \/><\/p>\n<h4 style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><b><span style=\"color: #199ad8;\">Phase 4<\/span>\u00a0<\/b><\/span><\/h4>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">We can now check the deployments carried out by the prepared pipeline in the AWS console. In the S3 console, go to the source bucket and copy the version ID.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">Then go to AWS CodePipeline and go to the pipeline that has just been created. Note that the version ID is the same in all regions, both in source action and all deploy actions. Deployment has been successfully completed.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5836 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/etap-4.gif\" alt=\"\" width=\"1200\" height=\"579\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400; font-size: 22px; color: #979797;\">To make sure that the action is successful, enter the public IP address of the Amazon EC2 instance in the browser, which was provided by AWS CodeDeploy in stage 1. The following message should appear in the browser.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-5842 size-full\" src=\"https:\/\/lcloud.pl\/wp-content\/uploads\/etap-4.1.png\" alt=\"\" width=\"948\" height=\"220\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400;\"><span style=\"color: #979797;\">To sum up &#8211; we&#8217;ve just done a multi-regional deployment, without having to worry about the process of copying code between regions. To make further changes, simply apply the changes to the source code in the main region, and they will be implemented automatically using AWS CodeDeploy. Code changes can also be used to build and test between regions. Once we know the deployment options, the next step is to remove the buckets and stack. Although the buckets were created using AWS CloudFormation, there is no way to remove them along with the stack. To do this, enter the Amazon S3 console and follow the steps in <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/dev\/delete-or-empty-bucket.html\">the instructions for removing \/ emptying buckets<\/a><\/span>. To remove the AWS CloudFormation stack, follow the steps in <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/cfn-console-delete-stack.html\">the instructions<\/a><\/span>.<\/span>\u00a0<\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"font-weight: 400;\"><span style=\"color: #979797;\">If you have additional questions, it&#8217;s always a good idea to use <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/forums.aws.amazon.com\/forum.jspa?forumID=197&amp;start=0\">the AWS CodePipeline forum<\/a><\/span> or<span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/console.aws.amazon.com\/support\/home?#\"> AWS Support<\/a><\/span>. <\/span><\/span><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 22px;\"><span style=\"color: #979797;\"><span style=\"font-weight: 400;\">The practical use of AWS services can also be found on our YouTube channel, where Wojtek Orzechowski talks about <span style=\"color: #199ad8;\"><a style=\"color: #199ad8;\" href=\"https:\/\/www.youtube.com\/watch?v=9kdZNWKjOWk\">the project<\/a><\/span> we implemented for Goop.com<\/span><span style=\"font-weight: 400;\">.<\/span><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The implementation process is one of the key stages of the software cycle and is associated with its installation and adaptation to the needs of the user. In order to improve the entire process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3 or AWS CodePipeline, which [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":9941,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[30,147,37,35,14],"class_list":["post-5858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-aws-en","tag-chmura-obliczeniowa-en","tag-cloud","tag-cloud-computing","tag-devops-en"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Multi-region deployment using AWS CodePipeline | LCloud<\/title>\n<meta name=\"description\" content=\"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Multi-region deployment using AWS CodePipeline | LCloud\" \/>\n<meta property=\"og:description\" content=\"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/\" \/>\n<meta property=\"og:site_name\" content=\"LCloud\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-25T11:58:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-10T14:43:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lcloud.pl\/wp-content\/uploads\/deployment-wieloreg-mini-social.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"LCloud\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Multi-region deployment using AWS CodePipeline | LCloud\" \/>\n<meta name=\"twitter:description\" content=\"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/lcloud.pl\/wp-content\/uploads\/deployment-wieloreg-mini-social.png\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"LCloud\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/\",\"url\":\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/\",\"name\":\"Multi-region deployment using AWS CodePipeline | LCloud\",\"isPartOf\":{\"@id\":\"https:\/\/lcloud.pl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lcloud.pl\/wp-content\/uploads\/Deployment-wieloregionowy-przy-uzyciu-AWS-CodePipeline-1.jpg\",\"datePublished\":\"2020-06-25T11:58:29+00:00\",\"dateModified\":\"2024-12-10T14:43:24+00:00\",\"author\":{\"@id\":\"https:\/\/lcloud.pl\/#\/schema\/person\/4514b7cb65efcf283a08aebc7269087f\"},\"description\":\"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lcloud.pl\/en\/multi-region-deployment\/#primaryimage\",\"url\":\"https:\/\/lcloud.pl\/wp-content\/uploads\/Deployment-wieloregionowy-przy-uzyciu-AWS-CodePipeline-1.jpg\",\"contentUrl\":\"https:\/\/lcloud.pl\/wp-content\/uploads\/Deployment-wieloregionowy-przy-uzyciu-AWS-CodePipeline-1.jpg\",\"width\":1440,\"height\":274,\"caption\":\"Deployment wieloregionowy przy u\u017cyciu AWS CodePipeline.\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lcloud.pl\/#website\",\"url\":\"https:\/\/lcloud.pl\/\",\"name\":\"LCloud\",\"description\":\"AWS Advanced Consulting Partner | APN Well-Architected Partner\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lcloud.pl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/lcloud.pl\/#\/schema\/person\/4514b7cb65efcf283a08aebc7269087f\",\"name\":\"LCloud\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lcloud.pl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/61f46c824c899f1219b825e20fe617f3f16e4cd29b62c016d533e3f2b154c604?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/61f46c824c899f1219b825e20fe617f3f16e4cd29b62c016d533e3f2b154c604?s=96&d=mm&r=g\",\"caption\":\"LCloud\"},\"url\":\"https:\/\/lcloud.pl\/en\/author\/developers\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Multi-region deployment using AWS CodePipeline | LCloud","description":"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...","og_locale":"en_US","og_type":"article","og_title":"Multi-region deployment using AWS CodePipeline | LCloud","og_description":"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...","og_url":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/","og_site_name":"LCloud","article_published_time":"2020-06-25T11:58:29+00:00","article_modified_time":"2024-12-10T14:43:24+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/lcloud.pl\/wp-content\/uploads\/deployment-wieloreg-mini-social.png","type":"image\/png"}],"author":"LCloud","twitter_card":"summary_large_image","twitter_title":"Multi-region deployment using AWS CodePipeline | LCloud","twitter_description":"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...","twitter_image":"https:\/\/lcloud.pl\/wp-content\/uploads\/deployment-wieloreg-mini-social.png","twitter_misc":{"Written by":"LCloud","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/","url":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/","name":"Multi-region deployment using AWS CodePipeline | LCloud","isPartOf":{"@id":"https:\/\/lcloud.pl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/#primaryimage"},"image":{"@id":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/#primaryimage"},"thumbnailUrl":"https:\/\/lcloud.pl\/wp-content\/uploads\/Deployment-wieloregionowy-przy-uzyciu-AWS-CodePipeline-1.jpg","datePublished":"2020-06-25T11:58:29+00:00","dateModified":"2024-12-10T14:43:24+00:00","author":{"@id":"https:\/\/lcloud.pl\/#\/schema\/person\/4514b7cb65efcf283a08aebc7269087f"},"description":"To improve the deployment process, AWS has prepared services related to the DevOps culture. These include AWS CodeDeploy, AWS CloudFormation, Amazon S3...","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lcloud.pl\/en\/multi-region-deployment\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lcloud.pl\/en\/multi-region-deployment\/#primaryimage","url":"https:\/\/lcloud.pl\/wp-content\/uploads\/Deployment-wieloregionowy-przy-uzyciu-AWS-CodePipeline-1.jpg","contentUrl":"https:\/\/lcloud.pl\/wp-content\/uploads\/Deployment-wieloregionowy-przy-uzyciu-AWS-CodePipeline-1.jpg","width":1440,"height":274,"caption":"Deployment wieloregionowy przy u\u017cyciu AWS CodePipeline."},{"@type":"WebSite","@id":"https:\/\/lcloud.pl\/#website","url":"https:\/\/lcloud.pl\/","name":"LCloud","description":"AWS Advanced Consulting Partner | APN Well-Architected Partner","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lcloud.pl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/lcloud.pl\/#\/schema\/person\/4514b7cb65efcf283a08aebc7269087f","name":"LCloud","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lcloud.pl\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/61f46c824c899f1219b825e20fe617f3f16e4cd29b62c016d533e3f2b154c604?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/61f46c824c899f1219b825e20fe617f3f16e4cd29b62c016d533e3f2b154c604?s=96&d=mm&r=g","caption":"LCloud"},"url":"https:\/\/lcloud.pl\/en\/author\/developers\/"}]}},"_links":{"self":[{"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/posts\/5858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/comments?post=5858"}],"version-history":[{"count":2,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/posts\/5858\/revisions"}],"predecessor-version":[{"id":9943,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/posts\/5858\/revisions\/9943"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/media\/9941"}],"wp:attachment":[{"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/media?parent=5858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/categories?post=5858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lcloud.pl\/en\/wp-json\/wp\/v2\/tags?post=5858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}