-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New Glue Data sources - Glue Connection and Glue Data Catalog Encryption Settings #18802
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @danu165 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
@danu165 This looks promising. Let us know when you're ready for us to look it over. |
@YakDriver I think it's ready for review now. I put the WIP tag as I couldn't run a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial review
return &schema.Resource{ | ||
ReadContext: dataSourceAwsGlueDataCatalogEncryptionSettingsRead, | ||
Schema: map[string]*schema.Schema{ | ||
"id": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id attribute is implicit dont think we need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it also implicitly required? The goal here is to make id
a required argument, so just want to make sure that behavior would remain the same if I take this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, my mistake i see this is the convention in data sources to keep "id" explicit. ill try to run tests soon. code wise looks good
Getting this when trying to run tests:
|
|
||
func testAccDataSourceAwsGlueConnectionConfig(rName string) string { | ||
return fmt.Sprintf(` | ||
resource "aws_glue_connection" "test" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to faling tests, lets change this to something that works on the resource accaptenece tests:
this is the basic config for connection resource tests
resource "aws_glue_connection" "test" {
connection_properties = {
JDBC_CONNECTION_URL = "jdbc:mysql://terraformacctesting.com/testdatabase"
PASSWORD = "testpassword"
USERNAME = "testusername"
}
name = "%s"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thank you. Just pushed a commit with this test.
resource.TestCheckResourceAttrPair(datasourceName, "creation_time", resourceName, "creation_time"), | ||
resource.TestCheckResourceAttrPair(datasourceName, "connection_type", resourceName, "connection_type"), | ||
resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets also add connection_properties
check here as we added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have connection_properties
as part of the schema in the data source. It doesn't appear for every type of connection so I thought it might be best to leave it out.
{ | ||
Config: testAccDataSourceAwsGlueDataCatalogEncryptionSettingsConfig(), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccDataSourceAwsGlueDataCatalogEncryptionSettingsCheck(datasourceName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from what i see in other datasource tests we don't need this check here. (the data source is not creating anything so there is nothing to check here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I based this from data_source_aws_kms_key_test.go
. Could you point me to another file whose structure I should copy?
{ | ||
Config: testAccDataSourceAwsGlueConnectionConfig(rName), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccDataSourceAwsGlueConnectionCheck(datasourceName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above resource
Hi @danu165. now im getting:
Are you able to verify tests on your end? ill keep digging meanwhile |
@DrFaust92 I haven't been able to get tests working locally. As a note, when I run
So it seems my profile doesn't have permissions to create symlinks. |
I've created an issue upstream in the project that handles the provider acceptance testing framework: hashicorp/terraform-plugin-sdk#759 Until that is resolved, unfortunately create symbolic link permissions on Windows may be required (or using another OS, such as WSL). |
opened #19367 to address fixes with passing tests |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
This PR adds new data sources for aws_glue_connection and aws_glue_data_catalog_encryption_settings.
Note: I was not able to test this due to odd behavior from
make fmt
. It modifies almost every file where it changes all instances of "%w" to "%s". I would appreciate it if someone else could test this for me.Output from acceptance testing: