Skip to content

Commit 3930a72

Browse files
init (#225)
1 parent 7d6b3ed commit 3930a72

File tree

6 files changed

+201
-2
lines changed

6 files changed

+201
-2
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## [1.1.4](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.1.3...v1.1.4)
1111

1212
## Added
13+
- Connector `fivetran_connector.auth` fields support:
14+
- Added field `fivetran_connector.auth.custom_field_ids`.
15+
- Added field `fivetran_connector.auth.previous_refresh_token`.
16+
- Added field `fivetran_connector.auth.user_access_token`.
17+
- Added field `fivetran_connector.auth.consumer_secret`.
18+
- Added field `fivetran_connector.auth.consumer_key`.
19+
- Added field `fivetran_connector.auth.oauth_token`.
20+
- Added field `fivetran_connector.auth.oauth_token_secret`.
21+
- Added field `fivetran_connector.auth.role_arn`.
22+
- Added field `fivetran_connector.auth.aws_access_key`.
23+
- Added field `fivetran_connector.auth.aws_secret_key`.
24+
- Added field `fivetran_connector.auth.client_id`.
25+
- Added field `fivetran_connector.auth.key_id`.
26+
- Added field `fivetran_connector.auth.team_id`.
27+
- Added field `fivetran_connector.auth.client_secret`.
1328
- Resource `fivetran_destination` updates:
1429
- Added field `fivetran_destination.config.workspace_name` for OneLake.
1530
- Added field `fivetran_destination.config.lakehouse_name` for OneLake.
@@ -93,6 +108,7 @@ New connector config fields supported:
93108
## [1.1.1](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.1.0...v1.1.1)
94109

95110
## Added
111+
- Supports setting connector synchronization every minute. Added possible value 1 for the field `fivetran_connector_schedule.sync_frequency`.
96112
- New resource `fivetran_connector_certificates` that allows to manage the list of certificates approved for connector.
97113
- New resource `fivetran_connector_fingerprints` that allows to manage the list of SSH fingerprints approved for connector.
98114
- New resource `fivetran_destination_certificates` that allows to manage the list of certificates approved for destination.

docs/data-sources/connector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Read-Only:
301301
- Service `subscript`: Your Subscript API key.
302302
- Service `survicate`:
303303
- Service `trello`: Your TRELLO api key.
304-
- `api_key:api_secret` (String, Sensitive) Field usage depends on `service` value:
304+
- `api_key_api_secret` (String, Sensitive) Field usage depends on `service` value:
305305
- Service `revel`: Your Revel Systems API Key and API Secret.
306306
- `api_keys` (Set of String, Sensitive) Field usage depends on `service` value:
307307
- Service `mandrill`: Comma-separated list of API keys. Required if `use_api_keys` is set to `true`.

docs/resources/connector.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,22 @@ Optional:
9999
Optional:
100100

101101
- `access_token` (String, Sensitive) The `Access Token` carries the information necessary for API resources to fetch data.
102+
- `aws_access_key` (String, Sensitive) `AWS Access Key` of your AWS Account User.
103+
- `aws_secret_key` (String, Sensitive) `AWS Secret Key` of your AWS Account User.
102104
- `client_access` (Block List, Max: 1) Your application client access fields. (see [below for nested schema](#nestedblock--auth--client_access))
105+
- `client_id` (String, Sensitive) `Client ID` of your Amazon Seller/Vendor Central client application.
106+
- `client_secret` (String, Sensitive) `Client Secret` of your Amazon Seller/Vendor Central client application.
107+
- `consumer_key` (String, Sensitive) Consumer key of your application.
108+
- `consumer_secret` (String, Sensitive) Consumer secret of your application.
109+
- `key_id` (String, Sensitive) Apple Search Ads REST API Key ID. Must be populated if `is_auth2_enabled` is set to `true`.
110+
- `oauth_token` (String, Sensitive) OAuth token of your application.
111+
- `oauth_token_secret` (String, Sensitive) OAuth token secret of your application.
112+
- `previous_refresh_token` (String, Sensitive) Previous `Refresh token` of your application.
103113
- `realm_id` (String, Sensitive) `Realm ID` of your application.
104114
- `refresh_token` (String, Sensitive) The long-lived `Refresh token` along with the `client_id` and `client_secret` parameters carry the information necessary to get a new access token for API resources.
115+
- `role_arn` (String, Sensitive) `IAM Role ARN` of your AWS Account.
116+
- `team_id` (String, Sensitive) Apple Search Ads REST API Team ID. Must be populated if `is_auth2_enabled` is set to `true`.
117+
- `user_access_token` (String, Sensitive) Access Token
105118

106119
<a id="nestedblock--auth--client_access"></a>
107120
### Nested Schema for `auth.client_access`
@@ -376,7 +389,7 @@ Optional:
376389
- Service `subscript`: Your Subscript API key.
377390
- Service `survicate`:
378391
- Service `trello`: Your TRELLO api key.
379-
- `api_key:api_secret` (String, Sensitive) Field usage depends on `service` value:
392+
- `api_key_api_secret` (String, Sensitive) Field usage depends on `service` value:
380393
- Service `revel`: Your Revel Systems API Key and API Secret.
381394
- `api_keys` (Set of String, Sensitive) Field usage depends on `service` value:
382395
- Service `mandrill`: Comma-separated list of API keys. Required if `use_api_keys` is set to `true`.

fivetran/connector_common.go

+78
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,84 @@ func getConnectorSchemaAuth() *schema.Schema {
274274
Sensitive: true,
275275
Description: "`Realm ID` of your application.",
276276
},
277+
"previous_refresh_token": {
278+
Type: schema.TypeString,
279+
Optional: true,
280+
Sensitive: true,
281+
Description: "Previous `Refresh token` of your application.",
282+
},
283+
"user_access_token": {
284+
Type: schema.TypeString,
285+
Optional: true,
286+
Sensitive: true,
287+
Description: "Access Token",
288+
},
289+
"consumer_secret": {
290+
Type: schema.TypeString,
291+
Optional: true,
292+
Sensitive: true,
293+
Description: "Consumer secret of your application.",
294+
},
295+
"consumer_key": {
296+
Type: schema.TypeString,
297+
Optional: true,
298+
Sensitive: true,
299+
Description: "Consumer key of your application.",
300+
},
301+
"oauth_token": {
302+
Type: schema.TypeString,
303+
Optional: true,
304+
Sensitive: true,
305+
Description: "OAuth token of your application.",
306+
},
307+
"oauth_token_secret": {
308+
Type: schema.TypeString,
309+
Optional: true,
310+
Sensitive: true,
311+
Description: "OAuth token secret of your application.",
312+
},
313+
"role_arn": {
314+
Type: schema.TypeString,
315+
Optional: true,
316+
Sensitive: true,
317+
Description: "`IAM Role ARN` of your AWS Account.",
318+
},
319+
"aws_access_key": {
320+
Type: schema.TypeString,
321+
Optional: true,
322+
Sensitive: true,
323+
Description: "`AWS Access Key` of your AWS Account User.",
324+
},
325+
"aws_secret_key": {
326+
Type: schema.TypeString,
327+
Optional: true,
328+
Sensitive: true,
329+
Description: "`AWS Secret Key` of your AWS Account User.",
330+
},
331+
"client_id": {
332+
Type: schema.TypeString,
333+
Optional: true,
334+
Sensitive: true,
335+
Description: "`Client ID` of your Amazon Seller/Vendor Central client application.",
336+
},
337+
"key_id": {
338+
Type: schema.TypeString,
339+
Optional: true,
340+
Sensitive: true,
341+
Description: "Apple Search Ads REST API Key ID. Must be populated if `is_auth2_enabled` is set to `true`.",
342+
},
343+
"team_id": {
344+
Type: schema.TypeString,
345+
Optional: true,
346+
Sensitive: true,
347+
Description: "Apple Search Ads REST API Team ID. Must be populated if `is_auth2_enabled` is set to `true`.",
348+
},
349+
"client_secret": {
350+
Type: schema.TypeString,
351+
Optional: true,
352+
Sensitive: true,
353+
Description: "`Client Secret` of your Amazon Seller/Vendor Central client application.",
354+
},
277355
},
278356
},
279357
}

fivetran/resource_connector.go

+52
Original file line numberDiff line numberDiff line change
@@ -341,5 +341,57 @@ func resourceConnectorUpdateCustomAuth(resourceData *schema.ResourceData) *map[s
341341
authMap["realm_id"] = v
342342
}
343343

344+
if v := a["previous_refresh_token"].(string); v != "" {
345+
authMap["previous_refresh_token"] = v
346+
}
347+
348+
if v := a["user_access_token"].(string); v != "" {
349+
authMap["user_access_token"] = v
350+
}
351+
352+
if v := a["consumer_secret"].(string); v != "" {
353+
authMap["consumer_secret"] = v
354+
}
355+
356+
if v := a["consumer_key"].(string); v != "" {
357+
authMap["consumer_key"] = v
358+
}
359+
360+
if v := a["oauth_token"].(string); v != "" {
361+
authMap["oauth_token"] = v
362+
}
363+
364+
if v := a["oauth_token_secret"].(string); v != "" {
365+
authMap["oauth_token_secret"] = v
366+
}
367+
368+
if v := a["role_arn"].(string); v != "" {
369+
authMap["role_arn"] = v
370+
}
371+
372+
if v := a["aws_access_key"].(string); v != "" {
373+
authMap["aws_access_key"] = v
374+
}
375+
376+
if v := a["aws_secret_key"].(string); v != "" {
377+
authMap["aws_secret_key"] = v
378+
}
379+
380+
if v := a["client_id"].(string); v != "" {
381+
authMap["client_id"] = v
382+
}
383+
384+
if v := a["key_id"].(string); v != "" {
385+
authMap["key_id"] = v
386+
}
387+
388+
if v := a["team_id"].(string); v != "" {
389+
authMap["team_id"] = v
390+
}
391+
392+
if v := a["client_secret"].(string); v != "" {
393+
authMap["client_secret"] = v
394+
}
395+
344396
return &authMap
345397
}

fivetran/tests/mock/resource_connector_static_mapping_test.go

+40
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,21 @@ const (
3636
auth {
3737
refresh_token = "refresh_token"
3838
access_token = "access_token"
39+
previous_refresh_token = "previous_refresh_token"
3940
realm_id = "realm_id"
41+
user_access_token = "user_access_token"
42+
consumer_secret = "consumer_secret"
43+
consumer_key = "consumer_key"
44+
oauth_token = "oauth_token"
45+
oauth_token_secret = "oauth_token_secret"
46+
role_arn = "role_arn"
47+
aws_access_key = "aws_access_key"
48+
aws_secret_key = "aws_secret_key"
49+
client_id = "client_id"
50+
key_id = "key_id"
51+
team_id = "team_id"
52+
client_secret = "client_secret"
53+
4054
client_access {
4155
client_id = "client_id"
4256
client_secret = "client_secret"
@@ -105,6 +119,19 @@ func setupMockClientConnectorResourceConfigMapping(t *testing.T) {
105119
assertKeyExistsAndHasValue(t, auth, "refresh_token", "refresh_token")
106120
assertKeyExistsAndHasValue(t, auth, "access_token", "access_token")
107121
assertKeyExistsAndHasValue(t, auth, "realm_id", "realm_id")
122+
assertKeyExistsAndHasValue(t, auth, "previous_refresh_token", "previous_refresh_token")
123+
assertKeyExistsAndHasValue(t, auth, "user_access_token", "user_access_token")
124+
assertKeyExistsAndHasValue(t, auth, "consumer_secret", "consumer_secret")
125+
assertKeyExistsAndHasValue(t, auth, "consumer_key", "consumer_key")
126+
assertKeyExistsAndHasValue(t, auth, "oauth_token", "oauth_token")
127+
assertKeyExistsAndHasValue(t, auth, "oauth_token_secret", "oauth_token_secret")
128+
assertKeyExistsAndHasValue(t, auth, "role_arn", "role_arn")
129+
assertKeyExistsAndHasValue(t, auth, "aws_access_key", "aws_access_key")
130+
assertKeyExistsAndHasValue(t, auth, "aws_secret_key", "aws_secret_key")
131+
assertKeyExistsAndHasValue(t, auth, "client_id", "client_id")
132+
assertKeyExistsAndHasValue(t, auth, "key_id", "key_id")
133+
assertKeyExistsAndHasValue(t, auth, "team_id", "team_id")
134+
assertKeyExistsAndHasValue(t, auth, "client_secret", "client_secret")
108135

109136
assertKeyExists(t, auth, "client_access")
110137

@@ -143,6 +170,19 @@ func TestResourceConnectorConfigMappingMock(t *testing.T) {
143170
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.refresh_token", "refresh_token"),
144171
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.access_token", "access_token"),
145172
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.realm_id", "realm_id"),
173+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.previous_refresh_token", "previous_refresh_token"),
174+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.user_access_token", "user_access_token"),
175+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.consumer_secret", "consumer_secret"),
176+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.consumer_key", "consumer_key"),
177+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.oauth_token", "oauth_token"),
178+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.oauth_token_secret", "oauth_token_secret"),
179+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.role_arn", "role_arn"),
180+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.aws_access_key", "aws_access_key"),
181+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.aws_secret_key", "aws_secret_key"),
182+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.client_id", "client_id"),
183+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.key_id", "key_id"),
184+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.team_id", "team_id"),
185+
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.client_secret", "client_secret"),
146186

147187
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.client_access.0.client_id", "client_id"),
148188
resource.TestCheckResourceAttr("fivetran_connector.test_connector", "auth.0.client_access.0.client_secret", "client_secret"),

0 commit comments

Comments
 (0)