Unable to register targets on AWS Target groupHow to register an EC2 Instance with an ELBV2?Any AWS Powershell command fails with message “Invalid URI: The hostname could not be parsed.”PowerShell ISE vs ScriptIssues while running Register-ELBInstanceWithLoadBalancer on powershellPowershell Script Issue with SQL Server 2012/2014Excecuting a Powershell script within a SSIS packagePassing an array as parameter from CMD to PowerShell give problemsWatch a folder on another server for changesError in executing Exchange PS remoting: Method invocation failed?creating mutilple load balancers ,target groups and listeners in terraformI can't get Powershell StartsWith function to work
Finitely generated matrix groups whose eigenvalues are all algebraic
Blending or harmonizing
Does the Idaho Potato Commission associate potato skins with healthy eating?
Can a virus destroy the BIOS of a modern computer?
Was the Stack Exchange "Happy April Fools" page fitting with the '90's code?
In Bayesian inference, why are some terms dropped from the posterior predictive?
Is there a hemisphere-neutral way of specifying a season?
How can I prove that a state of equilibrium is unstable?
Processor speed limited at 0.4 Ghz
Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?
How do I exit BASH while loop using modulus operator?
What is the opposite of "eschatology"?
Does marriage to a non-Numenorean disqualify a candidate for the crown of Gondor?
Is it possible to create a QR code using text?
Why are UK visa biometrics appointments suspended at USCIS Application Support Centers?
What is an equivalently powerful replacement spell for Yuan-Ti's Suggestion spell?
How could indestructible materials be used in power generation?
Notepad++ delete until colon for every line with replace all
Mathematica command that allows it to read my intentions
Bullying boss launched a smear campaign and made me unemployable
Avoiding the "not like other girls" trope?
GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?
Implication of namely
Placement of More Information/Help Icon button for Radio Buttons
Unable to register targets on AWS Target group
How to register an EC2 Instance with an ELBV2?Any AWS Powershell command fails with message “Invalid URI: The hostname could not be parsed.”PowerShell ISE vs ScriptIssues while running Register-ELBInstanceWithLoadBalancer on powershellPowershell Script Issue with SQL Server 2012/2014Excecuting a Powershell script within a SSIS packagePassing an array as parameter from CMD to PowerShell give problemsWatch a folder on another server for changesError in executing Exchange PS remoting: Method invocation failed?creating mutilple load balancers ,target groups and listeners in terraformI can't get Powershell StartsWith function to work
I am trying to setup an automated DNS deployment using powershell. I have written a powershell script that creates TargetGroup, registers instances to the TG, creates an ALB and adds a listener to it. Once, that is done, it creates R53 RecordSet and creates an A record to the ALB DNS.
I am having issues in having the instances registered to the TargetGroup.
This is my code snippet to that section:
$searchFor1 =@( @name = 'tag:Name'; values = $target1)
$searchFor2 =@( @name = 'tag:Name'; values = $target2)
$id1 = (Get-EC2Instance -Filter $searchFor1).Instances | select InstanceId
$id2 = (Get-EC2Instance -Filter $searchFor2).Instances | select InstanceId
# Create Target Group
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $custname -Port $siteport -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $vpcid
Start-Sleep -s 120
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid2 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $id1.InstanceId
$addid2.Id = $id2.InstanceId
$addid1.Port = $siteport
$addid2.Port = $siteport
$tgarn = (Get-ELB2TargetGroup -Name $custname).TargetGroupArn
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid2)
It throws below error:
Register-ELB2Target : An instance ID must be specified
At C:scriptsDistinct-DNS-Deployment.ps1:107 char:1
+ Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...LB2TargetCmdlet:RegisterELB2TargetCmdlet) [Register
-ELB2Target], InvalidOperationException
+ FullyQualifiedErrorId : Amazon.ElasticLoadBalancingV2.AmazonElasticLoadBalancingV2Exception,Amazon.PowerShell.Cm
dlets.ELB2.RegisterELB2TargetCmdlet
I have checked a similar post here. And the corresponding posts, so far nothing helped. I am wondering if anyone can guide me what am I doing wrong?
I have tried to run each line one by one and that happens to register the instance to the TargetGroup, just the script fails.
Instances are t2.micro and they are in running state.
amazon-web-services powershell aws-alb
add a comment |
I am trying to setup an automated DNS deployment using powershell. I have written a powershell script that creates TargetGroup, registers instances to the TG, creates an ALB and adds a listener to it. Once, that is done, it creates R53 RecordSet and creates an A record to the ALB DNS.
I am having issues in having the instances registered to the TargetGroup.
This is my code snippet to that section:
$searchFor1 =@( @name = 'tag:Name'; values = $target1)
$searchFor2 =@( @name = 'tag:Name'; values = $target2)
$id1 = (Get-EC2Instance -Filter $searchFor1).Instances | select InstanceId
$id2 = (Get-EC2Instance -Filter $searchFor2).Instances | select InstanceId
# Create Target Group
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $custname -Port $siteport -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $vpcid
Start-Sleep -s 120
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid2 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $id1.InstanceId
$addid2.Id = $id2.InstanceId
$addid1.Port = $siteport
$addid2.Port = $siteport
$tgarn = (Get-ELB2TargetGroup -Name $custname).TargetGroupArn
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid2)
It throws below error:
Register-ELB2Target : An instance ID must be specified
At C:scriptsDistinct-DNS-Deployment.ps1:107 char:1
+ Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...LB2TargetCmdlet:RegisterELB2TargetCmdlet) [Register
-ELB2Target], InvalidOperationException
+ FullyQualifiedErrorId : Amazon.ElasticLoadBalancingV2.AmazonElasticLoadBalancingV2Exception,Amazon.PowerShell.Cm
dlets.ELB2.RegisterELB2TargetCmdlet
I have checked a similar post here. And the corresponding posts, so far nothing helped. I am wondering if anyone can guide me what am I doing wrong?
I have tried to run each line one by one and that happens to register the instance to the TargetGroup, just the script fails.
Instances are t2.micro and they are in running state.
amazon-web-services powershell aws-alb
Are you sure there is something actually returned from the search of the instances: $addid1.Id = $id1.InstanceId <-- this line should be verified --- I could visualize the error 'An instance ID must be specified' only in case if $addid1.Id is $null not have valid instance id
– Ketanbhut
Mar 10 at 9:35
add a comment |
I am trying to setup an automated DNS deployment using powershell. I have written a powershell script that creates TargetGroup, registers instances to the TG, creates an ALB and adds a listener to it. Once, that is done, it creates R53 RecordSet and creates an A record to the ALB DNS.
I am having issues in having the instances registered to the TargetGroup.
This is my code snippet to that section:
$searchFor1 =@( @name = 'tag:Name'; values = $target1)
$searchFor2 =@( @name = 'tag:Name'; values = $target2)
$id1 = (Get-EC2Instance -Filter $searchFor1).Instances | select InstanceId
$id2 = (Get-EC2Instance -Filter $searchFor2).Instances | select InstanceId
# Create Target Group
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $custname -Port $siteport -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $vpcid
Start-Sleep -s 120
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid2 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $id1.InstanceId
$addid2.Id = $id2.InstanceId
$addid1.Port = $siteport
$addid2.Port = $siteport
$tgarn = (Get-ELB2TargetGroup -Name $custname).TargetGroupArn
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid2)
It throws below error:
Register-ELB2Target : An instance ID must be specified
At C:scriptsDistinct-DNS-Deployment.ps1:107 char:1
+ Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...LB2TargetCmdlet:RegisterELB2TargetCmdlet) [Register
-ELB2Target], InvalidOperationException
+ FullyQualifiedErrorId : Amazon.ElasticLoadBalancingV2.AmazonElasticLoadBalancingV2Exception,Amazon.PowerShell.Cm
dlets.ELB2.RegisterELB2TargetCmdlet
I have checked a similar post here. And the corresponding posts, so far nothing helped. I am wondering if anyone can guide me what am I doing wrong?
I have tried to run each line one by one and that happens to register the instance to the TargetGroup, just the script fails.
Instances are t2.micro and they are in running state.
amazon-web-services powershell aws-alb
I am trying to setup an automated DNS deployment using powershell. I have written a powershell script that creates TargetGroup, registers instances to the TG, creates an ALB and adds a listener to it. Once, that is done, it creates R53 RecordSet and creates an A record to the ALB DNS.
I am having issues in having the instances registered to the TargetGroup.
This is my code snippet to that section:
$searchFor1 =@( @name = 'tag:Name'; values = $target1)
$searchFor2 =@( @name = 'tag:Name'; values = $target2)
$id1 = (Get-EC2Instance -Filter $searchFor1).Instances | select InstanceId
$id2 = (Get-EC2Instance -Filter $searchFor2).Instances | select InstanceId
# Create Target Group
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $custname -Port $siteport -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $vpcid
Start-Sleep -s 120
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid2 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $id1.InstanceId
$addid2.Id = $id2.InstanceId
$addid1.Port = $siteport
$addid2.Port = $siteport
$tgarn = (Get-ELB2TargetGroup -Name $custname).TargetGroupArn
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid2)
It throws below error:
Register-ELB2Target : An instance ID must be specified
At C:scriptsDistinct-DNS-Deployment.ps1:107 char:1
+ Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...LB2TargetCmdlet:RegisterELB2TargetCmdlet) [Register
-ELB2Target], InvalidOperationException
+ FullyQualifiedErrorId : Amazon.ElasticLoadBalancingV2.AmazonElasticLoadBalancingV2Exception,Amazon.PowerShell.Cm
dlets.ELB2.RegisterELB2TargetCmdlet
I have checked a similar post here. And the corresponding posts, so far nothing helped. I am wondering if anyone can guide me what am I doing wrong?
I have tried to run each line one by one and that happens to register the instance to the TargetGroup, just the script fails.
Instances are t2.micro and they are in running state.
amazon-web-services powershell aws-alb
amazon-web-services powershell aws-alb
edited Mar 8 at 21:03
Amitabh Ghosh
asked Mar 8 at 20:40
Amitabh GhoshAmitabh Ghosh
336
336
Are you sure there is something actually returned from the search of the instances: $addid1.Id = $id1.InstanceId <-- this line should be verified --- I could visualize the error 'An instance ID must be specified' only in case if $addid1.Id is $null not have valid instance id
– Ketanbhut
Mar 10 at 9:35
add a comment |
Are you sure there is something actually returned from the search of the instances: $addid1.Id = $id1.InstanceId <-- this line should be verified --- I could visualize the error 'An instance ID must be specified' only in case if $addid1.Id is $null not have valid instance id
– Ketanbhut
Mar 10 at 9:35
Are you sure there is something actually returned from the search of the instances: $addid1.Id = $id1.InstanceId <-- this line should be verified --- I could visualize the error 'An instance ID must be specified' only in case if $addid1.Id is $null not have valid instance id
– Ketanbhut
Mar 10 at 9:35
Are you sure there is something actually returned from the search of the instances: $addid1.Id = $id1.InstanceId <-- this line should be verified --- I could visualize the error 'An instance ID must be specified' only in case if $addid1.Id is $null not have valid instance id
– Ketanbhut
Mar 10 at 9:35
add a comment |
1 Answer
1
active
oldest
votes
As per the https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/ElasticLoadBalancingV2/TTargetDescription.html -
the Amazon.ElasticLoadBalancingV2.Model.TargetDescription is about 'Information about a target' -
which means, you should be assigning a single instance id Also, if you take a close look at the properties:
AvailabilityZone System.String
Id System.String
Port System.Int32
The result of your instance search may or may not be single output - you should keep them in loop to create each target via TargetDescription
$Instances = (Get-EC2Instance -Filter @Name="tag:auto-delete";Value="no").instances |select instanceid
$theVpc = get-ec2vpc -VpcId vpc-4565e5c4
$name = "new-tg"
$port = "80"
$protocol = "HTTP"
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $name -Port $port -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $theVpc.VpcId
$tgarn = (Get-ELB2TargetGroup -Name $name).TargetGroupArn
If($instances -ne $null)
foreach ($instance in $instances )
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $Instance.instanceid
$addid1.Port = $port
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Remove-Variable addid1
else
echo "There were no instances with the matching filter"
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070684%2funable-to-register-targets-on-aws-target-group%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
As per the https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/ElasticLoadBalancingV2/TTargetDescription.html -
the Amazon.ElasticLoadBalancingV2.Model.TargetDescription is about 'Information about a target' -
which means, you should be assigning a single instance id Also, if you take a close look at the properties:
AvailabilityZone System.String
Id System.String
Port System.Int32
The result of your instance search may or may not be single output - you should keep them in loop to create each target via TargetDescription
$Instances = (Get-EC2Instance -Filter @Name="tag:auto-delete";Value="no").instances |select instanceid
$theVpc = get-ec2vpc -VpcId vpc-4565e5c4
$name = "new-tg"
$port = "80"
$protocol = "HTTP"
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $name -Port $port -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $theVpc.VpcId
$tgarn = (Get-ELB2TargetGroup -Name $name).TargetGroupArn
If($instances -ne $null)
foreach ($instance in $instances )
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $Instance.instanceid
$addid1.Port = $port
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Remove-Variable addid1
else
echo "There were no instances with the matching filter"
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
add a comment |
As per the https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/ElasticLoadBalancingV2/TTargetDescription.html -
the Amazon.ElasticLoadBalancingV2.Model.TargetDescription is about 'Information about a target' -
which means, you should be assigning a single instance id Also, if you take a close look at the properties:
AvailabilityZone System.String
Id System.String
Port System.Int32
The result of your instance search may or may not be single output - you should keep them in loop to create each target via TargetDescription
$Instances = (Get-EC2Instance -Filter @Name="tag:auto-delete";Value="no").instances |select instanceid
$theVpc = get-ec2vpc -VpcId vpc-4565e5c4
$name = "new-tg"
$port = "80"
$protocol = "HTTP"
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $name -Port $port -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $theVpc.VpcId
$tgarn = (Get-ELB2TargetGroup -Name $name).TargetGroupArn
If($instances -ne $null)
foreach ($instance in $instances )
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $Instance.instanceid
$addid1.Port = $port
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Remove-Variable addid1
else
echo "There were no instances with the matching filter"
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
add a comment |
As per the https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/ElasticLoadBalancingV2/TTargetDescription.html -
the Amazon.ElasticLoadBalancingV2.Model.TargetDescription is about 'Information about a target' -
which means, you should be assigning a single instance id Also, if you take a close look at the properties:
AvailabilityZone System.String
Id System.String
Port System.Int32
The result of your instance search may or may not be single output - you should keep them in loop to create each target via TargetDescription
$Instances = (Get-EC2Instance -Filter @Name="tag:auto-delete";Value="no").instances |select instanceid
$theVpc = get-ec2vpc -VpcId vpc-4565e5c4
$name = "new-tg"
$port = "80"
$protocol = "HTTP"
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $name -Port $port -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $theVpc.VpcId
$tgarn = (Get-ELB2TargetGroup -Name $name).TargetGroupArn
If($instances -ne $null)
foreach ($instance in $instances )
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $Instance.instanceid
$addid1.Port = $port
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Remove-Variable addid1
else
echo "There were no instances with the matching filter"
As per the https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/ElasticLoadBalancingV2/TTargetDescription.html -
the Amazon.ElasticLoadBalancingV2.Model.TargetDescription is about 'Information about a target' -
which means, you should be assigning a single instance id Also, if you take a close look at the properties:
AvailabilityZone System.String
Id System.String
Port System.Int32
The result of your instance search may or may not be single output - you should keep them in loop to create each target via TargetDescription
$Instances = (Get-EC2Instance -Filter @Name="tag:auto-delete";Value="no").instances |select instanceid
$theVpc = get-ec2vpc -VpcId vpc-4565e5c4
$name = "new-tg"
$port = "80"
$protocol = "HTTP"
$tg = New-ELB2TargetGroup -TargetType "instance" -HealthyThresholdCount 4 -Name $name -Port $port -Protocol "HTTP" -UnhealthyThresholdCount 4 -VpcId $theVpc.VpcId
$tgarn = (Get-ELB2TargetGroup -Name $name).TargetGroupArn
If($instances -ne $null)
foreach ($instance in $instances )
$addid1 = New-Object Amazon.ElasticLoadBalancingV2.Model.TargetDescription
$addid1.Id = $Instance.instanceid
$addid1.Port = $port
Register-ELB2Target -TargetGroupArn $tgarn -Target @($addid1)
Remove-Variable addid1
else
echo "There were no instances with the matching filter"
edited Mar 12 at 17:45
answered Mar 10 at 9:57
KetanbhutKetanbhut
1417
1417
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
add a comment |
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
Hello, The issue was how the targets are being looked at. I had $target = $target.ToLower(). Which was returning the name tag all in lowercase, whereas the actual instance name tag had 1st character uppercase. The $addid1.id was thus returning null value. After rectifying that, I was able to register targets. Thanks KS for your insight as well, I will try it out as an alternate way to address this.
– Amitabh Ghosh
Mar 12 at 5:17
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070684%2funable-to-register-targets-on-aws-target-group%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Are you sure there is something actually returned from the search of the instances: $addid1.Id = $id1.InstanceId <-- this line should be verified --- I could visualize the error 'An instance ID must be specified' only in case if $addid1.Id is $null not have valid instance id
– Ketanbhut
Mar 10 at 9:35