Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

343
Vistas
Pass AWS CodePipeline variable to actions

I'm trying to pass the CodePipeline variable #{codepipeline PipelineExecutionId} to both the codeBuild action and then a deploy action.

I understand this variable is readily available to all actions as explained in AWS docs.

I'm however having a difficulty with the syntax as the parameters is not passed thru into the actions.

I've been using the following code:

For the build actions:

        - Name: "Build-Docker-Container"
          Actions:
            - Name: "Build-Docker-Container"
              ActionTypeId:
                Category: Build
                Owner: AWS
                Provider: CodeBuild
                Version: "1"
              Configuration:
                ProjectName: !Sub ${ProjectName}-build-${BranchName}
                EnvironmentVariables:
                  - Name: IMAGE_TAG
                    Type: PLAINTEXT
                    Value: "#{codepipeline.PipelineExecutionId}"
              InputArtifacts:
                - Name: !Ref ProjectName
              RunOrder: 3

and for the deploy action:

        - Name: "Deploy-Services"
          Actions:
            - Name: "Deploy-Services"
              ActionTypeId:
                Category: Deploy
                Owner: AWS
                Provider: CloudFormation
                Version: "1"
              Configuration:
                ActionMode: CREATE_UPDATE
                StackName: !Sub "${ProjectName}-services-${BranchName}"
                TemplatePath: !Sub "${ProjectName}::aws/03-services.yml"
                Capabilities: "CAPABILITY_NAMED_IAM"
                RoleArn: !GetAtt DeployRole.Arn
                ParameterOverrides: !Sub |
                  {
                    "ProjectName": "${ProjectName}",
                    "ExecutionId": "#{codepipeline.PipelineExecutionId}"
                  }
              InputArtifacts:
                - Name: !Ref ProjectName
                - Name: InfrastructureOutput
              RunOrder: 4

UPDATE The code was actually good; I just needed to update the CloudFormation pipeline stack to apply it (I thought the github webhook would trigger this, but it only update the actions inside the pipeline)

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I can confirm that the syntax you've used in the deploy action is correct:

                ParameterOverrides: !Sub |
                  {
                    "ProjectName": "${ProjectName}",
                    "ExecutionId": "#{codepipeline.PipelineExecutionId}"
                  }

I verified that on my Pipeline with CloudFormation provider. I can also confirm that this works as expected.

You can check in console if you edit the CFN action's in question, that the parameters are correctly set:

enter image description here

For now I can't verify build action, but by the look of it, it also seems fine.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda