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

asked 5 years ago305 views
2 Answers
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...

answered 5 years ago
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.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions