Skip to content

google_datastream_connection_profile fails with 'Unexpected block: salesforce_profile not expected here #22292

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

Open
alimuf opened this issue Apr 10, 2025 · 1 comment · May be fixed by GoogleCloudPlatform/magic-modules#13675

Comments

@alimuf
Copy link

alimuf commented Apr 10, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.11.3
on darwin_arm64

  • provider registry.terraform.io/hashicorp/google v6.29.0
  • provider registry.terraform.io/hashicorp/google-beta v6.29.0

Affected Resource(s)

google_datastream_connection_profile

Terraform Configuration

resource "google_datastream_connection_profile" "default" {
    display_name          = "Salesforce Source"
    location              = "us-central1"
    connection_profile_id = "source-profile"
    create_without_validation: true
    provider = google-beta

    salesforce_profile {
        domain = "fake-domain.my.salesforce.com"
        user_credentials {
          username = "fake-username"
          secret_manager_stored_password = "fake-password"
          secret_manager_stored_security_token = "fake-token"
        }
    }
}

Debug Output

No response

Expected Behavior

The configuration should be accepted as it follows the structure documented in the provider documentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/datastream_connection_profile#example-usage---datastream-connection-profile-salesforce

Actual Behavior

Error: Unexpected block: Blocks of type "salesforce_profile" are not expected here

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

b/409850847

@alimuf alimuf added the bug label Apr 10, 2025
@github-actions github-actions bot added forward/review In review; remove label to forward service/datastream labels Apr 10, 2025
@ggtisc ggtisc self-assigned this Apr 10, 2025
@ggtisc
Copy link
Collaborator

ggtisc commented Apr 10, 2025

Hi @alimuf!

This is just a mistake in the documentation, as you can notice in the other examples of the same link and for intuition, in terraform is used the = but not the :. Here is a complete correct code of the linked example:

resource "google_sql_database_instance" "sql_instance_22292" {
  name                = "sql-instance-22292"
  database_version    = "SQLSERVER_2019_STANDARD"
  region              = "us-central1"
  root_password       = "something"
  deletion_protection = true

  settings {
    tier = "db-custom-2-4096"

    ip_configuration {
      authorized_networks {
        value = "34.71.242.81"
      }

      authorized_networks {
        value = "34.72.28.29"
      }

      authorized_networks {
        value = "34.67.6.157"
      }

      authorized_networks {
        value = "34.67.234.134"
      }

      authorized_networks {
        value = "34.72.239.218"
      }
    }
  }
}

resource "google_sql_user" "sql_user_22292" {
    name     = "sql-user-22292"
    instance = google_sql_database_instance.sql_instance_22292.name
    password = "something"
}

resource "google_secret_manager_secret" "sql_password_secret_22292" {
  secret_id = "sql-password-22292"

  replication {
    user_managed {
      replicas {
        location = "us-central1"
      }
    }
  }
}

resource "google_secret_manager_secret_version" "sql_password_version_22292" {
  secret      = google_secret_manager_secret.sql_password_secret_22292.name
  secret_data = google_sql_user.sql_user_22292.password
  enabled     = true
}

resource "google_secret_manager_secret" "salesforce_token_secret_22292" {
  secret_id = "salesforce-token-22292"

  replication {
    user_managed {
      replicas {
        location = "us-central1"
      }
    }
  }
}

resource "google_secret_manager_secret_version" "salesforce_token_version_22292" {
  secret      = google_secret_manager_secret.salesforce_token_secret_22292.name
  secret_data = "your-salesforce-security-token"
  enabled     = true
}

resource "google_datastream_connection_profile" "ds_conn_profile_22292" {
  display_name              = "ds-conn-profile-22292"
  location                  = "us-central1"
  connection_profile_id     = "ds-conn-profile-22292"
  create_without_validation = true
  provider                  = google-beta

  salesforce_profile {
    domain = "fake-domain.my.salesforce.com"
      
    user_credentials {
      username                              = google_sql_user.sql_user_22292.name
      secret_manager_stored_password        = google_secret_manager_secret_version.sql_password_version_22292.id
      secret_manager_stored_security_token  = google_secret_manager_secret_version.salesforce_token_version_22292.id
    }
  }
}

I'm forwarding this as a documentation issue to correct the mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants