Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26304

Output variables missing while using AWS CloudFormation as build-step

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • cloudformation-plugin
    • Jenkins ver. 1.586
      AWS CloudFormation Plugin ver. 0.14

      When I create a project and creating CloudFormation stack through "Build Environment" section everything is working fine (outputs are added as environment variables).
      When I use "AWS CloudFormation" through "Add build-step" it seems that the outputs variables are missing.
      This has stopped our development due to that I need to execute shells and inject variables to the stack but I can't while it's running as "Build Environment", and when I move it as "build-step" I don't have the outputs I need.

          [JENKINS-26304] Output variables missing while using AWS CloudFormation as build-step

          edovale added a comment -

          edovale added a comment - Work on this should start soon. See here: https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/9

          amit gilad added a comment - - edited

          Hi Or
          I tried it with a few scenarios and it worked for me, can you please attach an example of what you are trying to do so i can check it out

          amit gilad added a comment - - edited Hi Or I tried it with a few scenarios and it worked for me, can you please attach an example of what you are trying to do so i can check it out

          Mike Chambers added a comment - - edited

          Hi Amit
          To recreate this issue:

          • Use a CF template with Outputs specified, e.g.:
                "Outputs": {
                    "VPCId": {
                        "Description": "Virtual Private Cloud identifiers",
                        "Value": {
                            "Ref": "VPCdev"
                        }
                    }
                }
            
          • Create a Jenkins job
          • Within: 'Build Environment' > 'Create AWS Cloud Formation stack' - Add CF json with all mandatory feilds completed.
          • Within: 'Build' > 'Execute Shell' - add 'env'
          • After running this build the VPCid CF Output is shown (amoungst other things) in the 'Console Output' of the env command.
          • Now edit the job configuration...
          • Delete the 'Build Environment' CF entry
          • Add a 'Build' > 'AWS Cloud Formation' with the same details as before.
          • Ensure the 'Execute Shell' - 'env' is still after the CF build block.
          • Now, after running, the VPCid CF Output is NOT shown in the 'Console Output' of the env command.

          The use case where this matters is where scripts need to be run before building a number of CF stacks, for example the script may create the CF json template in a step prior to each stack build, and use outputs from the previous stack to generate the next CF template.

          Jenkins 1.535 + 1.599
          jenkins-cloudformation-plugin 0.14
          Jenkins, TurnKey Linux 13.0 / Debian 7.2 Wheezy (AWS AMI from Marketplace)
          Tests run as 'admin' user.

          More than happy to do anything I can to help resolve this issue. However my Java leaves a lot to be desired.

          Mike Chambers added a comment - - edited Hi Amit To recreate this issue: Use a CF template with Outputs specified, e.g.: "Outputs" : { "VPCId" : { "Description" : "Virtual Private Cloud identifiers" , "Value" : { "Ref" : "VPCdev" } } } Create a Jenkins job Within: 'Build Environment' > 'Create AWS Cloud Formation stack' - Add CF json with all mandatory feilds completed. Within: 'Build' > 'Execute Shell' - add 'env' After running this build the VPCid CF Output is shown (amoungst other things) in the 'Console Output' of the env command. Now edit the job configuration... Delete the 'Build Environment' CF entry Add a 'Build' > 'AWS Cloud Formation' with the same details as before. Ensure the 'Execute Shell' - 'env' is still after the CF build block. Now, after running, the VPCid CF Output is NOT shown in the 'Console Output' of the env command. The use case where this matters is where scripts need to be run before building a number of CF stacks, for example the script may create the CF json template in a step prior to each stack build, and use outputs from the previous stack to generate the next CF template. Jenkins 1.535 + 1.599 jenkins-cloudformation-plugin 0.14 Jenkins, TurnKey Linux 13.0 / Debian 7.2 Wheezy (AWS AMI from Marketplace) Tests run as 'admin' user. More than happy to do anything I can to help resolve this issue. However my Java leaves a lot to be desired.

          Mike Chambers added a comment -

          OK for anyone looking at this, its worth reading the comments in:
          https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/9

          (I've compiled a temp fixed version in there.)

          Mike Chambers added a comment - OK for anyone looking at this, its worth reading the comments in: https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/9 (I've compiled a temp fixed version in there.)

          lsb want added a comment -

          I got this issue too, I think this pull request also can fix this issue https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/22.

          @nickveenhof
          Sorry nickveenhof , I reference your patch. and make a little different.
          Would I to this.
          https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/23

          lsb want added a comment - I got this issue too, I think this pull request also can fix this issue https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/22 . @nickveenhof Sorry nickveenhof , I reference your patch. and make a little different. Would I to this. https://github.com/jenkinsci/jenkins-cloudformation-plugin/pull/23

            edovale edovale
            ortzabary Or Tzabary
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: