-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update DNS Record when metadata of compute instance is changed or deleted #6971
Comments
@jgireeshj what |
As I have mentioned, I have done the coding for creating the organization asset feed. I am unsure of how to integrate the code to update a DNS Record. I need your help in doing the following:
Scenario is : I am stuck how to take this forward in integrating the cloud function to perform this action |
@jgireeshj I am not sure what to do with your above code against what you are trying to achieve. Is below resource you are looking for? There are some examples showing how to manage the DNS records with https://www.terraform.io/docs/providers/google/r/dns_record_set.html |
I think you have not understood the concept. Please find the details below: A compute instnace is launched Google cloud.(used google_compute_instance) These two were created by means of a terraform script. Now, the name of the instance is updated manually in the Google cloud console. What fuctionality can be used to update the DNS Record set automatically with the new name of the instnace. |
@jgireeshj sorry if I misunderstood what you were trying to do. Looks at the line resource "google_dns_record_set" "frontend" {
name = "frontend.${google_dns_managed_zone.prod.dns_name}"
type = "A"
ttl = 300
managed_zone = google_dns_managed_zone.prod.name
rrdatas = [google_compute_instance.frontend.network_interface[0].access_config[0].nat_ip]
} Below is what I tested using the example I provided earlier. After I update the instance name, I see below plan on
If this is not what you intended to do, please provide your code and specify the question in details. Thanks |
@edwardmedia I know this concept. For a new or existing instance, this is possible. But this is manual work. I want to automize the task as whenever a new tag is added to a compute instance, a DNS CNAME Record has to be automatically created. As per the details, you have shared it is not possible to check if the DNS Record exists and to create a new one. |
@jgireeshj |
@jgireeshj I am closing this issue now as I assume you have resolved the issue. Feel free to reopen it if you need to continue the conversation. Thanks |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v0.12.29
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Whenever a change in the metadata of the compute instance is occurred, the DNS Records associated to it has to be changed or updatedor deleted.
Actual Behavior
I am able to create google_cloud_asset_organization_feed, but unsure how to integrate it with updating DNS Record sets
Terraform Configuration Files
The text was updated successfully, but these errors were encountered: