Skip to content

Manual choose of deployment account in AWS codepipeline

0

I'm working on aws codepipeline and i want to have a manual approval rule that will determine to which environment artifacts should be deployed (dev stage or prod) what are the options? the only one solution i see for now is manual approval rule with comment with env name that will invoke lambda that will proceed the pipeline.

if it is the only way, can lambda have access to approval comments to read?

if there are other ways, can you provide me with some articles or documentation on how it can be done?

1 Answer
2
Accepted Answer

Implement a manual approval rule in AWS CodePipeline to determine the deployment environment:

Add a manual approval action to your pipeline:
    You can add a manual approval action to a stage in your pipeline where you want the execution to stop and wait for someone with the required IAM permissions to approve or reject the action.
    When the pipeline reaches the manual approval action, it will stop and wait for the approval. If approved, the pipeline execution will resume. If rejected or no action taken within 7 days, the pipeline execution will fail.
    You can customize the approval message and the URL for the reviewer to access more information about the change.

Integrate with a Lambda function:
    You can add a Lambda function action to your pipeline that will be invoked after the manual approval.
    The Lambda function can then read the approval comments and determine the deployment environment based on the comments.
    To access the approval comments, you can use the
    #SourceVariables.CommitId
    and
    #TestVariables.testRunId
    variables in the Lambda function configuration.

For more detailed information on implementing these options, I recommend referring to the AWS CodePipeline documentation:

Adding a manual approval action to a pipeline

Integrating a Lambda function with CodePipeline

AWS

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 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.