Coder Social home page Coder Social logo

Comments (5)

bblommers avatar bblommers commented on September 28, 2024 1

Thanks for the explanation @yairsappir! moto >= 5.0.10.dev23 now also returns the Target.NotRegistered in that scenario, so as far as I can tell it behaves exactly like AWS.

I've closes this for now, but feel free to open a new issue if you run into any (other) problems.

from moto.

bblommers avatar bblommers commented on September 28, 2024

Hi @yairsappir, thanks for raising this. We currently just delete targets when deregistering them, but it sounds like we should still keep track of them. Marking it as a bug to improve this area.

from moto.

yairsappir avatar yairsappir commented on September 28, 2024

Hi and thanks for the response!
Just wanted to add that when calling describe_target_health on a target that doesn't exist using the regular boto3 api results in a unused state with reason Target.NotRegistered.

So I believe that unused should be returned rather than unavailable in this scenario.

from moto.

bblommers avatar bblommers commented on September 28, 2024

Hi @yairsappir, moto >= 5.0.10.dev18 now returns the correct state for deregistered instances.

when calling describe_target_health on a target that doesn't exist using the regular boto3 api results in a unused state with reason Target.NotRegistered.

When I try to register an unknown EC2 instance, boto3 already throws an error that the instance doesn't exist. Or are you using different targets, like ALB's or Lambda Functions?

from moto.

yairsappir avatar yairsappir commented on September 28, 2024

Hi @bblommers ,

Thank you for looking at this!

I used this code:

import boto3
elbv2_client = boto3.client('elbv2','us-east-1')
elbv2_client.describe_target_health(TargetGroupArn=target_group_arn,Targets=[{'Id':'i-12345678901234567'}])

Where target_group_arn is a real target group for ec2, and i-12345678901234567 is used as-is.

This also returns State: unused with Reason: Target.NotRegistered

Not sure if that is a bug on AWS side or not though..

from moto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.