@@ -46,12 +46,6 @@ func Provider() *schema.Provider {
4646 DefaultFunc : schema .EnvDefaultFunc ("PGHOST" , nil ),
4747 Description : "Name of PostgreSQL server address" ,
4848 },
49- "connection_host" : {
50- Type : schema .TypeString ,
51- Optional : true ,
52- DefaultFunc : schema .EnvDefaultFunc ("PGHOST" , nil ),
53- Description : "Name of PostgreSQL server address to connect to" ,
54- },
5549 "port" : {
5650 Type : schema .TypeInt ,
5751 Optional : true ,
@@ -106,6 +100,13 @@ func Provider() *schema.Provider {
106100 Description : "AWS IAM role to assume for IAM auth" ,
107101 },
108102
103+ "aws_rds_iam_token_host" : {
104+ Type : schema .TypeString ,
105+ Optional : true ,
106+ DefaultFunc : schema .EnvDefaultFunc ("PGHOST" , nil ),
107+ Description : "Name of PostgreSQL server address for AWS RDS IAM to get token" ,
108+ },
109+
109110 "azure_identity_auth" : {
110111 Type : schema .TypeBool ,
111112 Optional : true ,
@@ -350,18 +351,18 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
350351 port := d .Get ("port" ).(int )
351352 username := d .Get ("username" ).(string )
352353
353- connectionHost := d .Get ("connection_host" ).(string )
354- if connectionHost == "" {
355- connectionHost = host
356- }
357-
358354 var password string
359355 if d .Get ("aws_rds_iam_auth" ).(bool ) {
356+ awsIAMTokenHost := d .Get ("aws_rds_iam_token_host" ).(string )
357+ if awsIAMTokenHost == "" {
358+ awsIAMTokenHost = host
359+ }
360+
360361 profile := d .Get ("aws_rds_iam_profile" ).(string )
361362 region := d .Get ("aws_rds_iam_region" ).(string )
362363 role := d .Get ("aws_rds_iam_provider_role_arn" ).(string )
363364 var err error
364- password , err = getRDSAuthToken (region , profile , role , username , host , port )
365+ password , err = getRDSAuthToken (region , profile , role , username , awsIAMTokenHost , port )
365366 if err != nil {
366367 return nil , err
367368 }
@@ -382,7 +383,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
382383 config := Config {
383384 Scheme : d .Get ("scheme" ).(string ),
384385 Host : host ,
385- ConnectionHost : connectionHost ,
386+ AWSIAMDBAuthTokenHost : awsIAMTokenHost ,
386387 Port : port ,
387388 Username : username ,
388389 Password : password ,
0 commit comments