简体   繁体   中英

How to register RDS instance with CloudMap

I know this is possible through the AWS CLI and Console as I have done it like this but I would now need to do it in Terraform. I would like to execute the equivalent of the CLI command as aws servicediscovery register-instance .

Pointing to any documentation or examples that can be shared would be most beneficial and appreciated.

This is now possible using the aws_service_discovery_instance resource as of version v3.57.0 of the AWS provider.

resource "aws_service_discovery_instance" "example" {
  instance_id = "mydb"
  service_id  = aws_service_discovery_service.example.id

  attributes = {
    AWS_INSTANCE_CNAME = aws_db_instance.example.address
  }
}

Adding instances to the discovery service is not yet supported :

But pull requests has already been preprared for that, so hopefully soon:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM