-
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 Data Source: aws_glue_script #4481
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.
A bunch of mostly minor comments - but this otherwise LGTM 👍
aws/data_source_aws_glue_script.go
Outdated
|
||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/glue" | ||
"github.com/hashicorp/terraform/helper/schema" |
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.
really minor we can group these
"language": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: glue.LanguagePython, |
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.
would this be better as Required with no default set?
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.
It defaults to Python if you do not provide a value 😉
"scala_code": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, |
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 could argue these could be one field, in case additional languages are added in the future?
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'm not sure why the Glue API distinguishes between the return values. It only returns one of them at a time currently 😕 Maybe it will return multiple in the future. We tend to opt for sticking with API rather than making our own choices for UX due to past maintenance issues. I'm tempted to leave this as-is hoping that AWS has a good reason for this API design decision.
aws/data_source_aws_glue_script.go
Outdated
|
||
input := &glue.CreateScriptInput{ | ||
DagEdges: expandGlueCodeGenEdges(d.Get("dag_edge").([]interface{})), | ||
DagNodes: expandGlueCodeGenNodes(d.Get("dag_node").([]interface{})), |
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.
minor splitting these out into separate lines makes this easier when things crash
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'll update 👍
## Attributes Reference | ||
|
||
* `python_script` - The Python script generated from the DAG. The `language` argument must be set to `PYTHON`. | ||
* `scala_code` - The Scala code generated from the DAG. The `language` argument must be set to `SCALA`. |
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'd argue this would be better as:
* `scala_code` - The Scala code generated from the DAG when the `language` argument is set to `SCALA`.
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'll update 👍
|
||
* `name` - (Required) The name of the argument or property. | ||
* `param` - (Optional) Boolean if the value is used as a parameter. Defaults to `false`. | ||
* `value` - (Required) The value of the argument or property. |
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.
minor should we be sorting this Required -> Optional, then by Alphabetical?
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.
Good call -- will update 👍
* `args` - (Required) Nested configuration an argument or property of a node. Defined below. | ||
* `id` - (Required) A node identifier that is unique within the node's graph. | ||
* `line_number` - (Optional) The line number of the node. | ||
* `node_type` - (Required) The type of node this is. |
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.
minor should we be sorting this Required -> Optional, then by Alphabetical?
] | ||
|
||
dag_node = [ | ||
# ... |
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.
it'd be good to give a working example here imo
This has been released in version 1.20.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Closes #3879
Changes proposed in this pull request:
CreateScript
API callOutput from acceptance testing: