MissingEndpoint: 'Endpoint' configuration is required for this service
I'm having issues getting terratest to communicate to AWS, it creates the resources via terraform but terratest is says its missing the endpoint configuration My terraform module creates RDS, my scenario returns the entire RDS object back so I can look into it ``` output "rds" { value = module.main } ``` My test looks like the following ``` func Test_Defaults(t *testing.T) { t.Parallel() workingDir := "./scenarios/postgres" // At the end of the test, undeploy the web app using Terraform defer test_structure.RunTestStage(t, "cleanup_terraform", func() { // Temporarily commented out to keep resource around while testing verify code // Remove(t, workingDir) }) // Deploy the web app using Terraform test_structure.RunTestStage(t, "deploy_terraform", func() { Deploy(t, workingDir, nil) }) test_structure.RunTestStage(t, "validate", func() { ValidateAddressAndPort(t, workingDir, 5432) }) } ``` I am deploying my code with the following ``` func Deploy(t *testing.T, workingDir string, vars map[string]interface{}) { // Construct the terraform options with default retryable errors to handle the most common retryable errors in // terraform testing. terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ // The path to where our Terraform code is located TerraformDir: workingDir, // Variables to pass to our Terraform code using -var options Vars: vars, }) // Save the Terraform Options struct, instance name, and instance text so future test stages can use it test_structure.SaveTerraformOptions(t, workingDir, terraformOptions) // This will run `terraform init` and `terraform apply` and fail the test if there are any errors terraform.InitAndApply(t, terraformOptions) } ``` My validate looks like this ``` func ValidateAddressAndPort(t *testing.T, workingDir string, expectedPort int64) { options := test_structure.LoadTerraformOptions(t, workingDir) // Get Output output := terraform.OutputAll(t, options) // RDS output result := output["rds"].(map[string]interface{}) // Variables region := fmt.Sprintf("%v", result["aws_region"]) id := fmt.Sprintf("%v", result["id"]) // Look up the endpoint address and port of the RDS instance address := aws.GetAddressOfRdsInstance(t, id, region) port := aws.GetPortOfRdsInstance(t, id, region) // Verify that the address is not null assert.NotNil(t, address) // Verify that the DB instance is listening on the port mentioned assert.Equal(t, expectedPort, port) } ``` I'm getting an error while running says ` rds.go:18: MissingEndpoint: 'Endpoint' configuration is required for this service ` I've tried using the aws.NewRDSClient but getting same error.. I'm not sure whats going on but maybe something to do with my AWS_PROFILE, I'm not using a default profile I'm able to get to AWS via AWS CLI, and terraform can create the resources
I found the issue, region was not in my outputs.. so it was passing in null, was causing issues with the session