Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Private IP of instance launched by autoscaling group #11713

Closed
coolgooze opened this issue Feb 6, 2017 · 4 comments
Closed

Get Private IP of instance launched by autoscaling group #11713

coolgooze opened this issue Feb 6, 2017 · 4 comments

Comments

@coolgooze
Copy link

ASG
resource "aws_autoscaling_group" "REDIS_ASG" {
name = "${var.environment}-REDIS_ASG"
launch_configuration = "${aws_launch_configuration.redis_launch_conf.name}"
#availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"]
vpc_zone_identifier = ["${data.aws_subnet.PrivateDBSubnetAZ1.id}","${data.aws_subnet.PrivateDBSubnetAZ2.id}","${data.aws_subnet.PrivateDBSubnetAZ3.id}"]
min_size = 1
max_size = 1
desired_capacity = 1
health_check_grace_period = 600
health_check_type = "EC2"
force_delete = "false"
termination_policies = ["OldestInstance"]
tag {
key = "Name"
value = "${var.environment}-int-redis"
propagate_at_launch = true
}
}

i am trying to create a A Record
resource "aws_route53_record" "redis" {
zone_id = "${data.aws_route53_zone.dns.zone_id}"
name = "redis-${var.environment}.${data.aws_route53_zone.dns.name}"
type = "A"
ttl = "60"
records = ["${aws_autoscaling_group.REDIS_ASG.private_ip}"]
}

Output-

  • Resource 'aws_autoscaling_group.REDIS_ASG' does not have attribute 'private_ip' for variable 'aws_autoscaling_group.REDIS_ASG.private_ip'
@coolgooze
Copy link
Author

This is currently a blocker, can you please raise a PR

@insidepacket
Copy link

Looks like that there have been a FR for this
Feature Request: IDs & IPs for autoscaling group instances #8400

@igoratencompass
Copy link

Very useful, will provide same functionality as CloudFormation does. We can simply wait for ASG to finish creating all instances and report back with private ip's, instance id's etc. so we can have further actions follow in terraform like creating dns records for the instances etc.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants