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

A record in Route53 isn't updated after pushing the new EC2 instance #15

Closed
Talgat777 opened this issue Aug 23, 2021 · 1 comment
Closed
Labels
question Further information is requested

Comments

@Talgat777
Copy link

What is the current behavior?
Route53 isn't updating A record when Auto Scaling Group pushes the new EC2 instance

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Kill the EC2 process in Auto Scaling Group by setting desired capacity to 0 and then set it to 1 (min capacity should be set to 0)

What is the expected behavior?
After the new instance of EC2 is pushed, the A record in route53 should be updated with the latest EC2 public ip

Software versions?

@Ohid25
Copy link
Contributor

Ohid25 commented Jul 1, 2022

Sincere apologies for the extremely late reply! We had some problems internally in our team.

Regarding your problem - does the EC2 instance have IAM permissions to allow for changing Route53 records?

data "aws_iam_policy_document" "bastion_role_policy" {
  count = var.hosted_zone_id != "" ? 1 : 0

  statement {
    actions = [
      "autoscaling:DescribeAutoScalingInstances",
      "autoscaling:DescribeAutoScalingGroups",
      "ec2:DescribeAddresses",
      "ec2:DescribeInstances",
      "ec2:DescribeTags"
    ]
    effect    = "Allow"
    resources = ["*"]
  }

  statement {
    actions = [
      "route53:ChangeResourceRecordSets",
      "route53:GetHostedZone"
    ]
    effect    = "Allow"
    resources = ["arn:${data.aws_partition.current.partition}:route53:::hostedzone/${var.hosted_zone_id}"]
  }
}

@Ohid25 Ohid25 added the question Further information is requested label Jul 1, 2022
@Ohid25 Ohid25 closed this as completed Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants