Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Add ELB-Registration to EC2 Template #48

Open
ferricoxide opened this issue Jan 31, 2019 · 0 comments
Open

Add ELB-Registration to EC2 Template #48

ferricoxide opened this issue Jan 31, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@ferricoxide
Copy link
Member

Is your feature request related to a problem? Please describe.

Current automation relies on either manual registration of EC2 instance to the ELB or an action within the supplied Jenkins pipeline-job. In the later case, there is a race-condition wherein the ELB registration-attempt may happen when either the ELB or the EC2 are not sufficiently ready, causing the EC2 Jenkins job to fail

Describe the solution you'd like

  1. Add registration-step to EC2-level automation (something like):
    {
      "Fn::If": [
        "AttachToElb",
        {
          "Fn::Join": [
            "",
            [
              "# Register to Named ELB\n",
              "aws elb --region ",
              { "Ref": "AWS::Region" },
              " register-instances-with-load-balancer --load-balancer-name ",
              { "Ref": "ElbName" },
              " --instances ",
              " $( curl -skl http://169.254.169.254/latest/meta-data/instance-id/ )",
              "\n"
            ]
          ]
        },
        ""
      ]
    },
    to the end of the EC2 template's UserData's script.sh section. Add ElbName parameter{} and AttachToElb condition{} as appropriate
  2. Remove (presumably) redundant registration-step from Jenkins pipeline-job.

Describe alternatives you've considered

If converting to use with ELBv2 (ALB), implement by adding reference to ALB's Tgroup.

@ferricoxide ferricoxide added the enhancement New feature or request label Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant