How to separate the stages in the pipeline?

0

Hello all,

I'm trying to separate the stages in the pipeline, but failing.

My project follows the Python webservice template in which the below section, seems to create both "Prod" and "Stage" automatically:

Parameters:
  ProjectId:
    Type: String
    Description: CodeStar projectId used to associate new resources to team members
  CodeDeployRole:
    Type: String
    Description: IAM role to allow AWS CodeDeploy to manage deployment of AWS Lambda functions
  Stage:
    Type: String
    Description: The name for a project pipeline stage, such as Staging or Prod, for which resources are provisioned and deployed.
    Default: ''

I tried:

https://docs.aws.amazon.com/codestar/latest/userguide/customize-ec2-multi-endpoints-newstage.html

And ended up with the new "*-prod" stack failing to create. I also tried:

https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-edit.html

But the downloaded template does not have a deployment stage section.

What I am trying is to be able to have "Stage" as default from a "develop" branch and "Prod" only from "master".

Can someone please provide instructions on how to do that?

Thank you

已提問 5 年前檢視次數 319 次
2 個答案
0

Looks like what I faced yesterday is related to this bug:

https://github.com/awslabs/serverless-application-model/issues/191

Not sure how to proceed in order to achieve dev, staging and then prod.

Maybe multiple projects...

已回答 5 年前
0

As part of knowledge acquisition I followed the steps found in "Add a Prod Stage and Endpoint to a Project" from the user guide https://docs.aws.amazon.com/codestar/latest/userguide/codestar-ug.pdf.

I then created a new pipeline adding only "Source" and "Build", reusing the roles and other resources already created by CodeStar. On the "Source" I changed the branch to be the "Prod" one, leaving the pipeline created by CodeStar to be the "Dev".

For the "Deploy" stages I made sure the stack name was different and on the "Advanced" field on each pipeline I passed the corresponding Stage, e.g.:

{"ProjectId":"uni-api", "CodeDeployRole":"arn:aws:iam::xxxxxxx:role/CodeStarWorker-xxxxxx-CodeDeploy", "Stage":"Prod"}

After all that it finally worked! One pipeline per source branch (for each Stage) working.

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南