From cc76c9f431c274a2ac3c4fb2547746107d4b2767 Mon Sep 17 00:00:00 2001 From: Vitaly Mosin <73104048+beevital@users.noreply.github.com> Date: Fri, 6 May 2022 16:53:18 +0300 Subject: [PATCH] Use secure go-getter v1.5.11 (#29) * use secure go-getter v1.5.11 * changelog * changelog upd * changelog updates for v0.4.0 * changelog remarks --- CHANGELOG.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++-- go.mod | 1 + go.sum | 3 +- 3 files changed, 99 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ffcb8c7..a250c0b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,16 +5,109 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.3.6...HEAD) +## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.4.1...HEAD) + +## [0.4.1](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.4.0...v0.4.1) - 2022-05-06 + +## Fixed +- Upgrading `go-getter` to 1.5.11 in order to address a [dependency security vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2022-29810) ## [0.4.0](https://github.com/fivetran/terraform-provider-fivetran/compare/v0.3.6...v0.4.0) - 2022-05-04 -Considering this version as BETA +Considering this version as BETA. -## Features +## Breaking changes - New `destination_schema` field for determining `schema`, `table` and `schema_prefix` outside `config` to prevent drifting changes. - Changes in `destination_schema` leads to resource replacement +### Migration from v0.3.6 + +You should move the following fields in `connector_resource` configurations: +- `connector_resource.config.schema` -> `connector_resource.destination_schema.name` +- `connector_resource.config.table` -> `connector_resource.destination_schema.table` +- `connector_resource.config.schema_prefix` -> `connector_resource.destination_schema.schema_prefix` + +The following field is now excluded from `connector_resource` schema: +- `connector_resource.schema` - replaced with `name` field + +The following Computed field was added to `connector_resource` schema: +- `connector_resource.name` - this field contains resulting Fivetran Connector Name you can see on Fivetran Dashboard UI + +Example: + +``` +v0.3.6 : +resource "fivetran_connector" "postgres" { + group_id = fivetran_group.my_group.id + service = "postgres" + sync_frequency = 5 + paused = false + pause_after_trial = false + schema = "production_pg" + config { + schema_prefix = "production_pg" + host = "123.456.789.012" + port = "5432" + user = "postgres" + password = "IDontKnowThePassword" + database = "prod" + update_method = "XMIN" + } +} + +resource "fivetran_connector" "google_sheets" { + group_id = fivetran_group.my_group.id + service = "google_sheets" + sync_frequency = 5 + paused = false + pause_after_trial = false + schema = "connector_schema_name.table_name" + config { + schema = "connector_schema_name" + table = "table_name" + sheet_id = "1Rmq_FN2kTNwWiT4adZKBxHBBlaHBLAHBLAH..." + named_range = "Some Range Name" + } +} + +v0.4.0 : +resource "fivetran_connector" "postgres" { + group_id = fivetran_group.my_group.id + service = "postgres" + sync_frequency = 5 + paused = false + pause_after_trial = false + destination_schema { + prefix = "production_pg" + } + config { + host = "123.456.789.012" + port = "5432" + user = "postgres" + password = "IDontKnowThePassword" + database = "prod" + update_method = "XMIN" + } +} + +resource "fivetran_connector" "google_sheets" { + group_id = fivetran_group.my_group.id + service = "google_sheets" + sync_frequency = 5 + paused = false + pause_after_trial = false + destination_schema { + name = "connector_schema_name" + table = "table_name" + } + config { + sheet_id = "1Rmq_FN2kTNwWiT4adZKBxHBBlaHBLAHBLAH..." + named_range = "Some Range Name" + } +} +``` + + ## Fixed - All sensitive fields marked as sensitive in connector_resource - Minor connector resource fixes diff --git a/go.mod b/go.mod index ab486fef..cadfa7a2 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,7 @@ module github.com/fivetran/terraform-provider-fivetran require ( github.com/fivetran/go-fivetran v0.5.6 + github.com/hashicorp/go-getter v1.5.11 // indirect github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0 github.com/mattn/go-colorable v0.1.8 // indirect ) diff --git a/go.sum b/go.sum index 52076867..206ab6e3 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,9 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= +github.com/hashicorp/go-getter v1.5.11 h1:wioTuNmaBU3IE9vdFtFMcmZWj0QzLc6DYaP6sNe5onY= +github.com/hashicorp/go-getter v1.5.11/go.mod h1:9i48BP6wpWweI/0/+FBjqLrp9S8XtwUGjiu0QkWHEaY= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o=