Skip to content
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

TERRA-102 ⁃ Update docs with example for secure_bundles.url (v2.1.15) #218

Closed
tringuyen-yw opened this issue Mar 24, 2023 · 5 comments · Fixed by #329
Closed

TERRA-102 ⁃ Update docs with example for secure_bundles.url (v2.1.15) #218

tringuyen-yw opened this issue Mar 24, 2023 · 5 comments · Fixed by #329

Comments

@tringuyen-yw
Copy link

tringuyen-yw commented Mar 24, 2023

Hi there,

Using datastax/astra provider v2.1.15 The secure_bundles.url attribute is not accessible, contrary to the official documentation. See Reference section at the bottom of the ticket.

Terraform Version

Terraform v1.4.2
on linux_amd64
+ provider registry.terraform.io/datastax/astra v2.1.15

Affected Resource(s)

Please list the resources as a list, for example:

  • data.astra_secure_connect_bundle_url

Terraform Configuration Files

data "astra_secure_connect_bundle_url" "securebundle-dev" {
  database_id = astra_database.astradb-dev.id
}

# this code is NOT working with astra provider v2.1.15
output "astra_securebundle_dev" {
  value = data.astra_secure_connect_bundle_url.securebundle-dev.secure_bundles.url
}

Expected Behavior

Should return the strring of the URL to download the bundle. Please note the below code is OK OK with astra provider v2.1.14

# WORKING OK with astra provider v2.1.14 (NOTE: not having secure_bundles attribute)
output "astra_securebundle_dev" {
  value = data.astra_secure_connect_bundle_url.securebundle-dev.url
}

Actual Behavior

terraform plan failed by

╷
│ Error: Unsupported attribute
│ 
│   on outputs.tf line 2, in output "astra_securebundle_dev":
│    2:   value = data.astra_secure_connect_bundle_url.securebundle-dev.secure_bundles.url
│ 
│ Can't access attributes on a list of objects. Did you mean to access attribute "url" for a specific element of the list, or across all elements of the list?

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

References

Documentation astra_secure_connect_bundle_url (Data Source) states that

the secure_bundles has a nested property url String type.

┆Issue is synchronized with this Jira Task by Unito
┆Issue Number: TERRA-102
┆Priority: Major

@sync-by-unito sync-by-unito bot changed the title Unsupported attribute secure_bundles.url (v2.1.15) TERRA-102 ⁃ Unsupported attribute secure_bundles.url (v2.1.15) Mar 24, 2023
@emerkle826
Copy link
Contributor

@tringuyen-yw As of v2.1.15, the url attribute is part of each element of the secure_bundles list. You will need to change this:

output "astra_securebundle_dev" {
  value = data.astra_secure_connect_bundle_url.securebundle-dev.url
}

to this:

output "astra_securebundle_dev" {
  value = data.astra_secure_connect_bundle_url.securebundle-dev[0].url
}

@tringuyen-yw
Copy link
Author

@emerkle826 Thanks for the hint about the list syntax [0]. Must add the new secure_bundles attribute though, The exact syntax is:

output "astra_securebundle_dev" {
  value = data.astra_secure_connect_bundle_url.securebundle-dev.secure_bundles[0].url
}

This ticket can now be closed. Before you do, can you get the documentation team to update the Terraform provider documentation (link in the Reference section at the bottom of the first post). The doc should give some examples to clarify the syntax.

@emerkle826
Copy link
Contributor

@tringuyen-yw Sorry about the typo, you are correct that secure_bundles needs to be there.

As for the docs, they are technically correct as they secure_bundles as a List. But the examples on the page do not show how to reference the new datasource structure, only how to configure one. I'll get the docs updated as part of this ticket on the next release as the docs only get updated on releases.

@emerkle826 emerkle826 changed the title TERRA-102 ⁃ Unsupported attribute secure_bundles.url (v2.1.15) TERRA-102 ⁃ Update docs with example for secure_bundles.url (v2.1.15) Mar 27, 2023
@JanGe
Copy link

JanGe commented Mar 30, 2023

Our Terraform builds today broke too due to this unannounced breaking change.

@emerkle826 Could the Datastax team please make sure to not introduce breaking changes like these in patch version upgrades of the provider? The correct module version should have been 3.0.0 to make this obvious. Thank you!

@emerkle826
Copy link
Contributor

@JanGe Sorry about that. I'll be more careful with breaking changes in the future. There will be another one coming soon to fix #170, which I will be updating the major version for most likely.

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

Successfully merging a pull request may close this issue.

3 participants