Is it possible to use an existing ELB in a new CFT without the ELB being exported by an existing CF stack?












0















I was wondering if it is possible to use a existing ELB thats not being exported by a CF stack to be referenced in a new CFT and used in the resulting CF stack. The only resources online seem like an existing CFT needs export the ELB in order for a new CFT to import it. However, it seems like it should be possible for a new CFT to reference and use an existing ELB that is not exported by another CFT. I tried referencing by name as a parameter but couldn't find a supported parameter type for ELBs.










share|improve this question



























    0















    I was wondering if it is possible to use a existing ELB thats not being exported by a CF stack to be referenced in a new CFT and used in the resulting CF stack. The only resources online seem like an existing CFT needs export the ELB in order for a new CFT to import it. However, it seems like it should be possible for a new CFT to reference and use an existing ELB that is not exported by another CFT. I tried referencing by name as a parameter but couldn't find a supported parameter type for ELBs.










    share|improve this question

























      0












      0








      0








      I was wondering if it is possible to use a existing ELB thats not being exported by a CF stack to be referenced in a new CFT and used in the resulting CF stack. The only resources online seem like an existing CFT needs export the ELB in order for a new CFT to import it. However, it seems like it should be possible for a new CFT to reference and use an existing ELB that is not exported by another CFT. I tried referencing by name as a parameter but couldn't find a supported parameter type for ELBs.










      share|improve this question














      I was wondering if it is possible to use a existing ELB thats not being exported by a CF stack to be referenced in a new CFT and used in the resulting CF stack. The only resources online seem like an existing CFT needs export the ELB in order for a new CFT to import it. However, it seems like it should be possible for a new CFT to reference and use an existing ELB that is not exported by another CFT. I tried referencing by name as a parameter but couldn't find a supported parameter type for ELBs.







      amazon-web-services amazon-cloudformation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 2 at 22:51









      JerryJerry

      32




      32
























          1 Answer
          1






          active

          oldest

          votes


















          0














          It should be possible. Using an export from a CF stack is basically asking AWS to pass the string representation of that resource to the other stack, on your behalf. So if you export a AWS::ElasticLoadBalancingV2::LoadBalancer (and it returns its ARN), you can just pass a Load Balancer to another stack by providing the same ARN.



          In other words, I don't see any reason why this wouldn't work:



          Parameters:
          MyServicesLoadBalancer:
          Type: "String"
          Description: "ARN of the Load Balancer"

          Resources:
          MyServicesLoadBalancerListener:
          Type: "AWS::ElasticLoadBalancingV2::Listener"
          Properties:
          LoadBalancerArn: !Ref MyServicesLoadBalancer
          Port: 80
          Protocol: HTTP
          DefaultActions:
          - Type: fixed-response
          FixedResponseConfig:
          ContentType: "text/plain"
          MessageBody: "You've reached the listener! Congrats!"
          StatusCode: "200"





          share|improve this answer
























          • Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

            – Jerry
            Jan 3 at 17:32











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014211%2fis-it-possible-to-use-an-existing-elb-in-a-new-cft-without-the-elb-being-exporte%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          It should be possible. Using an export from a CF stack is basically asking AWS to pass the string representation of that resource to the other stack, on your behalf. So if you export a AWS::ElasticLoadBalancingV2::LoadBalancer (and it returns its ARN), you can just pass a Load Balancer to another stack by providing the same ARN.



          In other words, I don't see any reason why this wouldn't work:



          Parameters:
          MyServicesLoadBalancer:
          Type: "String"
          Description: "ARN of the Load Balancer"

          Resources:
          MyServicesLoadBalancerListener:
          Type: "AWS::ElasticLoadBalancingV2::Listener"
          Properties:
          LoadBalancerArn: !Ref MyServicesLoadBalancer
          Port: 80
          Protocol: HTTP
          DefaultActions:
          - Type: fixed-response
          FixedResponseConfig:
          ContentType: "text/plain"
          MessageBody: "You've reached the listener! Congrats!"
          StatusCode: "200"





          share|improve this answer
























          • Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

            – Jerry
            Jan 3 at 17:32
















          0














          It should be possible. Using an export from a CF stack is basically asking AWS to pass the string representation of that resource to the other stack, on your behalf. So if you export a AWS::ElasticLoadBalancingV2::LoadBalancer (and it returns its ARN), you can just pass a Load Balancer to another stack by providing the same ARN.



          In other words, I don't see any reason why this wouldn't work:



          Parameters:
          MyServicesLoadBalancer:
          Type: "String"
          Description: "ARN of the Load Balancer"

          Resources:
          MyServicesLoadBalancerListener:
          Type: "AWS::ElasticLoadBalancingV2::Listener"
          Properties:
          LoadBalancerArn: !Ref MyServicesLoadBalancer
          Port: 80
          Protocol: HTTP
          DefaultActions:
          - Type: fixed-response
          FixedResponseConfig:
          ContentType: "text/plain"
          MessageBody: "You've reached the listener! Congrats!"
          StatusCode: "200"





          share|improve this answer
























          • Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

            – Jerry
            Jan 3 at 17:32














          0












          0








          0







          It should be possible. Using an export from a CF stack is basically asking AWS to pass the string representation of that resource to the other stack, on your behalf. So if you export a AWS::ElasticLoadBalancingV2::LoadBalancer (and it returns its ARN), you can just pass a Load Balancer to another stack by providing the same ARN.



          In other words, I don't see any reason why this wouldn't work:



          Parameters:
          MyServicesLoadBalancer:
          Type: "String"
          Description: "ARN of the Load Balancer"

          Resources:
          MyServicesLoadBalancerListener:
          Type: "AWS::ElasticLoadBalancingV2::Listener"
          Properties:
          LoadBalancerArn: !Ref MyServicesLoadBalancer
          Port: 80
          Protocol: HTTP
          DefaultActions:
          - Type: fixed-response
          FixedResponseConfig:
          ContentType: "text/plain"
          MessageBody: "You've reached the listener! Congrats!"
          StatusCode: "200"





          share|improve this answer













          It should be possible. Using an export from a CF stack is basically asking AWS to pass the string representation of that resource to the other stack, on your behalf. So if you export a AWS::ElasticLoadBalancingV2::LoadBalancer (and it returns its ARN), you can just pass a Load Balancer to another stack by providing the same ARN.



          In other words, I don't see any reason why this wouldn't work:



          Parameters:
          MyServicesLoadBalancer:
          Type: "String"
          Description: "ARN of the Load Balancer"

          Resources:
          MyServicesLoadBalancerListener:
          Type: "AWS::ElasticLoadBalancingV2::Listener"
          Properties:
          LoadBalancerArn: !Ref MyServicesLoadBalancer
          Port: 80
          Protocol: HTTP
          DefaultActions:
          - Type: fixed-response
          FixedResponseConfig:
          ContentType: "text/plain"
          MessageBody: "You've reached the listener! Congrats!"
          StatusCode: "200"






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 1:41









          tyrontyron

          1,113925




          1,113925













          • Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

            – Jerry
            Jan 3 at 17:32



















          • Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

            – Jerry
            Jan 3 at 17:32

















          Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

          – Jerry
          Jan 3 at 17:32





          Turns out all I had to do was use the ELB's name in the LoadBalancerNames section of the AutoScalingGroup

          – Jerry
          Jan 3 at 17:32




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014211%2fis-it-possible-to-use-an-existing-elb-in-a-new-cft-without-the-elb-being-exporte%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas