Andrew Ramnikov
Andrew Ramnikov

Reputation: 793

Is it possible in CloudFormation to rerun an action if it failes?

I have created a CloudFormation Pipeline. Some tasks need to be rerun on fail. Is it possible to set it on CodePipeline Level or on CodeBuild Level? Below are examples that I use for my setup.

    - Name: Build
      Actions:
      ## Creating CodeBuild to execute Terraform Repo in TFE
        - Name: CodeBuildTerraform
          ActionTypeId:
            Category: Build
            Owner: AWS
            Version: "1"
            Provider: CodeBuild
          InputArtifacts:
            - Name: SourceArtifactTerraform
          OutputArtifacts:
            - Name: BuildOutputArtifactTerraform
          RunOrder: 1
          Configuration:
            ProjectName: !Join
                           - "_"
                           - - !Ref "AWS::StackName"
                             - !Ref "AWS::Region"
                             - "ProjectTerrafom"

Upvotes: 0

Views: 958

Answers (2)

Anuj
Anuj

Reputation: 11

While it's possible that an AWS glitch could have contributed to the intermittent deployment failures, there could be various other factors at play as well. Deployment issues can be caused by a range of reasons, including network connectivity problems, temporary resource unavailability, misconfigured settings, or even issues with the deployment pipeline itself.

If you suspect that the issue is related to AWS, it's a good idea to check the AWS service status dashboard or any relevant incident reports to see if there were any ongoing outages or disruptions around the time of your deployment attempts. Additionally, reviewing the error messages or logs from the failed deployments might provide more insight into the specific nature of the problem.

Upvotes: 1

Marcin
Marcin

Reputation: 238111

Sadly, CodePipeline (CD) does not automatically retry failed actions. You have to do it manually for each pipeline as explained in AWS docs:

Upvotes: 2

Related Questions