-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add simple redshift_datashare
resource
#18
Conversation
@winglot if you're happy with this approach it should be pretty quick for me to add a corresponding data source. I'll also need to add a |
04e6233
to
fd0eba0
Compare
State: schema.ImportStatePassthrough, | ||
}, | ||
Schema: map[string]*schema.Schema{ | ||
"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.
Could you move the strings to consts as other resources have?
const (
datashareNameAttr = "name"
datashareOwnerAttr = "owner"
...
)
In my opinion, this is a better approach rather than raw strings all around, it eliminates the possibility of a typo and makes it easier to rename an attribute in the future if needed.
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.
@winglot - I've moved the attribute names to constants and amended the commit.
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.
Rebased #20 on these changes as well.
fd0eba0
to
3f33c0b
Compare
…aws-sdk-go-v2-config-1.x Update module github.com/aws/aws-sdk-go-v2/config to v1.18.42
This is a simplified version of #17. Effectively it's just the
auto
mode from that PR.Adds a
redshit_datashare
resource to manage data sharing between Redshift clusters. This should be defined on the producer cluster.For each schema, we
ALTER DATASHARE ADD SCHEMA
. We also addALL TABLES IN SCHEMA
andALL FUNCTIONS IN SCHEMA
andSET INCLUDENEW=true FOR SCHEMA
, so that newly-created tables/functions are automatically exposed to the datashare by the redshift cluster itself, without needing to re-run terraform.There is test coverage, however because data sharing only works on RA3 clusters, the test case is conditionally enabled on whether or not an environment variable named
REDSHIFT_DATASHARE_SUPPORTED
is set: