From 8fd56bd13cd9cbf6bf700a93ced7ea8115253fe2 Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Thu, 20 Jan 2022 17:53:40 +0100 Subject: [PATCH 001/128] prepare release (#80) (#188) --- launchdarkly/project_helper.go | 1 - 1 file changed, 1 deletion(-) diff --git a/launchdarkly/project_helper.go b/launchdarkly/project_helper.go index 0ca347c7..2a84d79f 100644 --- a/launchdarkly/project_helper.go +++ b/launchdarkly/project_helper.go @@ -85,7 +85,6 @@ func projectRead(ctx context.Context, d *schema.ResourceData, meta interface{}, if err != nil { return diag.Errorf("could not set include_in_snippet on project with key %q: %v", project.Key, err) } - } err = d.Set(TAGS, project.Tags) From aea6005bbc1fdad324d9c4cd9266f2735c7004be Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Fri, 21 Jan 2022 12:30:53 +0000 Subject: [PATCH 002/128] Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug --- CHANGELOG.md | 6 +++ launchdarkly/segment_rule_helper.go | 34 ++++++++----- launchdarkly/segment_rule_helper_test.go | 64 ++++++++++++++++++++++++ website/docs/r/segment.html.markdown | 2 +- 4 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 launchdarkly/segment_rule_helper_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index a6656628..efe4e429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [2.4.1] (Unreleased) + +BUG FIXES: + +- Fixes a [bug](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/79) introduced in v2.2.0 where `launchdarkly_segments` with `rule` blocks not containing a `weight` were defaulting to a `weight` of 0. + ## [2.4.0] (January 19, 2022) FEATURES: diff --git a/launchdarkly/segment_rule_helper.go b/launchdarkly/segment_rule_helper.go index 1e8a228d..ebe66583 100644 --- a/launchdarkly/segment_rule_helper.go +++ b/launchdarkly/segment_rule_helper.go @@ -17,8 +17,8 @@ func segmentRulesSchema() *schema.Schema { Type: schema.TypeInt, Elem: &schema.Schema{Type: schema.TypeInt}, Optional: true, - ValidateDiagFunc: validation.ToDiagFunc(validation.IntBetween(0, 100000)), - Description: "The integer weight of the rule (between 0 and 100000).", + ValidateDiagFunc: validation.ToDiagFunc(validation.IntBetween(1, 100000)), + Description: "The integer weight of the rule (between 1 and 100000).", }, BUCKET_BY: { Type: schema.TypeString, @@ -47,21 +47,31 @@ func segmentRulesFromResourceData(d *schema.ResourceData, metaRaw interface{}) ( func segmentRuleFromResourceData(val interface{}) (ldapi.UserSegmentRule, error) { ruleMap := val.(map[string]interface{}) - weight := int32(ruleMap[WEIGHT].(int)) - bucketBy := ruleMap[BUCKET_BY].(string) - r := ldapi.UserSegmentRule{ - Weight: &weight, - BucketBy: &bucketBy, - } - for _, c := range ruleMap[CLAUSES].([]interface{}) { + rawClauses := ruleMap[CLAUSES].([]interface{}) + clauses := make([]ldapi.Clause, 0, len(rawClauses)) + for _, c := range rawClauses { clause, err := clauseFromResourceData(c) if err != nil { - return r, err + return ldapi.UserSegmentRule{}, err } - r.Clauses = append(r.Clauses, clause) + clauses = append(clauses, clause) + } + + r := ldapi.NewUserSegmentRule(clauses) + + bucketBy := ruleMap[BUCKET_BY].(string) + if bucketBy != "" { + r.SetBucketBy(bucketBy) + } + + // weight == 0 when omitted from the config. In this case we do not want to include a weight in the PATCH + // request because the results will be counterintuitive. See: https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/79 + weight := int32(ruleMap[WEIGHT].(int)) + if weight > 0 { + r.SetWeight(weight) } - return r, nil + return *r, nil } func segmentRulesToResourceData(rules []ldapi.UserSegmentRule) (interface{}, error) { diff --git a/launchdarkly/segment_rule_helper_test.go b/launchdarkly/segment_rule_helper_test.go new file mode 100644 index 00000000..457399be --- /dev/null +++ b/launchdarkly/segment_rule_helper_test.go @@ -0,0 +1,64 @@ +package launchdarkly + +import ( + "testing" + + ldapi "github.com/launchdarkly/api-client-go/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestSegmentRuleFromResourceData(t *testing.T) { + cases := []struct { + name string + input map[string]interface{} + expected ldapi.UserSegmentRule + }{ + { + // https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/79 + name: "Zero case should not create a UserSegmentRule with 0 weight", + input: map[string]interface{}{ + WEIGHT: 0, + BUCKET_BY: "", + CLAUSES: []interface{}{}, + }, + expected: ldapi.UserSegmentRule{ + Clauses: []ldapi.Clause{}, + }, + }, + { + name: "Clauses only - most typical case", + input: map[string]interface{}{ + WEIGHT: 0, + BUCKET_BY: "", + CLAUSES: []interface{}{ + map[string]interface{}{ + ATTRIBUTE: "country", + OP: "in", + NEGATE: false, + VALUES: []interface{}{"us", "gb"}, + VALUE_TYPE: "string", + }, + }, + }, + expected: ldapi.UserSegmentRule{ + Clauses: []ldapi.Clause{ + { + Attribute: "country", + Op: "in", + Negate: false, + Values: []interface{}{"us", "gb"}, + }, + }, + }, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + actual, err := segmentRuleFromResourceData(tc.input) + require.NoError(t, err) + assert.Equal(t, tc.expected, actual) + }) + } +} diff --git a/website/docs/r/segment.html.markdown b/website/docs/r/segment.html.markdown index 159ccfab..d6c2b53b 100644 --- a/website/docs/r/segment.html.markdown +++ b/website/docs/r/segment.html.markdown @@ -59,7 +59,7 @@ resource "launchdarkly_segment" "example" { Nested `rules` blocks have the following structure: -- `weight` - (Optional) The integer weight of the rule (between 0 and 100000). +- `weight` - (Optional) The integer weight of the rule (between 1 and 100000). - `bucket_by` - (Optional) The attribute by which to group users together. From f1e972c77ed81f2fd4e2a3eff87471f237f04819 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Fri, 21 Jan 2022 13:50:23 +0000 Subject: [PATCH 003/128] Fix flag trigger creation panic (#190) --- CHANGELOG.md | 4 +- .../resource_launchdarkly_flag_trigger.go | 14 +++--- ...resource_launchdarkly_flag_trigger_test.go | 50 +++++++++++++++++++ 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efe4e429..c7fcc6d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ BUG FIXES: -- Fixes a [bug](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/79) introduced in v2.2.0 where `launchdarkly_segments` with `rule` blocks not containing a `weight` were defaulting to a `weight` of 0. +- Fixed a [bug](https://app.shortcut.com/launchdarkly/story/138913/terraform-provider-panics-when-trying-to-create-triggers-that-are-enabled) preventing `launchdarkly_flag_trigger`s from being created in the `enabled` state. + +- Fixed a [bug](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/79) introduced in v2.2.0 where `launchdarkly_segments` with `rule` blocks not containing a `weight` were defaulting to a `weight` of 0. ## [2.4.0] (January 19, 2022) diff --git a/launchdarkly/resource_launchdarkly_flag_trigger.go b/launchdarkly/resource_launchdarkly_flag_trigger.go index 7ba39e71..b66889a3 100644 --- a/launchdarkly/resource_launchdarkly_flag_trigger.go +++ b/launchdarkly/resource_launchdarkly_flag_trigger.go @@ -38,15 +38,19 @@ func resourceFlagTriggerCreate(ctx context.Context, d *schema.ResourceData, meta triggerBody := ldapi.NewTriggerPost(integrationKey) triggerBody.Instructions = &instructions - preUpdateTrigger, _, err := client.ld.FlagTriggersApi.CreateTriggerWorkflow(client.ctx, projectKey, envKey, flagKey).TriggerPost(*triggerBody).Execute() + createdTrigger, _, err := client.ld.FlagTriggersApi.CreateTriggerWorkflow(client.ctx, projectKey, envKey, flagKey).TriggerPost(*triggerBody).Execute() if err != nil { return diag.Errorf("failed to create %s trigger for proj/env/flag %s/%s/%s: %s", integrationKey, projectKey, envKey, flagKey, err.Error()) } - _ = d.Set(TRIGGER_URL, preUpdateTrigger.TriggerURL) + _ = d.Set(TRIGGER_URL, createdTrigger.TriggerURL) + + if createdTrigger.Id == nil { + return diag.Errorf("received a nil trigger ID when creating %s trigger for proj/env/flag %s/%s/%s: %s", integrationKey, projectKey, envKey, flagKey, err.Error()) + } + d.SetId(*createdTrigger.Id) // if enabled is false upon creation, we need to do a patch since the create endpoint // does not accept multiple instructions - var postUpdateTrigger ldapi.TriggerWorkflowRep if !enabled { instructions = []map[string]interface{}{{ KIND: "disableTrigger", @@ -55,13 +59,11 @@ func resourceFlagTriggerCreate(ctx context.Context, d *schema.ResourceData, meta Instructions: &instructions, } - postUpdateTrigger, _, err = client.ld.FlagTriggersApi.PatchTriggerWorkflow(client.ctx, projectKey, envKey, flagKey, *preUpdateTrigger.Id).FlagTriggerInput(input).Execute() + _, _, err = client.ld.FlagTriggersApi.PatchTriggerWorkflow(client.ctx, projectKey, envKey, flagKey, *createdTrigger.Id).FlagTriggerInput(input).Execute() if err != nil { return diag.Errorf("failed to update %s trigger for proj/env/flag %s/%s/%s: %s", integrationKey, projectKey, envKey, flagKey, err.Error()) } } - - d.SetId(*postUpdateTrigger.Id) return resourceFlagTriggerRead(ctx, d, metaRaw) } diff --git a/launchdarkly/resource_launchdarkly_flag_trigger_test.go b/launchdarkly/resource_launchdarkly_flag_trigger_test.go index ec61389a..7a009e5f 100644 --- a/launchdarkly/resource_launchdarkly_flag_trigger_test.go +++ b/launchdarkly/resource_launchdarkly_flag_trigger_test.go @@ -22,6 +22,20 @@ resource "launchdarkly_flag_trigger" "basic" { enabled = false } ` + + testAccFlagTriggerCreateEnabled = ` +resource "launchdarkly_flag_trigger" "basic" { + project_key = launchdarkly_project.test.key + env_key = "test" + flag_key = launchdarkly_feature_flag.trigger_flag.key + integration_key = "generic-trigger" + instructions { + kind = "turnFlagOff" + } + enabled = true +} +` + testAccFlagTriggerUpdate = ` resource "launchdarkly_flag_trigger" "basic" { project_key = launchdarkly_project.test.key @@ -127,6 +141,42 @@ func TestAccFlagTrigger_CreateUpdate(t *testing.T) { }) } +func TestAccFlagTrigger_CreateEnabled(t *testing.T) { + projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + flagKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "launchdarkly_flag_trigger.basic" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: withRandomProject(projectKey, withRandomFlag(flagKey, testAccFlagTriggerCreateEnabled)), + Check: resource.ComposeTestCheckFunc( + testAccCheckProjectExists("launchdarkly_project.test"), + testAccCheckFlagExists(projectKey, "launchdarkly_feature_flag.trigger_flag"), + resource.TestCheckResourceAttr(resourceName, PROJECT_KEY, projectKey), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, FLAG_KEY, flagKey), + resource.TestCheckResourceAttr(resourceName, INTEGRATION_KEY, "generic-trigger"), + resource.TestCheckResourceAttr(resourceName, "instructions.0.kind", "turnFlagOff"), + resource.TestCheckResourceAttr(resourceName, ENABLED, "true"), + resource.TestCheckResourceAttrSet(resourceName, TRIGGER_URL), + resource.TestCheckResourceAttrSet(resourceName, MAINTAINER_ID), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdPrefix: fmt.Sprintf("%s/test/%s/", projectKey, flagKey), + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{TRIGGER_URL}, + }, + }, + }) +} + func testAccCheckFlagExists(projectKey, resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] From 09a6fa3d3ae4255a67c19a8fd9b7971bee18d858 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Fri, 21 Jan 2022 14:03:54 +0000 Subject: [PATCH 004/128] Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7fcc6d2..30db396c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [2.4.1] (Unreleased) +## [2.4.1] (January 21, 2022) BUG FIXES: From e493b76890085a40dd4e2eaa4c115ab5b3a55495 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Mon, 7 Feb 2022 17:03:26 +0000 Subject: [PATCH 005/128] Add Slack webhooks to audit_log_subscription (#192) --- CHANGELOG.md | 11 +++++ .../audit_log_subscription_configs.go | 28 ++++++++++++ launchdarkly/audit_log_subscription_helper.go | 15 +++---- ...aunchdarkly_audit_log_subscription_test.go | 43 +++++++++++++++++++ ...aunchdarkly_audit_log_subscription_test.go | 37 ++++++++++++++++ .../d/audit_log_subscription.html.markdown | 2 +- .../r/audit_log_subscription.html.markdown | 2 +- 7 files changed, 128 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30db396c..aa6550c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [Unreleased] + +FEATURES: + +- Added Slack webhooks to the `launchdarkly_audit_log_subscription` resource and data source. [#16](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/16) +- Added more Datadog host URLs to the Datadog `launchdarkly_audit_log_subscription` resource. + +BUG FIXES: + +- Fixed an issue where the `config` was not being set on the `launchdarkly_audit_log_subscription` data source. + ## [2.4.1] (January 21, 2022) BUG FIXES: diff --git a/launchdarkly/audit_log_subscription_configs.go b/launchdarkly/audit_log_subscription_configs.go index a20103e2..ef9da821 100644 --- a/launchdarkly/audit_log_subscription_configs.go +++ b/launchdarkly/audit_log_subscription_configs.go @@ -49,6 +49,9 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]interface{}{ "allowedValues": []interface{}{ "https://api.datadoghq.com", "https://api.datadoghq.eu", + "https://us3.datadoghq.com", + "https://us5.datadoghq.com", + "https://app.ddog-gov.com", }, "defaultValue": "https://api.datadoghq.com", "isSecret": false, @@ -296,3 +299,28 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]interface{}{ }, }, } + +// There is not currently a manifest for slack webhooks so we have to use this for now. +var EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]interface{}{ + "slack": map[string]interface{}{ + "url": map[string]interface{}{ + "type": "uri", + "isOptional": false, + "allowedValues": nil, + "defaultValue": nil, + "isSecret": false, + }, + }, +} + +func getSubscriptionConfigurationFields() map[string]interface{} { + fields := make(map[string]interface{}, len(SUBSCRIPTION_CONFIGURATION_FIELDS)+len(EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS)) + + for k, v := range SUBSCRIPTION_CONFIGURATION_FIELDS { + fields[k] = v + } + for k, v := range EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS { + fields[k] = v + } + return fields +} diff --git a/launchdarkly/audit_log_subscription_helper.go b/launchdarkly/audit_log_subscription_helper.go index 02be4802..d907e8d0 100644 --- a/launchdarkly/audit_log_subscription_helper.go +++ b/launchdarkly/audit_log_subscription_helper.go @@ -55,9 +55,9 @@ func auditLogSubscriptionSchema(isDataSource bool) map[string]*schema.Schema { } func parseAuditLogSubscriptionConfigs() map[string]IntegrationConfig { - // SUBSCRIPTION_CONFIGURATION_FIELDS can be found in audit_log_subscription_configs.go - configs := make(map[string]IntegrationConfig, len(SUBSCRIPTION_CONFIGURATION_FIELDS)) - for integrationKey, rawVariables := range SUBSCRIPTION_CONFIGURATION_FIELDS { + rawConfigFields := getSubscriptionConfigurationFields() + configs := make(map[string]IntegrationConfig, len(rawConfigFields)) + for integrationKey, rawVariables := range rawConfigFields { cfg := IntegrationConfig{} variables := rawVariables.(map[string]interface{}) for k, v := range variables { @@ -162,7 +162,7 @@ func configFromResourceData(d *schema.ResourceData) (map[string]interface{}, err return convertedConfig, nil } -func configToResourceData(d *schema.ResourceData, config map[string]interface{}) (map[string]interface{}, error) { +func configToResourceData(d *schema.ResourceData, config map[string]interface{}, isDataSource bool) (map[string]interface{}, error) { integrationKey := d.Get(INTEGRATION_KEY).(string) configMap := parseAuditLogSubscriptionConfigs() configFormat, ok := configMap[integrationKey] @@ -174,9 +174,9 @@ func configToResourceData(d *schema.ResourceData, config map[string]interface{}) for k, v := range config { key := strcase.SnakeCase(k) // some attributes have defaults that the API will return and terraform will complain since config - // is not a computed attribute (cannot be both required & computed) + // is not a computed attribute (cannot be both required & computed). This does not apply for data sources. // TODO: handle this in a SuppressDiff function - if _, setByUser := originalConfig[key]; !setByUser { + if _, setByUser := originalConfig[key]; !setByUser && !isDataSource { continue } convertedConfig[key] = v @@ -221,10 +221,9 @@ func auditLogSubscriptionRead(ctx context.Context, d *schema.ResourceData, metaR d.SetId(*sub.Id) } - _ = d.Set(INTEGRATION_KEY, sub.Kind) _ = d.Set(NAME, sub.Name) _ = d.Set(ON, sub.On) - cfg, err := configToResourceData(d, *sub.Config) + cfg, err := configToResourceData(d, *sub.Config, isDataSource) if err != nil { return diag.Errorf("failed to set config on integration with id %q: %v", *sub.Id, err) } diff --git a/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go b/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go index 01dc454a..89664b2b 100644 --- a/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go +++ b/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go @@ -116,3 +116,46 @@ func TestAccDataSourceAuditLogSubscription_exists(t *testing.T) { }, }) } + +func TestAccDataSourceAuditLogSubscription_Slack(t *testing.T) { + accTest := os.Getenv("TF_ACC") + if accTest == "" { + t.SkipNow() + } + + integrationKey := "slack" + client, err := newClient(os.Getenv(LAUNCHDARKLY_ACCESS_TOKEN), os.Getenv(LAUNCHDARKLY_API_HOST), false) + require.NoError(t, err) + + subscriptionBody := ldapi.SubscriptionPost{ + Name: "test subscription", + Config: map[string]interface{}{ + "url": "https://hooks.slack.com/services/SOME-RANDOM-HOOK", + }, + } + sub, err := testAccDataSourceAuditLogSubscriptionCreate(client, integrationKey, subscriptionBody) + require.NoError(t, err) + + defer func() { + err := testAccDataSourceAuditLogSubscriptionDelete(client, integrationKey, *sub.Id) + require.NoError(t, err) + }() + + resourceName := "data.launchdarkly_audit_log_subscription.test" + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(testAccDataSourceAuditLogSubscriptionExists, *sub.Id, integrationKey), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "id", *sub.Id), + resource.TestCheckResourceAttr(resourceName, "config.url", "https://hooks.slack.com/services/SOME-RANDOM-HOOK"), + ), + }, + }, + }) +} diff --git a/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go b/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go index dbdb4a2b..f9bf9bff 100644 --- a/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go +++ b/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go @@ -177,6 +177,43 @@ func TestAccAuditLogSubscription_CreateMSTeams(t *testing.T) { }) } +func TestAccAuditLogSubscription_CreateSlack(t *testing.T) { + // splunk specifically needs to be converted to kebab case, so we need to handle it specially + integrationKey := "slack" + config := `{ + url = "https://hooks.slack.com/services/SOME-RANDOM-HOOK" + } + ` + + resourceName := fmt.Sprintf("launchdarkly_audit_log_subscription.%s_tf_test", integrationKey) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(testAccAuditLogSubscriptionCreate, integrationKey, integrationKey, config), + Check: resource.ComposeTestCheckFunc( + testAccCheckIntegrationExists(resourceName), + resource.TestCheckResourceAttrSet(resourceName, ID), + resource.TestCheckResourceAttr(resourceName, INTEGRATION_KEY, integrationKey), + resource.TestCheckResourceAttr(resourceName, NAME, "terraform test"), + resource.TestCheckResourceAttr(resourceName, ON, "true"), + resource.TestCheckResourceAttr(resourceName, "config.url", "https://hooks.slack.com/services/SOME-RANDOM-HOOK"), + resource.TestCheckResourceAttr(resourceName, "tags.#", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.0", "integrations"), + resource.TestCheckResourceAttr(resourceName, "tags.1", "terraform"), + resource.TestCheckResourceAttr(resourceName, "statements.#", "1"), + resource.TestCheckResourceAttr(resourceName, "statements.0.actions.0", "*"), + resource.TestCheckResourceAttr(resourceName, "statements.0.resources.0", "proj/*:env/*:flag/*"), + resource.TestCheckResourceAttr(resourceName, "statements.0.effect", "deny"), + ), + }, + }, + }) +} + func TestAccAuditLogSubscription_CreateSplunk(t *testing.T) { // splunk specifically needs to be converted to kebab case, so we need to handle it specially integrationKey := "splunk" diff --git a/website/docs/d/audit_log_subscription.html.markdown b/website/docs/d/audit_log_subscription.html.markdown index a7668ab2..02f66b29 100644 --- a/website/docs/d/audit_log_subscription.html.markdown +++ b/website/docs/d/audit_log_subscription.html.markdown @@ -24,7 +24,7 @@ data "launchdarkly_audit_log_subscription" "test" { - `id` (Required) - The unique subscription ID. This can be found in the URL of the pull-out configuration sidebar for the given subscription on your [LaunchDarkly Integrations page](https://app.launchdarkly.com/default/integrations). -- `integration_key` (Required) - The integration key. As of January 2022, supported integrations are `"datadog"`, `"dynatrace"`, `"elastic"`, `"honeycomb"`, `"logdna"`, `"msteams"`, `"new-relic-apm"`, `"signalfx"`, and `"splunk"`. +- `integration_key` (Required) - The integration key. As of February 2022, supported integrations are `"datadog"`, `"dynatrace"`, `"elastic"`, `"honeycomb"`, `"logdna"`, `"msteams"`, `"new-relic-apm"`, `"signalfx"`, `"slack"`, and `"splunk"`. ## Attributes Reference diff --git a/website/docs/r/audit_log_subscription.html.markdown b/website/docs/r/audit_log_subscription.html.markdown index 9a266673..a7ac0ab2 100644 --- a/website/docs/r/audit_log_subscription.html.markdown +++ b/website/docs/r/audit_log_subscription.html.markdown @@ -35,7 +35,7 @@ resource "launchdarkly_audit_log_subscription" "example" { ## Argument Reference -- `integration_key` (Required) The integration key. As of January 2022, supported integrations are `"datadog"`, `"dynatrace"`, `"elastic"`, `"honeycomb"`, `"logdna"`, `"msteams"`, `"new-relic-apm"`, `"signalfx"`, and `"splunk"`. A change in this field will force the destruction of the existing resource and the creation of a new one. +- `integration_key` (Required) The integration key. As of January 2022, supported integrations are `"datadog"`, `"dynatrace"`, `"elastic"`, `"honeycomb"`, `"logdna"`, `"msteams"`, `"new-relic-apm"`, `"signalfx"`, `"slack"`, and `"splunk"`. A change in this field will force the destruction of the existing resource and the creation of a new one. - `name` (Required) - A human-friendly name for your audit log subscription viewable from within the LaunchDarkly Integrations page. From 2512cf3925b752357da0c97bc9ea067faf7b2ef5 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Tue, 8 Feb 2022 10:54:17 +0000 Subject: [PATCH 006/128] backmerge v2.5.0 (#193) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa6550c2..2697c7cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [Unreleased] +## [2.5.0] (February 7, 2022) FEATURES: From f4332bc9f4b6154a3b8ff76ff14c44801d0dea50 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Tue, 8 Feb 2022 16:36:26 +0000 Subject: [PATCH 007/128] Use jennifer to generate audit log subscription configs (#194) --- .pre-commit-config.yaml | 15 +- GNUmakefile | 6 + docs/DEVELOPMENT.md | 2 +- .../audit_log_subscription_configs.go | 326 -------- .../audit_log_subscription_configs.json | 1 - ...udit_log_subscription_configs_generated.go | 190 +++++ launchdarkly/audit_log_subscription_helper.go | 83 +- scripts/codegen/cmd/root.go | 66 ++ scripts/codegen/go.mod | 9 + scripts/codegen/go.sum | 774 ++++++++++++++++++ scripts/codegen/main.go | 7 + scripts/codegen/manifestgen/generator.go | 64 ++ scripts/codegen/manifestgen/manifests.go | 69 ++ .../generate_integration_audit_log_configs.py | 62 -- 14 files changed, 1230 insertions(+), 444 deletions(-) delete mode 100644 launchdarkly/audit_log_subscription_configs.go delete mode 100644 launchdarkly/audit_log_subscription_configs.json create mode 100644 launchdarkly/audit_log_subscription_configs_generated.go create mode 100644 scripts/codegen/cmd/root.go create mode 100644 scripts/codegen/go.mod create mode 100644 scripts/codegen/go.sum create mode 100644 scripts/codegen/main.go create mode 100644 scripts/codegen/manifestgen/generator.go create mode 100644 scripts/codegen/manifestgen/manifests.go delete mode 100644 scripts/generate_integration_audit_log_configs.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da478a0d..d73e7def 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,18 +5,17 @@ repos: rev: v0.1.4 hooks: - id: gofmts + - repo: https://github.com/golangci/golangci-lint rev: v1.43.0 hooks: - id: golangci-lint + - repo: local hooks: - - id: generate-audit-log-subscription-configs - name: Generate Audit Log Subscription Configurations - description: This hook runs a python script to update the audit log subscription configuration validation fields. - entry: python scripts/generate_integration_audit_log_configs.py + - id: make-generate-no-change + name: Make generate does not create additional changes + description: Ensures make generate does not create additional changes + entry: bash -c 'make generate' pass_filenames: false - language: python - additional_dependencies: ['requests'] - verbose: true - + language: system diff --git a/GNUmakefile b/GNUmakefile index c3ff6172..90a5fb2c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -39,6 +39,12 @@ fmtcheck: errcheck: @sh -c "'$(CURDIR)/scripts/errcheck.sh'" +install-codegen: + cd scripts/codegen && go install && cd ../.. + +generate: install-codegen + go generate ./... + test-compile: @if [ "$(TEST)" = "./..." ]; then \ echo "ERROR: Set TEST to a specific package. For example,"; \ diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 7d9a8f41..80528413 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -20,7 +20,7 @@ $ mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terrafor $ git clone git@github.com:launchdarkly/terraform-provider-launchdarkly ``` -If you are working on the `launchdarkly_audit_log_subscription` resource, you will want to ensure the configuration field mapping is up-to-date with the [most recent changes](https://github.com/launchdarkly/integration-framework/tree/master/integrations) while testing by `cd`-ing into `scripts/` and running `python generate_integration_audit_log_configs.py`. Please note you will need to have the Python `requests` package installed locally. Otherwise, this will be run as a git commit hook. Then, to update the go mapping, follow the instructions in audit_log_subscription_configs.go and commit and push your changes. +If you are working on the `launchdarkly_audit_log_subscription` resource, you will want to ensure the configuration field mapping is up-to-date with the [most recent changes](https://github.com/launchdarkly/integration-framework/tree/master/integrations) by running `make generate`. To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. diff --git a/launchdarkly/audit_log_subscription_configs.go b/launchdarkly/audit_log_subscription_configs.go deleted file mode 100644 index ef9da821..00000000 --- a/launchdarkly/audit_log_subscription_configs.go +++ /dev/null @@ -1,326 +0,0 @@ -package launchdarkly - -// to get the updated SUBSCRIPTION_CONFIGURATION_FIELDS value, paste the generated json in -// audit_log_subscription_configs.json into https://rodrigo-brito.github.io/json-to-go-map/ - -// TODO: generate this automatically -// func parseAuditLogSubscriptionConfigsFromJson() (map[string]IntegrationConfig, error) { -// var configs map[string]IntegrationConfig -// file, err := ioutil.ReadFile(CONFIG_FILE) -// if err != nil { -// return configs, err -// } - -// err = json.Unmarshal([]byte(file), &configs) -// if err != nil { -// return configs, err -// } -// return configs, nil -// } - -var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]interface{}{ - "appdynamics": map[string]interface{}{ - "account": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - "applicationID": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - }, - "datadog": map[string]interface{}{ - "apiKey": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "hostURL": map[string]interface{}{ - "type": "enum", - "isOptional": true, - "allowedValues": []interface{}{ - "https://api.datadoghq.com", - "https://api.datadoghq.eu", - "https://us3.datadoghq.com", - "https://us5.datadoghq.com", - "https://app.ddog-gov.com", - }, - "defaultValue": "https://api.datadoghq.com", - "isSecret": false, - }, - }, - "dynatrace": map[string]interface{}{ - "apiToken": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "url": map[string]interface{}{ - "type": "uri", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - "entity": map[string]interface{}{ - "type": "enum", - "isOptional": true, - "allowedValues": []interface{}{ - "APPLICATION", - "APPLICATION_METHOD", - "APPLICATION_METHOD_GROUP", - "AUTO_SCALING_GROUP", - "AUXILIARY_SYNTHETIC_TEST", - "AWS_APPLICATION_LOAD_BALANCER", - "AWS_AVAILABILITY_ZONE", - "AWS_CREDENTIALS", - "AWS_LAMBDA_FUNCTION", - "AWS_NETWORK_LOAD_BALANCER", - "AZURE_API_MANAGEMENT_SERVICE", - "AZURE_APPLICATION_GATEWAY", - "AZURE_COSMOS_DB", - "AZURE_CREDENTIALS", - "AZURE_EVENT_HUB", - "AZURE_EVENT_HUB_NAMESPACE", - "AZURE_FUNCTION_APP", - "AZURE_IOT_HUB", - "AZURE_LOAD_BALANCER", - "AZURE_MGMT_GROUP", - "AZURE_REDIS_CACHE", - "AZURE_REGION", - "AZURE_SERVICE_BUS_NAMESPACE", - "AZURE_SERVICE_BUS_QUEUE", - "AZURE_SERVICE_BUS_TOPIC", - "AZURE_SQL_DATABASE", - "AZURE_SQL_ELASTIC_POOL", - "AZURE_SQL_SERVER", - "AZURE_STORAGE_ACCOUNT", - "AZURE_SUBSCRIPTION", - "AZURE_TENANT", - "AZURE_VM", - "AZURE_VM_SCALE_SET", - "AZURE_WEB_APP", - "CF_APPLICATION", - "CF_FOUNDATION", - "CINDER_VOLUME", - "CLOUD_APPLICATION", - "CLOUD_APPLICATION_INSTANCE", - "CLOUD_APPLICATION_NAMESPACE", - "CONTAINER_GROUP", - "CONTAINER_GROUP_INSTANCE", - "CUSTOM_APPLICATION", - "CUSTOM_DEVICE", - "CUSTOM_DEVICE_GROUP", - "DCRUM_APPLICATION", - "DCRUM_SERVICE", - "DCRUM_SERVICE_INSTANCE", - "DEVICE_APPLICATION_METHOD", - "DISK", - "DOCKER_CONTAINER_GROUP_INSTANCE", - "DYNAMO_DB_TABLE", - "EBS_VOLUME", - "EC2_INSTANCE", - "ELASTIC_LOAD_BALANCER", - "ENVIRONMENT", - "EXTERNAL_SYNTHETIC_TEST_STEP", - "GCP_ZONE", - "GEOLOCATION", - "GEOLOC_SITE", - "GOOGLE_COMPUTE_ENGINE", - "HOST", - "HOST_GROUP", - "HTTP_CHECK", - "HTTP_CHECK_STEP", - "HYPERVISOR", - "KUBERNETES_CLUSTER", - "KUBERNETES_NODE", - "MOBILE_APPLICATION", - "NETWORK_INTERFACE", - "NEUTRON_SUBNET", - "OPENSTACK_PROJECT", - "OPENSTACK_REGION", - "OPENSTACK_VM", - "OS", - "PROCESS_GROUP", - "PROCESS_GROUP_INSTANCE", - "RELATIONAL_DATABASE_SERVICE", - "SERVICE", - "SERVICE_INSTANCE", - "SERVICE_METHOD", - "SERVICE_METHOD_GROUP", - "SWIFT_CONTAINER", - "SYNTHETIC_LOCATION", - "SYNTHETIC_TEST", - "SYNTHETIC_TEST_STEP", - "VIRTUALMACHINE", - "VMWARE_DATACENTER", - }, - "defaultValue": "APPLICATION", - "isSecret": false, - }, - }, - "elastic": map[string]interface{}{ - "url": map[string]interface{}{ - "type": "uri", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - "token": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "index": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - }, - "honeycomb": map[string]interface{}{ - "datasetName": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - "apiKey": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - }, - "logdna": map[string]interface{}{ - "ingestionKey": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "level": map[string]interface{}{ - "type": "string", - "isOptional": true, - "allowedValues": nil, - "defaultValue": "INFO", - "isSecret": false, - }, - }, - "msteams": map[string]interface{}{ - "url": map[string]interface{}{ - "type": "uri", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - }, - "new-relic-apm": map[string]interface{}{ - "apiKey": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "applicationId": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - "domain": map[string]interface{}{ - "type": "enum", - "isOptional": true, - "allowedValues": []interface{}{ - "api.newrelic.com", - "api.eu.newrelic.com", - }, - "defaultValue": "api.newrelic.com", - "isSecret": false, - }, - }, - "signalfx": map[string]interface{}{ - "accessToken": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "realm": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - }, - "splunk": map[string]interface{}{ - "base-url": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - "token": map[string]interface{}{ - "type": "string", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": true, - }, - "skip-ca-verification": map[string]interface{}{ - "type": "boolean", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - }, -} - -// There is not currently a manifest for slack webhooks so we have to use this for now. -var EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]interface{}{ - "slack": map[string]interface{}{ - "url": map[string]interface{}{ - "type": "uri", - "isOptional": false, - "allowedValues": nil, - "defaultValue": nil, - "isSecret": false, - }, - }, -} - -func getSubscriptionConfigurationFields() map[string]interface{} { - fields := make(map[string]interface{}, len(SUBSCRIPTION_CONFIGURATION_FIELDS)+len(EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS)) - - for k, v := range SUBSCRIPTION_CONFIGURATION_FIELDS { - fields[k] = v - } - for k, v := range EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS { - fields[k] = v - } - return fields -} diff --git a/launchdarkly/audit_log_subscription_configs.json b/launchdarkly/audit_log_subscription_configs.json deleted file mode 100644 index c6ab2b60..00000000 --- a/launchdarkly/audit_log_subscription_configs.json +++ /dev/null @@ -1 +0,0 @@ -{"appdynamics": {"account": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}, "applicationID": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}}, "datadog": {"apiKey": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "hostURL": {"type": "enum", "isOptional": true, "allowedValues": ["https://api.datadoghq.com", "https://api.datadoghq.eu", "https://us3.datadoghq.com", "https://us5.datadoghq.com", "https://app.ddog-gov.com"], "defaultValue": "https://api.datadoghq.com", "isSecret": false}}, "dynatrace": {"apiToken": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "url": {"type": "uri", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}, "entity": {"type": "enum", "isOptional": true, "allowedValues": ["APPLICATION", "APPLICATION_METHOD", "APPLICATION_METHOD_GROUP", "AUTO_SCALING_GROUP", "AUXILIARY_SYNTHETIC_TEST", "AWS_APPLICATION_LOAD_BALANCER", "AWS_AVAILABILITY_ZONE", "AWS_CREDENTIALS", "AWS_LAMBDA_FUNCTION", "AWS_NETWORK_LOAD_BALANCER", "AZURE_API_MANAGEMENT_SERVICE", "AZURE_APPLICATION_GATEWAY", "AZURE_COSMOS_DB", "AZURE_CREDENTIALS", "AZURE_EVENT_HUB", "AZURE_EVENT_HUB_NAMESPACE", "AZURE_FUNCTION_APP", "AZURE_IOT_HUB", "AZURE_LOAD_BALANCER", "AZURE_MGMT_GROUP", "AZURE_REDIS_CACHE", "AZURE_REGION", "AZURE_SERVICE_BUS_NAMESPACE", "AZURE_SERVICE_BUS_QUEUE", "AZURE_SERVICE_BUS_TOPIC", "AZURE_SQL_DATABASE", "AZURE_SQL_ELASTIC_POOL", "AZURE_SQL_SERVER", "AZURE_STORAGE_ACCOUNT", "AZURE_SUBSCRIPTION", "AZURE_TENANT", "AZURE_VM", "AZURE_VM_SCALE_SET", "AZURE_WEB_APP", "CF_APPLICATION", "CF_FOUNDATION", "CINDER_VOLUME", "CLOUD_APPLICATION", "CLOUD_APPLICATION_INSTANCE", "CLOUD_APPLICATION_NAMESPACE", "CONTAINER_GROUP", "CONTAINER_GROUP_INSTANCE", "CUSTOM_APPLICATION", "CUSTOM_DEVICE", "CUSTOM_DEVICE_GROUP", "DCRUM_APPLICATION", "DCRUM_SERVICE", "DCRUM_SERVICE_INSTANCE", "DEVICE_APPLICATION_METHOD", "DISK", "DOCKER_CONTAINER_GROUP_INSTANCE", "DYNAMO_DB_TABLE", "EBS_VOLUME", "EC2_INSTANCE", "ELASTIC_LOAD_BALANCER", "ENVIRONMENT", "EXTERNAL_SYNTHETIC_TEST_STEP", "GCP_ZONE", "GEOLOCATION", "GEOLOC_SITE", "GOOGLE_COMPUTE_ENGINE", "HOST", "HOST_GROUP", "HTTP_CHECK", "HTTP_CHECK_STEP", "HYPERVISOR", "KUBERNETES_CLUSTER", "KUBERNETES_NODE", "MOBILE_APPLICATION", "NETWORK_INTERFACE", "NEUTRON_SUBNET", "OPENSTACK_PROJECT", "OPENSTACK_REGION", "OPENSTACK_VM", "OS", "PROCESS_GROUP", "PROCESS_GROUP_INSTANCE", "RELATIONAL_DATABASE_SERVICE", "SERVICE", "SERVICE_INSTANCE", "SERVICE_METHOD", "SERVICE_METHOD_GROUP", "SWIFT_CONTAINER", "SYNTHETIC_LOCATION", "SYNTHETIC_TEST", "SYNTHETIC_TEST_STEP", "VIRTUALMACHINE", "VMWARE_DATACENTER"], "defaultValue": "APPLICATION", "isSecret": false}}, "elastic": {"url": {"type": "uri", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}, "token": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "index": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}}, "honeycomb": {"datasetName": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}, "apiKey": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}}, "logdna": {"ingestionKey": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "level": {"type": "string", "isOptional": true, "allowedValues": null, "defaultValue": "INFO", "isSecret": false}}, "msteams": {"url": {"type": "uri", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}}, "new-relic-apm": {"apiKey": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "applicationId": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}, "domain": {"type": "enum", "isOptional": true, "allowedValues": ["api.newrelic.com", "api.eu.newrelic.com"], "defaultValue": "api.newrelic.com", "isSecret": false}}, "signalfx": {"accessToken": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "realm": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}}, "splunk": {"base-url": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}, "token": {"type": "string", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": true}, "skip-ca-verification": {"type": "boolean", "isOptional": false, "allowedValues": null, "defaultValue": null, "isSecret": false}}} \ No newline at end of file diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go new file mode 100644 index 00000000..d21b0657 --- /dev/null +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -0,0 +1,190 @@ +// Code generated by github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen DO NOT EDIT. + +package launchdarkly + +var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ + "datadog": { + "apiKey": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Datadog [API key](https://app.datadoghq.com/account/settings#api).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "hostURL": { + AllowedValues: []string{"https://api.datadoghq.com", "https://api.datadoghq.eu", "https://us3.datadoghq.com", "https://us5.datadoghq.com", "https://app.ddog-gov.com"}, + DefaultValue: "https://api.datadoghq.com", + Description: "Your Datadog host URL. Read [How do I tell which Datadog site I am on?](https://docs.datadoghq.com/getting_started/site/#how-do-i-tell-which-datadog-site-i-am-on) if you are unsure which host URL to select.", + IsOptional: true, + IsSecret: false, + Type: "enum", + }, + }, + "dynatrace": { + "apiToken": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Dynatrace API token. [Learn more](https://www.dynatrace.com/support/help/shortlink/api-authentication#generate-a-token) about generating tokens. The 'access problem and event feed, metrics, and topology' scope is required.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "entity": { + AllowedValues: []string{"APPLICATION", "APPLICATION_METHOD", "APPLICATION_METHOD_GROUP", "AUTO_SCALING_GROUP", "AUXILIARY_SYNTHETIC_TEST", "AWS_APPLICATION_LOAD_BALANCER", "AWS_AVAILABILITY_ZONE", "AWS_CREDENTIALS", "AWS_LAMBDA_FUNCTION", "AWS_NETWORK_LOAD_BALANCER", "AZURE_API_MANAGEMENT_SERVICE", "AZURE_APPLICATION_GATEWAY", "AZURE_COSMOS_DB", "AZURE_CREDENTIALS", "AZURE_EVENT_HUB", "AZURE_EVENT_HUB_NAMESPACE", "AZURE_FUNCTION_APP", "AZURE_IOT_HUB", "AZURE_LOAD_BALANCER", "AZURE_MGMT_GROUP", "AZURE_REDIS_CACHE", "AZURE_REGION", "AZURE_SERVICE_BUS_NAMESPACE", "AZURE_SERVICE_BUS_QUEUE", "AZURE_SERVICE_BUS_TOPIC", "AZURE_SQL_DATABASE", "AZURE_SQL_ELASTIC_POOL", "AZURE_SQL_SERVER", "AZURE_STORAGE_ACCOUNT", "AZURE_SUBSCRIPTION", "AZURE_TENANT", "AZURE_VM", "AZURE_VM_SCALE_SET", "AZURE_WEB_APP", "CF_APPLICATION", "CF_FOUNDATION", "CINDER_VOLUME", "CLOUD_APPLICATION", "CLOUD_APPLICATION_INSTANCE", "CLOUD_APPLICATION_NAMESPACE", "CONTAINER_GROUP", "CONTAINER_GROUP_INSTANCE", "CUSTOM_APPLICATION", "CUSTOM_DEVICE", "CUSTOM_DEVICE_GROUP", "DCRUM_APPLICATION", "DCRUM_SERVICE", "DCRUM_SERVICE_INSTANCE", "DEVICE_APPLICATION_METHOD", "DISK", "DOCKER_CONTAINER_GROUP_INSTANCE", "DYNAMO_DB_TABLE", "EBS_VOLUME", "EC2_INSTANCE", "ELASTIC_LOAD_BALANCER", "ENVIRONMENT", "EXTERNAL_SYNTHETIC_TEST_STEP", "GCP_ZONE", "GEOLOCATION", "GEOLOC_SITE", "GOOGLE_COMPUTE_ENGINE", "HOST", "HOST_GROUP", "HTTP_CHECK", "HTTP_CHECK_STEP", "HYPERVISOR", "KUBERNETES_CLUSTER", "KUBERNETES_NODE", "MOBILE_APPLICATION", "NETWORK_INTERFACE", "NEUTRON_SUBNET", "OPENSTACK_PROJECT", "OPENSTACK_REGION", "OPENSTACK_VM", "OS", "PROCESS_GROUP", "PROCESS_GROUP_INSTANCE", "RELATIONAL_DATABASE_SERVICE", "SERVICE", "SERVICE_INSTANCE", "SERVICE_METHOD", "SERVICE_METHOD_GROUP", "SWIFT_CONTAINER", "SYNTHETIC_LOCATION", "SYNTHETIC_TEST", "SYNTHETIC_TEST_STEP", "VIRTUALMACHINE", "VMWARE_DATACENTER"}, + DefaultValue: "APPLICATION", + Description: "Select the Dynatrace entity `meType` to associate with all events.", + IsOptional: true, + IsSecret: false, + Type: "enum", + }, + "url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the URL used to access your Dynatrace (managed or hosted) service. Follow the pattern shown in the placeholder text.", + IsOptional: false, + IsSecret: false, + Type: "uri", + }, + }, + "elastic": { + "index": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the index name where you want to store your LaunchDarkly data", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "token": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the [base64 _credentials_ based on your API Key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html)", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the URL for your Elasticsearch endpoint including socket", + IsOptional: false, + IsSecret: false, + Type: "uri", + }, + }, + "honeycomb": { + "apiKey": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [Honeycomb API key](https://ui.honeycomb.io/teams).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "datasetName": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the name of your Honeycomb dataset. This value will associate LaunchDarkly data with the corresponding Honeycomb dataset.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + }, + "logdna": { + "ingestionKey": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [LogDNA ingestion key](https://app.logdna.com/manage/api-keys).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "level": { + AllowedValues: []string{}, + DefaultValue: "INFO", + Description: "The log level with which LaunchDarkly messages will be published.", + IsOptional: true, + IsSecret: false, + Type: "string", + }, + }, + "msteams": {"url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Microsoft Teams [incoming webhook URL](https://docs.launchdarkly.com/integrations/microsoft-teams#setting-up-a-connector-in-microsoft-teams).", + IsOptional: false, + IsSecret: false, + Type: "uri", + }}, + "new-relic-apm": { + "apiKey": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [New Relic REST API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#rest-api-key).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "applicationId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [New Relic application ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/app-id-other-product-ids#ui).", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "domain": { + AllowedValues: []string{"api.newrelic.com", "api.eu.newrelic.com"}, + DefaultValue: "api.newrelic.com", + Description: "Your New Relic data center. The default(US) is \"api.newrelic.com\". Use \"api.eu.newrelic.com\" if you are using the EU data center.", + IsOptional: true, + IsSecret: false, + Type: "enum", + }, + }, + "signalfx": { + "accessToken": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [SignalFx access token](https://docs.signalfx.com/en/latest/admin-guide/tokens.html#working-with-access-tokens).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "realm": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [SignalFx realm](https://developers.signalfx.com/#realms-in-endpoints).", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + }, + "splunk": { + "base-url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [Splunk HTTP event collector base URL](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector).", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "skip-ca-verification": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Splunk Cloud instances sign their own SSL certificates by default. If you use Splunk Cloud, you may need to skip certificate validation in order for this integration to work.", + IsOptional: false, + IsSecret: false, + Type: "boolean", + }, + "token": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your HTTP event collector token value.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + }, +} diff --git a/launchdarkly/audit_log_subscription_helper.go b/launchdarkly/audit_log_subscription_helper.go index d907e8d0..721971a7 100644 --- a/launchdarkly/audit_log_subscription_helper.go +++ b/launchdarkly/audit_log_subscription_helper.go @@ -12,16 +12,43 @@ import ( strcase "github.com/stoewer/go-strcase" ) +//go:generate codegen -o audit_log_subscription_configs_generated.go + var KEBAB_CASE_INTEGRATIONS = []string{"splunk"} type IntegrationConfig map[string]FormVariable type FormVariable struct { Type string - IsOptional *bool - AllowedValues *[]string - DefaultValue *interface{} - IsSecret *bool + IsOptional bool + AllowedValues []string + DefaultValue interface{} + Description string + IsSecret bool +} + +// There is not currently a manifest for slack webhooks so we have to use this for now. +var EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ + "slack": { + "url": { + Type: "uri", + IsOptional: false, + AllowedValues: []string{}, + DefaultValue: nil, + IsSecret: false, + }, + }, +} + +func getSubscriptionConfigurationMap() map[string]IntegrationConfig { + configs := make(map[string]IntegrationConfig, len(SUBSCRIPTION_CONFIGURATION_FIELDS)+len(EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS)) + for k, v := range SUBSCRIPTION_CONFIGURATION_FIELDS { + configs[k] = v + } + for k, v := range EXTRA_SUBSCRIPTION_CONFIGURATION_FIELDS { + configs[k] = v + } + return configs } func auditLogSubscriptionSchema(isDataSource bool) map[string]*schema.Schema { @@ -54,42 +81,6 @@ func auditLogSubscriptionSchema(isDataSource bool) map[string]*schema.Schema { } } -func parseAuditLogSubscriptionConfigs() map[string]IntegrationConfig { - rawConfigFields := getSubscriptionConfigurationFields() - configs := make(map[string]IntegrationConfig, len(rawConfigFields)) - for integrationKey, rawVariables := range rawConfigFields { - cfg := IntegrationConfig{} - variables := rawVariables.(map[string]interface{}) - for k, v := range variables { - variable := v.(map[string]interface{}) - formVariable := FormVariable{Type: variable["type"].(string)} - if variable["isOptional"] != nil { - isOptional := variable["isOptional"].(bool) - formVariable.IsOptional = &isOptional - } - if variable["allowedValues"] != nil { - rawValues := variable["allowedValues"].([]interface{}) - var allowedValues []string - for _, value := range rawValues { - allowedValues = append(allowedValues, value.(string)) - } - formVariable.AllowedValues = &allowedValues - } - if variable["isSecret"] != nil { - isSecret := variable["isSecret"].(bool) - formVariable.IsSecret = &isSecret - } - if variable["defaultValue"] != nil { - defaultValue := variable["defaultValue"] - formVariable.DefaultValue = &defaultValue - } - cfg[k] = formVariable - } - configs[integrationKey] = cfg - } - return configs -} - func getConfigFieldKey(integrationKey, resourceKey string) string { // a select number of integrations take fields in kebab case, ex. "skip-ca-verification" // currently this only applies to splunk @@ -107,7 +98,7 @@ func configFromResourceData(d *schema.ResourceData) (map[string]interface{}, err // TODO: refactor to return list of diags warnings with all formatting errors integrationKey := d.Get(INTEGRATION_KEY).(string) config := d.Get(CONFIG).(map[string]interface{}) - configMap := parseAuditLogSubscriptionConfigs() + configMap := getSubscriptionConfigurationMap() configFormat, ok := configMap[integrationKey] if !ok { return config, fmt.Errorf("%s is not a valid integration_key for audit log subscriptions", integrationKey) @@ -128,7 +119,7 @@ func configFromResourceData(d *schema.ResourceData) (map[string]interface{}, err key := strcase.SnakeCase(k) // convert to snake case to validate user config rawValue, ok := config[key] if !ok { - if !*v.IsOptional { + if !v.IsOptional { return config, fmt.Errorf("config variable %s must be set", key) } // we will let the API handle default configs for now since it otherwise messes @@ -150,8 +141,8 @@ func configFromResourceData(d *schema.ResourceData) (map[string]interface{}, err convertedConfig[k] = value case "enum": value := rawValue.(string) - if !stringInSlice(value, *v.AllowedValues) { - return config, fmt.Errorf("config value %s for %v must be one of the following approved string values: %v", rawValue, k, *v.AllowedValues) + if !stringInSlice(value, v.AllowedValues) { + return config, fmt.Errorf("config value %s for %v must be one of the following approved string values: %v", rawValue, k, v.AllowedValues) } convertedConfig[k] = value default: @@ -164,7 +155,7 @@ func configFromResourceData(d *schema.ResourceData) (map[string]interface{}, err func configToResourceData(d *schema.ResourceData, config map[string]interface{}, isDataSource bool) (map[string]interface{}, error) { integrationKey := d.Get(INTEGRATION_KEY).(string) - configMap := parseAuditLogSubscriptionConfigs() + configMap := getSubscriptionConfigurationMap() configFormat, ok := configMap[integrationKey] if !ok { return config, fmt.Errorf("%s is not a currently supported integration_key for audit log subscriptions", integrationKey) @@ -183,7 +174,7 @@ func configToResourceData(d *schema.ResourceData, config map[string]interface{}, if value, isBool := v.(bool); isBool { convertedConfig[key] = strconv.FormatBool(value) } - if *configFormat[k].IsSecret { + if configFormat[k].IsSecret { // if the user didn't put it in as obfuscated, we don't want to set it as obfuscated convertedConfig[key] = originalConfig[key] } diff --git a/scripts/codegen/cmd/root.go b/scripts/codegen/cmd/root.go new file mode 100644 index 00000000..f36bc247 --- /dev/null +++ b/scripts/codegen/cmd/root.go @@ -0,0 +1,66 @@ +package cmd + +import ( + "bytes" + "os" + + "github.com/pkg/errors" + + "github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen/manifestgen" + "github.com/spf13/cobra" +) + +var OUTPUT_PATH string +var ACCESS_TOKEN string +var APP_HOST string + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: "codegen", + Short: "This command is used to generate a structured Go map of LaunchDarkly auditlog events hooks configs", + Long: `This command does the following: + 1. Fetches integration manifests from https://app.launchdarkly.com/api/v2/integration-manifests + 2. Unmarshals the output into a custom Go struct + 3. Generates Go code at the specified output + `, + + RunE: func(cmd *cobra.Command, args []string) error { + if ACCESS_TOKEN == "" { + return errors.New("LAUNCHDARKLY_ACCESS_TOKEN not set") + } + manifests, err := manifestgen.FetchManifests(APP_HOST, ACCESS_TOKEN) + if err != nil { + return err + } + buf := &bytes.Buffer{} + err = manifestgen.Render(buf, manifests) + if err != nil { + panic(err) + } + err = os.WriteFile(OUTPUT_PATH, buf.Bytes(), 0644) + if err != nil { + panic(err) + } + return err + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + err := rootCmd.Execute() + if err != nil { + os.Exit(1) + } +} + +func init() { + // Here you will define your flags and configuration settings. + // Cobra supports persistent flags, which, if defined here, + // will be global for your application. + rootCmd.Flags().StringVar(&APP_HOST, "host", "app.launchdarkly.com", "LaunchDarkly app host") + rootCmd.Flags().StringVarP(&OUTPUT_PATH, "output-path", "o", "", "Output path (required)") + _ = rootCmd.MarkFlagRequired("output-path") + + ACCESS_TOKEN = os.Getenv("LAUNCHDARKLY_ACCESS_TOKEN") +} diff --git a/scripts/codegen/go.mod b/scripts/codegen/go.mod new file mode 100644 index 00000000..94660a04 --- /dev/null +++ b/scripts/codegen/go.mod @@ -0,0 +1,9 @@ +module github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen + +go 1.16 + +require ( + github.com/dave/jennifer v1.5.0 + github.com/pkg/errors v0.9.1 + github.com/spf13/cobra v1.3.0 +) diff --git a/scripts/codegen/go.sum b/scripts/codegen/go.sum new file mode 100644 index 00000000..8a99b2db --- /dev/null +++ b/scripts/codegen/go.sum @@ -0,0 +1,774 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/dave/astrid v0.0.0-20170323122508-8c2895878b14/go.mod h1:Sth2QfxfATb/nW4EsrSi2KyJmbcniZ8TgTaji17D6ms= +github.com/dave/brenda v1.1.0/go.mod h1:4wCUr6gSlu5/1Tk7akE5X7UorwiQ8Rij0SKH3/BGMOM= +github.com/dave/courtney v0.3.0/go.mod h1:BAv3hA06AYfNUjfjQr+5gc6vxeBVOupLqrColj+QSD8= +github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= +github.com/dave/jennifer v1.5.0 h1:HmgPN93bVDpkQyYbqhCHj5QlgvUkvEOzMyEvKLgCRrg= +github.com/dave/jennifer v1.5.0/go.mod h1:4MnyiFIlZS3l5tSDn8VnzE6ffAhYBMB2SZntBsZGUok= +github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= +github.com/dave/patsy v0.0.0-20210517141501-957256f50cba/go.mod h1:qfR88CgEGLoiqDaE+xxDCi5QA5v4vUoW0UCX2Nd5Tlc= +github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= +github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/scripts/codegen/main.go b/scripts/codegen/main.go new file mode 100644 index 00000000..27bdd3d4 --- /dev/null +++ b/scripts/codegen/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen/cmd" + +func main() { + cmd.Execute() +} diff --git a/scripts/codegen/manifestgen/generator.go b/scripts/codegen/manifestgen/generator.go new file mode 100644 index 00000000..7a19874c --- /dev/null +++ b/scripts/codegen/manifestgen/generator.go @@ -0,0 +1,64 @@ +package manifestgen + +import ( + "io" + + "github.com/dave/jennifer/jen" +) + +func Render(w io.Writer, manifests []Manifest) error { + file := jen.NewFile("launchdarkly") + file.HeaderComment("Code generated by github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen DO NOT EDIT.") + + integrationsDict := make(jen.Dict, len(manifests)) + for _, manifest := range manifests { + if manifest.RequiresOauth { + continue + } + if _, ok := manifest.Capabilities["auditLogEventsHook"]; !ok { + continue + } + + configDict := make(jen.Dict, len(manifest.FormVariables)) + for _, formVar := range manifest.FormVariables { + configDict[jen.Lit(formVar.Key)] = jen.Values(convertFormVarToDict(formVar)) + } + integrationsDict[jen.Lit(manifest.Key)] = jen.Values(configDict) + } + + file.Add(jen.Var().Id("SUBSCRIPTION_CONFIGURATION_FIELDS").Op("=").Map(jen.String()).Id("IntegrationConfig")).Values( + integrationsDict, + ) + + return file.Render(w) +} + +func convertFormVarToDict(formVar FormVariable) jen.Dict { + return jen.Dict{ + jen.Id("AllowedValues"): convertAllowedValues(formVar.AllowedValues), + jen.Id("DefaultValue"): convertDefaultValue(formVar.DefaultValue), + jen.Id("Description"): jen.Lit(formVar.Description), + jen.Id("IsSecret"): jen.Lit(formVar.IsSecret), + jen.Id("IsOptional"): jen.Lit(formVar.IsOptional), + jen.Id("Type"): jen.Lit(formVar.Type), + } +} + +func convertAllowedValues(allowedValues []string) jen.Code { + return jen.Index().String().ValuesFunc(func(g *jen.Group) { + for _, v := range allowedValues { + g.Lit(v) + } + }) +} + +func convertDefaultValue(defaultValue interface{}) jen.Code { + switch v := defaultValue.(type) { + case string: + return jen.Lit(v) + case bool: + return jen.Lit(v) + default: + return jen.Nil() + } +} diff --git a/scripts/codegen/manifestgen/manifests.go b/scripts/codegen/manifestgen/manifests.go new file mode 100644 index 00000000..04ec664e --- /dev/null +++ b/scripts/codegen/manifestgen/manifests.go @@ -0,0 +1,69 @@ +package manifestgen + +import ( + "encoding/json" + "io/ioutil" + "net/http" + "net/url" + + "github.com/pkg/errors" +) + +type ManifestsResponse struct { + Items []Manifest +} + +type Manifest struct { + Key string + RequiresOauth bool + Capabilities map[string]interface{} + FormVariables []FormVariable +} + +type FormVariable struct { + AllowedValues []string + DefaultValue interface{} + Description string + IsOptional bool + IsSecret bool + Key string + Type string +} + +func FetchManifests(appHost, accessToken string) ([]Manifest, error) { + manifestURL := url.URL{ + Scheme: "https", + Host: appHost, + Path: "api/v2/integration-manifests", + } + req, err := http.NewRequest(http.MethodGet, manifestURL.String(), nil) + if err != nil { + return nil, err + } + req.Header.Add("Authorization", accessToken) + + client := http.Client{} + res, err := client.Do(req) + if err != nil { + return nil, err + } + if res == nil { + return nil, errors.New("Get a nil response when fetching manifests") + } + if res.Body == nil { + return nil, errors.New("Got a nil response body when fetching manifests") + } + defer res.Body.Close() + + body, err := ioutil.ReadAll(res.Body) + if err != nil { + return nil, err + } + + var responseBody ManifestsResponse + err = json.Unmarshal(body, &responseBody) + if err != nil { + return nil, err + } + return responseBody.Items, nil +} diff --git a/scripts/generate_integration_audit_log_configs.py b/scripts/generate_integration_audit_log_configs.py deleted file mode 100644 index 6aa32f8a..00000000 --- a/scripts/generate_integration_audit_log_configs.py +++ /dev/null @@ -1,62 +0,0 @@ -import os -import requests -import json - -def get_audit_log_manifests(host, api_key): - if not host or not api_key: - raise Exception('host or api key not set') - path_get_manifests = '/api/v2/integration-manifests' - resp = requests.get(host + path_get_manifests, headers={'Authorization': api_key}) - if resp.status_code != 200: - raise Exception(resp.status_code, 'unsuccessful get manifests request') - return filter_manifests(resp.json()['items']) - -def filter_manifests(manifests): - filtered = [] - for m in manifests: - if 'capabilities' in m and 'auditLogEventsHook' in m['capabilities']: - filtered.append(m) - return filtered - -def construct_config(manifest): - """ takes an audit log manifest and returns the form variables in the format - { : { - 'type': , - 'isOptional': , - 'allowedValues': , - 'defaultValue': , - 'isSecret': - } } - """ - rawFormVariables = manifest['formVariables'] - formVariables = {} - for rawV in rawFormVariables: - v = { 'type': rawV['type'] } - for attribute in ['isOptional', 'allowedValues', 'defaultValue', 'isSecret']: - if attribute in rawV: - v[attribute] = rawV[attribute] - formVariables[rawV['key']] = v - return formVariables - -def construct_config_dict(manifests): - cfgs = {} - for m in manifests: - cfgs[m['key']] = construct_config(m) - return cfgs - -def seed_config_file(): - host = os.getenv('LAUNCHDARKLY_API_HOST', 'https://app.launchdarkly.com') - if not host.startswith('http'): - host = 'https://' + host - api_key = os.getenv('LAUNCHDARKLY_ACCESS_TOKEN') - print('getting manifests...') - manifests = get_audit_log_manifests(host, api_key) - print('constructing configs...') - configs = construct_config_dict(manifests) - print('seeding file...') - with open('launchdarkly/audit_log_subscription_configs.json', 'w') as f: - json.dump(configs, f) - print('COMPLETE, config data written to launchdarkly/audit_log_subscription_configs.json') - -if __name__ == '__main__': - seed_config_file() \ No newline at end of file From de0fe4159aa68fd69c17586e87b4cb343a93c625 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Tue, 8 Feb 2022 18:39:34 +0000 Subject: [PATCH 008/128] Run terraform provider acceptance tests daily and notify of failures (#196) --- .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c64411da..3e6658aa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,24 @@ version: 2.1 orbs: go: circleci/go@1.7.0 linter: talkiq/linter@1.4.1 + slack: circleci/slack@4.7.1 + +commands: + notify-slack-of-failures: + parameters: + branch_pattern: + type: string + default: main + steps: + - slack/notify: + branch_pattern: <> + channel: CLR408M4Y #proj-terraform + event: fail + custom: | + {"text":"A terraform provider test failed","blocks":[{"type":"section", + "text":{"type":"mrkdwn","text":":terraform-on-fire: A terraform provider *${CIRCLE_JOB}* job failed"}}, + {"type":"context","elements":[{"type":"mrkdwn","text":"branch: _${CIRCLE_BRANCH}_"}]},{"type":"actions","elements": + [{"type":"button","text":{"type":"plain_text","text":"View job"},"url":"${CIRCLE_BUILD_URL}"}]}]} jobs: test: @@ -66,6 +84,7 @@ jobs: - run: name: Test Webhook Resource command: TESTARGS="-run TestAccWebhook" make testacc + - notify-slack-of-failures lint: executor: @@ -80,9 +99,26 @@ jobs: sudo apt update sudo apt install python3-pip python-is-python3 - linter/pre-commit + - notify-slack-of-failures workflows: main: jobs: - - test - - lint + - test: + context: slack-orb + - lint: + context: slack-orb + + daily: + triggers: + - schedule: + cron: "0 0 * * *" + filters: + branches: + only: + - main + jobs: + - test: + context: slack-orb + - lint: + context: slack-orb From 9a38dde4561e394a9b4cfc8af31604cbb20abaa9 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Wed, 9 Feb 2022 19:17:32 +0000 Subject: [PATCH 009/128] Update changelog branch (#195) --- examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/README.md b/examples/README.md index c526ba94..e426d651 100644 --- a/examples/README.md +++ b/examples/README.md @@ -62,6 +62,6 @@ terraform { } ``` -Some resources or attributes, such as [webhook policy_statements](./webhook/example.tf), that were added later may require a provider version later than 1.0; check the [changelog](https://github.com/launchdarkly/terraform-provider-launchdarkly/blob/master/CHANGELOG.md) for more information on versions. +Some resources or attributes, such as [webhook policy_statements](./webhook/example.tf), that were added later may require a provider version later than 1.0; check the [changelog](https://github.com/launchdarkly/terraform-provider-launchdarkly/blob/main/CHANGELOG.md) for more information on versions. If you would prefer to define your variables some other way, see [Terraform's documentation on input variables](https://learn.hashicorp.com/terraform/getting-started/variables) for some other ways to do so. From d285706f7acd16ea677997ada0459fbe8196ae0e Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 14 Mar 2022 11:58:14 +0000 Subject: [PATCH 010/128] [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow --- CHANGELOG.md | 6 ++++++ launchdarkly/audit_log_subscription_configs_generated.go | 8 ++++++++ .../resource_launchdarkly_audit_log_subscription_test.go | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2697c7cf..73afcfcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [Unreleased] + +ENHANCEMENTS: + +- Added the `hide_member_details` argument to the Datadog `config` for the `launchdarkly_audit_log_subscription` resource. When `hide_member_details` is `true`, LaunchDarkly member information will be redacted before events are sent to Datadog. + ## [2.5.0] (February 7, 2022) FEATURES: diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index d21b0657..350f23e4 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -12,6 +12,14 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ IsSecret: true, Type: "string", }, + "hideMemberDetails": { + AllowedValues: []string{}, + DefaultValue: false, + Description: "Don't send related member email and names.", + IsOptional: true, + IsSecret: false, + Type: "boolean", + }, "hostURL": { AllowedValues: []string{"https://api.datadoghq.com", "https://api.datadoghq.eu", "https://us3.datadoghq.com", "https://us5.datadoghq.com", "https://app.ddog-gov.com"}, DefaultValue: "https://api.datadoghq.com", diff --git a/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go b/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go index f9bf9bff..8c66051a 100644 --- a/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go +++ b/launchdarkly/resource_launchdarkly_audit_log_subscription_test.go @@ -50,7 +50,8 @@ func TestAccAuditLogSubscription_CreateUpdateDatadog(t *testing.T) { integrationKey := "datadog" // omitting host_url = "https://api.datadoghq.com" to test the handling of attributes with default values config := `{ - api_key = "thisisasecretkey" + api_key = "thisisasecretkey" + hide_member_details = true } ` @@ -70,6 +71,7 @@ func TestAccAuditLogSubscription_CreateUpdateDatadog(t *testing.T) { resource.TestCheckResourceAttr(resourceName, NAME, "terraform test"), resource.TestCheckResourceAttr(resourceName, ON, "true"), resource.TestCheckResourceAttr(resourceName, "config.api_key", "thisisasecretkey"), + resource.TestCheckResourceAttr(resourceName, "config.hide_member_details", "true"), // resource.TestCheckResourceAttr(resourceName, "config.host_url", "https://api.datadoghq.com"), resource.TestCheckResourceAttr(resourceName, "tags.#", "2"), resource.TestCheckResourceAttr(resourceName, "tags.0", "integrations"), From 42d99acd1e6463f260de01b9f2b3f828dd9e0d83 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 17 Mar 2022 10:46:35 +0000 Subject: [PATCH 011/128] Increase checkpoint-api.harhicorp.com timeout to 10s (#198) --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e6658aa..2a02a958 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,10 @@ jobs: name: go/default tag: &go_version "1.16.10" + environment: + # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com + CHECKPOINT_TIMEOUT: 10000 + steps: - checkout - go/mod-download-cached From 04b73ff511265edd99b4be9d7258e1c2ddb0a7ec Mon Sep 17 00:00:00 2001 From: Clifford Tawiah Date: Tue, 5 Apr 2022 23:48:36 -0500 Subject: [PATCH 012/128] Updated destination tests to use random env keys to avoid env conflict errors --- .../resource_launchdarkly_destination_test.go | 90 ++++++++++--------- ...resource_launchdarkly_feature_flag_test.go | 18 ++++ 2 files changed, 68 insertions(+), 40 deletions(-) diff --git a/launchdarkly/resource_launchdarkly_destination_test.go b/launchdarkly/resource_launchdarkly_destination_test.go index 5014f519..538b1e92 100644 --- a/launchdarkly/resource_launchdarkly_destination_test.go +++ b/launchdarkly/resource_launchdarkly_destination_test.go @@ -13,7 +13,7 @@ const ( testAccDestinationCreateKinesis = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "kinesis-dest" kind = "kinesis" config = { @@ -28,7 +28,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationCreatePubsub = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "pubsub-dest" kind = "google-pubsub" config = { @@ -41,7 +41,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationCreateMparticle = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "mparticle-dest" kind = "mparticle" config = { @@ -58,7 +58,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationCreateSegment = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "segment-dest" kind = "segment" config = { @@ -72,7 +72,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationCreateAzureEventHubs = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "azure-event-hubs-dest" kind = "azure-event-hubs" config = { @@ -89,7 +89,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationUpdateKinesis = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "updated-kinesis-dest" kind = "kinesis" config = { @@ -104,7 +104,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationUpdatePubsub = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "updated-pubsub-dest" kind = "google-pubsub" config = { @@ -119,7 +119,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationUpdateMparticle = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "updated-mparticle-dest" kind = "mparticle" config = { @@ -136,7 +136,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationUpdateSegment = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "segment-dest" kind = "segment" config = { @@ -149,7 +149,7 @@ resource "launchdarkly_destination" "test" { testAccDestinationUpdateAzureEventHubs = ` resource "launchdarkly_destination" "test" { project_key = launchdarkly_project.test.key - env_key = "test" + env_key = "%s" name = "updated-azure-event-hubs-dest" kind = "azure-event-hubs" config = { @@ -169,6 +169,7 @@ func TestAccDestination_CreateKinesis(t *testing.T) { // make sure you also test that the kind conforms to one of the three acceptable ones // kinesis, google-pubsub, or mparticle projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -177,11 +178,11 @@ func TestAccDestination_CreateKinesis(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateKinesis), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateKinesis, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "kinesis-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "kinesis"), resource.TestCheckResourceAttr(resourceName, "config.region", "us-east-1"), @@ -200,6 +201,7 @@ func TestAccDestination_CreateKinesis(t *testing.T) { func TestAccDestination_CreateMparticle(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -208,11 +210,11 @@ func TestAccDestination_CreateMparticle(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateMparticle), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateMparticle, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "mparticle-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "mparticle"), resource.TestCheckResourceAttr(resourceName, "config.api_key", "apiKeyfromMParticle"), @@ -225,6 +227,7 @@ func TestAccDestination_CreateMparticle(t *testing.T) { func TestAccDestination_CreatePubsub(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -233,11 +236,11 @@ func TestAccDestination_CreatePubsub(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreatePubsub), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreatePubsub, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "pubsub-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "google-pubsub"), resource.TestCheckResourceAttr(resourceName, ON, "false"), @@ -251,6 +254,7 @@ func TestAccDestination_CreatePubsub(t *testing.T) { func TestAccDestination_CreateSegment(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -259,11 +263,11 @@ func TestAccDestination_CreateSegment(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateSegment), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateSegment, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "segment-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "segment"), resource.TestCheckResourceAttr(resourceName, "config.write_key", "super-secret-write-key"), @@ -276,6 +280,7 @@ func TestAccDestination_CreateSegment(t *testing.T) { func TestAccDestination_CreateAzureEventHubs(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -284,11 +289,11 @@ func TestAccDestination_CreateAzureEventHubs(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateAzureEventHubs), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateAzureEventHubs, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "azure-event-hubs-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "azure-event-hubs"), resource.TestCheckResourceAttr(resourceName, "config.namespace", "namespace"), @@ -304,6 +309,7 @@ func TestAccDestination_CreateAzureEventHubs(t *testing.T) { func TestAccDestination_UpdateKinesis(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -312,11 +318,11 @@ func TestAccDestination_UpdateKinesis(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateKinesis), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateKinesis, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "kinesis-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "kinesis"), resource.TestCheckResourceAttr(resourceName, "config.role_arn", "arn:aws:iam::123456789012:role/marketingadmin"), @@ -324,10 +330,10 @@ func TestAccDestination_UpdateKinesis(t *testing.T) { ), }, { - Config: withRandomProject(projectKey, testAccDestinationUpdateKinesis), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationUpdateKinesis, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "updated-kinesis-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "kinesis"), resource.TestCheckResourceAttr(resourceName, "config.role_arn", "arn:aws:iam::123456789012:role/marketingadmin"), @@ -341,6 +347,7 @@ func TestAccDestination_UpdateKinesis(t *testing.T) { func TestAccDestination_UpdatePubsub(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -349,11 +356,11 @@ func TestAccDestination_UpdatePubsub(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreatePubsub), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreatePubsub, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "pubsub-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "google-pubsub"), resource.TestCheckResourceAttr(resourceName, "config.project", "test-project"), @@ -361,10 +368,10 @@ func TestAccDestination_UpdatePubsub(t *testing.T) { ), }, { - Config: withRandomProject(projectKey, testAccDestinationUpdatePubsub), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationUpdatePubsub, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "updated-pubsub-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "google-pubsub"), resource.TestCheckResourceAttr(resourceName, "config.project", "renamed-project"), @@ -378,6 +385,7 @@ func TestAccDestination_UpdatePubsub(t *testing.T) { func TestAccDestination_UpdateMparticle(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -386,11 +394,11 @@ func TestAccDestination_UpdateMparticle(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateMparticle), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateMparticle, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "mparticle-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "mparticle"), resource.TestCheckResourceAttr(resourceName, "config.secret", "mParticleSecret"), @@ -399,10 +407,10 @@ func TestAccDestination_UpdateMparticle(t *testing.T) { ), }, { - Config: withRandomProject(projectKey, testAccDestinationUpdateMparticle), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationUpdateMparticle, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "updated-mparticle-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "mparticle"), resource.TestCheckResourceAttr(resourceName, "config.secret", "updatedSecret"), @@ -417,6 +425,7 @@ func TestAccDestination_UpdateMparticle(t *testing.T) { func TestAccDestination_UpdateSegment(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -425,11 +434,11 @@ func TestAccDestination_UpdateSegment(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateSegment), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateSegment, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "segment-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "segment"), resource.TestCheckResourceAttr(resourceName, ON, "true"), @@ -438,11 +447,11 @@ func TestAccDestination_UpdateSegment(t *testing.T) { ), }, { - Config: withRandomProject(projectKey, testAccDestinationUpdateSegment), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationUpdateSegment, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "segment-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "segment"), resource.TestCheckResourceAttr(resourceName, ON, "false"), // should default to false when removed @@ -456,6 +465,7 @@ func TestAccDestination_UpdateSegment(t *testing.T) { func TestAccDestination_UpdateAzureEventHubs(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + envKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_destination.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -464,11 +474,11 @@ func TestAccDestination_UpdateAzureEventHubs(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: withRandomProject(projectKey, testAccDestinationCreateAzureEventHubs), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationCreateAzureEventHubs, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "azure-event-hubs-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "azure-event-hubs"), resource.TestCheckResourceAttr(resourceName, "config.namespace", "namespace"), @@ -480,11 +490,11 @@ func TestAccDestination_UpdateAzureEventHubs(t *testing.T) { ), }, { - Config: withRandomProject(projectKey, testAccDestinationUpdateAzureEventHubs), + Config: withRandomProjectAndEnv(projectKey, envKey, fmt.Sprintf(testAccDestinationUpdateAzureEventHubs, envKey)), Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckDestinationExists(resourceName), - resource.TestCheckResourceAttr(resourceName, ENV_KEY, "test"), + resource.TestCheckResourceAttr(resourceName, ENV_KEY, envKey), resource.TestCheckResourceAttr(resourceName, NAME, "updated-azure-event-hubs-dest"), resource.TestCheckResourceAttr(resourceName, KIND, "azure-event-hubs"), resource.TestCheckResourceAttr(resourceName, "config.namespace", "namespace"), diff --git a/launchdarkly/resource_launchdarkly_feature_flag_test.go b/launchdarkly/resource_launchdarkly_feature_flag_test.go index d0c124f0..9413ac02 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_test.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_test.go @@ -460,6 +460,24 @@ func withRandomProject(randomProject, resource string) string { %s`, randomProject, resource) } +func withRandomProjectAndEnv(randomProject, randomEnvironment, resource string) string { + return fmt.Sprintf(` + resource "launchdarkly_project" "test" { + lifecycle { + ignore_changes = [environments] + } + name = "testProject" + key = "%s" + environments { + name = "testEnvironment" + key = "%s" + color = "000000" + } + } + + %s`, randomProject, randomEnvironment, resource) +} + func withRandomProjectIncludeInSnippetTrue(randomProject, resource string) string { return fmt.Sprintf(` resource "launchdarkly_project" "test" { From e722f061047d0d433c8a5fbcc76fbe4e45eedef7 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 7 Apr 2022 14:27:28 +0100 Subject: [PATCH 013/128] [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow --- CHANGELOG.md | 4 ++++ examples/v2/feature_flags/README.md | 4 ++++ examples/v2/feature_flags/setup.tf | 7 +++++++ website/docs/index.html.markdown | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73afcfcd..ae468e7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ENHANCEMENTS: - Added the `hide_member_details` argument to the Datadog `config` for the `launchdarkly_audit_log_subscription` resource. When `hide_member_details` is `true`, LaunchDarkly member information will be redacted before events are sent to Datadog. +NOTES: + +- Added a callout to the `bypassRequiredApproval` action in documentation. + ## [2.5.0] (February 7, 2022) FEATURES: diff --git a/examples/v2/feature_flags/README.md b/examples/v2/feature_flags/README.md index b71fafff..425551fb 100644 --- a/examples/v2/feature_flags/README.md +++ b/examples/v2/feature_flags/README.md @@ -10,6 +10,10 @@ This example contains three config files: - [flag_types_example.tf](./flag_types_example.tf), which provides examples of the different ways you can define binary (boolean) and multivariate (string, numeric, and JSON) flag variations using the `launchdarkly_feature_flag` resource - [targeting_example.tf](./targeting_example.tf), which provides complex examples of user targeting using the `launchdarkly_feature_flag_environment` resource. For more detail on user targeting, see the [official LaunchDarkly documentation](https://docs.launchdarkly.com/home/managing-flags/targeting-users). +### Bypassing approval requests + +If [approval requests are required](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings) in the feature flag's environment, you can bypass them by adding the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the role associated with the LaunchDarkly access token or service token used by the provider. + ### Run Init your working directory from the CL with `terraform init` and then apply the changes with `terraform apply`. You should see output resembling the following: diff --git a/examples/v2/feature_flags/setup.tf b/examples/v2/feature_flags/setup.tf index 6faa3225..c36a1051 100644 --- a/examples/v2/feature_flags/setup.tf +++ b/examples/v2/feature_flags/setup.tf @@ -17,6 +17,13 @@ resource "launchdarkly_project" "tf_flag_examples" { name = "example environment" key = "example-env" color = "ababab" + # You can configure approval settings per environment to control who can apply flag changes + # Your Terraform user can be configured with a custom role to allow it to bypass approval requirements + # See https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings + approval_settings { + min_num_approvals = 2 + required = true + } } tags = [ diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 6aaaed15..b3bedea2 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -43,7 +43,8 @@ Please refer to [Terraform's documentation on upgrading to v0.13](https://www.te The provider supports the following arguments: -- `access_token` - (Optional) The [personal access token](https://docs.launchdarkly.com/docs/api-access-tokens) you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. +- `access_token` - (Optional) The [API access token](https://docs.launchdarkly.com/docs/api-access-tokens) or [service token](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens) used to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. +If you want to grant the terraform provider the ability to make flag changes without requesting approval in an environment that is configured to require approvals, you can add the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the service token's custom role. To learn about custom role actions, read [Custom role actions](https://docs.launchdarkly.com/home/members/role-actions). - `oauth_token` - (Optional) An OAuth V2 token you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_OAUTH_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. From b88452aeaf9570ae40127fc1df31205291022b87 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 7 Apr 2022 15:21:15 +0100 Subject: [PATCH 014/128] Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae468e7d..97c2a34e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [Unreleased] +## [2.5.1] (April 7, 2022) ENHANCEMENTS: From ae41bdb0cbf3455108794ee4602c1f848a1a8dff Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Thu, 14 Apr 2022 14:50:13 +0100 Subject: [PATCH 015/128] fix doc issues (#202) --- website/docs/d/flag_trigger.html.markdown | 2 +- website/docs/d/relay_proxy_configuration.html.markdown | 2 +- website/docs/r/flag_trigger.html.markdown | 6 ++++-- website/docs/r/relay_proxy_configuration.html.markdown | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/website/docs/d/flag_trigger.html.markdown b/website/docs/d/flag_trigger.html.markdown index 4c5ad5ab..e5822a6e 100644 --- a/website/docs/d/flag_trigger.html.markdown +++ b/website/docs/d/flag_trigger.html.markdown @@ -30,7 +30,7 @@ data "launchdarkly_flag_trigger" "example" { - `id` - (Required) The Terraform trigger ID. This ID takes the following format: `///`. The unique trigger ID can be found in your saved trigger URL: ``` -https://app.launchdarkly.com/webhook/triggers//aff25a53-17d9-4112-a9b8-12718d1a2e79 +https://app.launchdarkly.com/webhook/triggers/THIS_IS_YOUR_TRIGGER_ID/aff25a53-17d9-4112-a9b8-12718d1a2e79 ``` Please note that if you did not save this upon creation of the resource, you will have to reset it to get a new value, which can cause breaking changes. diff --git a/website/docs/d/relay_proxy_configuration.html.markdown b/website/docs/d/relay_proxy_configuration.html.markdown index 3e4cdde4..6c29c8b0 100644 --- a/website/docs/d/relay_proxy_configuration.html.markdown +++ b/website/docs/d/relay_proxy_configuration.html.markdown @@ -31,7 +31,7 @@ resource "launchdarkly_relay_proxy_configuration" "example" { - `id` - (Required) The Relay Proxy configuration's unique 24 character ID. The unique relay proxy ID can be found in the relay proxy edit page URL, which you can locate by clicking the three dot menu on your relay proxy item in the UI and selecting 'Edit configuration': ``` -https://app.launchdarkly.com/settings/relay//edit +https://app.launchdarkly.com/settings/relay/THIS_IS_YOUR_RELAY_PROXY_ID/edit ``` ## Attribute Reference diff --git a/website/docs/r/flag_trigger.html.markdown b/website/docs/r/flag_trigger.html.markdown index 3a235940..fd94ed54 100644 --- a/website/docs/r/flag_trigger.html.markdown +++ b/website/docs/r/flag_trigger.html.markdown @@ -57,13 +57,15 @@ In addition to the above arguments, this resource supports the following compute LaunchDarkly flag triggers can be imported using the following syntax: ``` -$ terraform import launchdarkly_flag_trigger.example /// +$ terraform import launchdarkly_flag_trigger.example example-project-key/example-env-key/example-flag-key/62581d4488def814b831abc3 ``` +where the string following the final slash is your unique trigger ID. + The unique trigger ID can be found in your saved trigger URL: ``` -https://app.launchdarkly.com/webhook/triggers//aff25a53-17d9-4112-a9b8-12718d1a2e79 +https://app.launchdarkly.com/webhook/triggers/THIS_IS_YOUR_TRIGGER_ID/aff25a53-17d9-4112-a9b8-12718d1a2e79 ``` Please note that if you did not save this upon creation of the resource, you will have to reset it to get a new value, which can cause breaking changes. diff --git a/website/docs/r/relay_proxy_configuration.html.markdown b/website/docs/r/relay_proxy_configuration.html.markdown index 19cc5253..6784306e 100644 --- a/website/docs/r/relay_proxy_configuration.html.markdown +++ b/website/docs/r/relay_proxy_configuration.html.markdown @@ -56,12 +56,12 @@ Relay proxy configuration `policy` blocks are composed of the following argument Relay Proxy configurations can be imported using the configuration's unique 24 character ID, e.g. -```shell-session +``` $ terraform import launchdarkly_relay_proxy_configuration.example 51d440e30c9ff61457c710f6 ``` The unique relay proxy ID can be found in the relay proxy edit page URL, which you can locate by clicking the three dot menu on your relay proxy item in the UI and selecting 'Edit configuration': ``` -https://app.launchdarkly.com/settings/relay//edit +https://app.launchdarkly.com/settings/relay/THIS_IS_YOUR_RELAY_PROXY_ID/edit ``` From a402d113fc2cf3e4a6a6454978cddaa4d4151391 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 14 Apr 2022 17:22:13 +0100 Subject: [PATCH 016/128] [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog --- CHANGELOG.md | 8 +++++++- examples/v2/feature_flags/README.md | 4 ---- examples/v2/feature_flags/setup.tf | 7 ------- website/docs/index.html.markdown | 3 +-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97c2a34e..7aee3984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -## [2.5.1] (April 7, 2022) +## [Unreleased] + +NOTES: + +- Removed callout to `bypassRequiredApproval` action in documentation pending further development. + +## [2.6.0] (April 7, 2022) ENHANCEMENTS: diff --git a/examples/v2/feature_flags/README.md b/examples/v2/feature_flags/README.md index 425551fb..b71fafff 100644 --- a/examples/v2/feature_flags/README.md +++ b/examples/v2/feature_flags/README.md @@ -10,10 +10,6 @@ This example contains three config files: - [flag_types_example.tf](./flag_types_example.tf), which provides examples of the different ways you can define binary (boolean) and multivariate (string, numeric, and JSON) flag variations using the `launchdarkly_feature_flag` resource - [targeting_example.tf](./targeting_example.tf), which provides complex examples of user targeting using the `launchdarkly_feature_flag_environment` resource. For more detail on user targeting, see the [official LaunchDarkly documentation](https://docs.launchdarkly.com/home/managing-flags/targeting-users). -### Bypassing approval requests - -If [approval requests are required](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings) in the feature flag's environment, you can bypass them by adding the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the role associated with the LaunchDarkly access token or service token used by the provider. - ### Run Init your working directory from the CL with `terraform init` and then apply the changes with `terraform apply`. You should see output resembling the following: diff --git a/examples/v2/feature_flags/setup.tf b/examples/v2/feature_flags/setup.tf index c36a1051..6faa3225 100644 --- a/examples/v2/feature_flags/setup.tf +++ b/examples/v2/feature_flags/setup.tf @@ -17,13 +17,6 @@ resource "launchdarkly_project" "tf_flag_examples" { name = "example environment" key = "example-env" color = "ababab" - # You can configure approval settings per environment to control who can apply flag changes - # Your Terraform user can be configured with a custom role to allow it to bypass approval requirements - # See https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings - approval_settings { - min_num_approvals = 2 - required = true - } } tags = [ diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index b3bedea2..6aaaed15 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -43,8 +43,7 @@ Please refer to [Terraform's documentation on upgrading to v0.13](https://www.te The provider supports the following arguments: -- `access_token` - (Optional) The [API access token](https://docs.launchdarkly.com/docs/api-access-tokens) or [service token](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens) used to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. -If you want to grant the terraform provider the ability to make flag changes without requesting approval in an environment that is configured to require approvals, you can add the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the service token's custom role. To learn about custom role actions, read [Custom role actions](https://docs.launchdarkly.com/home/members/role-actions). +- `access_token` - (Optional) The [personal access token](https://docs.launchdarkly.com/docs/api-access-tokens) you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. - `oauth_token` - (Optional) An OAuth V2 token you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_OAUTH_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. From 66d55a1ac4712637cfd036ce55b111ec73905378 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 14 Apr 2022 17:59:31 +0100 Subject: [PATCH 017/128] backmerge 2.6.1 (#204) --- CHANGELOG.md | 3 ++- examples/v2/feature_flags/setup.tf | 5 +++++ website/docs/index.html.markdown | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aee3984..73899a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -## [Unreleased] +## [2.6.1] (April 12, 2022) NOTES: - Removed callout to `bypassRequiredApproval` action in documentation pending further development. +- Fix formatting in some documentation ## [2.6.0] (April 7, 2022) diff --git a/examples/v2/feature_flags/setup.tf b/examples/v2/feature_flags/setup.tf index 6faa3225..a3cdc296 100644 --- a/examples/v2/feature_flags/setup.tf +++ b/examples/v2/feature_flags/setup.tf @@ -17,6 +17,11 @@ resource "launchdarkly_project" "tf_flag_examples" { name = "example environment" key = "example-env" color = "ababab" + # You can configure approval settings per environment to control who can apply flag changes + approval_settings { + min_num_approvals = 2 + required = true + } } tags = [ diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 6aaaed15..c97f5b24 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -43,7 +43,8 @@ Please refer to [Terraform's documentation on upgrading to v0.13](https://www.te The provider supports the following arguments: -- `access_token` - (Optional) The [personal access token](https://docs.launchdarkly.com/docs/api-access-tokens) you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. +- `access_token` - (Optional) The [personal access token](https://docs.launchdarkly.com/api-access-tokens) or [service token](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens) used to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. + - `oauth_token` - (Optional) An OAuth V2 token you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_OAUTH_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. From 494df8f2a5ce3a61c0cd1870b0596b7674bca568 Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Wed, 4 May 2022 13:48:28 +0200 Subject: [PATCH 018/128] Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests --- CHANGELOG.md | 10 ++++++++-- launchdarkly/keys.go | 1 + .../resource_launchdarkly_custom_role.go | 17 +++++++++++++++++ .../resource_launchdarkly_custom_role_test.go | 6 +++++- website/docs/r/custom_role.html.markdown | 2 ++ 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73899a3d..58c51290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ +## [2.6.2] (Unreleased) + +FEATURES: + +- Added the `base_permissions` field to the `launchdarkly_custom_role` resource. + ## [2.6.1] (April 12, 2022) -NOTES: +NOTES: - Removed callout to `bypassRequiredApproval` action in documentation pending further development. - Fix formatting in some documentation @@ -9,7 +15,7 @@ NOTES: ENHANCEMENTS: -- Added the `hide_member_details` argument to the Datadog `config` for the `launchdarkly_audit_log_subscription` resource. When `hide_member_details` is `true`, LaunchDarkly member information will be redacted before events are sent to Datadog. +- Added the `hide_member_details` argument to the Datadog `config` for the `launchdarkly_audit_log_subscription` resource. When `hide_member_details` is `true`, LaunchDarkly member information will be redacted before events are sent to Datadog. NOTES: diff --git a/launchdarkly/keys.go b/launchdarkly/keys.go index 16861126..bcb7fdaa 100644 --- a/launchdarkly/keys.go +++ b/launchdarkly/keys.go @@ -9,6 +9,7 @@ const ( APPROVAL_SETTINGS = "approval_settings" ARCHIVED = "archived" ATTRIBUTE = "attribute" + BASE_PERMISSIONS = "base_permissions" BUCKET_BY = "bucket_by" CAN_APPLY_DECLINED_CHANGES = "can_apply_declined_changes" CAN_REVIEW_OWN_REQUEST = "can_review_own_request" diff --git a/launchdarkly/resource_launchdarkly_custom_role.go b/launchdarkly/resource_launchdarkly_custom_role.go index e40b3d89..c7f8a070 100644 --- a/launchdarkly/resource_launchdarkly_custom_role.go +++ b/launchdarkly/resource_launchdarkly_custom_role.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ldapi "github.com/launchdarkly/api-client-go/v7" ) @@ -41,6 +42,13 @@ func resourceCustomRole() *schema.Resource { Optional: true, Description: "Description of the custom role", }, + BASE_PERMISSIONS: { + Type: schema.TypeString, + Optional: true, + Description: "The base permission level - either reader or no_access. Defaults to reader", + ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"reader", "no_access"}, false)), + Default: "reader", + }, POLICY: policyArraySchema(), POLICY_STATEMENTS: policyStatementsSchema(policyStatementSchemaOptions{}), }, @@ -52,6 +60,7 @@ func resourceCustomRoleCreate(ctx context.Context, d *schema.ResourceData, metaR customRoleKey := d.Get(KEY).(string) customRoleName := d.Get(NAME).(string) customRoleDescription := d.Get(DESCRIPTION).(string) + customRoleBasePermissions := d.Get(BASE_PERMISSIONS).(string) customRolePolicies := policiesFromResourceData(d) policyStatements, err := policyStatementsFromResourceData(d.Get(POLICY_STATEMENTS).([]interface{})) if err != nil { @@ -67,6 +76,9 @@ func resourceCustomRoleCreate(ctx context.Context, d *schema.ResourceData, metaR Description: ldapi.PtrString(customRoleDescription), Policy: customRolePolicies, } + if customRoleBasePermissions != "" { + customRoleBody.BasePermissions = ldapi.PtrString(customRoleBasePermissions) + } _, _, err = client.ld.CustomRolesApi.PostCustomRole(client.ctx).CustomRolePost(customRoleBody).Execute() @@ -102,6 +114,7 @@ func resourceCustomRoleRead(ctx context.Context, d *schema.ResourceData, metaRaw _ = d.Set(KEY, customRole.Key) _ = d.Set(NAME, customRole.Name) _ = d.Set(DESCRIPTION, customRole.Description) + _ = d.Set(BASE_PERMISSIONS, customRole.BasePermissions) // Because "policy" is now deprecated in favor of "policy_statements", only set "policy" if it has // already been set by the user. @@ -128,6 +141,7 @@ func resourceCustomRoleUpdate(ctx context.Context, d *schema.ResourceData, metaR customRoleKey := d.Get(KEY).(string) customRoleName := d.Get(NAME).(string) customRoleDescription := d.Get(DESCRIPTION).(string) + customRoleBasePermissions := d.Get(BASE_PERMISSIONS).(string) customRolePolicies := policiesFromResourceData(d) policyStatements, err := policyStatementsFromResourceData(d.Get(POLICY_STATEMENTS).([]interface{})) if err != nil { @@ -143,6 +157,9 @@ func resourceCustomRoleUpdate(ctx context.Context, d *schema.ResourceData, metaR patchReplace("/description", &customRoleDescription), patchReplace("/policy", &customRolePolicies), }} + if customRoleBasePermissions != "" { + patch.Patch = append(patch.Patch, patchReplace("/basePermissions", &customRoleBasePermissions)) + } _, _, err = client.ld.CustomRolesApi.PatchCustomRole(client.ctx, customRoleKey).PatchWithComment(patch).Execute() if err != nil { diff --git a/launchdarkly/resource_launchdarkly_custom_role_test.go b/launchdarkly/resource_launchdarkly_custom_role_test.go index 745e6f85..d1ad280e 100644 --- a/launchdarkly/resource_launchdarkly_custom_role_test.go +++ b/launchdarkly/resource_launchdarkly_custom_role_test.go @@ -14,7 +14,8 @@ const ( resource "launchdarkly_custom_role" "test" { key = "%s" name = "Custom role - %s" - description= "Deny all actions on production environments" + description = "Deny all actions on production environments" + base_permissions = "no_access" policy { actions = ["*"] effect = "deny" @@ -100,6 +101,7 @@ func TestAccCustomRole_Create(t *testing.T) { resource.TestCheckResourceAttr(resourceName, KEY, key), resource.TestCheckResourceAttr(resourceName, NAME, "Custom role - "+name), resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "Deny all actions on production environments"), + resource.TestCheckResourceAttr(resourceName, BASE_PERMISSIONS, "no_access"), resource.TestCheckResourceAttr(resourceName, "policy.#", "1"), resource.TestCheckResourceAttr(resourceName, "policy.0.actions.#", "1"), resource.TestCheckResourceAttr(resourceName, "policy.0.actions.0", "*"), @@ -164,6 +166,7 @@ func TestAccCustomRole_CreateWithNotStatements(t *testing.T) { resource.TestCheckResourceAttr(resourceName, KEY, key), resource.TestCheckResourceAttr(resourceName, NAME, "Custom role - "+name), resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "Don't allow all actions on non-staging environments"), + resource.TestCheckResourceAttr(resourceName, BASE_PERMISSIONS, "reader"), resource.TestCheckResourceAttr(resourceName, "policy.#", "0"), resource.TestCheckResourceAttr(resourceName, "policy_statements.#", "1"), resource.TestCheckResourceAttr(resourceName, "policy_statements.0.not_actions.#", "1"), @@ -205,6 +208,7 @@ func TestAccCustomRole_Update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, KEY, key), resource.TestCheckResourceAttr(resourceName, NAME, "Updated - "+name), resource.TestCheckResourceAttr(resourceName, DESCRIPTION, ""), // should be empty after removal + resource.TestCheckResourceAttr(resourceName, BASE_PERMISSIONS, "reader"), resource.TestCheckResourceAttr(resourceName, "policy.#", "1"), resource.TestCheckResourceAttr(resourceName, "policy.0.actions.#", "1"), resource.TestCheckResourceAttr(resourceName, "policy.0.actions.0", "*"), diff --git a/website/docs/r/custom_role.html.markdown b/website/docs/r/custom_role.html.markdown index c2c9deea..1365c818 100644 --- a/website/docs/r/custom_role.html.markdown +++ b/website/docs/r/custom_role.html.markdown @@ -42,6 +42,8 @@ resource "launchdarkly_custom_role" "example" { - `description` - (Optional) The description of the custom role. +- `base_permissions` - (Optional) The base permission level. Either `reader` or `no_access`. Defaults to `reader` if not set. + - `policy_statements` - (Required) The custom role policy block. To learn more, read [Policies in custom roles](https://docs.launchdarkly.com/docs/policies-in-custom-roles). Custom role `policy_statements` blocks are composed of the following arguments: From 38d70bca4bea426f890e341c688b7fe9c5549e96 Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Thu, 5 May 2022 16:56:43 +0200 Subject: [PATCH 019/128] Backmerge/release 2.7.0 (#206) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.0 release (#98) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * auto-generate integration configs Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian --- CHANGELOG.md | 2 +- launchdarkly/audit_log_subscription_configs_generated.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c51290..2fa64b91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [2.6.2] (Unreleased) +## [2.7.0] (Unreleased) FEATURES: diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 350f23e4..89fa5456 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -7,7 +7,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "apiKey": { AllowedValues: []string{}, DefaultValue: nil, - Description: "Enter your Datadog [API key](https://app.datadoghq.com/account/settings#api).", + Description: "Enter your Datadog [API key](https://app.datadoghq.com/organization-settings/api-keys).", IsOptional: false, IsSecret: true, Type: "string", From 6559f7198e53a0103b933d7a78459311f5c5203c Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 11 May 2022 16:05:04 -0700 Subject: [PATCH 020/128] (bug-fix) Update modules to accept new API header Hashicorp [recently added a Release API](https://www.hashicorp.com/blog/announcing-the-hashicorp-releases-api) that includes a new `Content-Type` header `application/vnd+hashicorp.releases-api.v0+json`. This gets used somewhere in making requests, but the `hc-install` Go library was previously at version 0.3.1 which raised an error when it encountered this header. V0.3.2 accepts the header, so this updates the Go modules in this repo using `go get -u && go mod tidy`. --- go.mod | 23 +-- go.sum | 163 +++++++----------- .../resource_launchdarkly_environment_test.go | 4 +- ...nchdarkly_feature_flag_environment_test.go | 6 +- .../resource_launchdarkly_project_test.go | 1 - .../resource_launchdarkly_segment_test.go | 2 +- 6 files changed, 73 insertions(+), 126 deletions(-) diff --git a/go.mod b/go.mod index c555234f..0a69438c 100644 --- a/go.mod +++ b/go.mod @@ -7,26 +7,21 @@ require ( github.com/fatih/color v1.13.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/go-hclog v1.0.0 // indirect - github.com/hashicorp/go-plugin v1.4.3 // indirect - github.com/hashicorp/go-retryablehttp v0.7.0 - github.com/hashicorp/hcl/v2 v2.11.1 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0 - github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045 // indirect + github.com/hashicorp/go-plugin v1.4.4 // indirect + github.com/hashicorp/go-retryablehttp v0.7.1 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 + github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect github.com/launchdarkly/api-client-go/v7 v7.1.1 github.com/mattn/go-colorable v0.1.12 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/oklog/run v1.1.0 // indirect github.com/stoewer/go-strcase v1.2.0 github.com/stretchr/testify v1.7.0 - github.com/zclconf/go-cty v1.10.0 // indirect - golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect - golang.org/x/text v0.3.7 // indirect + github.com/vmihailenco/tagparser v0.1.2 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect + golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect - google.golang.org/grpc v1.42.0 // indirect + google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 // indirect ) diff --git a/go.sum b/go.sum index c4f80cd5..fd67613a 100644 --- a/go.sum +++ b/go.sum @@ -11,9 +11,7 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= @@ -31,18 +29,13 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= @@ -51,11 +44,10 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= -github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -64,18 +56,9 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= -github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -83,9 +66,9 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -97,8 +80,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= @@ -122,7 +105,6 @@ github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3a github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -159,8 +141,10 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -173,7 +157,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -187,63 +170,54 @@ 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-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0 h1:bkKf0BeBXcSYa7f5Fyi9gMuQ8gNsxeiNpZjR6VxNZeo= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM= github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= -github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= +github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= +github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= +github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk= github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= -github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/hcl/v2 v2.11.1 h1:yTyWcXcm9XB0TEkyU/JCRU6rYy4K+mgLtzn2wlrJbcc= -github.com/hashicorp/hcl/v2 v2.11.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= +github.com/hashicorp/hc-install v0.3.2 h1:oiQdJZvXmkNcRcEOOfM5n+VTsvNjWQeOjfAoO6dKSH8= +github.com/hashicorp/hc-install v0.3.2/go.mod h1:xMG6Tr8Fw1WFjlxH0A9v61cW15pFwgEGqEz0V4jisHs= +github.com/hashicorp/hcl/v2 v2.12.0 h1:PsYxySWpMD4KPaoJLnsHwtK5Qptvj/4Q6s0t4sUxZf4= +github.com/hashicorp/hcl/v2 v2.12.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.15.0 h1:cqjh4d8HYNQrDoEmlSGelHmg2DYDh5yayckvJ5bV18E= -github.com/hashicorp/terraform-exec v0.15.0/go.mod h1:H4IG8ZxanU+NW0ZpDRNsvh9f0ul7C0nHP+rUR/CHs7I= +github.com/hashicorp/terraform-exec v0.16.1 h1:NAwZFJW2L2SaCBVZoVaH8LPImLOGbPLkSHy0IYbs2uE= +github.com/hashicorp/terraform-exec v0.16.1/go.mod h1:aj0lVshy8l+MHhFNoijNHtqTJQI3Xlowv5EOsEaGO7M= github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniyEi5CM+FWGY= github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= -github.com/hashicorp/terraform-plugin-go v0.5.0 h1:+gCDdF0hcYCm0YBTxrP4+K1NGIS5ZKZBKDORBewLJmg= -github.com/hashicorp/terraform-plugin-go v0.5.0/go.mod h1:PAVN26PNGpkkmsvva1qfriae5Arky3xl3NfzKa8XFVM= -github.com/hashicorp/terraform-plugin-log v0.2.0 h1:rjflRuBqCnSk3UHOR25MP1G5BDLKktTA6lNjjcAnBfI= -github.com/hashicorp/terraform-plugin-log v0.2.0/go.mod h1:E1kJmapEHzqu1x6M++gjvhzM2yMQNXPVWZRCB8sgYjg= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0 h1:osXVmeDNoYGxPGnIFxrR//rxa47XIMwzOBL9/rX0iDM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0/go.mod h1:FjM9DXWfP0w/AeOtJoSKHBZ01LqmaO6uP4bXhv3fekw= +github.com/hashicorp/terraform-plugin-go v0.9.0 h1:FvLY/3z4SNVatPZdoFcyrlNbCar+WyyOTv5X4Tp+WZc= +github.com/hashicorp/terraform-plugin-go v0.9.0/go.mod h1:EawBkgjBWNf7jiKnVoyDyF39OSV+u6KUX+Y73EPj3oM= +github.com/hashicorp/terraform-plugin-log v0.3.0/go.mod h1:EjueSP/HjlyFAsDqt+okpCPjkT4NDynAe32AeDC4vps= +github.com/hashicorp/terraform-plugin-log v0.4.0 h1:F3eVnm8r2EfQCe2k9blPIiF/r2TT01SHijXnS7bujvc= +github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 h1:9fjPgCenJqnbjo95SDcbJ+YdLyEC1N35cwKWcRWhJTQ= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0/go.mod h1:hLa0sTiySU/AWEgV2GxJh0/pQIqcCmm30IPja9N9lTg= github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= -github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045 h1:R/I8ofvXuPcTNoc//N4ruvaHGZcShI/VuU2iXo875Lo= -github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045/go.mod h1:anRyJbe12BZscpFgaeGu9gH12qfdBP094LYFtuAFzd4= +github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 h1:IOawOnLgKntezAV3oJs17rkhXha+h0EF5OMjb2KFlYc= +github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -251,17 +225,11 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= -github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -276,38 +244,28 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/launchdarkly/api-client-go/v7 v7.1.1 h1:3VBkFt9xHljMw5KDlVFDUogxfH78Y7GLVu8irBC8Gy8= github.com/launchdarkly/api-client-go/v7 v7.1.1/go.mod h1:GVl1inKsWoKX3yLgdqrjxWw8k4ih0HlSmdnrhi5NNDs= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -320,7 +278,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -330,7 +287,6 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= @@ -340,16 +296,16 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -366,7 +322,6 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -376,7 +331,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= @@ -402,7 +356,6 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -411,7 +364,6 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -442,20 +394,22 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b h1:MWaHNqZy3KTpuTMAGvv+Kw+ylsEpmyJZizz1dqxnu28= -golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -495,27 +449,29 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -561,12 +517,10 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d h1:W07d4xkoAUSNOkOzdzXCdFGxT7o2rW4q8M34tB2i//k= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -583,7 +537,6 @@ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -625,8 +578,8 @@ google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -640,12 +593,12 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -658,15 +611,15 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= diff --git a/launchdarkly/resource_launchdarkly_environment_test.go b/launchdarkly/resource_launchdarkly_environment_test.go index c2eace76..b1921154 100644 --- a/launchdarkly/resource_launchdarkly_environment_test.go +++ b/launchdarkly/resource_launchdarkly_environment_test.go @@ -299,7 +299,7 @@ func TestAccEnvironmentWithApprovals(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "approval_settings.0.can_review_own_request", "true"), resource.TestCheckResourceAttr(resourceName, "approval_settings.0.can_apply_declined_changes", "false"), resource.TestCheckResourceAttr(resourceName, "approval_settings.0.min_num_approvals", "1"), - resource.TestCheckNoResourceAttr(resourceName, "approval_settings.0.required_approval_tags"), + resource.TestCheckNoResourceAttr(resourceName, "approval_settings.0.required_approval_tags.#"), ), }, { @@ -316,7 +316,7 @@ func TestAccEnvironmentWithApprovals(t *testing.T) { resource.TestCheckResourceAttr(resourceName, KEY, "approvals-test"), resource.TestCheckResourceAttr(resourceName, COLOR, "bababa"), resource.TestCheckResourceAttr(resourceName, PROJECT_KEY, projectKey), - resource.TestCheckNoResourceAttr(resourceName, APPROVAL_SETTINGS), + resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.%%", APPROVAL_SETTINGS)), ), }, }, diff --git a/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go b/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go index 20af0633..f0d21f1f 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go @@ -401,11 +401,11 @@ func TestAccFeatureFlagEnvironment_Empty(t *testing.T) { resource.TestCheckResourceAttr(resourceName, OFF_VARIATION, "2"), resource.TestCheckResourceAttr(resourceName, "fallthrough.0.variation", "0"), resource.TestCheckResourceAttr(resourceName, TRACK_EVENTS, "false"), - resource.TestCheckNoResourceAttr(resourceName, RULES), + resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.0", RULES)), resource.TestCheckNoResourceAttr(resourceName, "rules.#"), - resource.TestCheckNoResourceAttr(resourceName, PREREQUISITES), + resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.0", PREREQUISITES)), resource.TestCheckNoResourceAttr(resourceName, "prerequisites.#"), - resource.TestCheckNoResourceAttr(resourceName, TARGETS), + resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.0", TARGETS)), resource.TestCheckNoResourceAttr(resourceName, "targets.#"), ), }, diff --git a/launchdarkly/resource_launchdarkly_project_test.go b/launchdarkly/resource_launchdarkly_project_test.go index 581297b4..708b3ed1 100644 --- a/launchdarkly/resource_launchdarkly_project_test.go +++ b/launchdarkly/resource_launchdarkly_project_test.go @@ -228,7 +228,6 @@ func TestAccProject_Update(t *testing.T) { testAccCheckProjectExists(resourceName), resource.TestCheckResourceAttr(resourceName, KEY, projectKey), resource.TestCheckResourceAttr(resourceName, NAME, "awesome test project"), - resource.TestCheckNoResourceAttr(resourceName, "tags"), resource.TestCheckNoResourceAttr(resourceName, "tags.#"), resource.TestCheckResourceAttr(resourceName, INCLUDE_IN_SNIPPET, "false"), ), diff --git a/launchdarkly/resource_launchdarkly_segment_test.go b/launchdarkly/resource_launchdarkly_segment_test.go index ac52de8a..f65f6810 100644 --- a/launchdarkly/resource_launchdarkly_segment_test.go +++ b/launchdarkly/resource_launchdarkly_segment_test.go @@ -208,7 +208,7 @@ func TestAccSegment_Update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "excluded.#", "2"), resource.TestCheckResourceAttr(resourceName, "excluded.0", "user3"), resource.TestCheckResourceAttr(resourceName, "excluded.1", "user4"), - resource.TestCheckNoResourceAttr(resourceName, RULES), + resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.#", RULES)), ), }, { From 626aaaec753beead904ca569dfe1d54bc56038b7 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Thu, 19 May 2022 16:02:13 -0700 Subject: [PATCH 021/128] Update circleci test timeout to 15 seconds The circleci test failed because the test took 10.10 seconds. So let's update the timeout to 15 seconds from 10. link to old test failure: https://app.circleci.com/pipelines/github/launchdarkly/terraform-provider-launchdarkly-private/1452/workflows/51a2008f-0c3e-4b7d-af3b-3c1d84387b84/jobs/1847?invite=true#step-113-330%7CError --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a02a958..f0e03088 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ jobs: environment: # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com - CHECKPOINT_TIMEOUT: 10000 + CHECKPOINT_TIMEOUT: 15000 steps: - checkout From 9084524526b4ef3621a40e6ea8306341208999cf Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 30 Jun 2022 14:56:01 +0100 Subject: [PATCH 022/128] Regenerate auditlog configs to resolve CI failures (#211) * Regenerate auditlog configs * Run make generate again --- launchdarkly/audit_log_subscription_configs_generated.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 89fa5456..9e840672 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -67,7 +67,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "token": { AllowedValues: []string{}, DefaultValue: nil, - Description: "Enter the [base64 _credentials_ based on your API Key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html)", + Description: "Enter the base64 _credentials_ based on your [API Key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html)", IsOptional: false, IsSecret: true, Type: "string", @@ -75,7 +75,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "url": { AllowedValues: []string{}, DefaultValue: nil, - Description: "Enter the URL for your Elasticsearch endpoint including socket", + Description: "Enter the URL for your Elasticsearch endpoint, including the socket", IsOptional: false, IsSecret: false, Type: "uri", From 54dbc29e005482d9089afa3f2b0d05460f05e40e Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Mon, 11 Jul 2022 12:10:22 +0100 Subject: [PATCH 023/128] Run make generate to supress CI failures (#212) --- launchdarkly/audit_log_subscription_configs_generated.go | 2 +- launchdarkly/variations_helper.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 9e840672..a960e005 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -93,7 +93,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "datasetName": { AllowedValues: []string{}, DefaultValue: nil, - Description: "Enter the name of your Honeycomb dataset. This value will associate LaunchDarkly data with the corresponding Honeycomb dataset.", + Description: "Enter the name of your Honeycomb dataset. This associates LaunchDarkly data with the corresponding Honeycomb dataset.", IsOptional: false, IsSecret: false, Type: "string", diff --git a/launchdarkly/variations_helper.go b/launchdarkly/variations_helper.go index be201936..fcda387a 100644 --- a/launchdarkly/variations_helper.go +++ b/launchdarkly/variations_helper.go @@ -3,7 +3,6 @@ package launchdarkly import ( "encoding/json" "fmt" - "reflect" "strconv" "strings" @@ -307,7 +306,7 @@ func variationsToVariationType(variations []ldapi.Variation) (string, error) { case map[string]interface{}, []interface{}: variationType = JSON_VARIATION default: - return "", fmt.Errorf("unknown variation type: %q", reflect.TypeOf(variationValue)) + return "", fmt.Errorf("unknown variation type: %T", variationValue) } return variationType, nil } From b9a34191310a7def43fa60e442e355599e3622d6 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Tue, 12 Jul 2022 10:47:36 -0700 Subject: [PATCH 024/128] added a check for environment and warning --- launchdarkly/feature_flag_environment_helper.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/launchdarkly/feature_flag_environment_helper.go b/launchdarkly/feature_flag_environment_helper.go index 42913200..f1abc076 100644 --- a/launchdarkly/feature_flag_environment_helper.go +++ b/launchdarkly/feature_flag_environment_helper.go @@ -60,6 +60,10 @@ func getFeatureFlagEnvironment(client *Client, projectKey, flagKey, environmentK return client.ld.FeatureFlagsApi.GetFeatureFlag(client.ctx, projectKey, flagKey).Env(environmentKey).Execute() } +func getEnvironment(client *Client, projectKey, environmentKey string) (ldapi.Environment, *http.Response, error) { + return client.ld.EnvironmentsApi.GetEnvironment(client.ctx, projectKey, environmentKey).Execute() +} + func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw interface{}, isDataSource bool) diag.Diagnostics { var diags diag.Diagnostics client := raw.(*Client) @@ -70,6 +74,17 @@ func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw } envKey := d.Get(ENV_KEY).(string) + _, res, err := getEnvironment(client, projectKey, envKey) + if isStatusNotFound(res) { + log.Printf("[WARN] failed to find environment %q in project %q, removing from state", envKey, projectKey) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: fmt.Sprintf("[WARN] failed to find environment %q in project %q, removing from state", envKey, projectKey), + }) + d.SetId("") + return diags + } + flag, res, err := getFeatureFlagEnvironment(client, projectKey, flagKey, envKey) if isStatusNotFound(res) && !isDataSource { log.Printf("[WARN] failed to find flag %q in project %q, removing from state", flagKey, projectKey) From c073a3b55a0e752cd9b42e7411a0d32c75423355 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Tue, 12 Jul 2022 10:51:33 -0700 Subject: [PATCH 025/128] fix go lint error --- launchdarkly/feature_flag_environment_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchdarkly/feature_flag_environment_helper.go b/launchdarkly/feature_flag_environment_helper.go index f1abc076..7ce314a8 100644 --- a/launchdarkly/feature_flag_environment_helper.go +++ b/launchdarkly/feature_flag_environment_helper.go @@ -74,7 +74,7 @@ func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw } envKey := d.Get(ENV_KEY).(string) - _, res, err := getEnvironment(client, projectKey, envKey) + _, res, _ := getEnvironment(client, projectKey, envKey) if isStatusNotFound(res) { log.Printf("[WARN] failed to find environment %q in project %q, removing from state", envKey, projectKey) diags = append(diags, diag.Diagnostic{ From 2ba884b53d2eb55045595f9b3c0ae53e013c5761 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Tue, 12 Jul 2022 12:13:27 -0700 Subject: [PATCH 026/128] use environmentExists function --- ...udit_log_subscription_configs_generated.go | 36 +++++++++++++++++++ .../feature_flag_environment_helper.go | 13 +++---- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index a960e005..3b5131a0 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -81,6 +81,24 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "uri", }, }, + "grafana": { + "apiKey": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter an API key to your Grafana instance. This API key must have editor privileges.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "endpointUrl": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Grafana instance's URL. This instance must be accessible to LaunchDarkly's servers.", + IsOptional: false, + IsSecret: false, + Type: "uri", + }, + }, "honeycomb": { "apiKey": { AllowedValues: []string{}, @@ -125,6 +143,24 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ IsSecret: false, Type: "uri", }}, + "new-relic": { + "accountId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [New Relic account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id). The associated account must be enabled for Insights Pro.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "apiKey": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [New Relic API key](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/introduction-event-api#register).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + }, "new-relic-apm": { "apiKey": { AllowedValues: []string{}, diff --git a/launchdarkly/feature_flag_environment_helper.go b/launchdarkly/feature_flag_environment_helper.go index 7ce314a8..fbb3119b 100644 --- a/launchdarkly/feature_flag_environment_helper.go +++ b/launchdarkly/feature_flag_environment_helper.go @@ -60,10 +60,6 @@ func getFeatureFlagEnvironment(client *Client, projectKey, flagKey, environmentK return client.ld.FeatureFlagsApi.GetFeatureFlag(client.ctx, projectKey, flagKey).Env(environmentKey).Execute() } -func getEnvironment(client *Client, projectKey, environmentKey string) (ldapi.Environment, *http.Response, error) { - return client.ld.EnvironmentsApi.GetEnvironment(client.ctx, projectKey, environmentKey).Execute() -} - func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw interface{}, isDataSource bool) diag.Diagnostics { var diags diag.Diagnostics client := raw.(*Client) @@ -74,8 +70,13 @@ func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw } envKey := d.Get(ENV_KEY).(string) - _, res, _ := getEnvironment(client, projectKey, envKey) - if isStatusNotFound(res) { + envExists, err := environmentExists(projectKey, envKey, client) + + if err != nil { + return diag.FromErr(err) + } + + if !envExists { log.Printf("[WARN] failed to find environment %q in project %q, removing from state", envKey, projectKey) diags = append(diags, diag.Diagnostic{ Severity: diag.Warning, From dd21daca123de3756c91cbfe1395708ab71b1469 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Wed, 13 Jul 2022 12:05:58 -0700 Subject: [PATCH 027/128] remove grafana --- ...udit_log_subscription_configs_generated.go | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 3b5131a0..a960e005 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -81,24 +81,6 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "uri", }, }, - "grafana": { - "apiKey": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter an API key to your Grafana instance. This API key must have editor privileges.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "endpointUrl": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your Grafana instance's URL. This instance must be accessible to LaunchDarkly's servers.", - IsOptional: false, - IsSecret: false, - Type: "uri", - }, - }, "honeycomb": { "apiKey": { AllowedValues: []string{}, @@ -143,24 +125,6 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ IsSecret: false, Type: "uri", }}, - "new-relic": { - "accountId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your [New Relic account ID](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/account-id). The associated account must be enabled for Insights Pro.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - "apiKey": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your [New Relic API key](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/introduction-event-api#register).", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - }, "new-relic-apm": { "apiKey": { AllowedValues: []string{}, From 88840f0caa3680ab49ce70ead0e36758971aef13 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Wed, 13 Jul 2022 14:26:25 -0700 Subject: [PATCH 028/128] Update changelog with bug fix for datasource feature flag environment --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fa64b91..2f293d52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ FEATURES: - Added the `base_permissions` field to the `launchdarkly_custom_role` resource. +BUG FIXES: + +- Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. + ## [2.6.1] (April 12, 2022) NOTES: From 7b218fe57e401dc4744267993fa95ec9a244626c Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Mon, 25 Jul 2022 17:53:23 -0700 Subject: [PATCH 029/128] added changes --- CHANGELOG.md | 12 ++-- ...udit_log_subscription_configs_generated.go | 60 +++++++++++++++++++ .../feature_flag_environment_helper.go | 4 +- 3 files changed, 69 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f293d52..7fefa26d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ -## [2.7.0] (Unreleased) +## [2.7.1] (July 21, 2022) -FEATURES: +BUG FIXES: -- Added the `base_permissions` field to the `launchdarkly_custom_role` resource. +- Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) -BUG FIXES: +## [2.7.0] (May 5, 2022) -- Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. +FEATURES: + +- Added the `base_permissions` field to the `launchdarkly_custom_role` resource. ## [2.6.1] (April 12, 2022) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index a960e005..917d9306 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -3,6 +3,32 @@ package launchdarkly var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ + "cloudtrail": { + "accountId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [AWS account ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#FindingYourAWSId). The associated account must be configured to use CloudTrail Lake.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "iamRoleArn": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ARN of the IAM Role for LaunchDarkly to assume to post to your AWS CloudTrail destination.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "ingestionChannelArn": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ARN of the CloudTrail Ingestion Channel for LaunchDarkly to use.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + }, "datadog": { "apiKey": { AllowedValues: []string{}, @@ -195,4 +221,38 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, + "terraform-cloud": { + "hostName": { + AllowedValues: []string{}, + DefaultValue: "https://app.terraform.io", + Description: "Enter your Terraform Enterprise host name in the format https://HOST_URL.", + IsOptional: true, + IsSecret: false, + Type: "string", + }, + "token": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Terraform Enterprise [user token or team token](https://www.terraform.io/cloud-docs/users-teams-organizations/users#creating-a-token).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "workspaceId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ID of the Terraform workspace you want runs to trigger for based on the policy below.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + }, + "zapier": {"url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your zap webhook URL", + IsOptional: false, + IsSecret: false, + Type: "uri", + }}, } diff --git a/launchdarkly/feature_flag_environment_helper.go b/launchdarkly/feature_flag_environment_helper.go index fbb3119b..18b75555 100644 --- a/launchdarkly/feature_flag_environment_helper.go +++ b/launchdarkly/feature_flag_environment_helper.go @@ -77,10 +77,10 @@ func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw } if !envExists { - log.Printf("[WARN] failed to find environment %q in project %q, removing from state", envKey, projectKey) + log.Printf("[WARN] failed to find environment %q in project %q, removing resource from state", envKey, projectKey) diags = append(diags, diag.Diagnostic{ Severity: diag.Warning, - Summary: fmt.Sprintf("[WARN] failed to find environment %q in project %q, removing from state", envKey, projectKey), + Summary: fmt.Sprintf("[WARN] failed to find environment %q in project %q, removing resource from state", envKey, projectKey), }) d.SetId("") return diags From 70c9c34f10729a15b649d2e7af625ed2b4dffd5b Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Wed, 27 Jul 2022 14:26:00 +0200 Subject: [PATCH 030/128] upgrade go version 1.18.1 (#217) * upgrade go version * Upgrade to go 1.18.1 * Upgrade go version everywhere * Upgrade circle linter to V2 * Add cache prefix to linter * Turn cache prefix into string Co-authored-by: Henry Barrow --- .circleci/config.yml | 7 ++--- .github/workflows/release.yml | 2 +- .go-version | 2 +- CHANGELOG.md | 4 +++ go.mod | 50 ++++++++++++++++++++++++++++++----- go.sum | 27 ------------------- scripts/codegen/go.mod | 7 ++++- 7 files changed, 59 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f0e03088..af750b1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 orbs: go: circleci/go@1.7.0 - linter: talkiq/linter@1.4.1 + linter: talkiq/linter@2.0.0 slack: circleci/slack@4.7.1 commands: @@ -27,7 +27,7 @@ jobs: test: executor: name: go/default - tag: &go_version "1.16.10" + tag: &go_version "1.18.1" environment: # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com @@ -102,7 +102,8 @@ jobs: command: | sudo apt update sudo apt install python3-pip python-is-python3 - - linter/pre-commit + - linter/pre-commit: + cache_prefix: "0" - notify-slack-of-failures workflows: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee613a31..b480117f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.18 - name: Import GPG key id: import_gpg uses: paultyng/ghaction-import-gpg@v2.1.0 diff --git a/.go-version b/.go-version index d3799fb2..ec6d649b 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.16.10 +1.18.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fefa26d..48ca5d18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ BUG FIXES: - Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) +NOTES: + +- Upgrade Go version to 1.18 + ## [2.7.0] (May 5, 2022) FEATURES: diff --git a/go.mod b/go.mod index 0a69438c..f06a07c7 100644 --- a/go.mod +++ b/go.mod @@ -1,27 +1,63 @@ module github.com/launchdarkly/terraform-provider-launchdarkly -go 1.16 +go 1.18 + +require ( + github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 + github.com/hashicorp/go-retryablehttp v0.7.1 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 + github.com/launchdarkly/api-client-go/v7 v7.1.1 + github.com/stoewer/go-strcase v1.2.0 + github.com/stretchr/testify v1.7.0 +) require ( github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.13.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.8 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.4.4 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.4.0 // indirect + github.com/hashicorp/hc-install v0.3.2 // indirect + github.com/hashicorp/hcl/v2 v2.12.0 // indirect + github.com/hashicorp/logutils v1.0.0 // indirect + github.com/hashicorp/terraform-exec v0.16.1 // indirect + github.com/hashicorp/terraform-json v0.13.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.9.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.4.0 // indirect github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect - github.com/launchdarkly/api-client-go/v7 v7.1.1 github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.1.0 // indirect - github.com/stoewer/go-strcase v1.2.0 - github.com/stretchr/testify v1.7.0 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect + github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.2 // indirect + github.com/zclconf/go-cty v1.10.0 // indirect + golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect + golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 // indirect + google.golang.org/grpc v1.46.0 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index fd67613a..6abc7265 100644 --- a/go.sum +++ b/go.sum @@ -41,7 +41,6 @@ github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/ github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= @@ -50,8 +49,6 @@ github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4t github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= @@ -66,7 +63,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -80,7 +76,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -142,7 +137,6 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -171,12 +165,10 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S 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-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= @@ -190,7 +182,6 @@ github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= github.com/hashicorp/hc-install v0.3.2 h1:oiQdJZvXmkNcRcEOOfM5n+VTsvNjWQeOjfAoO6dKSH8= github.com/hashicorp/hc-install v0.3.2/go.mod h1:xMG6Tr8Fw1WFjlxH0A9v61cW15pFwgEGqEz0V4jisHs= github.com/hashicorp/hcl/v2 v2.12.0 h1:PsYxySWpMD4KPaoJLnsHwtK5Qptvj/4Q6s0t4sUxZf4= @@ -203,18 +194,14 @@ github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniy github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= github.com/hashicorp/terraform-plugin-go v0.9.0 h1:FvLY/3z4SNVatPZdoFcyrlNbCar+WyyOTv5X4Tp+WZc= github.com/hashicorp/terraform-plugin-go v0.9.0/go.mod h1:EawBkgjBWNf7jiKnVoyDyF39OSV+u6KUX+Y73EPj3oM= -github.com/hashicorp/terraform-plugin-log v0.3.0/go.mod h1:EjueSP/HjlyFAsDqt+okpCPjkT4NDynAe32AeDC4vps= github.com/hashicorp/terraform-plugin-log v0.4.0 h1:F3eVnm8r2EfQCe2k9blPIiF/r2TT01SHijXnS7bujvc= github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg= github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 h1:9fjPgCenJqnbjo95SDcbJ+YdLyEC1N35cwKWcRWhJTQ= github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0/go.mod h1:hLa0sTiySU/AWEgV2GxJh0/pQIqcCmm30IPja9N9lTg= -github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 h1:IOawOnLgKntezAV3oJs17rkhXha+h0EF5OMjb2KFlYc= github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -224,7 +211,6 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= @@ -240,7 +226,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/launchdarkly/api-client-go/v7 v7.1.1 h1:3VBkFt9xHljMw5KDlVFDUogxfH78Y7GLVu8irBC8Gy8= github.com/launchdarkly/api-client-go/v7 v7.1.1/go.mod h1:GVl1inKsWoKX3yLgdqrjxWw8k4ih0HlSmdnrhi5NNDs= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -257,11 +242,9 @@ github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa1 github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -270,8 +253,6 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -285,7 +266,6 @@ github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdk github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= @@ -365,7 +345,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -514,7 +493,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -546,7 +524,6 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -574,13 +551,11 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -595,10 +570,8 @@ google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/scripts/codegen/go.mod b/scripts/codegen/go.mod index 94660a04..dc68b2fe 100644 --- a/scripts/codegen/go.mod +++ b/scripts/codegen/go.mod @@ -1,9 +1,14 @@ module github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen -go 1.16 +go 1.18 require ( github.com/dave/jennifer v1.5.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.3.0 ) + +require ( + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect +) From 8bee33e83efa325579cd73d0e296a99dca240102 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Wed, 27 Jul 2022 14:41:15 +0100 Subject: [PATCH 031/128] Backmerge public/release v2.7.1 3 (#219) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.0 release (#98) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * auto-generate integration configs Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.1 release (#103) - Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) * Prepare release 2.7.1 2 (#104) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * Backmerge/release 2.7.0 (#206) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.0 release (#98) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * auto-generate integration configs Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian * (bug-fix) Update modules to accept new API header Hashicorp [recently added a Release API](https://www.hashicorp.com/blog/announcing-the-hashicorp-releases-api) that includes a new `Content-Type` header `application/vnd+hashicorp.releases-api.v0+json`. This gets used somewhere in making requests, but the `hc-install` Go library was previously at version 0.3.1 which raised an error when it encountered this header. V0.3.2 accepts the header, so this updates the Go modules in this repo using `go get -u && go mod tidy`. * Update circleci test timeout to 15 seconds The circleci test failed because the test took 10.10 seconds. So let's update the timeout to 15 seconds from 10. link to old test failure: https://app.circleci.com/pipelines/github/launchdarkly/terraform-provider-launchdarkly-private/1452/workflows/51a2008f-0c3e-4b7d-af3b-3c1d84387b84/jobs/1847?invite=true#step-113-330%7CError * Regenerate auditlog configs to resolve CI failures (#211) * Regenerate auditlog configs * Run make generate again * Run make generate to supress CI failures (#212) * added a check for environment and warning * fix go lint error * use environmentExists function * remove grafana * Update changelog with bug fix for datasource feature flag environment * added changes * upgrade go version 1.18.1 (#217) * upgrade go version * Upgrade to go 1.18.1 * Upgrade go version everywhere * Upgrade circle linter to V2 * Add cache prefix to linter * Turn cache prefix into string Co-authored-by: Henry Barrow * remove checked in testing examples Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian Co-authored-by: Lucy Voigt Co-authored-by: Lucy Voigt Co-authored-by: Sunny Guduru * fix merge issue in Circle config (#105) Co-authored-by: Isabelle Miller Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian Co-authored-by: Sunny Guduru Co-authored-by: Lucy Voigt Co-authored-by: Lucy Voigt From 402b508a70623afbfef850f59f79e498eeb67359 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 28 Jul 2022 10:00:39 +0100 Subject: [PATCH 032/128] Remove invalid integration configurations (#221) --- ...udit_log_subscription_configs_generated.go | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 917d9306..703ddf39 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -3,32 +3,6 @@ package launchdarkly var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ - "cloudtrail": { - "accountId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your [AWS account ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#FindingYourAWSId). The associated account must be configured to use CloudTrail Lake.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - "iamRoleArn": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ARN of the IAM Role for LaunchDarkly to assume to post to your AWS CloudTrail destination.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "ingestionChannelArn": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ARN of the CloudTrail Ingestion Channel for LaunchDarkly to use.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - }, "datadog": { "apiKey": { AllowedValues: []string{}, @@ -221,32 +195,6 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, - "terraform-cloud": { - "hostName": { - AllowedValues: []string{}, - DefaultValue: "https://app.terraform.io", - Description: "Enter your Terraform Enterprise host name in the format https://HOST_URL.", - IsOptional: true, - IsSecret: false, - Type: "string", - }, - "token": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your Terraform Enterprise [user token or team token](https://www.terraform.io/cloud-docs/users-teams-organizations/users#creating-a-token).", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "workspaceId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ID of the Terraform workspace you want runs to trigger for based on the policy below.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - }, "zapier": {"url": { AllowedValues: []string{}, DefaultValue: nil, From db398b88ba5b61a352c150c859507873aa77db7c Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 28 Jul 2022 10:31:01 +0100 Subject: [PATCH 033/128] Add blacklist to manifest codegen and remove Zapier. (#222) * Update blacklist to codegen and remove Zapier * Update changelog --- CHANGELOG.md | 10 ++++++++-- .../audit_log_subscription_configs_generated.go | 8 -------- scripts/codegen/manifestgen/generator.go | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ca5d18..9774757b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ -## [2.7.1] (July 21, 2022) +## [2.7.2] (July 28, 2022) BUG FIXES: -- Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) +- Remove invalid configurations from the `launchdarkly_audit_log_subscription` resource. + +## [2.7.1] (July 27, 2022) + +BUG FIXES: + +- The `launchdarkly_feature_flag_environment` data source now checks whether the environment exists and prints out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) NOTES: diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 703ddf39..a960e005 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -195,12 +195,4 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, - "zapier": {"url": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your zap webhook URL", - IsOptional: false, - IsSecret: false, - Type: "uri", - }}, } diff --git a/scripts/codegen/manifestgen/generator.go b/scripts/codegen/manifestgen/generator.go index 7a19874c..43ff974e 100644 --- a/scripts/codegen/manifestgen/generator.go +++ b/scripts/codegen/manifestgen/generator.go @@ -6,6 +6,19 @@ import ( "github.com/dave/jennifer/jen" ) +var OMITTED_INTEGRATION_KEYS = []string{ + "zapier", // Zapier is omitted because it the integration configuration is managed by Zapier +} + +func isOmitted(integrationKey string) bool { + for _, invalidIntegrationKey := range OMITTED_INTEGRATION_KEYS { + if integrationKey == invalidIntegrationKey { + return true + } + } + return false +} + func Render(w io.Writer, manifests []Manifest) error { file := jen.NewFile("launchdarkly") file.HeaderComment("Code generated by github.com/launchdarkly/terraform-provider-launchdarkly/scripts/codegen DO NOT EDIT.") @@ -19,6 +32,10 @@ func Render(w io.Writer, manifests []Manifest) error { continue } + if isOmitted(manifest.Key) { + continue + } + configDict := make(jen.Dict, len(manifest.FormVariables)) for _, formVar := range manifest.FormVariables { configDict[jen.Lit(formVar.Key)] = jen.Values(convertFormVarToDict(formVar)) From b9e966d47dce9c2515999dd2d0fef44aed68c437 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 28 Jul 2022 11:07:22 +0100 Subject: [PATCH 034/128] Backmerge release 2.7.2 (#223) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.0 release (#98) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * auto-generate integration configs Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.1 release (#103) - Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) * Prepare release 2.7.1 2 (#104) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * Backmerge/release 2.7.0 (#206) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.0 release (#98) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * auto-generate integration configs Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian * (bug-fix) Update modules to accept new API header Hashicorp [recently added a Release API](https://www.hashicorp.com/blog/announcing-the-hashicorp-releases-api) that includes a new `Content-Type` header `application/vnd+hashicorp.releases-api.v0+json`. This gets used somewhere in making requests, but the `hc-install` Go library was previously at version 0.3.1 which raised an error when it encountered this header. V0.3.2 accepts the header, so this updates the Go modules in this repo using `go get -u && go mod tidy`. * Update circleci test timeout to 15 seconds The circleci test failed because the test took 10.10 seconds. So let's update the timeout to 15 seconds from 10. link to old test failure: https://app.circleci.com/pipelines/github/launchdarkly/terraform-provider-launchdarkly-private/1452/workflows/51a2008f-0c3e-4b7d-af3b-3c1d84387b84/jobs/1847?invite=true#step-113-330%7CError * Regenerate auditlog configs to resolve CI failures (#211) * Regenerate auditlog configs * Run make generate again * Run make generate to supress CI failures (#212) * added a check for environment and warning * fix go lint error * use environmentExists function * remove grafana * Update changelog with bug fix for datasource feature flag environment * added changes * upgrade go version 1.18.1 (#217) * upgrade go version * Upgrade to go 1.18.1 * Upgrade go version everywhere * Upgrade circle linter to V2 * Add cache prefix to linter * Turn cache prefix into string Co-authored-by: Henry Barrow * remove checked in testing examples Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian Co-authored-by: Lucy Voigt Co-authored-by: Lucy Voigt Co-authored-by: Sunny Guduru * fix merge issue in Circle config (#105) * Release 2.7.2 (#106) * Ammend changelog (#107) Co-authored-by: Isabelle Miller Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian Co-authored-by: Sunny Guduru Co-authored-by: Lucy Voigt Co-authored-by: Lucy Voigt From e7d7f77ebe5cd48d383c3562c380b3b918f4e417 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Tue, 28 Jun 2022 14:55:48 -0700 Subject: [PATCH 035/128] Update Go api client to 10.0.1 Make GET request to get correct project type in test_utils Remove git diff from circleci --- .circleci/config.yml | 5 ++ .gitignore | 1 + GNUmakefile | 2 +- go.mod | 1 + go.sum | 5 +- launchdarkly/approvals_helper.go | 2 +- ...udit_log_subscription_configs_generated.go | 60 +++++++++++++++++++ launchdarkly/audit_log_subscription_helper.go | 4 +- launchdarkly/clause_helper.go | 2 +- launchdarkly/clause_helper_test.go | 2 +- launchdarkly/config.go | 4 +- launchdarkly/custom_properties_helper.go | 2 +- launchdarkly/custom_properties_helper_test.go | 2 +- ...aunchdarkly_audit_log_subscription_test.go | 10 ++-- ...ta_source_launchdarkly_environment_test.go | 8 +-- ...nchdarkly_feature_flag_environment_test.go | 6 +- ...a_source_launchdarkly_feature_flag_test.go | 4 +- ...a_source_launchdarkly_flag_trigger_test.go | 6 +- .../data_source_launchdarkly_metric_test.go | 6 +- .../data_source_launchdarkly_project_test.go | 8 +-- ...chdarkly_relay_proxy_configuration_test.go | 14 ++--- .../data_source_launchdarkly_segment_test.go | 6 +- .../data_source_launchdarkly_team_member.go | 2 +- ...ta_source_launchdarkly_team_member_test.go | 2 +- .../data_source_launchdarkly_team_members.go | 2 +- ...a_source_launchdarkly_team_members_test.go | 2 +- .../data_source_launchdarkly_webhook_test.go | 12 ++-- launchdarkly/default_variations_helper.go | 2 +- .../default_variations_helper_test.go | 2 +- launchdarkly/environments_helper.go | 2 +- launchdarkly/environments_helper_test.go | 2 +- launchdarkly/fallthrough_helper.go | 2 +- .../feature_flag_environment_helper.go | 6 +- launchdarkly/feature_flags_helper.go | 2 +- launchdarkly/flag_trigger_helper.go | 2 +- launchdarkly/helper.go | 4 +- launchdarkly/keys.go | 7 +++ launchdarkly/metrics_helper.go | 2 +- launchdarkly/policies_helper.go | 10 ++-- launchdarkly/policy_statements_helper.go | 32 +++++----- launchdarkly/policy_statements_helper_test.go | 22 +++---- launchdarkly/prerequisite_helper.go | 2 +- launchdarkly/project_helper.go | 14 +++-- .../resource_launchdarkly_access_token.go | 16 ++--- ...rce_launchdarkly_audit_log_subscription.go | 6 +- .../resource_launchdarkly_custom_role.go | 2 +- .../resource_launchdarkly_destination.go | 2 +- .../resource_launchdarkly_environment.go | 6 +- .../resource_launchdarkly_feature_flag.go | 6 +- ...e_launchdarkly_feature_flag_environment.go | 2 +- .../resource_launchdarkly_flag_trigger.go | 8 +-- launchdarkly/resource_launchdarkly_metric.go | 6 +- launchdarkly/resource_launchdarkly_project.go | 8 +-- ..._launchdarkly_relay_proxy_configuration.go | 2 +- launchdarkly/resource_launchdarkly_segment.go | 4 +- .../resource_launchdarkly_team_member.go | 4 +- launchdarkly/resource_launchdarkly_webhook.go | 4 +- launchdarkly/rollout_helper.go | 2 +- launchdarkly/rule_helper.go | 2 +- launchdarkly/segment_rule_helper.go | 2 +- launchdarkly/segment_rule_helper_test.go | 2 +- launchdarkly/target_helper.go | 2 +- launchdarkly/target_helper_test.go | 2 +- launchdarkly/test_utils.go | 10 ++-- launchdarkly/variations_helper.go | 2 +- launchdarkly/variations_helper_test.go | 2 +- launchdarkly/webhooks_helper.go | 2 +- 67 files changed, 240 insertions(+), 157 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af750b1c..a2b42623 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,6 +85,11 @@ jobs: TESTARGS="-run TestAccTeamMember_UpdateGeneric" make testacc TESTARGS="-run TestAccTeamMember_CreateWithCustomRole" make testacc TESTARGS="-run TestAccTeamMember_UpdateWithCustomRole" make testacc + - run: + name: Test Team Resource + command: | + TESTARGS="-run TestAccTeam_Create" make testacc + TESTARGS="-run TestAccTeam_Update" make testacc - run: name: Test Webhook Resource command: TESTARGS="-run TestAccWebhook" make testacc diff --git a/.gitignore b/.gitignore index 22624338..db1cc1fc 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ # # example.tfvars +api-client-go/ /.idea/ /crash.log /terraform-provider-launchdarkly diff --git a/GNUmakefile b/GNUmakefile index 90a5fb2c..28216371 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,7 +9,7 @@ LDFLAGS:=-ldflags="-X github.com/launchdarkly/terraform-provider-launchdarkly/la default: build build: fmtcheck - go install $(LDFLAGS) + go install github.com/ashanbrown/gofmts/cmd/gofmts@v0.1.4 test: fmtcheck go test -i $(TEST) || exit 1 diff --git a/go.mod b/go.mod index f06a07c7..3926131e 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect + github.com/launchdarkly/api-client-go/v10 v10.0.1 github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/go.sum b/go.sum index 6abc7265..3d3451f7 100644 --- a/go.sum +++ b/go.sum @@ -226,8 +226,9 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/launchdarkly/api-client-go/v7 v7.1.1 h1:3VBkFt9xHljMw5KDlVFDUogxfH78Y7GLVu8irBC8Gy8= -github.com/launchdarkly/api-client-go/v7 v7.1.1/go.mod h1:GVl1inKsWoKX3yLgdqrjxWw8k4ih0HlSmdnrhi5NNDs= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/launchdarkly/api-client-go/v10 v10.0.1 h1:9uJ5Uf7FsSwFjSP648Ii9qG6O22ZUrw0RFIMtIkPWkY= +github.com/launchdarkly/api-client-go/v10 v10.0.1/go.mod h1:LeQ6lizPnybCGvNfKpnnVxMMG2a2hFF5Lnz+jBBgxqQ= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= diff --git a/launchdarkly/approvals_helper.go b/launchdarkly/approvals_helper.go index e3b8e4b1..68a6052b 100644 --- a/launchdarkly/approvals_helper.go +++ b/launchdarkly/approvals_helper.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func approvalSchema() *schema.Schema { diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index a960e005..917d9306 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -3,6 +3,32 @@ package launchdarkly var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ + "cloudtrail": { + "accountId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [AWS account ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#FindingYourAWSId). The associated account must be configured to use CloudTrail Lake.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "iamRoleArn": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ARN of the IAM Role for LaunchDarkly to assume to post to your AWS CloudTrail destination.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "ingestionChannelArn": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ARN of the CloudTrail Ingestion Channel for LaunchDarkly to use.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + }, "datadog": { "apiKey": { AllowedValues: []string{}, @@ -195,4 +221,38 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, + "terraform-cloud": { + "hostName": { + AllowedValues: []string{}, + DefaultValue: "https://app.terraform.io", + Description: "Enter your Terraform Enterprise host name in the format https://HOST_URL.", + IsOptional: true, + IsSecret: false, + Type: "string", + }, + "token": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Terraform Enterprise [user token or team token](https://www.terraform.io/cloud-docs/users-teams-organizations/users#creating-a-token).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "workspaceId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ID of the Terraform workspace you want runs to trigger for based on the policy below.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + }, + "zapier": {"url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your zap webhook URL", + IsOptional: false, + IsSecret: false, + Type: "uri", + }}, } diff --git a/launchdarkly/audit_log_subscription_helper.go b/launchdarkly/audit_log_subscription_helper.go index 721971a7..3bdc6cd8 100644 --- a/launchdarkly/audit_log_subscription_helper.go +++ b/launchdarkly/audit_log_subscription_helper.go @@ -214,7 +214,7 @@ func auditLogSubscriptionRead(ctx context.Context, d *schema.ResourceData, metaR _ = d.Set(NAME, sub.Name) _ = d.Set(ON, sub.On) - cfg, err := configToResourceData(d, *sub.Config, isDataSource) + cfg, err := configToResourceData(d, sub.Config, isDataSource) if err != nil { return diag.Errorf("failed to set config on integration with id %q: %v", *sub.Id, err) } @@ -222,7 +222,7 @@ func auditLogSubscriptionRead(ctx context.Context, d *schema.ResourceData, metaR if err != nil { return diag.Errorf("failed to set config on integration with id %q: %v", *sub.Id, err) } - err = d.Set(STATEMENTS, policyStatementsToResourceData(*sub.Statements)) + err = d.Set(STATEMENTS, policyStatementsToResourceData(sub.Statements)) if err != nil { return diag.Errorf("failed to set statements on integration with id %q: %v", *sub.Id, err) } diff --git a/launchdarkly/clause_helper.go b/launchdarkly/clause_helper.go index 168a538f..95fbf120 100644 --- a/launchdarkly/clause_helper.go +++ b/launchdarkly/clause_helper.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) const ( diff --git a/launchdarkly/clause_helper_test.go b/launchdarkly/clause_helper_test.go index ec9ec026..33d8655c 100644 --- a/launchdarkly/clause_helper_test.go +++ b/launchdarkly/clause_helper_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/config.go b/launchdarkly/config.go index 8b6ac883..919ca62b 100644 --- a/launchdarkly/config.go +++ b/launchdarkly/config.go @@ -11,14 +11,14 @@ import ( "time" retryablehttp "github.com/hashicorp/go-retryablehttp" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) //nolint:staticcheck // The version string gets updated at build time using -ldflags var version = "unreleased" const ( - APIVersion = "20191212" + APIVersion = "20220603" MAX_RETRIES = 8 RETRY_WAIT_MIN = 200 * time.Millisecond RETRY_WAIT_MAX = 2000 * time.Millisecond diff --git a/launchdarkly/custom_properties_helper.go b/launchdarkly/custom_properties_helper.go index 75bc4c2d..67fa6582 100644 --- a/launchdarkly/custom_properties_helper.go +++ b/launchdarkly/custom_properties_helper.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // https://docs.launchdarkly.com/docs/custom-properties diff --git a/launchdarkly/custom_properties_helper_test.go b/launchdarkly/custom_properties_helper_test.go index db6eaa3f..a1bb8f4b 100644 --- a/launchdarkly/custom_properties_helper_test.go +++ b/launchdarkly/custom_properties_helper_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go b/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go index 89664b2b..4b5571e2 100644 --- a/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go +++ b/launchdarkly/data_source_launchdarkly_audit_log_subscription_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -32,16 +32,16 @@ func testAccDataSourceAuditLogSubscriptionCreate(client *Client, integrationKey statementActions := []string{"*"} statements := []ldapi.StatementPost{{ Effect: "allow", - Resources: &statementResources, - Actions: &statementActions, + Resources: statementResources, + Actions: statementActions, }} - subscriptionBody.Statements = &statements + subscriptionBody.Statements = statements sub, _, err := client.ld.IntegrationAuditLogSubscriptionsApi.CreateSubscription(client.ctx, integrationKey).SubscriptionPost(subscriptionBody).Execute() if err != nil { return nil, fmt.Errorf("failed to create integration subscription for test: %v", handleLdapiErr(err)) } - return &sub, nil + return sub, nil } func testAccDataSourceAuditLogSubscriptionDelete(client *Client, integrationKey, id string) error { diff --git a/launchdarkly/data_source_launchdarkly_environment_test.go b/launchdarkly/data_source_launchdarkly_environment_test.go index 3b36dc6d..bb3c08ff 100644 --- a/launchdarkly/data_source_launchdarkly_environment_test.go +++ b/launchdarkly/data_source_launchdarkly_environment_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -28,13 +28,13 @@ func testAccDataSourceEnvironmentScaffold(client *Client, projectKey string, env projectBody := ldapi.ProjectPost{ Name: "Env Test Project", Key: projectKey, - Environments: &[]ldapi.EnvironmentPost{envBody}, + Environments: []ldapi.EnvironmentPost{envBody}, } project, err := testAccDataSourceProjectCreate(client, projectBody) if err != nil { return nil, err } - for _, env := range project.Environments { + for _, env := range project.Environments.Items { if env.Key == envBody.Key { return &env, nil } @@ -95,7 +95,7 @@ func TestAccDataSourceEnv_exists(t *testing.T) { Key: envKey, Color: envColor, SecureMode: ldapi.PtrBool(true), - Tags: &[]string{ + Tags: []string{ "some", "tag", }, } diff --git a/launchdarkly/data_source_launchdarkly_feature_flag_environment_test.go b/launchdarkly/data_source_launchdarkly_feature_flag_environment_test.go index 3309ab3b..6195ee97 100644 --- a/launchdarkly/data_source_launchdarkly_feature_flag_environment_test.go +++ b/launchdarkly/data_source_launchdarkly_feature_flag_environment_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -26,7 +26,7 @@ func testAccDataSourceFeatureFlagEnvironmentScaffold(client *Client, projectKey, flagBody := ldapi.FeatureFlagBody{ Name: "Feature Flag Env Data Source Test", Key: flagKey, - Variations: &[]ldapi.Variation{ + Variations: []ldapi.Variation{ {Value: intfPtr(true)}, {Value: intfPtr(false)}, }, @@ -55,7 +55,7 @@ func testAccDataSourceFeatureFlagEnvironmentScaffold(client *Client, projectKey, return nil, fmt.Errorf("failed to get feature flag: %s", err.Error()) } - return &flag, nil + return flag, nil } func TestAccDataSourceFeatureFlagEnvironment_noMatchReturnsError(t *testing.T) { diff --git a/launchdarkly/data_source_launchdarkly_feature_flag_test.go b/launchdarkly/data_source_launchdarkly_feature_flag_test.go index 74b0984c..69e593a4 100644 --- a/launchdarkly/data_source_launchdarkly_feature_flag_test.go +++ b/launchdarkly/data_source_launchdarkly_feature_flag_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -71,7 +71,7 @@ func TestAccDataSourceFeatureFlag_exists(t *testing.T) { flagBody := ldapi.FeatureFlagBody{ Name: flagName, Key: flagKey, - Variations: &[]ldapi.Variation{ + Variations: []ldapi.Variation{ {Value: intfPtr(true)}, {Value: intfPtr(false)}, }, diff --git a/launchdarkly/data_source_launchdarkly_flag_trigger_test.go b/launchdarkly/data_source_launchdarkly_flag_trigger_test.go index a16e1d54..ae595cbb 100644 --- a/launchdarkly/data_source_launchdarkly_flag_trigger_test.go +++ b/launchdarkly/data_source_launchdarkly_flag_trigger_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -32,7 +32,7 @@ func testAccDataSourceFlagTriggerScaffold(client *Client, projectKey, flagKey st if err != nil { return nil, err } - return &trigger, nil + return trigger, nil } func TestAccDataSourceFlagTrigger_noMatchReturnsError(t *testing.T) { @@ -80,7 +80,7 @@ func TestAccDataSourceFlagTrigger_exists(t *testing.T) { flagKey := "trigger-test" instructions := []map[string]interface{}{{"kind": "turnFlagOff"}} post := ldapi.NewTriggerPost("datadog") - post.Instructions = &instructions + post.Instructions = instructions trigger, err := testAccDataSourceFlagTriggerScaffold(client, projectKey, flagKey, post) require.NoError(t, err) diff --git a/launchdarkly/data_source_launchdarkly_metric_test.go b/launchdarkly/data_source_launchdarkly_metric_test.go index 316a7fab..74e925f8 100644 --- a/launchdarkly/data_source_launchdarkly_metric_test.go +++ b/launchdarkly/data_source_launchdarkly_metric_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -36,7 +36,7 @@ func testAccDataSourceMetricScaffold(client *Client, projectKey string, metricBo return nil, err } - return &metric, nil + return metric, nil } func TestAccDataSourceMetric_noMatchReturnsError(t *testing.T) { @@ -92,7 +92,7 @@ func TestAccDataSourceMetric_exists(t *testing.T) { Name: &metricName, Key: metricKey, Kind: "pageview", - Urls: &[]ldapi.UrlPost{{ + Urls: []ldapi.UrlPost{{ Kind: &metricUrlKind, Substring: &metricUrlSubstring, }}, diff --git a/launchdarkly/data_source_launchdarkly_project_test.go b/launchdarkly/data_source_launchdarkly_project_test.go index 3eb7b091..c74fb386 100644 --- a/launchdarkly/data_source_launchdarkly_project_test.go +++ b/launchdarkly/data_source_launchdarkly_project_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -64,10 +64,10 @@ func TestAccDataSourceProject_exists(t *testing.T) { UsingEnvironmentId: false, UsingMobileKey: false, }, - Tags: &[]string{ + Tags: []string{ tag, }, - Environments: &[]ldapi.EnvironmentPost{ + Environments: []ldapi.EnvironmentPost{ { Name: envName, Key: envKey, @@ -75,7 +75,7 @@ func TestAccDataSourceProject_exists(t *testing.T) { SecureMode: ldapi.PtrBool(true), ConfirmChanges: ldapi.PtrBool(true), RequireComments: ldapi.PtrBool(true), - Tags: &[]string{ + Tags: []string{ tag, }, }, diff --git a/launchdarkly/data_source_launchdarkly_relay_proxy_configuration_test.go b/launchdarkly/data_source_launchdarkly_relay_proxy_configuration_test.go index 35b37094..3833dfdf 100644 --- a/launchdarkly/data_source_launchdarkly_relay_proxy_configuration_test.go +++ b/launchdarkly/data_source_launchdarkly_relay_proxy_configuration_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -50,9 +50,9 @@ func TestAccDataSourceRelayProxyConfig_exists(t *testing.T) { name := "test config" resourceSpec := "proj/*:env/*" - policy := []ldapi.StatementRep{{ - Resources: &([]string{resourceSpec}), - Actions: &([]string{"*"}), + policy := []ldapi.Statement{{ + Resources: ([]string{resourceSpec}), + Actions: ([]string{"*"}), Effect: "allow", }} @@ -97,9 +97,9 @@ func TestAccDataSourceRelayProxyConfig_NotResource(t *testing.T) { name := "test config" resourceSpec := "proj/*:env/*" - policy := []ldapi.StatementRep{{ - NotResources: &([]string{resourceSpec}), - Actions: &([]string{"*"}), + policy := []ldapi.Statement{{ + NotResources: ([]string{resourceSpec}), + Actions: ([]string{"*"}), Effect: "allow", }} diff --git a/launchdarkly/data_source_launchdarkly_segment_test.go b/launchdarkly/data_source_launchdarkly_segment_test.go index c5c0189a..678df084 100644 --- a/launchdarkly/data_source_launchdarkly_segment_test.go +++ b/launchdarkly/data_source_launchdarkly_segment_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -43,7 +43,7 @@ func testAccDataSourceSegmentCreate(client *Client, projectKey, segmentKey strin Name: "Data Source Test Segment", Key: segmentKey, Description: ldapi.PtrString("test description"), - Tags: &[]string{"terraform"}, + Tags: []string{"terraform"}, } _, _, err = client.ld.SegmentsApi.PostSegment(client.ctx, project.Key, envKey).SegmentBody(segmentBody).Execute() @@ -64,7 +64,7 @@ func testAccDataSourceSegmentCreate(client *Client, projectKey, segmentKey strin return nil, fmt.Errorf("failed to update segment %q in project %q: %s", segmentKey, projectKey, handleLdapiErr(err)) } - return &segment, nil + return segment, nil } func TestAccDataSourceSegment_noMatchReturnsError(t *testing.T) { diff --git a/launchdarkly/data_source_launchdarkly_team_member.go b/launchdarkly/data_source_launchdarkly_team_member.go index a70d58de..9fb77f3b 100644 --- a/launchdarkly/data_source_launchdarkly_team_member.go +++ b/launchdarkly/data_source_launchdarkly_team_member.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func memberSchema() map[string]*schema.Schema { diff --git a/launchdarkly/data_source_launchdarkly_team_member_test.go b/launchdarkly/data_source_launchdarkly_team_member_test.go index ff74d947..24f86e1a 100644 --- a/launchdarkly/data_source_launchdarkly_team_member_test.go +++ b/launchdarkly/data_source_launchdarkly_team_member_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/data_source_launchdarkly_team_members.go b/launchdarkly/data_source_launchdarkly_team_members.go index 8600e76f..66026dac 100644 --- a/launchdarkly/data_source_launchdarkly_team_members.go +++ b/launchdarkly/data_source_launchdarkly_team_members.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func dataSourceTeamMembers() *schema.Resource { diff --git a/launchdarkly/data_source_launchdarkly_team_members_test.go b/launchdarkly/data_source_launchdarkly_team_members_test.go index 3e6042f2..4ee23643 100644 --- a/launchdarkly/data_source_launchdarkly_team_members_test.go +++ b/launchdarkly/data_source_launchdarkly_team_members_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/data_source_launchdarkly_webhook_test.go b/launchdarkly/data_source_launchdarkly_webhook_test.go index af7e0b80..27426fe4 100644 --- a/launchdarkly/data_source_launchdarkly_webhook_test.go +++ b/launchdarkly/data_source_launchdarkly_webhook_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/require" ) @@ -28,11 +28,11 @@ func testAccDataSourceWebhookCreate(client *Client, webhookName string) (*ldapi. Sign: false, On: true, Name: ldapi.PtrString(webhookName), - Tags: &[]string{"terraform"}, - Statements: &[]ldapi.StatementPost{ + Tags: []string{"terraform"}, + Statements: []ldapi.StatementPost{ { - Resources: &statementResources, - Actions: &statementActions, + Resources: statementResources, + Actions: statementActions, Effect: "allow", }, }, @@ -43,7 +43,7 @@ func testAccDataSourceWebhookCreate(client *Client, webhookName string) (*ldapi. return nil, fmt.Errorf("failed to create webhook with name %q: %s", webhookName, handleLdapiErr(err)) } - return &webhook, nil + return webhook, nil } func testAccDataSourceWebhookDelete(client *Client, webhookId string) error { diff --git a/launchdarkly/default_variations_helper.go b/launchdarkly/default_variations_helper.go index 5c58732c..d177e507 100644 --- a/launchdarkly/default_variations_helper.go +++ b/launchdarkly/default_variations_helper.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func defaultVariationsFromResourceData(d *schema.ResourceData) (*ldapi.Defaults, error) { diff --git a/launchdarkly/default_variations_helper_test.go b/launchdarkly/default_variations_helper_test.go index 051e6685..0ba48c72 100644 --- a/launchdarkly/default_variations_helper_test.go +++ b/launchdarkly/default_variations_helper_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/environments_helper.go b/launchdarkly/environments_helper.go index 1425cf49..aef0d0a1 100644 --- a/launchdarkly/environments_helper.go +++ b/launchdarkly/environments_helper.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // baseEnvironmentSchema covers the overlap between the data source and resource schemas diff --git a/launchdarkly/environments_helper_test.go b/launchdarkly/environments_helper_test.go index 6ed588a6..a314b879 100644 --- a/launchdarkly/environments_helper_test.go +++ b/launchdarkly/environments_helper_test.go @@ -3,7 +3,7 @@ package launchdarkly import ( "testing" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/fallthrough_helper.go b/launchdarkly/fallthrough_helper.go index d7ad044a..8a30961c 100644 --- a/launchdarkly/fallthrough_helper.go +++ b/launchdarkly/fallthrough_helper.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func fallthroughSchema(forDataSource bool) *schema.Schema { diff --git a/launchdarkly/feature_flag_environment_helper.go b/launchdarkly/feature_flag_environment_helper.go index 18b75555..15474a04 100644 --- a/launchdarkly/feature_flag_environment_helper.go +++ b/launchdarkly/feature_flag_environment_helper.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func baseFeatureFlagEnvironmentSchema(forDataSource bool) map[string]*schema.Schema { @@ -56,7 +56,7 @@ func baseFeatureFlagEnvironmentSchema(forDataSource bool) map[string]*schema.Sch } // get FeatureFlagEnvironment uses a query parameter to get the ldapi.FeatureFlag with only a single environment. -func getFeatureFlagEnvironment(client *Client, projectKey, flagKey, environmentKey string) (ldapi.FeatureFlag, *http.Response, error) { +func getFeatureFlagEnvironment(client *Client, projectKey, flagKey, environmentKey string) (*ldapi.FeatureFlag, *http.Response, error) { return client.ld.FeatureFlagsApi.GetFeatureFlag(client.ctx, projectKey, flagKey).Env(environmentKey).Execute() } @@ -136,7 +136,7 @@ func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw return diag.Errorf("failed to set targets on flag with key %q: %v", flagKey, err) } - err = d.Set(FALLTHROUGH, fallthroughToResourceData(environment.Fallthrough)) + err = d.Set(FALLTHROUGH, fallthroughToResourceData(*environment.Fallthrough)) if err != nil { return diag.Errorf("failed to set flag fallthrough on flag with key %q: %v", flagKey, err) } diff --git a/launchdarkly/feature_flags_helper.go b/launchdarkly/feature_flags_helper.go index 8f170630..65bd29a1 100644 --- a/launchdarkly/feature_flags_helper.go +++ b/launchdarkly/feature_flags_helper.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func baseFeatureFlagSchema() map[string]*schema.Schema { diff --git a/launchdarkly/flag_trigger_helper.go b/launchdarkly/flag_trigger_helper.go index f1dd3ec1..d233b23d 100644 --- a/launchdarkly/flag_trigger_helper.go +++ b/launchdarkly/flag_trigger_helper.go @@ -114,7 +114,7 @@ func flagTriggerRead(ctx context.Context, d *schema.ResourceData, metaRaw interf _ = d.Set(ENV_KEY, envKey) _ = d.Set(FLAG_KEY, flagKey) _ = d.Set(INTEGRATION_KEY, *trigger.IntegrationKey) - _ = d.Set(INSTRUCTIONS, *trigger.Instructions) + _ = d.Set(INSTRUCTIONS, trigger.Instructions) _ = d.Set(MAINTAINER_ID, trigger.MaintainerId) _ = d.Set(ENABLED, trigger.Enabled) // NOTE: we do not want to set the trigger url at any point past the create as it will always be obscured diff --git a/launchdarkly/helper.go b/launchdarkly/helper.go index 4cb3f6f4..f61ab318 100644 --- a/launchdarkly/helper.go +++ b/launchdarkly/helper.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) var randomRetrySleepSeeded = false @@ -59,7 +59,7 @@ func handleLdapiErr(err error) error { if err == nil { return nil } - if swaggerErr, ok := err.(ldapi.GenericOpenAPIError); ok { + if swaggerErr, ok := err.(*ldapi.GenericOpenAPIError); ok { return fmt.Errorf("%s: %s", swaggerErr.Error(), string(swaggerErr.Body())) } return err diff --git a/launchdarkly/keys.go b/launchdarkly/keys.go index bcb7fdaa..d9e0a4e7 100644 --- a/launchdarkly/keys.go +++ b/launchdarkly/keys.go @@ -5,6 +5,7 @@ package launchdarkly const ( //gofmts:sort ACTIONS = "actions" + ACTION_SET = "action_set" API_KEY = "api_key" APPROVAL_SETTINGS = "approval_settings" ARCHIVED = "archived" @@ -22,6 +23,7 @@ const ( CREATION_DATE = "creation_date" CUSTOM_PROPERTIES = "custom_properties" CUSTOM_ROLES = "custom_roles" + CUSTOM_ROLE_KEYS = "custom_role_keys" DEFAULTS = "defaults" DEFAULT_API_VERSION = "default_api_version" DEFAULT_CLIENT_SIDE_AVAILABILITY = "default_client_side_availability" @@ -57,7 +59,9 @@ const ( KEY = "key" KIND = "kind" LAST_NAME = "last_name" + MAINTAINERS = "maintainers" MAINTAINER_ID = "maintainer_id" + MEMBER_IDS = "member_ids" MIN_NUM_APPROVALS = "min_num_approvals" MOBILE_KEY = "mobile_key" NAME = "name" @@ -69,13 +73,16 @@ const ( ON_VARIATION = "on_variation" OP = "op" PATTERN = "pattern" + PERMISSION_GRANTS = "permission_grants" POLICY = "policy" POLICY_STATEMENTS = "policy_statements" PREREQUISITES = "prerequisites" PROJECT_KEY = "project_key" + PROJECT_KEYS = "project_keys" REQUIRED = "required" REQUIRED_APPROVAL_TAGS = "required_approval_tags" REQUIRE_COMMENTS = "require_comments" + RESOURCE = "resource" RESOURCES = "resources" ROLE = "role" ROLLOUT_WEIGHTS = "rollout_weights" diff --git a/launchdarkly/metrics_helper.go b/launchdarkly/metrics_helper.go index 15c9b4aa..2664bf15 100644 --- a/launchdarkly/metrics_helper.go +++ b/launchdarkly/metrics_helper.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func baseMetricSchema(isDataSource bool) map[string]*schema.Schema { diff --git a/launchdarkly/policies_helper.go b/launchdarkly/policies_helper.go index 1e4ae8c3..90396829 100644 --- a/launchdarkly/policies_helper.go +++ b/launchdarkly/policies_helper.go @@ -5,7 +5,7 @@ import ( "sort" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func policyArraySchema() *schema.Schema { @@ -67,8 +67,8 @@ func policyFromResourceData(val interface{}) ldapi.StatementPost { sort.Strings(statementResources) p := ldapi.StatementPost{ - Resources: &statementResources, - Actions: &statementActions, + Resources: statementResources, + Actions: statementActions, Effect: policyMap[EFFECT].(string), } return p @@ -101,8 +101,8 @@ func policyHash(val interface{}) int { // it was creating 3 different hash indices per policy since it was hashing the // pointer addresses rather than the values themselves policy := hashStatement{ - Resources: *rawPolicy.Resources, - Actions: *rawPolicy.Actions, + Resources: rawPolicy.Resources, + Actions: rawPolicy.Actions, Effect: rawPolicy.Effect, } return schema.HashString(fmt.Sprintf("%v", policy)) diff --git a/launchdarkly/policy_statements_helper.go b/launchdarkly/policy_statements_helper.go index 55f6655c..650147a0 100644 --- a/launchdarkly/policy_statements_helper.go +++ b/launchdarkly/policy_statements_helper.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // policyStatementSchemaOptions is used to help with renaming 'policy_statements' to statements for the launchdarkly_webhook resource. @@ -137,43 +137,43 @@ func policyStatementFromResourceData(statement map[string]interface{}) (ldapi.St return ret, nil } -func policyStatementsToResourceData(statements []ldapi.StatementRep) []interface{} { +func policyStatementsToResourceData(statements []ldapi.Statement) []interface{} { transformed := make([]interface{}, 0, len(statements)) for _, s := range statements { t := map[string]interface{}{ EFFECT: s.Effect, } - if s.Resources != nil && len(*s.Resources) > 0 { - t[RESOURCES] = stringSliceToInterfaceSlice(*s.Resources) + if s.Resources != nil && len(s.Resources) > 0 { + t[RESOURCES] = stringSliceToInterfaceSlice(s.Resources) } - if s.NotResources != nil && len(*s.NotResources) > 0 { - t[NOT_RESOURCES] = stringSliceToInterfaceSlice(*s.NotResources) + if s.NotResources != nil && len(s.NotResources) > 0 { + t[NOT_RESOURCES] = stringSliceToInterfaceSlice(s.NotResources) } - if s.Actions != nil && len(*s.Actions) > 0 { - t[ACTIONS] = stringSliceToInterfaceSlice(*s.Actions) + if s.Actions != nil && len(s.Actions) > 0 { + t[ACTIONS] = stringSliceToInterfaceSlice(s.Actions) } - if s.NotActions != nil && len(*s.NotActions) > 0 { - t[NOT_ACTIONS] = stringSliceToInterfaceSlice(*s.NotActions) + if s.NotActions != nil && len(s.NotActions) > 0 { + t[NOT_ACTIONS] = stringSliceToInterfaceSlice(s.NotActions) } transformed = append(transformed, t) } return transformed } -func statementsToStatementReps(policies []ldapi.Statement) []ldapi.StatementRep { - statements := make([]ldapi.StatementRep, 0, len(policies)) +func statementsToStatementReps(policies []ldapi.Statement) []ldapi.Statement { + statements := make([]ldapi.Statement, 0, len(policies)) for _, p := range policies { - rep := ldapi.StatementRep(p) + rep := ldapi.Statement(p) statements = append(statements, rep) } return statements } // The relay proxy config api requires a statementRep in the POST body -func statementPostsToStatementReps(policies []ldapi.StatementPost) []ldapi.StatementRep { - statements := make([]ldapi.StatementRep, 0, len(policies)) +func statementPostsToStatementReps(policies []ldapi.StatementPost) []ldapi.Statement { + statements := make([]ldapi.Statement, 0, len(policies)) for _, p := range policies { - rep := ldapi.StatementRep(p) + rep := ldapi.Statement(p) statements = append(statements, rep) } return statements diff --git a/launchdarkly/policy_statements_helper_test.go b/launchdarkly/policy_statements_helper_test.go index b898cd6a..b9d13fe6 100644 --- a/launchdarkly/policy_statements_helper_test.go +++ b/launchdarkly/policy_statements_helper_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -34,8 +34,8 @@ func TestPolicyStatementsRoundTripConversion(t *testing.T) { }, expected: []ldapi.StatementPost{ { - Resources: &statementResources, - Actions: &statementActions, + Resources: statementResources, + Actions: statementActions, Effect: "allow", }, }, @@ -58,13 +58,13 @@ func TestPolicyStatementsRoundTripConversion(t *testing.T) { }, expected: []ldapi.StatementPost{ { - Resources: &statementPostResources1, - Actions: &statementPostActions, + Resources: statementPostResources1, + Actions: statementPostActions, Effect: "allow", }, { - Resources: &statementPostResources2, - Actions: &statementPostActions, + Resources: statementPostResources2, + Actions: statementPostActions, Effect: "allow", }, }, @@ -82,8 +82,8 @@ func TestPolicyStatementsRoundTripConversion(t *testing.T) { }, expected: []ldapi.StatementPost{ { - NotResources: strArrayPtr([]string{"proj/*:env/production:flag/*"}), - Actions: &statementPostActions, + NotResources: *strArrayPtr([]string{"proj/*:env/production:flag/*"}), + Actions: statementPostActions, Effect: "allow", }, }, @@ -101,8 +101,8 @@ func TestPolicyStatementsRoundTripConversion(t *testing.T) { }, expected: []ldapi.StatementPost{ { - Resources: strArrayPtr([]string{"proj/*:env/production:flag/*"}), - NotActions: &statementPostActions, + Resources: *strArrayPtr([]string{"proj/*:env/production:flag/*"}), + NotActions: statementPostActions, Effect: "allow", }, }, diff --git a/launchdarkly/prerequisite_helper.go b/launchdarkly/prerequisite_helper.go index f4a71079..813df3a7 100644 --- a/launchdarkly/prerequisite_helper.go +++ b/launchdarkly/prerequisite_helper.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func prerequisitesSchema() *schema.Schema { diff --git a/launchdarkly/project_helper.go b/launchdarkly/project_helper.go index 2a84d79f..bcb6567d 100644 --- a/launchdarkly/project_helper.go +++ b/launchdarkly/project_helper.go @@ -4,9 +4,11 @@ import ( "context" "fmt" "log" + "net/http" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func projectRead(ctx context.Context, d *schema.ResourceData, meta interface{}, isDataSource bool) diag.Diagnostics { @@ -14,7 +16,7 @@ func projectRead(ctx context.Context, d *schema.ResourceData, meta interface{}, client := meta.(*Client) projectKey := d.Get(KEY).(string) - project, res, err := client.ld.ProjectsApi.GetProject(client.ctx, projectKey).Execute() + project, res, err := getFullProject(client, projectKey) // return nil error for resource reads but 404 for data source reads if isStatusNotFound(res) && !isDataSource { @@ -51,14 +53,14 @@ func projectRead(ctx context.Context, d *schema.ResourceData, meta interface{}, if !isDataSource { // Convert the returned environment list to a map so we can lookup each environment by key while preserving the // order defined in the config - envMap := environmentsToResourceDataMap(project.Environments) + envMap := environmentsToResourceDataMap(project.Environments.Items) // iterate over the environment keys in the order defined by the config and look up the environment returned by // LD's API rawEnvs := d.Get(ENVIRONMENTS).([]interface{}) envConfigKeys := rawEnvironmentConfigsToKeyList(rawEnvs) - envAddedMap := make(map[string]bool, len(project.Environments)) + envAddedMap := make(map[string]bool, len(project.Environments.Items)) environments := make([]interface{}, 0, len(envConfigKeys)) for _, envKey := range envConfigKeys { environments = append(environments, envMap[envKey]) @@ -68,7 +70,7 @@ func projectRead(ctx context.Context, d *schema.ResourceData, meta interface{}, // Now add all environments that are not specified in the config. // This is required in order to successfully import nested environments because rawEnvs is always an empty slice // durning import, even if nested environments are defined in the config. - for _, env := range project.Environments { + for _, env := range project.Environments.Items { alreadyAdded := envAddedMap[env.Key] if !alreadyAdded { environments = append(environments, envMap[env.Key]) @@ -99,3 +101,7 @@ func projectRead(ctx context.Context, d *schema.ResourceData, meta interface{}, return diags } + +func getFullProject(client *Client, projectKey string) (*ldapi.Project, *http.Response, error) { + return client.ld.ProjectsApi.GetProject(client.ctx, projectKey).Expand("environments").Execute() +} diff --git a/launchdarkly/resource_launchdarkly_access_token.go b/launchdarkly/resource_launchdarkly_access_token.go index 7c7feb82..efc8bed4 100644 --- a/launchdarkly/resource_launchdarkly_access_token.go +++ b/launchdarkly/resource_launchdarkly_access_token.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceAccessToken() *schema.Resource { @@ -151,9 +151,9 @@ func resourceAccessTokenCreate(ctx context.Context, d *schema.ResourceData, meta for i, cr := range customRolesRaw { customRoles[i] = cr.(string) } - accessTokenBody.CustomRoleIds = &customRoles + accessTokenBody.CustomRoleIds = customRoles } else if len(inlineRoles) > 0 { - accessTokenBody.InlineRole = &inlineRoles + accessTokenBody.InlineRole = inlineRoles } else if accessTokenRole, ok := d.GetOk(ROLE); ok { accessTokenBody.Role = ldapi.PtrString(accessTokenRole.(string)) } @@ -194,8 +194,8 @@ func resourceAccessTokenRead(ctx context.Context, d *schema.ResourceData, metaRa if accessToken.Role != nil { _ = d.Set(ROLE, *accessToken.Role) } - if accessToken.CustomRoleIds != nil && len(*accessToken.CustomRoleIds) > 0 { - customRoleKeys, err := customRoleIDsToKeys(client, *accessToken.CustomRoleIds) + if accessToken.CustomRoleIds != nil && len(accessToken.CustomRoleIds) > 0 { + customRoleKeys, err := customRoleIDsToKeys(client, accessToken.CustomRoleIds) if err != nil { return diag.FromErr(err) } @@ -205,12 +205,12 @@ func resourceAccessTokenRead(ctx context.Context, d *schema.ResourceData, metaRa _ = d.Set(DEFAULT_API_VERSION, accessToken.DefaultApiVersion) policies := accessToken.InlineRole - if policies != nil && len(*policies) > 0 { + if len(policies) > 0 { policyStatements, _ := policyStatementsFromResourceData(d.Get(POLICY_STATEMENTS).([]interface{})) if len(policyStatements) > 0 { - err = d.Set(POLICY_STATEMENTS, policyStatementsToResourceData(*policies)) + err = d.Set(POLICY_STATEMENTS, policyStatementsToResourceData(policies)) } else { - err = d.Set(INLINE_ROLES, policyStatementsToResourceData(*policies)) + err = d.Set(INLINE_ROLES, policyStatementsToResourceData(policies)) } if err != nil { return diag.Errorf("could not set policy on access token with id %q: %v", accessTokenID, err) diff --git a/launchdarkly/resource_launchdarkly_audit_log_subscription.go b/launchdarkly/resource_launchdarkly_audit_log_subscription.go index b2da548f..64995fff 100644 --- a/launchdarkly/resource_launchdarkly_audit_log_subscription.go +++ b/launchdarkly/resource_launchdarkly_audit_log_subscription.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceAuditLogSubscription() *schema.Resource { @@ -46,9 +46,9 @@ func resourceAuditLogSubscriptionCreate(ctx context.Context, d *schema.ResourceD subscriptionBody := ldapi.SubscriptionPost{ Name: name, On: &on, - Tags: &tags, + Tags: tags, Config: config, - Statements: &statements, + Statements: statements, } sub, _, err := client.ld.IntegrationAuditLogSubscriptionsApi.CreateSubscription(client.ctx, integrationKey).SubscriptionPost(subscriptionBody).Execute() diff --git a/launchdarkly/resource_launchdarkly_custom_role.go b/launchdarkly/resource_launchdarkly_custom_role.go index c7f8a070..91ad16f2 100644 --- a/launchdarkly/resource_launchdarkly_custom_role.go +++ b/launchdarkly/resource_launchdarkly_custom_role.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceCustomRole() *schema.Resource { diff --git a/launchdarkly/resource_launchdarkly_destination.go b/launchdarkly/resource_launchdarkly_destination.go index 2e3320b6..d95396c6 100644 --- a/launchdarkly/resource_launchdarkly_destination.go +++ b/launchdarkly/resource_launchdarkly_destination.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceDestination() *schema.Resource { diff --git a/launchdarkly/resource_launchdarkly_environment.go b/launchdarkly/resource_launchdarkly_environment.go index c4e507a1..f581fb70 100644 --- a/launchdarkly/resource_launchdarkly_environment.go +++ b/launchdarkly/resource_launchdarkly_environment.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceEnvironment() *schema.Resource { @@ -54,7 +54,7 @@ func resourceEnvironmentCreate(ctx context.Context, d *schema.ResourceData, meta DefaultTtl: &defaultTTL, SecureMode: &secureMode, DefaultTrackEvents: &defaultTrackEvents, - Tags: &tags, + Tags: tags, RequireComments: &requireComments, ConfirmChanges: &confirmChanges, } @@ -157,7 +157,7 @@ func environmentExists(projectKey string, key string, meta *Client) (bool, error } func environmentExistsInProject(project ldapi.Project, envKey string) bool { - for _, env := range project.Environments { + for _, env := range project.Environments.Items { if env.Key == envKey { return true } diff --git a/launchdarkly/resource_launchdarkly_feature_flag.go b/launchdarkly/resource_launchdarkly_feature_flag.go index 6767112c..403c5bce 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag.go +++ b/launchdarkly/resource_launchdarkly_feature_flag.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // We assign a custom diff in cases where the customer has not assigned CSA or IIS in config for a flag in order to respect project level defaults @@ -121,9 +121,9 @@ func resourceFeatureFlagCreate(ctx context.Context, d *schema.ResourceData, meta Name: flagName, Key: key, Description: &description, - Variations: &variations, + Variations: variations, Temporary: &temporary, - Tags: &tags, + Tags: tags, Defaults: defaults, } diff --git a/launchdarkly/resource_launchdarkly_feature_flag_environment.go b/launchdarkly/resource_launchdarkly_feature_flag_environment.go index 83db34dc..399b01e4 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_environment.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_environment.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceFeatureFlagEnvironment() *schema.Resource { diff --git a/launchdarkly/resource_launchdarkly_flag_trigger.go b/launchdarkly/resource_launchdarkly_flag_trigger.go index b66889a3..73412a10 100644 --- a/launchdarkly/resource_launchdarkly_flag_trigger.go +++ b/launchdarkly/resource_launchdarkly_flag_trigger.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceFlagTrigger() *schema.Resource { @@ -36,7 +36,7 @@ func resourceFlagTriggerCreate(ctx context.Context, d *schema.ResourceData, meta enabled := d.Get(ENABLED).(bool) triggerBody := ldapi.NewTriggerPost(integrationKey) - triggerBody.Instructions = &instructions + triggerBody.Instructions = instructions createdTrigger, _, err := client.ld.FlagTriggersApi.CreateTriggerWorkflow(client.ctx, projectKey, envKey, flagKey).TriggerPost(*triggerBody).Execute() if err != nil { @@ -56,7 +56,7 @@ func resourceFlagTriggerCreate(ctx context.Context, d *schema.ResourceData, meta KIND: "disableTrigger", }} input := ldapi.FlagTriggerInput{ - Instructions: &instructions, + Instructions: instructions, } _, _, err = client.ld.FlagTriggersApi.PatchTriggerWorkflow(client.ctx, projectKey, envKey, flagKey, *createdTrigger.Id).FlagTriggerInput(input).Execute() @@ -94,7 +94,7 @@ func resourceFlagTriggerUpdate(ctx context.Context, d *schema.ResourceData, meta } } input := ldapi.FlagTriggerInput{ - Instructions: &instructions, + Instructions: instructions, } _, _, err := client.ld.FlagTriggersApi.PatchTriggerWorkflow(client.ctx, projectKey, envKey, flagKey, triggerId).FlagTriggerInput(input).Execute() diff --git a/launchdarkly/resource_launchdarkly_metric.go b/launchdarkly/resource_launchdarkly_metric.go index 61acc108..e96e9005 100644 --- a/launchdarkly/resource_launchdarkly_metric.go +++ b/launchdarkly/resource_launchdarkly_metric.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // Our required fields for metrics depend on the value of the 'kind' enum. @@ -152,12 +152,12 @@ func resourceMetricCreate(ctx context.Context, d *schema.ResourceData, metaRaw i Name: &name, Key: key, Description: &description, - Tags: &tags, + Tags: tags, Kind: kind, IsActive: &isActive, IsNumeric: &isNumeric, Selector: &selector, - Urls: &urls, + Urls: urls, Unit: &unit, EventKey: &eventKey, } diff --git a/launchdarkly/resource_launchdarkly_project.go b/launchdarkly/resource_launchdarkly_project.go index 8a479cbb..0f62d9d8 100644 --- a/launchdarkly/resource_launchdarkly_project.go +++ b/launchdarkly/resource_launchdarkly_project.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // We assign a custom diff in cases where the customer has not assigned a default for CSA or IIS in config @@ -136,7 +136,7 @@ func resourceProjectCreate(ctx context.Context, d *schema.ResourceData, metaRaw } if len(envs) > 0 { - projectBody.Environments = &envs + projectBody.Environments = envs } _, _, err := client.ld.ProjectsApi.PostProject(client.ctx).ProjectPost(projectBody).Execute() @@ -207,7 +207,7 @@ func resourceProjectUpdate(ctx context.Context, d *schema.ResourceData, metaRaw // Update environments if necessary oldSchemaEnvList, newSchemaEnvList := d.GetChange(ENVIRONMENTS) // Get the project so we can see if we need to create any environments or just update existing environments - project, _, err := client.ld.ProjectsApi.GetProject(client.ctx, projectKey).Execute() + project, _, err := getFullProject(client, projectKey) if err != nil { return diag.Errorf("failed to load project %q before updating environments: %s", projectKey, handleLdapiErr(err)) } @@ -228,7 +228,7 @@ func resourceProjectUpdate(ctx context.Context, d *schema.ResourceData, metaRaw envKey := envConfig[KEY].(string) envConfigsForCompare[envKey] = envConfig // Check if the environment already exists. If it does not exist, create it - exists := environmentExistsInProject(project, envKey) + exists := environmentExistsInProject(*project, envKey) if !exists { envPost := environmentPostFromResourceData(env) _, _, err := client.ld.EnvironmentsApi.PostEnvironment(client.ctx, projectKey).EnvironmentPost(envPost).Execute() diff --git a/launchdarkly/resource_launchdarkly_relay_proxy_configuration.go b/launchdarkly/resource_launchdarkly_relay_proxy_configuration.go index 8c79813c..e828b11b 100644 --- a/launchdarkly/resource_launchdarkly_relay_proxy_configuration.go +++ b/launchdarkly/resource_launchdarkly_relay_proxy_configuration.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceRelayProxyConfig() *schema.Resource { diff --git a/launchdarkly/resource_launchdarkly_segment.go b/launchdarkly/resource_launchdarkly_segment.go index 98c376a9..fabb64bf 100644 --- a/launchdarkly/resource_launchdarkly_segment.go +++ b/launchdarkly/resource_launchdarkly_segment.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceSegment() *schema.Resource { @@ -67,7 +67,7 @@ func resourceSegmentCreate(ctx context.Context, d *schema.ResourceData, metaRaw Name: segmentName, Key: key, Description: &description, - Tags: &tags, + Tags: tags, } _, _, err := client.ld.SegmentsApi.PostSegment(client.ctx, projectKey, envKey).SegmentBody(segment).Execute() diff --git a/launchdarkly/resource_launchdarkly_team_member.go b/launchdarkly/resource_launchdarkly_team_member.go index 810b9a96..fcec81dd 100644 --- a/launchdarkly/resource_launchdarkly_team_member.go +++ b/launchdarkly/resource_launchdarkly_team_member.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceTeamMember() *schema.Resource { @@ -79,7 +79,7 @@ func resourceTeamMemberCreate(ctx context.Context, d *schema.ResourceData, metaR FirstName: &firstName, LastName: &lastName, Role: &memberRole, - CustomRoles: &customRoles, + CustomRoles: customRoles, } members, _, err := client.ld.AccountMembersApi.PostMembers(client.ctx).NewMemberForm([]ldapi.NewMemberForm{membersBody}).Execute() diff --git a/launchdarkly/resource_launchdarkly_webhook.go b/launchdarkly/resource_launchdarkly_webhook.go index cd943c8c..3e3acd80 100644 --- a/launchdarkly/resource_launchdarkly_webhook.go +++ b/launchdarkly/resource_launchdarkly_webhook.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func resourceWebhook() *schema.Resource { @@ -56,7 +56,7 @@ func resourceWebhookCreate(ctx context.Context, d *schema.ResourceData, metaRaw if err != nil { return diag.FromErr(err) } - webhookBody.Statements = &statements + webhookBody.Statements = statements } // The sign field isn't returned when GETting a webhook so terraform can't import it properly. diff --git a/launchdarkly/rollout_helper.go b/launchdarkly/rollout_helper.go index 9f3c00c9..ee443ad2 100644 --- a/launchdarkly/rollout_helper.go +++ b/launchdarkly/rollout_helper.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func rolloutSchema() *schema.Schema { diff --git a/launchdarkly/rule_helper.go b/launchdarkly/rule_helper.go index 7245933e..16639495 100644 --- a/launchdarkly/rule_helper.go +++ b/launchdarkly/rule_helper.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func rulesSchema() *schema.Schema { diff --git a/launchdarkly/segment_rule_helper.go b/launchdarkly/segment_rule_helper.go index ebe66583..a240a677 100644 --- a/launchdarkly/segment_rule_helper.go +++ b/launchdarkly/segment_rule_helper.go @@ -3,7 +3,7 @@ package launchdarkly import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func segmentRulesSchema() *schema.Schema { diff --git a/launchdarkly/segment_rule_helper_test.go b/launchdarkly/segment_rule_helper_test.go index 457399be..7567990c 100644 --- a/launchdarkly/segment_rule_helper_test.go +++ b/launchdarkly/segment_rule_helper_test.go @@ -3,7 +3,7 @@ package launchdarkly import ( "testing" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/target_helper.go b/launchdarkly/target_helper.go index c03503fb..f9b7494c 100644 --- a/launchdarkly/target_helper.go +++ b/launchdarkly/target_helper.go @@ -4,7 +4,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) func targetsSchema() *schema.Schema { diff --git a/launchdarkly/target_helper_test.go b/launchdarkly/target_helper_test.go index 24802ab1..b377464a 100644 --- a/launchdarkly/target_helper_test.go +++ b/launchdarkly/target_helper_test.go @@ -3,7 +3,7 @@ package launchdarkly import ( "testing" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" ) diff --git a/launchdarkly/test_utils.go b/launchdarkly/test_utils.go index 6c4890d7..37d9278b 100644 --- a/launchdarkly/test_utils.go +++ b/launchdarkly/test_utils.go @@ -1,16 +1,18 @@ package launchdarkly import ( - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) // testAccDataSourceProjectCreate creates a project with the given project parameters func testAccDataSourceProjectCreate(client *Client, projectBody ldapi.ProjectPost) (*ldapi.Project, error) { - project, _, err := client.ld.ProjectsApi.PostProject(client.ctx).ProjectPost(projectBody).Execute() + _, _, err := client.ld.ProjectsApi.PostProject(client.ctx).ProjectPost(projectBody).Execute() if err != nil { return nil, err } - return &project, nil + project, _, err := client.ld.ProjectsApi.GetProject(client.ctx, projectBody.Key).Expand("environments").Execute() + + return project, nil } func testAccDataSourceProjectDelete(client *Client, projectKey string) error { @@ -35,7 +37,7 @@ func testAccDataSourceFeatureFlagScaffold(client *Client, projectKey string, fla if err != nil { return nil, err } - return &flag, nil + return flag, nil } diff --git a/launchdarkly/variations_helper.go b/launchdarkly/variations_helper.go index fcda387a..c9e79d44 100644 --- a/launchdarkly/variations_helper.go +++ b/launchdarkly/variations_helper.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" ) const ( diff --git a/launchdarkly/variations_helper_test.go b/launchdarkly/variations_helper_test.go index 9546dd24..c132240a 100644 --- a/launchdarkly/variations_helper_test.go +++ b/launchdarkly/variations_helper_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v7" + ldapi "github.com/launchdarkly/api-client-go/v10" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/launchdarkly/webhooks_helper.go b/launchdarkly/webhooks_helper.go index 0bd59fc2..7051c5a4 100644 --- a/launchdarkly/webhooks_helper.go +++ b/launchdarkly/webhooks_helper.go @@ -46,7 +46,7 @@ func webhookRead(ctx context.Context, d *schema.ResourceData, meta interface{}, return diag.Errorf("failed to get webhook with id %q: %s", webhookID, handleLdapiErr(err)) } if webhook.Statements != nil { - statements := policyStatementsToResourceData(*webhook.Statements) + statements := policyStatementsToResourceData(webhook.Statements) err = d.Set(STATEMENTS, statements) if err != nil { return diag.Errorf("failed to set statements on webhook with id %q: %v", webhookID, err) From 6a6345ea069d53740128b4a764d7049e58192be0 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Thu, 28 Jul 2022 13:50:21 -0700 Subject: [PATCH 036/128] Fix up v10 migration PR --- .circleci/config.yml | 5 -- .gitignore | 1 - GNUmakefile | 2 +- ...udit_log_subscription_configs_generated.go | 60 ------------------- 4 files changed, 1 insertion(+), 67 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a2b42623..af750b1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,11 +85,6 @@ jobs: TESTARGS="-run TestAccTeamMember_UpdateGeneric" make testacc TESTARGS="-run TestAccTeamMember_CreateWithCustomRole" make testacc TESTARGS="-run TestAccTeamMember_UpdateWithCustomRole" make testacc - - run: - name: Test Team Resource - command: | - TESTARGS="-run TestAccTeam_Create" make testacc - TESTARGS="-run TestAccTeam_Update" make testacc - run: name: Test Webhook Resource command: TESTARGS="-run TestAccWebhook" make testacc diff --git a/.gitignore b/.gitignore index db1cc1fc..22624338 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ # # example.tfvars -api-client-go/ /.idea/ /crash.log /terraform-provider-launchdarkly diff --git a/GNUmakefile b/GNUmakefile index 28216371..90a5fb2c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,7 +9,7 @@ LDFLAGS:=-ldflags="-X github.com/launchdarkly/terraform-provider-launchdarkly/la default: build build: fmtcheck - go install github.com/ashanbrown/gofmts/cmd/gofmts@v0.1.4 + go install $(LDFLAGS) test: fmtcheck go test -i $(TEST) || exit 1 diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 917d9306..a960e005 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -3,32 +3,6 @@ package launchdarkly var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ - "cloudtrail": { - "accountId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your [AWS account ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#FindingYourAWSId). The associated account must be configured to use CloudTrail Lake.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - "iamRoleArn": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ARN of the IAM Role for LaunchDarkly to assume to post to your AWS CloudTrail destination.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "ingestionChannelArn": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ARN of the CloudTrail Ingestion Channel for LaunchDarkly to use.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - }, "datadog": { "apiKey": { AllowedValues: []string{}, @@ -221,38 +195,4 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, - "terraform-cloud": { - "hostName": { - AllowedValues: []string{}, - DefaultValue: "https://app.terraform.io", - Description: "Enter your Terraform Enterprise host name in the format https://HOST_URL.", - IsOptional: true, - IsSecret: false, - Type: "string", - }, - "token": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your Terraform Enterprise [user token or team token](https://www.terraform.io/cloud-docs/users-teams-organizations/users#creating-a-token).", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "workspaceId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ID of the Terraform workspace you want runs to trigger for based on the policy below.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - }, - "zapier": {"url": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your zap webhook URL", - IsOptional: false, - IsSecret: false, - Type: "uri", - }}, } From e9c8d436150866c6d6b26363234ba96c5560681f Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Tue, 28 Jun 2022 14:55:48 -0700 Subject: [PATCH 037/128] [SC-160359] Create Teams resource and datasource Adds the Teams resource and datasource --- .circleci/config.yml | 3 + go.mod | 1 - go.sum | 1 - launchdarkly/data_source_launchdarkly_team.go | 123 ++++++ .../data_source_launchdarkly_team_test.go | 94 +++++ launchdarkly/keys.go | 1 - launchdarkly/provider.go | 2 + launchdarkly/resource_launchdarkly_team.go | 379 ++++++++++++++++++ .../resource_launchdarkly_team_test.go | 162 ++++++++ website/docs/d/team.html.markdown | 39 ++ website/docs/r/teams.html.markdown | 51 +++ website/launchdarkly.erb | 6 + 12 files changed, 859 insertions(+), 3 deletions(-) create mode 100644 launchdarkly/data_source_launchdarkly_team.go create mode 100644 launchdarkly/data_source_launchdarkly_team_test.go create mode 100644 launchdarkly/resource_launchdarkly_team.go create mode 100644 launchdarkly/resource_launchdarkly_team_test.go create mode 100644 website/docs/d/team.html.markdown create mode 100644 website/docs/r/teams.html.markdown diff --git a/.circleci/config.yml b/.circleci/config.yml index af750b1c..66ca13e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,6 +85,9 @@ jobs: TESTARGS="-run TestAccTeamMember_UpdateGeneric" make testacc TESTARGS="-run TestAccTeamMember_CreateWithCustomRole" make testacc TESTARGS="-run TestAccTeamMember_UpdateWithCustomRole" make testacc + - run: + name: Test Team Resource + command: TESTARGS="-run TestAccTeam_CreateUpdate" make testacc - run: name: Test Webhook Resource command: TESTARGS="-run TestAccWebhook" make testacc diff --git a/go.mod b/go.mod index 3926131e..bc33a62a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-retryablehttp v0.7.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 - github.com/launchdarkly/api-client-go/v7 v7.1.1 github.com/stoewer/go-strcase v1.2.0 github.com/stretchr/testify v1.7.0 ) diff --git a/go.sum b/go.sum index 3d3451f7..44facbe1 100644 --- a/go.sum +++ b/go.sum @@ -226,7 +226,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/launchdarkly/api-client-go/v10 v10.0.1 h1:9uJ5Uf7FsSwFjSP648Ii9qG6O22ZUrw0RFIMtIkPWkY= github.com/launchdarkly/api-client-go/v10 v10.0.1/go.mod h1:LeQ6lizPnybCGvNfKpnnVxMMG2a2hFF5Lnz+jBBgxqQ= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= diff --git a/launchdarkly/data_source_launchdarkly_team.go b/launchdarkly/data_source_launchdarkly_team.go new file mode 100644 index 00000000..c63b918b --- /dev/null +++ b/launchdarkly/data_source_launchdarkly_team.go @@ -0,0 +1,123 @@ +package launchdarkly + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func teamSchema() map[string]*schema.Schema { + return map[string]*schema.Schema{ + KEY: { + Type: schema.TypeString, + Required: true, + Description: "The team's unique key", + }, + DESCRIPTION: { + Type: schema.TypeString, + Optional: true, + Description: "The team's description", + }, + NAME: { + Type: schema.TypeString, + Optional: true, + Description: "The team's human-readable name", + }, + MAINTAINERS: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + EMAIL: { + Type: schema.TypeString, + Required: true, + }, + ID: { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + FIRST_NAME: { + Type: schema.TypeString, + Computed: true, + }, + LAST_NAME: { + Type: schema.TypeString, + Computed: true, + }, + ROLE: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + Description: "A list of maintainers as 'member' objects", + }, + PROJECT_KEYS: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of keys of projects that this team owns", + }, + CUSTOM_ROLE_KEYS: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of keys for custom roles the team has", + }, + } +} + +func dataSourceTeam() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceTeamRead, + Schema: teamSchema(), + } +} + +func dataSourceTeamRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + client := meta.(*Client) + teamKey := d.Get(KEY).(string) + team, _, err := client.ld.TeamsApi.GetTeam(client.ctx, teamKey).Expand("roles,projects,maintainers").Execute() + + if err != nil { + return diag.Errorf("Error when calling `TeamsApi.GetTeam`: %v\n\n request: %v", err, team) + } + + projects := make([]string, len(team.Projects.Items)) + for i, v := range team.Projects.Items { + projects[i] = *v.Key + } + + customRoleKeys := make([]string, len(team.Roles.Items)) + for i, v := range team.Roles.Items { + customRoleKeys[i] = *v.Key + } + + maintainers := make([]map[string]interface{}, 0, len(team.Maintainers.Items)) + for _, m := range team.Maintainers.Items { + maintainer := make(map[string]interface{}) + maintainer[ID] = m.Id + maintainer[EMAIL] = m.Email + maintainer[FIRST_NAME] = m.FirstName + maintainer[LAST_NAME] = m.LastName + maintainer[ROLE] = m.Role + maintainers = append(maintainers, maintainer) + } + + if err != nil { + return diag.Errorf("failed to get team %q: %s", teamKey, handleLdapiErr(err)) + } + + d.SetId(teamKey) + _ = d.Set(KEY, team.Key) + _ = d.Set(NAME, team.Name) + _ = d.Set(DESCRIPTION, team.Description) + _ = d.Set(MAINTAINERS, maintainers) + _ = d.Set(PROJECT_KEYS, projects) + _ = d.Set(CUSTOM_ROLE_KEYS, customRoleKeys) + + return diags +} diff --git a/launchdarkly/data_source_launchdarkly_team_test.go b/launchdarkly/data_source_launchdarkly_team_test.go new file mode 100644 index 00000000..06cb05dc --- /dev/null +++ b/launchdarkly/data_source_launchdarkly_team_test.go @@ -0,0 +1,94 @@ +package launchdarkly + +import ( + "fmt" + "log" + "os" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + ldapi "github.com/launchdarkly/api-client-go/v10" + "github.com/stretchr/testify/require" +) + +func testAccDataSourceTeamConfig(teamKey string) string { + return fmt.Sprintf(` +data "launchdarkly_team" "chicken-nugget" { + key = "%s" +} +`, teamKey) +} + +func testAccDataSourceTeamCreate(client *Client, teamKey string) (*ldapi.Team, error) { + teamPostInput := ldapi.TeamPostInput{ + Key: teamKey, + Name: teamKey, + } + team, resp, err := client.ld.TeamsApi.PostTeam(client.ctx).TeamPostInput(teamPostInput).Execute() + if err != nil { + log.Printf("Error when calling `TeamsApi.PostTeam``:\nTeam: %v\nResponse: %v\nError:%v\n", team, resp, err) + return nil, err + } + return team, nil +} + +func testAccDataSourceTeamDelete(client *Client, teamKey string) error { + _, err := client.ld.TeamsApi.DeleteTeam(client.ctx, teamKey).Execute() + if err != nil { + return err + } + return nil +} + +func TestAccDataSourceTeam_noMatchReturnsError(t *testing.T) { + key := "false-teeth" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceTeamConfig(key), + ExpectError: regexp.MustCompile(`404 Not Found`), + }, + }, + }) +} + +func TestAccDataSourceTeam_exists(t *testing.T) { + accTest := os.Getenv("TF_ACC") + if accTest == "" { + t.SkipNow() + } + + // Populate account with dummy team + client, err := newClient(os.Getenv(LAUNCHDARKLY_ACCESS_TOKEN), os.Getenv(LAUNCHDARKLY_API_HOST), false) + require.NoError(t, err) + teamKey := "chicken-nugget" + team, createErr := testAccDataSourceTeamCreate(client, teamKey) + require.NoError(t, createErr) + + resourceName := fmt.Sprintf("data.launchdarkly_team.%s", teamKey) + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceTeamConfig(teamKey), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, KEY), + resource.TestCheckResourceAttr(resourceName, KEY, *team.Key), + resource.TestCheckResourceAttr(resourceName, NAME, *team.Name), + resource.TestCheckResourceAttr(resourceName, DESCRIPTION, *team.Description), + resource.TestCheckResourceAttr(resourceName, ID, *team.Key), + ), + }, + }, + }) + deleteErr := testAccDataSourceTeamDelete(client, teamKey) + require.NoError(t, deleteErr) +} diff --git a/launchdarkly/keys.go b/launchdarkly/keys.go index d9e0a4e7..80474790 100644 --- a/launchdarkly/keys.go +++ b/launchdarkly/keys.go @@ -73,7 +73,6 @@ const ( ON_VARIATION = "on_variation" OP = "op" PATTERN = "pattern" - PERMISSION_GRANTS = "permission_grants" POLICY = "policy" POLICY_STATEMENTS = "policy_statements" PREREQUISITES = "prerequisites" diff --git a/launchdarkly/provider.go b/launchdarkly/provider.go index f718b456..a7eef80d 100644 --- a/launchdarkly/provider.go +++ b/launchdarkly/provider.go @@ -47,6 +47,7 @@ func Provider() *schema.Provider { }, }, ResourcesMap: map[string]*schema.Resource{ + "launchdarkly_team": resourceTeam(), "launchdarkly_project": resourceProject(), "launchdarkly_environment": resourceEnvironment(), "launchdarkly_feature_flag": resourceFeatureFlag(), @@ -63,6 +64,7 @@ func Provider() *schema.Provider { "launchdarkly_metric": resourceMetric(), }, DataSourcesMap: map[string]*schema.Resource{ + "launchdarkly_team": dataSourceTeam(), "launchdarkly_team_member": dataSourceTeamMember(), "launchdarkly_team_members": dataSourceTeamMembers(), "launchdarkly_project": dataSourceProject(), diff --git a/launchdarkly/resource_launchdarkly_team.go b/launchdarkly/resource_launchdarkly_team.go new file mode 100644 index 00000000..70b2dd46 --- /dev/null +++ b/launchdarkly/resource_launchdarkly_team.go @@ -0,0 +1,379 @@ +package launchdarkly + +import ( + "context" + "fmt" + "log" + "sort" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + //"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + ldapi "github.com/launchdarkly/api-client-go/v10" +) + +func resourceTeam() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceTeamCreate, + ReadContext: resourceTeamRead, + UpdateContext: resourceTeamUpdate, + DeleteContext: resourceTeamDelete, + Exists: resourceTeamExists, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + KEY: { + Type: schema.TypeString, + Required: true, + Description: "The team's unique key", + }, + DESCRIPTION: { + Type: schema.TypeString, + Optional: true, + Description: "The team's description", + }, + NAME: { + Type: schema.TypeString, + Required: true, + Description: "The team's human-readable name", + }, + MEMBER_IDS: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of team member IDs as strings", + }, + MAINTAINERS: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of team maintainer IDs as strings", + }, + CUSTOM_ROLE_KEYS: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "A list of custom role keys for the team", + }, + }, + } +} + +func interfaceToArr(old interface{}) []string { + interfaceArr := old.([]interface{}) + + stringArr := make([]string, len(interfaceArr)) + for i, str := range interfaceArr { + stringArr[i] = str.(string) + } + + return sort.StringSlice(stringArr) + +} + +func makeAddAndRemoveArrays(old, updated []string) (remove, add []string) { + m := make(map[string]bool) + intersection_map := make(map[string]bool) + + // creates the intersection + for _, item := range old { + m[item] = true + } + + for _, item := range updated { + if _, ok := m[item]; ok { + intersection_map[item] = true + } + } + + for _, item := range old { + // if item in old isn't in intersecion append it + _, ok := intersection_map[item] + if !ok { + remove = append(remove, item) + } + } + + for _, item := range updated { + // if item in new isn't in intersecion append it + _, ok := intersection_map[item] + if !ok { + add = append(add, item) + } + } + + return remove, add +} + +func resourceTeamCreate(ctx context.Context, d *schema.ResourceData, metaRaw interface{}) diag.Diagnostics { + client := metaRaw.(*Client) + key := d.Get(KEY).(string) + name := d.Get(NAME).(string) + description := d.Get(DESCRIPTION).(string) + memberIDs := d.Get(MEMBER_IDS).([]interface{}) + maintainers := d.Get(MAINTAINERS).([]interface{}) + customRoleKeys := d.Get(CUSTOM_ROLE_KEYS).([]interface{}) + + stringMemberIDs := make([]string, len(memberIDs)) + for i := range memberIDs { + stringMemberIDs[i] = memberIDs[i].(string) + } + + stringMaintainers := make([]string, len(maintainers)) + for i := range maintainers { + stringMaintainers[i] = maintainers[i].(string) + } + + stringCustomRoleKeys := make([]string, len(customRoleKeys)) + for i := range customRoleKeys { + stringCustomRoleKeys[i] = customRoleKeys[i].(string) + } + + maintainTeam := "maintainTeam" + permissionGrantArray := make([]ldapi.PermissionGrantInput, 0) + + if len(maintainers) > 0 { + permissionGrantArray = append(permissionGrantArray, ldapi.PermissionGrantInput{ + ActionSet: &maintainTeam, + MemberIDs: stringMaintainers, + }) + } + + teamBody := ldapi.TeamPostInput{ + CustomRoleKeys: stringCustomRoleKeys, + Description: &description, + Key: key, + MemberIDs: stringMemberIDs, + Name: name, + PermissionGrants: permissionGrantArray, + } + + d.SetId(key) + + _, _, err := client.ld.TeamsApi.PostTeam(client.ctx).TeamPostInput(teamBody).Execute() + + if err != nil { + return diag.Errorf("Error when calling `TeamsApi.PostTeam`: %v\n\n request: %v", err, teamBody) + } + + return resourceTeamRead(ctx, d, metaRaw) +} + +func resourceTeamRead(ctx context.Context, d *schema.ResourceData, metaRaw interface{}) diag.Diagnostics { + var diags diag.Diagnostics + + client := metaRaw.(*Client) + teamKey := d.Id() + + team, res, err := client.ld.TeamsApi.GetTeam(client.ctx, teamKey).Expand("roles,projects,maintainers").Execute() + if isStatusNotFound(res) { + log.Printf("[WARN] failed to find team %q, removing from state", teamKey) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: fmt.Sprintf("[WARN] failed to find team %q, removing from state", teamKey), + }) + d.SetId(teamKey) + return diags + } + + if err != nil { + return diag.Errorf("failed to get team %q: %v", teamKey, err) + } + + members := make([]ldapi.Member, 0) + i := int64(0) + empty := "" + next := &empty + filter := fmt.Sprintf("team:%s", teamKey) + + for next != nil { + memberResponse, res, err := client.ld.AccountMembersApi.GetMembers(client.ctx).Limit(50).Offset(i * 50).Filter(filter).Execute() + if isStatusNotFound(res) { + log.Printf("[WARN] failed to find members for team %q, removing from state", teamKey) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: fmt.Sprintf("[WARN] failed to find members for team %q, removing from state", teamKey), + }) + d.SetId(teamKey) + return diags + } + + if err != nil { + return diag.Errorf("failed to get members for team %q: %v", teamKey, err) + } + + members = append(members, memberResponse.Items...) + next = memberResponse.Links["next"].Href + i++ + } + + customRoleKeys := make([]string, len(team.Roles.Items)) + for i, v := range team.Roles.Items { + customRoleKeys[i] = *v.Key + } + + maintainers := make([]string, len(team.Maintainers.Items)) + for i, m := range team.Maintainers.Items { + maintainers[i] = m.Id + } + + member_ids := make([]string, len(members)) + for i, m := range members { + member_ids[i] = m.Id + } + + if err != nil { + return diag.Errorf("failed to get team %q: %s", teamKey, handleLdapiErr(err)) + } + + d.SetId(teamKey) + _ = d.Set(KEY, team.Key) + _ = d.Set(NAME, team.Name) + _ = d.Set(DESCRIPTION, team.Description) + _ = d.Set(MEMBER_IDS, member_ids) + _ = d.Set(MAINTAINERS, maintainers) + _ = d.Set(CUSTOM_ROLE_KEYS, customRoleKeys) + + return diags +} + +func resourceTeamUpdate(ctx context.Context, d *schema.ResourceData, metaRaw interface{}) diag.Diagnostics { + client := metaRaw.(*Client) + + instructions := make([]map[string]interface{}, 0) + maintainTeam := "maintainTeam" + + if d.HasChange(NAME) { + _, new := d.GetChange(NAME) + instruction := make(map[string]interface{}) + instruction["kind"] = "updateName" + instruction["value"] = new.(string) + instructions = append(instructions, instruction) + } + if d.HasChange(DESCRIPTION) { + _, new := d.GetChange(DESCRIPTION) + instruction := make(map[string]interface{}) + instruction["kind"] = "updateDescription" + instruction["value"] = new.(string) + instructions = append(instructions, instruction) + } + if d.HasChange(MEMBER_IDS) { + old, update := d.GetChange(MEMBER_IDS) + + oldArr := interfaceToArr(old) + updateArr := interfaceToArr(update) + + remove, add := makeAddAndRemoveArrays(oldArr, updateArr) + + fmt.Printf("Old members array: %v, New members array: %v", oldArr, updateArr) + + if len(remove) > 0 { + instruction := make(map[string]interface{}) + instruction["kind"] = "removeMembers" + instruction["values"] = remove + instructions = append(instructions, instruction) + } + + if len(add) > 0 { + instruction := make(map[string]interface{}) + instruction["kind"] = "addMembers" + instruction["values"] = add + instructions = append(instructions, instruction) + } + } + if d.HasChange(MAINTAINERS) { + old, update := d.GetChange(MAINTAINERS) + + oldArr := interfaceToArr(old) + updateArr := interfaceToArr(update) + remove, add := makeAddAndRemoveArrays(oldArr, updateArr) + + if len(remove) > 0 { + removeInstruction := make(map[string]interface{}) + removeInstruction["kind"] = "removePermissionGrants" + removeInstruction["actionSet"] = maintainTeam + removeInstruction["memberIDs"] = remove + instructions = append(instructions, removeInstruction) + } + + if len(add) > 0 { + addInstruction := make(map[string]interface{}) + addInstruction["kind"] = "addPermissionGrants" + addInstruction["actionSet"] = maintainTeam + addInstruction["memberIDs"] = add + instructions = append(instructions, addInstruction) + } + } + + if d.HasChange(CUSTOM_ROLE_KEYS) { + old, update := d.GetChange(CUSTOM_ROLE_KEYS) + oldArr := interfaceToArr(old) + updateArr := interfaceToArr(update) + + remove, add := makeAddAndRemoveArrays(oldArr, updateArr) + + if len(remove) > 0 { + instruction := make(map[string]interface{}) + instruction["kind"] = "removeCustomRoles" + instruction["values"] = remove + instructions = append(instructions, instruction) + } + + if len(add) > 0 { + instruction := make(map[string]interface{}) + instruction["kind"] = "addCustomRoles" + instruction["values"] = add + instructions = append(instructions, instruction) + } + } + + if len(instructions) > 0 { + patch := ldapi.TeamPatchInput{ + Comment: nil, + Instructions: instructions, + } + + teamKey := d.Get(KEY).(string) + _, _, err := client.ld.TeamsApi.PatchTeam(client.ctx, teamKey).TeamPatchInput(patch).Execute() + + if err != nil { + return diag.Errorf("failed to update team member with id %q: %s", teamKey, handleLdapiErr(err)) + } + } + + return resourceTeamRead(ctx, d, metaRaw) +} + +func resourceTeamDelete(ctx context.Context, d *schema.ResourceData, metaRaw interface{}) diag.Diagnostics { + var diags diag.Diagnostics + + client := metaRaw.(*Client) + + _, err := client.ld.TeamsApi.DeleteTeam(client.ctx, d.Id()).Execute() + if err != nil { + return diag.Errorf("failed to delete team with key: %q: %s", d.Id(), handleLdapiErr(err)) + } + + return diags +} + +func resourceTeamExists(d *schema.ResourceData, metaRaw interface{}) (bool, error) { + return teamExists(d.Id(), metaRaw.(*Client)) +} + +func teamExists(teamKey string, meta *Client) (bool, error) { + _, res, err := meta.ld.TeamsApi.GetTeam(meta.ctx, teamKey).Execute() + if isStatusNotFound(res) { + return false, nil + } + if err != nil { + return false, fmt.Errorf("failed to get team with key: %q: %v", teamKey, handleLdapiErr(err)) + } + + return true, nil +} diff --git a/launchdarkly/resource_launchdarkly_team_test.go b/launchdarkly/resource_launchdarkly_team_test.go new file mode 100644 index 00000000..c6a678c9 --- /dev/null +++ b/launchdarkly/resource_launchdarkly_team_test.go @@ -0,0 +1,162 @@ +package launchdarkly + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +const ( + // Team members need to be made sequentially, not in parallel + testAccTeamCreate = ` +resource "launchdarkly_custom_role" "terraform_team_test" { + key = "terraform_teams_test_role" + name = "Terraform Teams test role" + base_permissions = "no_access" + policy { + actions = ["*"] + effect = "deny" + resources = ["proj/*:env/production"] + } +} + +resource "launchdarkly_team_member" "test_member_one" { + email = "%s@example.com" + role = "reader" +} + +resource "launchdarkly_team_member" "test_member_two" { + email = "%s@example.com" + role = "reader" + depends_on = [launchdarkly_team_member.test_member_one] +} + +resource "launchdarkly_team" "test" { + key = "%s" + name = "waterbear" + description = "The best integrations squad" + member_ids = [launchdarkly_team_member.test_member_one.id] + maintainers = [launchdarkly_team_member.test_member_two.id] + custom_role_keys = [launchdarkly_custom_role.terraform_team_test.key] +} +` + testAccTeamUpdate = ` +resource "launchdarkly_custom_role" "other_team_test" { + key = "other_terraform_teams_test_role" + name = "Other Terraform Teams test role" + base_permissions = "no_access" + policy { + actions = ["*"] + effect = "deny" + resources = ["proj/*:env/production"] + } +} + +resource "launchdarkly_team_member" "test_member_one" { + email = "%s@example.com" + role = "reader" +} + +resource "launchdarkly_team_member" "test_member_two" { + email = "%s@example.com" + role = "reader" + depends_on = [launchdarkly_team_member.test_member_one] +} + +resource "launchdarkly_team_member" "test_member_three" { + email = "%s@example.com" + role = "reader" + depends_on = [launchdarkly_team_member.test_member_two] +} + +resource "launchdarkly_team" "test" { + key = "%s" + name = "Integrations" + description = "The BEST integrations squad" + member_ids = [launchdarkly_team_member.test_member_two.id, launchdarkly_team_member.test_member_three.id] + maintainers = [launchdarkly_team_member.test_member_two.id, launchdarkly_team_member.test_member_one.id] + custom_role_keys = [launchdarkly_custom_role.other_team_test.key] +} +` +) + +func TestAccTeam_CreateUpdate(t *testing.T) { + var randomName = acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) + randomEmailOne := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + randomEmailTwo := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + randomEmailThree := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + var resourceName = fmt.Sprintf("launchdarkly_team.test") + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(testAccTeamCreate, randomEmailOne, randomEmailTwo, randomName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTeamExists(resourceName), + resource.TestCheckResourceAttr(resourceName, NAME, "waterbear"), + resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "The best integrations squad"), + resource.TestCheckResourceAttr(resourceName, "member_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "maintainers.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", "terraform_teams_test_role"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(testAccTeamUpdate, randomEmailOne, randomEmailTwo, randomEmailThree, randomName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTeamExists(resourceName), + resource.TestCheckResourceAttr(resourceName, NAME, "Integrations"), + resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "The BEST integrations squad"), + resource.TestCheckResourceAttr(resourceName, "member_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "maintainers.#", "2"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", "other_terraform_teams_test_role"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckTeamExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("not found: %s", resourceName) + } + if rs.Primary.ID == "" { + return fmt.Errorf("team ID is not set") + } + client := testAccProvider.Meta().(*Client) + _, _, err := client.ld.TeamsApi.GetTeam(client.ctx, rs.Primary.ID).Execute() + if err != nil { + return fmt.Errorf("received an error getting team: %s", err) + } + return nil + } +} diff --git a/website/docs/d/team.html.markdown b/website/docs/d/team.html.markdown new file mode 100644 index 00000000..f15931fe --- /dev/null +++ b/website/docs/d/team.html.markdown @@ -0,0 +1,39 @@ +--- +layout: "launchdarkly" +page_title: "LaunchDarkly: launchdarkly_team" +description: |- + Get information about a LaunchDarkly team. +--- + +# launchdarkly_team + +Provides a LaunchDarkly team data source. + +This data source allows you to retrieve team information from your LaunchDarkly organization on a team. + +## Example Usage + +```hcl +data "launchdarkly_team" "example" { + key = ["example_key_1"] +} +``` + +## Argument Reference + +- `key` - (Required) A string associated with a team key. + +- `name` - (Optional) A string associated with a team name. + +- `description` - (Optional) A string associated with a team description. + +## Attributes Reference + +In addition to the arguments above, the resource exports the found team as `team`. +The following attributes are available for a team: + +- `member ID's` - The list of team member's IDs as strings. + +- `maintainers` - The list of team maintainers as strings. + +- `custom_role_keys` - The list of keys for custom roles the team has. diff --git a/website/docs/r/teams.html.markdown b/website/docs/r/teams.html.markdown new file mode 100644 index 00000000..2c7b0aee --- /dev/null +++ b/website/docs/r/teams.html.markdown @@ -0,0 +1,51 @@ +--- +layout: "launchdarkly" +page_title: "LaunchDarkly: launchdarkly_team" +description: |- + Create and manage a LaunchDarkly team. +--- + +# launchdarkly_team + +Provides a LaunchDarkly team resource. + +This resource allows you to create and manage a teamwithin your LaunchDarkly organization. + +-> **Note:** You can only manage a team with "admin" level personal access tokens. To learn more, read [Managing Teams](https://docs.launchdarkly.com/docs/teams). + +## Example Usage + +```hcl +resource "launchdarkly_team" "example" { + key = "example_key" + name = "Team Name" + description = "example team description" + + members = ["example_user_key_1", "example_user_key_2"] + maintainers = ["example_user_key_1", "example_user_key_2"] + custom_role_keys = ["example_role_1", "example_role_1"] +} +``` + +## Argument Reference + +- `key` - (Required) The team's human readable key. This cannot be changed after creation. + +- `name` - (Required) The team's name. Please note that, once created, this must be changed by someone with admin access to teams in LaunchDarkly. + +- `description` - (Required) The team's description. Please note that, once created, this must be changed by someone with admin access to teams in LaunchDarkly. + +- `members` - (Required) The list of team member's IDs as strings. Please note that this must be edited by someone with admin access to teams in LaunchDarkly. + +- `maintainers` - (Required) The list of the team's maintainers. Please note that this must be edited by someone with admin access to teams in LaunchDarkly. + +- `custom_role_keys` - (Required) The list of custom roles keys associated with the team. Please note that this must be edited by someone with admin access to teams in LaunchDarkly. + + +## Import + +A LaunchDarkly team can be imported using the team's key e.g. + +``` +$ terraform import launchdarkly_team.example example_team_key +``` diff --git a/website/launchdarkly.erb b/website/launchdarkly.erb index 08ecc2eb..d4fd4de8 100644 --- a/website/launchdarkly.erb +++ b/website/launchdarkly.erb @@ -41,6 +41,9 @@
  • launchdarkly_team_members
  • +
  • + launchdarkly_team +
  • launchdarkly_metric
  • @@ -79,6 +82,9 @@
  • launchdarkly_team_member
  • +
  • + launchdarkly_team +
  • launchdarkly_destination
  • From 1d1e3d387305b291d9ed700bdd8df1dc6a074cfd Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Tue, 2 Aug 2022 17:14:19 -0700 Subject: [PATCH 038/128] Fix up documentation --- website/docs/d/team.html.markdown | 23 +++++++------- website/docs/r/team.html.markdown | 50 +++++++++++++++++++++++++++++ website/docs/r/teams.html.markdown | 51 ------------------------------ 3 files changed, 61 insertions(+), 63 deletions(-) create mode 100644 website/docs/r/team.html.markdown delete mode 100644 website/docs/r/teams.html.markdown diff --git a/website/docs/d/team.html.markdown b/website/docs/d/team.html.markdown index f15931fe..70f7e5b2 100644 --- a/website/docs/d/team.html.markdown +++ b/website/docs/d/team.html.markdown @@ -9,31 +9,30 @@ description: |- Provides a LaunchDarkly team data source. -This data source allows you to retrieve team information from your LaunchDarkly organization on a team. +This data source allows you to retrieve team information from your LaunchDarkly organization. ## Example Usage ```hcl -data "launchdarkly_team" "example" { - key = ["example_key_1"] +data "launchdarkly_team" "platform_team" { + key = "platform_team" } ``` ## Argument Reference -- `key` - (Required) A string associated with a team key. +- `key` - (Required) The team key. -- `name` - (Optional) A string associated with a team name. +## Attributes Reference -- `description` - (Optional) A string associated with a team description. +In addition to the arguments above, the resource exports the following attributes: -## Attributes Reference +- `custom_role_keys` - The list of the keys of the custom roles that you have assigned to the team. -In addition to the arguments above, the resource exports the found team as `team`. -The following attributes are available for a team: +- `description` - The team description. -- `member ID's` - The list of team member's IDs as strings. +- `maintainers` - The list of team maintainers as [team member objects](/docs/providers/launchdarkly/d/team_member.html). -- `maintainers` - The list of team maintainers as strings. +- `name` - Human readable name for the team. -- `custom_role_keys` - The list of keys for custom roles the team has. +- `project_keys` - The list of keys of the projects that the team has any write access to. diff --git a/website/docs/r/team.html.markdown b/website/docs/r/team.html.markdown new file mode 100644 index 00000000..3d40f2e9 --- /dev/null +++ b/website/docs/r/team.html.markdown @@ -0,0 +1,50 @@ +--- +layout: "launchdarkly" +page_title: "LaunchDarkly: launchdarkly_team" +description: |- + Create and manage a LaunchDarkly team. +--- + +# launchdarkly_team + +Provides a LaunchDarkly team resource. + +This resource allows you to create and manage a team within your LaunchDarkly organization. + +-> **Note:** Teams are available to customers on an Enterprise LaunchDarkly plan. To learn more, read about our pricing. To upgrade your plan, [contact LaunchDarkly Sales](https://launchdarkly.com/contact-sales/). + +## Example Usage + +```hcl +resource "launchdarkly_team" "platform_team" { + key = "platform_team" + name = "Platform team" + description = "Team to manage internal infrastructure" + member_ids = ["507f1f77bcf86cd799439011", "569f183514f4432160000007"] + maintainers = ["12ab3c45de678910abc12345"] + custom_role_keys = ["platform", "nomad-administrators"] +} +``` + +## Argument Reference + +- `key` - (Required) The team key. + +- `name` - (Required) A human-friendly name for the team. + +- `description` - (Optional) The team description. + +- `member_ids` - (Optional) List of member IDs who belong to the team. + +- `maintainers` - (Optional) List of member IDs for users who maintain the team. + +- `custom_role_keys` - (Optional) List of custom role keys the team will access. + + +## Import + +A LaunchDarkly team can be imported using the team key: + +``` +$ terraform import launchdarkly_team.platform_team platform_team +``` diff --git a/website/docs/r/teams.html.markdown b/website/docs/r/teams.html.markdown deleted file mode 100644 index 2c7b0aee..00000000 --- a/website/docs/r/teams.html.markdown +++ /dev/null @@ -1,51 +0,0 @@ ---- -layout: "launchdarkly" -page_title: "LaunchDarkly: launchdarkly_team" -description: |- - Create and manage a LaunchDarkly team. ---- - -# launchdarkly_team - -Provides a LaunchDarkly team resource. - -This resource allows you to create and manage a teamwithin your LaunchDarkly organization. - --> **Note:** You can only manage a team with "admin" level personal access tokens. To learn more, read [Managing Teams](https://docs.launchdarkly.com/docs/teams). - -## Example Usage - -```hcl -resource "launchdarkly_team" "example" { - key = "example_key" - name = "Team Name" - description = "example team description" - - members = ["example_user_key_1", "example_user_key_2"] - maintainers = ["example_user_key_1", "example_user_key_2"] - custom_role_keys = ["example_role_1", "example_role_1"] -} -``` - -## Argument Reference - -- `key` - (Required) The team's human readable key. This cannot be changed after creation. - -- `name` - (Required) The team's name. Please note that, once created, this must be changed by someone with admin access to teams in LaunchDarkly. - -- `description` - (Required) The team's description. Please note that, once created, this must be changed by someone with admin access to teams in LaunchDarkly. - -- `members` - (Required) The list of team member's IDs as strings. Please note that this must be edited by someone with admin access to teams in LaunchDarkly. - -- `maintainers` - (Required) The list of the team's maintainers. Please note that this must be edited by someone with admin access to teams in LaunchDarkly. - -- `custom_role_keys` - (Required) The list of custom roles keys associated with the team. Please note that this must be edited by someone with admin access to teams in LaunchDarkly. - - -## Import - -A LaunchDarkly team can be imported using the team's key e.g. - -``` -$ terraform import launchdarkly_team.example example_team_key -``` From 70e838e506d0920dee9b31ada5389ea3ea36f562 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 3 Aug 2022 08:39:58 -0700 Subject: [PATCH 039/128] Make lists unsorted to avoid unnecessary change detection --- launchdarkly/data_source_launchdarkly_team.go | 6 +-- launchdarkly/resource_launchdarkly_team.go | 37 ++++++++----------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/launchdarkly/data_source_launchdarkly_team.go b/launchdarkly/data_source_launchdarkly_team.go index c63b918b..c1a3895b 100644 --- a/launchdarkly/data_source_launchdarkly_team.go +++ b/launchdarkly/data_source_launchdarkly_team.go @@ -25,7 +25,7 @@ func teamSchema() map[string]*schema.Schema { Description: "The team's human-readable name", }, MAINTAINERS: { - Type: schema.TypeList, + Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -55,13 +55,13 @@ func teamSchema() map[string]*schema.Schema { Description: "A list of maintainers as 'member' objects", }, PROJECT_KEYS: { - Type: schema.TypeList, + Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, Description: "A list of keys of projects that this team owns", }, CUSTOM_ROLE_KEYS: { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Description: "A list of keys for custom roles the team has", diff --git a/launchdarkly/resource_launchdarkly_team.go b/launchdarkly/resource_launchdarkly_team.go index 70b2dd46..89ed5452 100644 --- a/launchdarkly/resource_launchdarkly_team.go +++ b/launchdarkly/resource_launchdarkly_team.go @@ -4,12 +4,10 @@ import ( "context" "fmt" "log" - "sort" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - //"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ldapi "github.com/launchdarkly/api-client-go/v10" ) @@ -43,19 +41,19 @@ func resourceTeam() *schema.Resource { Description: "The team's human-readable name", }, MEMBER_IDS: { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Description: "A list of team member IDs as strings", }, MAINTAINERS: { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Description: "A list of team maintainer IDs as strings", }, CUSTOM_ROLE_KEYS: { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Description: "A list of custom role keys for the team", @@ -65,20 +63,19 @@ func resourceTeam() *schema.Resource { } func interfaceToArr(old interface{}) []string { - interfaceArr := old.([]interface{}) + interfaceArr := old.(*schema.Set).List() stringArr := make([]string, len(interfaceArr)) for i, str := range interfaceArr { stringArr[i] = str.(string) } - return sort.StringSlice(stringArr) - + return stringArr } func makeAddAndRemoveArrays(old, updated []string) (remove, add []string) { m := make(map[string]bool) - intersection_map := make(map[string]bool) + intersectionMap := make(map[string]bool) // creates the intersection for _, item := range old { @@ -115,9 +112,9 @@ func resourceTeamCreate(ctx context.Context, d *schema.ResourceData, metaRaw int key := d.Get(KEY).(string) name := d.Get(NAME).(string) description := d.Get(DESCRIPTION).(string) - memberIDs := d.Get(MEMBER_IDS).([]interface{}) - maintainers := d.Get(MAINTAINERS).([]interface{}) - customRoleKeys := d.Get(CUSTOM_ROLE_KEYS).([]interface{}) + memberIDs := d.Get(MEMBER_IDS).(*schema.Set).List() + maintainers := d.Get(MAINTAINERS).(*schema.Set).List() + customRoleKeys := d.Get(CUSTOM_ROLE_KEYS).(*schema.Set).List() stringMemberIDs := make([]string, len(memberIDs)) for i := range memberIDs { @@ -153,8 +150,6 @@ func resourceTeamCreate(ctx context.Context, d *schema.ResourceData, metaRaw int PermissionGrants: permissionGrantArray, } - d.SetId(key) - _, _, err := client.ld.TeamsApi.PostTeam(client.ctx).TeamPostInput(teamBody).Execute() if err != nil { @@ -177,7 +172,7 @@ func resourceTeamRead(ctx context.Context, d *schema.ResourceData, metaRaw inter Severity: diag.Warning, Summary: fmt.Sprintf("[WARN] failed to find team %q, removing from state", teamKey), }) - d.SetId(teamKey) + d.SetId("") return diags } @@ -197,9 +192,9 @@ func resourceTeamRead(ctx context.Context, d *schema.ResourceData, metaRaw inter log.Printf("[WARN] failed to find members for team %q, removing from state", teamKey) diags = append(diags, diag.Diagnostic{ Severity: diag.Warning, - Summary: fmt.Sprintf("[WARN] failed to find members for team %q, removing from state", teamKey), + Summary: fmt.Sprintf("[WARN] failed to find members for team %q, removing team from state", teamKey), }) - d.SetId(teamKey) + d.SetId("") return diags } @@ -249,17 +244,17 @@ func resourceTeamUpdate(ctx context.Context, d *schema.ResourceData, metaRaw int maintainTeam := "maintainTeam" if d.HasChange(NAME) { - _, new := d.GetChange(NAME) + name := d.Get(NAME) instruction := make(map[string]interface{}) instruction["kind"] = "updateName" - instruction["value"] = new.(string) + instruction["value"] = name.(string) instructions = append(instructions, instruction) } if d.HasChange(DESCRIPTION) { - _, new := d.GetChange(DESCRIPTION) + description := d.Get(DESCRIPTION) instruction := make(map[string]interface{}) instruction["kind"] = "updateDescription" - instruction["value"] = new.(string) + instruction["value"] = description.(string) instructions = append(instructions, instruction) } if d.HasChange(MEMBER_IDS) { From 8fb45442befd4f95d47985cd939c46658ccbd5f4 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 3 Aug 2022 14:52:01 -0700 Subject: [PATCH 040/128] Update website/docs/d/team.html.markdown Co-authored-by: Henry Barrow --- website/docs/d/team.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/d/team.html.markdown b/website/docs/d/team.html.markdown index 70f7e5b2..f3d0ba86 100644 --- a/website/docs/d/team.html.markdown +++ b/website/docs/d/team.html.markdown @@ -11,6 +11,7 @@ Provides a LaunchDarkly team data source. This data source allows you to retrieve team information from your LaunchDarkly organization. +-> **Note:** Teams are available to customers on an Enterprise LaunchDarkly plan. To learn more, read about our pricing. To upgrade your plan, [contact LaunchDarkly Sales](https://launchdarkly.com/contact-sales/). ## Example Usage ```hcl From a97b4aefb13669b327454bb3c713420db7640034 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 3 Aug 2022 08:39:58 -0700 Subject: [PATCH 041/128] Make lists unsorted to avoid unnecessary change detection --- .circleci/config.yml | 2 +- ...udit_log_subscription_configs_generated.go | 2 +- launchdarkly/resource_launchdarkly_team.go | 8 +- .../resource_launchdarkly_team_test.go | 137 ++++++++++++++++-- website/docs/r/team.html.markdown | 2 +- 5 files changed, 133 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 66ca13e0..a500935b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,7 +87,7 @@ jobs: TESTARGS="-run TestAccTeamMember_UpdateWithCustomRole" make testacc - run: name: Test Team Resource - command: TESTARGS="-run TestAccTeam_CreateUpdate" make testacc + command: TESTARGS="-run TestAccTeam_" make testacc - run: name: Test Webhook Resource command: TESTARGS="-run TestAccWebhook" make testacc diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index a960e005..4169ab45 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -111,7 +111,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "level": { AllowedValues: []string{}, DefaultValue: "INFO", - Description: "The log level with which LaunchDarkly messages will be published.", + Description: "The level of log messages from LaunchDarkly.", IsOptional: true, IsSecret: false, Type: "string", diff --git a/launchdarkly/resource_launchdarkly_team.go b/launchdarkly/resource_launchdarkly_team.go index 89ed5452..75ef2ad7 100644 --- a/launchdarkly/resource_launchdarkly_team.go +++ b/launchdarkly/resource_launchdarkly_team.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - ldapi "github.com/launchdarkly/api-client-go/v10" ) @@ -84,13 +83,13 @@ func makeAddAndRemoveArrays(old, updated []string) (remove, add []string) { for _, item := range updated { if _, ok := m[item]; ok { - intersection_map[item] = true + intersectionMap[item] = true } } for _, item := range old { // if item in old isn't in intersecion append it - _, ok := intersection_map[item] + _, ok := intersectionMap[item] if !ok { remove = append(remove, item) } @@ -98,7 +97,7 @@ func makeAddAndRemoveArrays(old, updated []string) (remove, add []string) { for _, item := range updated { // if item in new isn't in intersecion append it - _, ok := intersection_map[item] + _, ok := intersectionMap[item] if !ok { add = append(add, item) } @@ -155,6 +154,7 @@ func resourceTeamCreate(ctx context.Context, d *schema.ResourceData, metaRaw int if err != nil { return diag.Errorf("Error when calling `TeamsApi.PostTeam`: %v\n\n request: %v", err, teamBody) } + d.SetId(key) return resourceTeamRead(ctx, d, metaRaw) } diff --git a/launchdarkly/resource_launchdarkly_team_test.go b/launchdarkly/resource_launchdarkly_team_test.go index c6a678c9..a9e7abdf 100644 --- a/launchdarkly/resource_launchdarkly_team_test.go +++ b/launchdarkly/resource_launchdarkly_team_test.go @@ -13,7 +13,7 @@ const ( // Team members need to be made sequentially, not in parallel testAccTeamCreate = ` resource "launchdarkly_custom_role" "terraform_team_test" { - key = "terraform_teams_test_role" + key = "%s" name = "Terraform Teams test role" base_permissions = "no_access" policy { @@ -43,9 +43,84 @@ resource "launchdarkly_team" "test" { custom_role_keys = [launchdarkly_custom_role.terraform_team_test.key] } ` - testAccTeamUpdate = ` + testAccTeamUpdateNameDescription = ` +resource "launchdarkly_custom_role" "terraform_team_test" { + key = "%s" + name = "Terraform Teams test role" + base_permissions = "no_access" + policy { + actions = ["*"] + effect = "deny" + resources = ["proj/*:env/production"] + } +} + +resource "launchdarkly_team_member" "test_member_one" { + email = "%s@example.com" + role = "reader" +} + +resource "launchdarkly_team_member" "test_member_two" { + email = "%s@example.com" + role = "reader" + depends_on = [launchdarkly_team_member.test_member_one] +} + +resource "launchdarkly_team" "test" { + key = "%s" + name = "Integrations" + description = "The BEST integrations squad" + member_ids = [launchdarkly_team_member.test_member_one.id] + maintainers = [launchdarkly_team_member.test_member_two.id] + custom_role_keys = [launchdarkly_custom_role.terraform_team_test.key] +} +` + testAccTeamUpdateRoles = ` +resource "launchdarkly_custom_role" "terraform_team_test" { + key = "%s" + name = "Terraform Teams test role" + base_permissions = "no_access" + policy { + actions = ["*"] + effect = "deny" + resources = ["proj/*:env/production"] + } +} + resource "launchdarkly_custom_role" "other_team_test" { - key = "other_terraform_teams_test_role" + key = "%s" + name = "Other Terraform Teams test role" + base_permissions = "no_access" + policy { + actions = ["*"] + effect = "deny" + resources = ["proj/*:env/production"] + } +} + +resource "launchdarkly_team_member" "test_member_one" { + email = "%s@example.com" + role = "reader" +} + +resource "launchdarkly_team_member" "test_member_two" { + email = "%s@example.com" + role = "reader" + depends_on = [launchdarkly_team_member.test_member_one] +} + +resource "launchdarkly_team" "test" { + key = "%s" + name = "Integrations" + description = "The BEST integrations squad" + member_ids = [launchdarkly_team_member.test_member_one.id] + maintainers = [launchdarkly_team_member.test_member_two.id] + custom_role_keys = [launchdarkly_custom_role.other_team_test.key] +} +` + testAccTeamUpdateMembersMaintainers = ` +resource "launchdarkly_custom_role" "other_team_test" { + key = "%s" name = "Other Terraform Teams test role" base_permissions = "no_access" policy { @@ -83,12 +158,12 @@ resource "launchdarkly_team" "test" { ` ) -func TestAccTeam_CreateUpdate(t *testing.T) { - var randomName = acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) +func TestAccTeam_Create(t *testing.T) { + randomName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) + randomRole := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) randomEmailOne := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) randomEmailTwo := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) - randomEmailThree := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) - var resourceName = fmt.Sprintf("launchdarkly_team.test") + resourceName := fmt.Sprintf("launchdarkly_team.test") resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -97,7 +172,7 @@ func TestAccTeam_CreateUpdate(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(testAccTeamCreate, randomEmailOne, randomEmailTwo, randomName), + Config: fmt.Sprintf(testAccTeamCreate, randomRole, randomEmailOne, randomEmailTwo, randomName), Check: resource.ComposeTestCheckFunc( testAccCheckTeamExists(resourceName), resource.TestCheckResourceAttr(resourceName, NAME, "waterbear"), @@ -105,7 +180,7 @@ func TestAccTeam_CreateUpdate(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "member_ids.#", "1"), resource.TestCheckResourceAttr(resourceName, "maintainers.#", "1"), resource.TestCheckResourceAttr(resourceName, "custom_role_keys.#", "1"), - resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", "terraform_teams_test_role"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", randomRole), ), }, { @@ -115,6 +190,16 @@ func TestAccTeam_CreateUpdate(t *testing.T) { }, }, }) +} + +func TestAccTeam_Update(t *testing.T) { + randomName := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) + randomRoleOne := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) + randomRoleTwo := acctest.RandStringFromCharSet(10, acctest.CharSetAlpha) + randomEmailOne := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + randomEmailTwo := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + randomEmailThree := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := fmt.Sprintf("launchdarkly_team.test") resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -123,7 +208,36 @@ func TestAccTeam_CreateUpdate(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(testAccTeamUpdate, randomEmailOne, randomEmailTwo, randomEmailThree, randomName), + Config: fmt.Sprintf(testAccTeamCreate, randomRoleOne, randomEmailOne, randomEmailTwo, randomName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTeamExists(resourceName), + )}, + { + Config: fmt.Sprintf(testAccTeamUpdateNameDescription, randomRoleOne, randomEmailOne, randomEmailTwo, randomName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTeamExists(resourceName), + resource.TestCheckResourceAttr(resourceName, NAME, "Integrations"), + resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "The BEST integrations squad"), + resource.TestCheckResourceAttr(resourceName, "member_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "maintainers.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", randomRoleOne), + ), + }, + { + Config: fmt.Sprintf(testAccTeamUpdateRoles, randomRoleOne, randomRoleTwo, randomEmailOne, randomEmailTwo, randomName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTeamExists(resourceName), + resource.TestCheckResourceAttr(resourceName, NAME, "Integrations"), + resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "The BEST integrations squad"), + resource.TestCheckResourceAttr(resourceName, "member_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "maintainers.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.#", "1"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", randomRoleTwo), + ), + }, + { + Config: fmt.Sprintf(testAccTeamUpdateMembersMaintainers, randomRoleTwo, randomEmailOne, randomEmailTwo, randomEmailThree, randomName), Check: resource.ComposeTestCheckFunc( testAccCheckTeamExists(resourceName), resource.TestCheckResourceAttr(resourceName, NAME, "Integrations"), @@ -131,9 +245,10 @@ func TestAccTeam_CreateUpdate(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "member_ids.#", "2"), resource.TestCheckResourceAttr(resourceName, "maintainers.#", "2"), resource.TestCheckResourceAttr(resourceName, "custom_role_keys.#", "1"), - resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", "other_terraform_teams_test_role"), + resource.TestCheckResourceAttr(resourceName, "custom_role_keys.0", randomRoleTwo), ), }, + { ResourceName: resourceName, ImportState: true, diff --git a/website/docs/r/team.html.markdown b/website/docs/r/team.html.markdown index 3d40f2e9..cb233e50 100644 --- a/website/docs/r/team.html.markdown +++ b/website/docs/r/team.html.markdown @@ -38,7 +38,7 @@ resource "launchdarkly_team" "platform_team" { - `maintainers` - (Optional) List of member IDs for users who maintain the team. -- `custom_role_keys` - (Optional) List of custom role keys the team will access. +- `custom_role_keys` - (Optional) List of custom role keys the team will access. The referenced custom roles must already exist in LaunchDarkly. If they don't, the provider may behave unexpectedly. ## Import From da5dacde9352cecb570cc237317d0fde527b3316 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 7 Apr 2022 15:03:56 +0100 Subject: [PATCH 042/128] prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> --- .circleci/config.yml | 4 ++++ examples/v2/feature_flags/README.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a500935b..7638acdc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,10 @@ jobs: # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com CHECKPOINT_TIMEOUT: 15000 + environment: + # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com + CHECKPOINT_TIMEOUT: 10000 + steps: - checkout - go/mod-download-cached diff --git a/examples/v2/feature_flags/README.md b/examples/v2/feature_flags/README.md index b71fafff..425551fb 100644 --- a/examples/v2/feature_flags/README.md +++ b/examples/v2/feature_flags/README.md @@ -10,6 +10,10 @@ This example contains three config files: - [flag_types_example.tf](./flag_types_example.tf), which provides examples of the different ways you can define binary (boolean) and multivariate (string, numeric, and JSON) flag variations using the `launchdarkly_feature_flag` resource - [targeting_example.tf](./targeting_example.tf), which provides complex examples of user targeting using the `launchdarkly_feature_flag_environment` resource. For more detail on user targeting, see the [official LaunchDarkly documentation](https://docs.launchdarkly.com/home/managing-flags/targeting-users). +### Bypassing approval requests + +If [approval requests are required](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings) in the feature flag's environment, you can bypass them by adding the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the role associated with the LaunchDarkly access token or service token used by the provider. + ### Run Init your working directory from the CL with `terraform init` and then apply the changes with `terraform apply`. You should see output resembling the following: From 43ee03be6980cf9f64cf59a53faf5af3b9bcb4ff Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 14 Apr 2022 17:51:34 +0100 Subject: [PATCH 043/128] prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> --- examples/v2/feature_flags/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/v2/feature_flags/README.md b/examples/v2/feature_flags/README.md index 425551fb..b71fafff 100644 --- a/examples/v2/feature_flags/README.md +++ b/examples/v2/feature_flags/README.md @@ -10,10 +10,6 @@ This example contains three config files: - [flag_types_example.tf](./flag_types_example.tf), which provides examples of the different ways you can define binary (boolean) and multivariate (string, numeric, and JSON) flag variations using the `launchdarkly_feature_flag` resource - [targeting_example.tf](./targeting_example.tf), which provides complex examples of user targeting using the `launchdarkly_feature_flag_environment` resource. For more detail on user targeting, see the [official LaunchDarkly documentation](https://docs.launchdarkly.com/home/managing-flags/targeting-users). -### Bypassing approval requests - -If [approval requests are required](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings) in the feature flag's environment, you can bypass them by adding the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the role associated with the LaunchDarkly access token or service token used by the provider. - ### Run Init your working directory from the CL with `terraform init` and then apply the changes with `terraform apply`. You should see output resembling the following: From 519707a6b1c199ca50b2df73b95f285adef55aa1 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Mon, 25 Jul 2022 14:24:52 -0700 Subject: [PATCH 044/128] Prepare 2.7.1 release (#103) - Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) --- .circleci/config.yml | 2 +- ...udit_log_subscription_configs_generated.go | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7638acdc..68d8b51d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ jobs: environment: # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com - CHECKPOINT_TIMEOUT: 10000 + CHECKPOINT_TIMEOUT: 15000 steps: - checkout diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 4169ab45..4c0e5bf5 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -3,6 +3,32 @@ package launchdarkly var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ + "cloudtrail": { + "accountId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your [AWS account ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#FindingYourAWSId). The associated account must be configured to use CloudTrail Lake.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + "iamRoleArn": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ARN of the IAM Role for LaunchDarkly to assume to post to your AWS CloudTrail destination.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "ingestionChannelArn": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ARN of the CloudTrail Ingestion Channel for LaunchDarkly to use.", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + }, "datadog": { "apiKey": { AllowedValues: []string{}, @@ -195,4 +221,38 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, + "terraform-cloud": { + "hostName": { + AllowedValues: []string{}, + DefaultValue: "https://app.terraform.io", + Description: "Enter your Terraform Enterprise host name in the format https://HOST_URL.", + IsOptional: true, + IsSecret: false, + Type: "string", + }, + "token": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your Terraform Enterprise [user token or team token](https://www.terraform.io/cloud-docs/users-teams-organizations/users#creating-a-token).", + IsOptional: false, + IsSecret: true, + Type: "string", + }, + "workspaceId": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter the ID of the Terraform workspace you want runs to trigger for based on the policy below.", + IsOptional: false, + IsSecret: false, + Type: "string", + }, + }, + "zapier": {"url": { + AllowedValues: []string{}, + DefaultValue: nil, + Description: "Enter your zap webhook URL", + IsOptional: false, + IsSecret: false, + Type: "uri", + }}, } From 1d371d9bd135fe0fa2e95b18fad16177f5562f6f Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Wed, 27 Jul 2022 14:41:02 +0200 Subject: [PATCH 045/128] Prepare release 2.7.1 2 (#104) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * Backmerge/release 2.7.0 (#206) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * prepare 2.6.1 release (#94) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * prepare 2.6.1 release * Merge remote-tracking branch public/main into release-2.6.1 * update changelog * update readme Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * Prepare 2.7.0 release (#98) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Backmerge/release 2.6.0 (#201) * prepare release (#80) * Prepare 2.4.1 release (#82) * prepare 2.5.0 release (#87) Co-authored-by: Isabelle Miller * prepare 2.6.0 release (#91) * prepare release (#80) (#188) * Do not allow 0% segment rule weights (#189) * Prevent users from setting a 0% rollout * Update changelog * Fix bug * Fix flag trigger creation panic (#190) * Backmerge/release 2.4.1 (#191) * Backmerge v2.4.1 * fix merge conflicts * Add Slack webhooks to audit_log_subscription (#192) * backmerge v2.5.0 (#193) * Use jennifer to generate audit log subscription configs (#194) * Run terraform provider acceptance tests daily and notify of failures (#196) * Update changelog branch (#195) * [ sc-143291] update autogenerated audit_log_subscription configs (#197) * update autogenerated configs to account for hideMemberDetails change to DDog integration * update changelog * Add test * Update CHANGELOG.md Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * Increase checkpoint-api.harhicorp.com timeout to 10s (#198) * Updated destination tests to use random env keys to avoid env conflict errors * [sc 148065] add approvals bypass to terraform docs (#200) * update docs to mention bypassing approval requests * update changelog * typo * Apply suggestions from code review Co-authored-by: Henry Barrow Co-authored-by: Henry Barrow * prepare 2.5.1 release Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Isabelle Miller Co-authored-by: Henry Barrow Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> * fix doc issues (#202) * [sc-149869] roll back documentation changes regarding (#203) * Revert "[sc 148065] add approvals bypass to terraform docs (#200)" This reverts commit e722f061047d0d433c8a5fbcc76fbe4e45eedef7. * update changelog * update changelog * backmerge 2.6.1 (#204) * Imiller/sc 151834/add base permissions to custom role resource (#205) * update changelog * messed up the version number * add base permissions to custom role resource & doc * update tests * auto-generate integration configs Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian * (bug-fix) Update modules to accept new API header Hashicorp [recently added a Release API](https://www.hashicorp.com/blog/announcing-the-hashicorp-releases-api) that includes a new `Content-Type` header `application/vnd+hashicorp.releases-api.v0+json`. This gets used somewhere in making requests, but the `hc-install` Go library was previously at version 0.3.1 which raised an error when it encountered this header. V0.3.2 accepts the header, so this updates the Go modules in this repo using `go get -u && go mod tidy`. * Update circleci test timeout to 15 seconds The circleci test failed because the test took 10.10 seconds. So let's update the timeout to 15 seconds from 10. link to old test failure: https://app.circleci.com/pipelines/github/launchdarkly/terraform-provider-launchdarkly-private/1452/workflows/51a2008f-0c3e-4b7d-af3b-3c1d84387b84/jobs/1847?invite=true#step-113-330%7CError * Regenerate auditlog configs to resolve CI failures (#211) * Regenerate auditlog configs * Run make generate again * Run make generate to supress CI failures (#212) * added a check for environment and warning * fix go lint error * use environmentExists function * remove grafana * Update changelog with bug fix for datasource feature flag environment * added changes * upgrade go version 1.18.1 (#217) * upgrade go version * Upgrade to go 1.18.1 * Upgrade go version everywhere * Upgrade circle linter to V2 * Add cache prefix to linter * Turn cache prefix into string Co-authored-by: Henry Barrow * remove checked in testing examples Co-authored-by: Henry Barrow Co-authored-by: Fabian Co-authored-by: Clifford Tawiah Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com> Co-authored-by: Fabian Co-authored-by: Lucy Voigt Co-authored-by: Lucy Voigt Co-authored-by: Sunny Guduru --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9774757b..298e9a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ NOTES: - Upgrade Go version to 1.18 +NOTES: + +- Upgrade Go version to 1.18 + ## [2.7.0] (May 5, 2022) FEATURES: From 6276ea66e14eb9ab3ee60f3fab1989cf5458aabf Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Wed, 27 Jul 2022 14:11:03 +0100 Subject: [PATCH 046/128] fix merge issue in Circle config (#105) --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68d8b51d..a500935b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,10 +33,6 @@ jobs: # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com CHECKPOINT_TIMEOUT: 15000 - environment: - # sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com - CHECKPOINT_TIMEOUT: 15000 - steps: - checkout - go/mod-download-cached From 76f1bcff9f94bcd68faaab8f03ffaf218257ebdd Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 28 Jul 2022 10:41:43 +0100 Subject: [PATCH 047/128] Release 2.7.2 (#106) --- CHANGELOG.md | 8 +-- ...udit_log_subscription_configs_generated.go | 60 ------------------- 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 298e9a4c..a34464a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,11 @@ NOTES: - Upgrade Go version to 1.18 -NOTES: - -- Upgrade Go version to 1.18 +## [2.7.1] (July 27, 2022) -## [2.7.0] (May 5, 2022) +BUG FIXES: -FEATURES: +- The `launchdarkly_feature_flag_environment` data source now checks whether the environment exists and prints out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) - Added the `base_permissions` field to the `launchdarkly_custom_role` resource. diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 4c0e5bf5..4169ab45 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -3,32 +3,6 @@ package launchdarkly var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ - "cloudtrail": { - "accountId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your [AWS account ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#FindingYourAWSId). The associated account must be configured to use CloudTrail Lake.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - "iamRoleArn": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ARN of the IAM Role for LaunchDarkly to assume to post to your AWS CloudTrail destination.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "ingestionChannelArn": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ARN of the CloudTrail Ingestion Channel for LaunchDarkly to use.", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - }, "datadog": { "apiKey": { AllowedValues: []string{}, @@ -221,38 +195,4 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ Type: "string", }, }, - "terraform-cloud": { - "hostName": { - AllowedValues: []string{}, - DefaultValue: "https://app.terraform.io", - Description: "Enter your Terraform Enterprise host name in the format https://HOST_URL.", - IsOptional: true, - IsSecret: false, - Type: "string", - }, - "token": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your Terraform Enterprise [user token or team token](https://www.terraform.io/cloud-docs/users-teams-organizations/users#creating-a-token).", - IsOptional: false, - IsSecret: true, - Type: "string", - }, - "workspaceId": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter the ID of the Terraform workspace you want runs to trigger for based on the policy below.", - IsOptional: false, - IsSecret: false, - Type: "string", - }, - }, - "zapier": {"url": { - AllowedValues: []string{}, - DefaultValue: nil, - Description: "Enter your zap webhook URL", - IsOptional: false, - IsSecret: false, - Type: "uri", - }}, } From 416ec8b7658c834e32f397911abf94cc73df8263 Mon Sep 17 00:00:00 2001 From: Dominick Agnello Date: Thu, 4 Aug 2022 13:53:04 -0700 Subject: [PATCH 048/128] prepare 2.8.0 release --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a34464a1..961ba8cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [2.8.0] (August 04, 2022) + +FEATURES: + +- Added `launchdarkly_team` data source and provider. + +NOTES: + +- Updated LaunchDarkly go api client from v7 to v10. + ## [2.7.2] (July 28, 2022) BUG FIXES: From f21dd2ca8db63a2eb13d991dcc61e8a723e8fff2 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Fri, 5 Aug 2022 08:32:22 -0700 Subject: [PATCH 049/128] [SC-163244] Add no-access role for team member resource The provider validates roles listed under the `roles` key for team member resources are in the list of builtin roles for LaunchDarkly. Previously that list omitted the `no_access` builtin role. This PR adds the role to the validation list, and updates a test to verify the roles can be used. --- launchdarkly/resource_launchdarkly_team_member.go | 4 ++-- launchdarkly/resource_launchdarkly_team_member_test.go | 4 ++-- website/docs/r/team_member.html.markdown | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/launchdarkly/resource_launchdarkly_team_member.go b/launchdarkly/resource_launchdarkly_team_member.go index fcec81dd..23f8ab13 100644 --- a/launchdarkly/resource_launchdarkly_team_member.go +++ b/launchdarkly/resource_launchdarkly_team_member.go @@ -45,8 +45,8 @@ func resourceTeamMember() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - Description: "The team member's role. This must be reader, writer, admin, or owner. Team members must have either a role or custom role", - ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"reader", "writer", "admin"}, false)), + Description: "The team member's role. This must be reader, writer, admin, or no_access. Team members must have either a role or custom role", + ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"reader", "writer", "admin", "no_access"}, false)), AtLeastOneOf: []string{ROLE, CUSTOM_ROLES}, }, CUSTOM_ROLES: { diff --git a/launchdarkly/resource_launchdarkly_team_member_test.go b/launchdarkly/resource_launchdarkly_team_member_test.go index 7dab9a29..0ed4ed20 100644 --- a/launchdarkly/resource_launchdarkly_team_member_test.go +++ b/launchdarkly/resource_launchdarkly_team_member_test.go @@ -24,7 +24,7 @@ resource "launchdarkly_team_member" "test" { email = "%s@example.com" first_name = "first" last_name = "last" - role = "writer" + role = "no_access" custom_roles = [] } ` @@ -136,7 +136,7 @@ func TestAccTeamMember_UpdateGeneric(t *testing.T) { resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), - resource.TestCheckResourceAttr(resourceName, ROLE, "writer"), + resource.TestCheckResourceAttr(resourceName, ROLE, "no_access"), resource.TestCheckResourceAttr(resourceName, "custom_roles.#", "0"), ), }, diff --git a/website/docs/r/team_member.html.markdown b/website/docs/r/team_member.html.markdown index fceb3575..8ebf50df 100644 --- a/website/docs/r/team_member.html.markdown +++ b/website/docs/r/team_member.html.markdown @@ -32,7 +32,7 @@ resource "launchdarkly_team_member" "example" { - `last_name` - (Optional) The team member's family name. Please note that, once created, this cannot be updated except by the team member themself. -- `role` - (Optional) The role associated with team member. Supported roles are `reader`, `writer`, or `admin`. If you don't specify a role, `reader` is assigned by default. +- `role` - (Optional) The role associated with team member. Supported roles are `reader`, `writer`, `no_access`, or `admin`. If you don't specify a role, `reader` is assigned by default. - `custom_roles` - (Optional) The list of custom roles keys associated with the team member. Custom roles are only available to customers on enterprise plans. To learn more about enterprise plans, contact sales@launchdarkly.com. From 72236a59fb97c6412d38dbcbc28b151ef3095bbb Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 9 Aug 2022 12:31:20 +0100 Subject: [PATCH 050/128] [sc-147722] add codeowners file (#230) * add codeowners file * eol\ * typo --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..b6eb40a3 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @launchdarkly/squad-integrations From c60959a3f4fe3b915ee2cc5f284507cd3e4ce422 Mon Sep 17 00:00:00 2001 From: Dominick Agnello <38410199+Blugil@users.noreply.github.com> Date: Wed, 10 Aug 2022 11:04:20 -0700 Subject: [PATCH 051/128] Dominickagnello/sc 163883/open a pr against the terraform provider (#232) * add gitattributes file to unhide generated files when reviewing PRs * add github action to open PR on integrations config file generation * [bot] Regenerate integration configs * add CODEOWNERS file and fix up new github action Co-authored-by: Dominick Agnello Co-authored-by: Blugil --- .gitattributes | 1 + .../generate_integration_config_pr.yml | 34 +++++++++++++++++++ ...udit_log_subscription_configs_generated.go | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/generate_integration_config_pr.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..9134729d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +launchdarkly/audit_log_subscription_configs_generated.go linguist-generated=false diff --git a/.github/workflows/generate_integration_config_pr.yml b/.github/workflows/generate_integration_config_pr.yml new file mode 100644 index 00000000..33b7fb5f --- /dev/null +++ b/.github/workflows/generate_integration_config_pr.yml @@ -0,0 +1,34 @@ +name: Open PR when integration configs change +on: + schedule: + # Run every 30 minutes + - cron: "5,35 * * * *" +jobs: + generate-manifest: + runs-on: ubuntu-latest + steps: + # Check out goaltender and LDIF side by side + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version-file: scripts/codegen/go.mod + cache: true + cache-dependency-path: | + scripts/codegen/go.sum + go.sum + + - run: make generate + env: + LAUNCHDARKLY_ACCESS_TOKEN: ${{secrets.LAUNCHDARKLY_ACCESS_TOKEN}} + + - name: Create Pull request + uses: peter-evans/create-pull-request@v4 + with: + branch: regenerate-integration-configs/patch + delete-branch: true + commit-message: "[bot] Regenerate integration configs" + title: "[bot] Regenerate integration configs" + body: | + This PR regenerates `launchdarkly/audit_log_subscription_configs_generated.go` based on recent changes to the [integrations manifest endpoint](https://app.launchdarkly.com/api/v2/integration-manifests). + labels: bot diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 4169ab45..904ab68b 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -33,7 +33,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "apiToken": { AllowedValues: []string{}, DefaultValue: nil, - Description: "Enter your Dynatrace API token. [Learn more](https://www.dynatrace.com/support/help/shortlink/api-authentication#generate-a-token) about generating tokens. The 'access problem and event feed, metrics, and topology' scope is required.", + Description: "Enter your Dynatrace Access token. [Learn more](https://www.dynatrace.com/support/help/shortlink/api-authentication#generate-a-token) about generating tokens. The 'Access problem and event feed, metrics, and topology' scope is required.", IsOptional: false, IsSecret: true, Type: "string", From 8ceb94b727faf99dad80c8b1be1133ad34708974 Mon Sep 17 00:00:00 2001 From: Dominick Agnello Date: Wed, 10 Aug 2022 11:12:03 -0700 Subject: [PATCH 052/128] add conditional so that new action only runs in private repo --- .github/workflows/generate_integration_config_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate_integration_config_pr.yml b/.github/workflows/generate_integration_config_pr.yml index 33b7fb5f..c94f185d 100644 --- a/.github/workflows/generate_integration_config_pr.yml +++ b/.github/workflows/generate_integration_config_pr.yml @@ -6,6 +6,7 @@ on: jobs: generate-manifest: runs-on: ubuntu-latest + if: github.repository == 'launchdarkly/terraform-provider-launchdarkly-private' steps: # Check out goaltender and LDIF side by side - uses: actions/checkout@v3 From 229b5b96afff3ff62710e2f0e2e84139726f5712 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Wed, 10 Aug 2022 20:00:26 +0100 Subject: [PATCH 053/128] Remove example.com email addresses from acceptance tests (#234) * Remove example.com email addresses from acceptance tests * Fix regexp --- ...ta_source_launchdarkly_team_member_test.go | 4 ++-- ...a_source_launchdarkly_team_members_test.go | 8 ++++---- ...resource_launchdarkly_feature_flag_test.go | 4 ++-- .../resource_launchdarkly_team_member_test.go | 20 +++++++++---------- .../resource_launchdarkly_team_test.go | 18 ++++++++--------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/launchdarkly/data_source_launchdarkly_team_member_test.go b/launchdarkly/data_source_launchdarkly_team_member_test.go index 24f86e1a..03493d5c 100644 --- a/launchdarkly/data_source_launchdarkly_team_member_test.go +++ b/launchdarkly/data_source_launchdarkly_team_member_test.go @@ -42,7 +42,7 @@ func testAccDataSourceTeamMemberDelete(client *Client, id string) error { } func TestAccDataSourceTeamMember_noMatchReturnsError(t *testing.T) { - email := "does-not-exist@example.com" + email := "does-not-exist+wbteste2e@launchdarkly.com" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -70,7 +70,7 @@ func TestAccDataSourceTeamMember_exists(t *testing.T) { teamMembers := make([]ldapi.Member, 0, teamMemberCount) for i := 0; i < teamMemberCount; i++ { - randomEmail := fmt.Sprintf("%s@example.com", acctest.RandStringFromCharSet(10, "abcdefghijklmnopqrstuvwxyz012346789+")) + randomEmail := fmt.Sprintf("%s+wbteste2e@launchdarkly.com", acctest.RandStringFromCharSet(10, "abcdefghijklmnopqrstuvwxyz012346789+")) member, err := testAccDataSourceTeamMemberCreate(client, randomEmail) require.NoError(t, err) teamMembers = append(teamMembers, *member) diff --git a/launchdarkly/data_source_launchdarkly_team_members_test.go b/launchdarkly/data_source_launchdarkly_team_members_test.go index 4ee23643..b783d993 100644 --- a/launchdarkly/data_source_launchdarkly_team_members_test.go +++ b/launchdarkly/data_source_launchdarkly_team_members_test.go @@ -31,7 +31,7 @@ data "launchdarkly_team_members" "test" { } func TestAccDataSourceTeamMembers_noMatchReturnsError(t *testing.T) { - emails := `["does-not-exist@example.com"]` + emails := `["does-not-exist+wbteste2e@launchdarkly.com"]` resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -40,14 +40,14 @@ func TestAccDataSourceTeamMembers_noMatchReturnsError(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccDataSourceTeamMembersConfig(emails), - ExpectError: regexp.MustCompile(`Error: No team member found for email: does-not-exist@example.com`), + ExpectError: regexp.MustCompile(`Error: No team member found for email: does-not-exist\+wbteste2e@launchdarkly.com`), }, }, }) } func TestAccDataSourceTeamMembers_noMatchReturnsNoErrorIfIgnoreMissing(t *testing.T) { - emails := `["does-not-exist@example.com"]` + emails := `["does-not-exist+wbteste2e@launchdarkly.com"]` resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -74,7 +74,7 @@ func TestAccDataSourceTeamMembers_exists(t *testing.T) { teamMembers := make([]ldapi.Member, 0, teamMemberCount) for i := 0; i < teamMemberCount; i++ { - randomEmail := fmt.Sprintf("%s@example.com", acctest.RandStringFromCharSet(10, "abcdefghijklmnopqrstuvwxyz012346789+")) + randomEmail := fmt.Sprintf("%s+wbteste2e@launchdarkly.com", acctest.RandStringFromCharSet(10, "abcdefghijklmnopqrstuvwxyz012346789+")) member, err := testAccDataSourceTeamMemberCreate(client, randomEmail) require.NoError(t, err) teamMembers = append(teamMembers, *member) diff --git a/launchdarkly/resource_launchdarkly_feature_flag_test.go b/launchdarkly/resource_launchdarkly_feature_flag_test.go index 9413ac02..6ef1aed7 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_test.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_test.go @@ -116,7 +116,7 @@ resource "launchdarkly_feature_flag" "json" { // not support creating members with the same email address more than once. testAccFeatureFlagWithMaintainer = ` resource "launchdarkly_team_member" "test" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" first_name = "first" last_name = "last" role = "admin" @@ -136,7 +136,7 @@ resource "launchdarkly_feature_flag" "maintained" { // the previous maintainer if that maintainer still exists testAccFeatureFlagMaintainerComputed = ` resource "launchdarkly_team_member" "test" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" first_name = "first" last_name = "last" role = "admin" diff --git a/launchdarkly/resource_launchdarkly_team_member_test.go b/launchdarkly/resource_launchdarkly_team_member_test.go index 0ed4ed20..4af8f05d 100644 --- a/launchdarkly/resource_launchdarkly_team_member_test.go +++ b/launchdarkly/resource_launchdarkly_team_member_test.go @@ -12,7 +12,7 @@ import ( const ( testAccTeamMemberCreate = ` resource "launchdarkly_team_member" "test" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" first_name = "first" last_name = "last" role = "admin" @@ -21,7 +21,7 @@ resource "launchdarkly_team_member" "test" { ` testAccTeamMemberUpdate = ` resource "launchdarkly_team_member" "test" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" first_name = "first" last_name = "last" role = "no_access" @@ -42,7 +42,7 @@ resource "launchdarkly_custom_role" "test" { } resource "launchdarkly_team_member" "custom_role_test" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" first_name = "first" last_name = "last" custom_roles = [launchdarkly_custom_role.test.key] @@ -72,7 +72,7 @@ resource "launchdarkly_custom_role" "test_2" { } resource "launchdarkly_team_member" "custom_role_test" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" first_name = "first" last_name = "last" custom_roles = [launchdarkly_custom_role.test_2.key] @@ -93,7 +93,7 @@ func TestAccTeamMember_CreateGeneric(t *testing.T) { Config: fmt.Sprintf(testAccTeamMemberCreate, randomName), Check: resource.ComposeTestCheckFunc( testAccCheckMemberExists(resourceName), - resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), + resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s+wbteste2e@launchdarkly.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), resource.TestCheckResourceAttr(resourceName, ROLE, "admin"), @@ -122,7 +122,7 @@ func TestAccTeamMember_UpdateGeneric(t *testing.T) { Config: fmt.Sprintf(testAccTeamMemberCreate, randomName), Check: resource.ComposeTestCheckFunc( testAccCheckMemberExists(resourceName), - resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), + resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s+wbteste2e@launchdarkly.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), resource.TestCheckResourceAttr(resourceName, ROLE, "admin"), @@ -133,7 +133,7 @@ func TestAccTeamMember_UpdateGeneric(t *testing.T) { Config: fmt.Sprintf(testAccTeamMemberUpdate, randomName), Check: resource.ComposeTestCheckFunc( testAccCheckMemberExists(resourceName), - resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), + resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s+wbteste2e@launchdarkly.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), resource.TestCheckResourceAttr(resourceName, ROLE, "no_access"), @@ -160,7 +160,7 @@ func TestAccTeamMember_CreateWithCustomRole(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckCustomRoleExists(roleResourceName), testAccCheckMemberExists(resourceName), - resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), + resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s+wbteste2e@launchdarkly.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), resource.TestCheckResourceAttr(resourceName, "custom_roles.#", "1"), @@ -194,7 +194,7 @@ func TestAccTeamMember_UpdateWithCustomRole(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckCustomRoleExists(roleResourceName1), testAccCheckMemberExists(resourceName), - resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), + resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s+wbteste2e@launchdarkly.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), resource.TestCheckResourceAttr(resourceName, "custom_roles.#", "1"), @@ -211,7 +211,7 @@ func TestAccTeamMember_UpdateWithCustomRole(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckCustomRoleExists(roleResourceName2), testAccCheckMemberExists(resourceName), - resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s@example.com", randomName)), + resource.TestCheckResourceAttr(resourceName, EMAIL, fmt.Sprintf("%s+wbteste2e@launchdarkly.com", randomName)), resource.TestCheckResourceAttr(resourceName, FIRST_NAME, "first"), resource.TestCheckResourceAttr(resourceName, LAST_NAME, "last"), resource.TestCheckResourceAttr(resourceName, "custom_roles.#", "1"), diff --git a/launchdarkly/resource_launchdarkly_team_test.go b/launchdarkly/resource_launchdarkly_team_test.go index a9e7abdf..9b37c249 100644 --- a/launchdarkly/resource_launchdarkly_team_test.go +++ b/launchdarkly/resource_launchdarkly_team_test.go @@ -24,12 +24,12 @@ resource "launchdarkly_custom_role" "terraform_team_test" { } resource "launchdarkly_team_member" "test_member_one" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" } resource "launchdarkly_team_member" "test_member_two" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" depends_on = [launchdarkly_team_member.test_member_one] } @@ -56,12 +56,12 @@ resource "launchdarkly_custom_role" "terraform_team_test" { } resource "launchdarkly_team_member" "test_member_one" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" } resource "launchdarkly_team_member" "test_member_two" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" depends_on = [launchdarkly_team_member.test_member_one] } @@ -99,12 +99,12 @@ resource "launchdarkly_custom_role" "other_team_test" { } resource "launchdarkly_team_member" "test_member_one" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" } resource "launchdarkly_team_member" "test_member_two" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" depends_on = [launchdarkly_team_member.test_member_one] } @@ -131,18 +131,18 @@ resource "launchdarkly_custom_role" "other_team_test" { } resource "launchdarkly_team_member" "test_member_one" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" } resource "launchdarkly_team_member" "test_member_two" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" depends_on = [launchdarkly_team_member.test_member_one] } resource "launchdarkly_team_member" "test_member_three" { - email = "%s@example.com" + email = "%s+wbteste2e@launchdarkly.com" role = "reader" depends_on = [launchdarkly_team_member.test_member_two] } From d4598138bc2f9e20e976927bfa364e98d8d039a0 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 10 Aug 2022 13:31:45 -0700 Subject: [PATCH 054/128] Retry failed acceptance tests once This modifies the GNUMakefile `testacc` target to run the specified acceptance tests once, and if they fail retry them one time. This is an effort to prevent alerts for flaky tests in the channel, which we've been seeing an increase in. Because we run each test individually in CI, this is actually pretty nice since just the tests that fail will get rerun and not all tests (unless running all tests locally). We may at some point want to add an environment variable or other configuration around this. --- GNUmakefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 90a5fb2c..a520d724 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,7 +17,10 @@ test: fmtcheck xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 testacc: fmtcheck - TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m + TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m; if [ $$? -eq 1 ]; then \ + printf "\n\nRetrying failed test\n\n"; \ + TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m; \ + fi vet: @echo "go vet ." From 362669f2dcfe7f8cc094208d64b37c10b978e9fc Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Fri, 5 Aug 2022 10:12:16 -0700 Subject: [PATCH 055/128] [SC-163262] Suppress diff when value_type doesn't change Because of how Terraform defaults work, Terraform will attempt to store a `value_type` for `values` even when `values` is empty. This adds a [DiffSuppressFunc](https://www.terraform.io/plugin/sdkv2/schemas/schema-behaviors#diffsuppressfunc) for the `value_type` in the schema that checks if the diff went from empty `""` (what's in the TF manifest) to `"string"` (the default value) and if there is no `value_type` in the resource (so the `value_type` wasn't actually updated by the user) then we can safely ignore the diff. This suppresses annoying messages for users without impacting the behavior of the provider. --- launchdarkly/clause_helper.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/launchdarkly/clause_helper.go b/launchdarkly/clause_helper.go index 95fbf120..56ccddf7 100644 --- a/launchdarkly/clause_helper.go +++ b/launchdarkly/clause_helper.go @@ -43,10 +43,11 @@ func clauseSchema() *schema.Schema { Description: "The list of values associated with the rule clause", }, VALUE_TYPE: { - Type: schema.TypeString, - Default: STRING_CLAUSE_VALUE, - Optional: true, - Description: "The type for each of the clause's values. Available types are boolean, string, and number. If omitted, value_type defaults to string", + Type: schema.TypeString, + Default: STRING_CLAUSE_VALUE, + Optional: true, + Description: "The type for each of the clause's values. Available types are boolean, string, and number. If omitted, value_type defaults to string", + DiffSuppressFunc: diffSuppressFunc, ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice( []string{ BOOL_CLAUSE_VALUE, @@ -67,6 +68,10 @@ func clauseSchema() *schema.Schema { } } +func diffSuppressFunc(_, old, new string, d *schema.ResourceData) bool { + return (old == "" && new == "string" && d.Get("value_type") == nil) +} + func clauseFromResourceData(val interface{}) (ldapi.Clause, error) { clauseMap := val.(map[string]interface{}) c := ldapi.Clause{ @@ -75,6 +80,9 @@ func clauseFromResourceData(val interface{}) (ldapi.Clause, error) { Negate: clauseMap[NEGATE].(bool), } valueType := clauseMap[VALUE_TYPE].(string) + if valueType == "" { + valueType = STRING_CLAUSE_VALUE + } values, err := clauseValuesFromResourceData(clauseMap[VALUES].([]interface{}), valueType) if err != nil { return c, err From c1ff182cb2f3c5902882171e2bd2937736894996 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Tue, 23 Aug 2022 13:45:53 -0700 Subject: [PATCH 056/128] Update launchdarkly/clause_helper.go Co-authored-by: Isabelle Miller --- launchdarkly/clause_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchdarkly/clause_helper.go b/launchdarkly/clause_helper.go index 56ccddf7..b89b57a8 100644 --- a/launchdarkly/clause_helper.go +++ b/launchdarkly/clause_helper.go @@ -69,7 +69,7 @@ func clauseSchema() *schema.Schema { } func diffSuppressFunc(_, old, new string, d *schema.ResourceData) bool { - return (old == "" && new == "string" && d.Get("value_type") == nil) + return (old == "" && new == STRING_CLAUSE_VALUE && d.Get("value_type") == nil) } func clauseFromResourceData(val interface{}) (ldapi.Clause, error) { From e7affce7c2822d13a79e8c34d5f0a1f3cfa112e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Aug 2022 11:20:53 +0100 Subject: [PATCH 057/128] [bot] Regenerate integration configs (#237) Co-authored-by: Blugil --- launchdarkly/audit_log_subscription_configs_generated.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchdarkly/audit_log_subscription_configs_generated.go b/launchdarkly/audit_log_subscription_configs_generated.go index 904ab68b..7dd8d4fb 100644 --- a/launchdarkly/audit_log_subscription_configs_generated.go +++ b/launchdarkly/audit_log_subscription_configs_generated.go @@ -173,7 +173,7 @@ var SUBSCRIPTION_CONFIGURATION_FIELDS = map[string]IntegrationConfig{ "base-url": { AllowedValues: []string{}, DefaultValue: nil, - Description: "Enter your [Splunk HTTP event collector base URL](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector).", + Description: "Enter your [Splunk HTTP event collector base URL](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector) (omitting the path).", IsOptional: false, IsSecret: false, Type: "string", From b8c908579f8eb0c2bffb6a9310243a1be0d8c429 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Wed, 24 Aug 2022 11:27:22 +0100 Subject: [PATCH 058/128] Update feature_flag_environmewnt to only create patch statements when something changed (#238) * Update feature_flag_environmewnt to only create patch statements when something changed * Fix spacing --- .circleci/config.yml | 38 ++--- CHANGELOG.md | 6 + GNUmakefile | 9 +- ...e_launchdarkly_feature_flag_environment.go | 72 +++++---- ...nchdarkly_feature_flag_environment_test.go | 145 ++++++++++++++++++ 5 files changed, 222 insertions(+), 48 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a500935b..1b895743 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,56 +41,56 @@ jobs: command: TESTARGS="-v" make test - run: name: Test Data Sources - command: TESTARGS="-run TestAccDataSource" make testacc + command: TESTARGS="-run TestAccDataSource" make testacc-with-retry - run: name: Test Access Token Resource - command: TESTARGS="-run TestAccAccessToken" make testacc + command: TESTARGS="-run TestAccAccessToken" make testacc-with-retry - run: name: Test Audit Log Subscription Resource - command: TESTARGS="-run TestAccAuditLogSubscription" make testacc + command: TESTARGS="-run TestAccAuditLogSubscription" make testacc-with-retry - run: name: Test Custom Role Resource - command: TESTARGS="-run TestAccCustomRole" make testacc + command: TESTARGS="-run TestAccCustomRole" make testacc-with-retry - run: name: Test Destination Resource - command: TESTARGS="-run TestAccDestination" make testacc + command: TESTARGS="-run TestAccDestination" make testacc-with-retry - run: name: Test Environment Resource - command: TESTARGS="-run TestAccEnvironment" make testacc + command: TESTARGS="-run TestAccEnvironment" make testacc-with-retry - run: name: Test Feature Flag Resource - command: TESTARGS="-run TestAccFeatureFlag" make testacc + command: TESTARGS="-run TestAccFeatureFlag" make testacc-with-retry - run: name: Test Feature Flag Environment Resource - command: TESTARGS="-run TestAccFeatureFlagEnvironment" make testacc + command: TESTARGS="-run TestAccFeatureFlagEnvironment" make testacc-with-retry - run: name: Test Flag Trigger Resource - command: TESTARGS="-run TestAccFlagTrigger" make testacc + command: TESTARGS="-run TestAccFlagTrigger" make testacc-with-retry - run: name: Test Metric Resource - command: TESTARGS="-run TestAccMetric" make testacc + command: TESTARGS="-run TestAccMetric" make testacc-with-retry - run: name: Test Project Resource - command: TESTARGS="-run TestAccProject" make testacc + command: TESTARGS="-run TestAccProject" make testacc-with-retry - run: name: Test Relay Proxy Configuration Resource - command: TESTARGS="-run TestAccRelayProxy" make testacc + command: TESTARGS="-run TestAccRelayProxy" make testacc-with-retry - run: name: Test Segment Resource - command: TESTARGS="-run TestAccSegment" make testacc + command: TESTARGS="-run TestAccSegment" make testacc-with-retry - run: name: Test Team Members command: | - TESTARGS="-run TestAccTeamMember_CreateGeneric" make testacc - TESTARGS="-run TestAccTeamMember_UpdateGeneric" make testacc - TESTARGS="-run TestAccTeamMember_CreateWithCustomRole" make testacc - TESTARGS="-run TestAccTeamMember_UpdateWithCustomRole" make testacc + TESTARGS="-run TestAccTeamMember_CreateGeneric" make testacc-with-retry + TESTARGS="-run TestAccTeamMember_UpdateGeneric" make testacc-with-retry + TESTARGS="-run TestAccTeamMember_CreateWithCustomRole" make testacc-with-retry + TESTARGS="-run TestAccTeamMember_UpdateWithCustomRole" make testacc-with-retry - run: name: Test Team Resource - command: TESTARGS="-run TestAccTeam_" make testacc + command: TESTARGS="-run TestAccTeam_" make testacc-with-retry - run: name: Test Webhook Resource - command: TESTARGS="-run TestAccWebhook" make testacc + command: TESTARGS="-run TestAccWebhook" make testacc-with-retry - notify-slack-of-failures lint: diff --git a/CHANGELOG.md b/CHANGELOG.md index b6a43468..98fa9ff2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [2.9.1] (Unreleased) + +BUG FIXES: + +- Fixes a bug in the `launchdarkly_feature_flag_environment` that prevented users from updating targeting rule clauses when the targeting rule was being used as the fallthrough variation with a percentage rollout. + ## [2.9.0] (August 05, 2022) FEATURES: diff --git a/GNUmakefile b/GNUmakefile index a520d724..1316c43b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,9 +17,12 @@ test: fmtcheck xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 testacc: fmtcheck - TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m; if [ $$? -eq 1 ]; then \ + TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m + +testacc-with-retry: fmtcheck + make testacc; if [ $$? -eq 1 ]; then \ printf "\n\nRetrying failed test\n\n"; \ - TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m; \ + make testacc; \ fi vet: @@ -70,4 +73,4 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) endif @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) -.PHONY: build install apply test testacc vet fmt fmtcheck errcheck lint test-compile website website-test +.PHONY: build install apply test testacc testacc-with-retry vet fmt fmtcheck errcheck lint test-compile website website-test diff --git a/launchdarkly/resource_launchdarkly_feature_flag_environment.go b/launchdarkly/resource_launchdarkly_feature_flag_environment.go index 399b01e4..5c5822ca 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_environment.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_environment.go @@ -150,39 +150,59 @@ func resourceFeatureFlagEnvironmentUpdate(ctx context.Context, d *schema.Resourc return diag.Errorf("failed to find environment with key %q", envKey) } - on := d.Get(ON) - rules, err := rulesFromResourceData(d) - if err != nil { - return diag.FromErr(err) + patchOperations := make([]ldapi.PatchOperation, 0, 7) + if d.HasChange(ON) { + on := d.Get(ON) + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "on"), on)) } - trackEvents := d.Get(TRACK_EVENTS).(bool) - prerequisites := prerequisitesFromResourceData(d, PREREQUISITES) - targets := targetsFromResourceData(d) - fall, err := fallthroughFromResourceData(d) - if err != nil { - return diag.FromErr(err) + if d.HasChange(RULES) { + rules, err := rulesFromResourceData(d) + if err != nil { + return diag.FromErr(err) + } + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "rules"), rules)) } - offVariation := d.Get(OFF_VARIATION) - comment := "Terraform" - patch := ldapi.PatchWithComment{ - Comment: &comment, - Patch: []ldapi.PatchOperation{ - patchReplace(patchFlagEnvPath(d, "on"), on), - patchReplace(patchFlagEnvPath(d, "rules"), rules), - patchReplace(patchFlagEnvPath(d, "trackEvents"), trackEvents), - patchReplace(patchFlagEnvPath(d, "prerequisites"), prerequisites), - patchReplace(patchFlagEnvPath(d, "targets"), targets), - patchReplace(patchFlagEnvPath(d, "fallthrough"), fall), - patchReplace(patchFlagEnvPath(d, "offVariation"), offVariation), - }} + if d.HasChange(TRACK_EVENTS) { + trackEvents := d.Get(TRACK_EVENTS).(bool) + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "trackEvents"), trackEvents)) + } + + if d.HasChange(PREREQUISITES) { + prerequisites := prerequisitesFromResourceData(d, PREREQUISITES) + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "prerequisites"), prerequisites)) + } + + if d.HasChange(TARGETS) { + targets := targetsFromResourceData(d) + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "targets"), targets)) + } + + if d.HasChange(FALLTHROUGH) { + fall, err := fallthroughFromResourceData(d) + if err != nil { + return diag.FromErr(err) + } + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "fallthrough"), fall)) + } + + if d.HasChange(OFF_VARIATION) { + offVariation := d.Get(OFF_VARIATION) + patchOperations = append(patchOperations, patchReplace(patchFlagEnvPath(d, "offVariation"), offVariation)) + } + comment := "Terraform" + patch := ldapi.PatchWithComment{Comment: &comment, Patch: patchOperations} log.Printf("[DEBUG] %+v\n", patch) - _, _, err = client.ld.FeatureFlagsApi.PatchFeatureFlag(client.ctx, projectKey, flagKey).PatchWithComment(patch).Execute() - if err != nil { - return diag.Errorf("failed to update flag %q in project %q, environment %q: %s", flagKey, projectKey, envKey, handleLdapiErr(err)) + + if len(patchOperations) > 0 { + _, _, err = client.ld.FeatureFlagsApi.PatchFeatureFlag(client.ctx, projectKey, flagKey).PatchWithComment(patch).Execute() + if err != nil { + return diag.Errorf("failed to update flag %q in project %q, environment %q: %s", flagKey, projectKey, envKey, handleLdapiErr(err)) + } } + return resourceFeatureFlagEnvironmentRead(ctx, d, metaRaw) } diff --git a/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go b/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go index f0d21f1f..5081fb9d 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_environment_test.go @@ -312,6 +312,88 @@ resource "launchdarkly_feature_flag_environment" "invalid_bucket_by" { } off_variation = 0 } +` + + testAccPercentageRollout = ` +resource "launchdarkly_feature_flag" "rollout" { + project_key = launchdarkly_project.test.key + key = "bool-flag" + name = "Basic boolean flag" + variation_type = "boolean" + variations { + value = true + } + variations { + value = false + } + + defaults { + on_variation = 1 + off_variation = 0 + } +} + +resource "launchdarkly_feature_flag_environment" "rollout" { + flag_id = launchdarkly_feature_flag.rollout.id + env_key = "test" + on = true + rules { + clauses { + attribute = "country" + op = "startsWith" + values = ["aus", "nz", "united"] + negate = false + } + variation = 0 + } + fallthrough { + variation = 0 + rollout_weights = [60000, 40000] + bucket_by = "country" + } + off_variation = 1 +} +` + + testAccPercentageRolloutClauseUpdate = ` +resource "launchdarkly_feature_flag" "rollout" { + project_key = launchdarkly_project.test.key + key = "bool-flag" + name = "Basic boolean flag" + variation_type = "boolean" + variations { + value = true + } + variations { + value = false + } + + defaults { + on_variation = 1 + off_variation = 0 + } +} + +resource "launchdarkly_feature_flag_environment" "rollout" { + flag_id = launchdarkly_feature_flag.rollout.id + env_key = "test" + on = true + rules { + clauses { + attribute = "country" + op = "startsWith" + values = ["aus", "us", "united"] + negate = false + } + variation = 0 + } + fallthrough { + variation = 0 + rollout_weights = [60000, 40000] + bucket_by = "country" + } + off_variation = 1 +} ` testAccInvalidRuleBucketBy = ` @@ -600,6 +682,69 @@ func TestAccFeatureFlagEnvironment_NumberClauseValue(t *testing.T) { }) } +func TestAccFeatureFlagEnvironment_UpdateClauseWithRollout(t *testing.T) { + projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "launchdarkly_feature_flag_environment.rollout" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: withRandomProject(projectKey, testAccPercentageRollout), + Check: resource.ComposeTestCheckFunc( + testAccCheckFeatureFlagEnvironmentExists(resourceName), + resource.TestCheckResourceAttr(resourceName, ON, "true"), + resource.TestCheckResourceAttr(resourceName, "rules.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.value_type", "string"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.#", "3"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.0", "aus"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.1", "nz"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.2", "united"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.variation", "0"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.rollout_weights.#", "2"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.rollout_weights.0", "60000"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.rollout_weights.1", "40000"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.bucket_by", "country"), + resource.TestCheckResourceAttr(resourceName, OFF_VARIATION, "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: withRandomProject(projectKey, testAccPercentageRolloutClauseUpdate), + Check: resource.ComposeTestCheckFunc( + testAccCheckFeatureFlagEnvironmentExists(resourceName), + resource.TestCheckResourceAttr(resourceName, ON, "true"), + resource.TestCheckResourceAttr(resourceName, "rules.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.#", "1"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.value_type", "string"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.#", "3"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.0", "aus"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.1", "us"), + resource.TestCheckResourceAttr(resourceName, "rules.0.clauses.0.values.2", "united"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.variation", "0"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.rollout_weights.#", "2"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.rollout_weights.0", "60000"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.rollout_weights.1", "40000"), + resource.TestCheckResourceAttr(resourceName, "fallthrough.0.bucket_by", "country"), + resource.TestCheckResourceAttr(resourceName, OFF_VARIATION, "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccFeatureFlagEnvironment_InvalidBucketBy(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) // resourceName := "launchdarkly_feature_flag_environment.invalid_bucket_by" From 07e3cc01a38e2049a975e80e65bdba022bc85bd9 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Wed, 24 Aug 2022 13:39:53 +0100 Subject: [PATCH 059/128] merge public/main (#239) --- CHANGELOG.md | 10 +++++----- website/docs/d/feature_flag.html.markdown | 2 +- website/docs/d/project.html.markdown | 2 +- website/docs/r/feature_flag.html.markdown | 2 +- website/docs/r/project.html.markdown | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98fa9ff2..56619f02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ -## [2.9.1] (Unreleased) +## [2.9.1] (August 24, 2022) BUG FIXES: - Fixes a bug in the `launchdarkly_feature_flag_environment` that prevented users from updating targeting rule clauses when the targeting rule was being used as the fallthrough variation with a percentage rollout. +- Fixes a bug in the `launchdarkly_feature_flag_environment` that resulted in the default `string` rule clause value type not being respected. [#102](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/102) + ## [2.9.0] (August 05, 2022) FEATURES: @@ -36,11 +38,9 @@ NOTES: - Upgrade Go version to 1.18 -## [2.7.1] (July 27, 2022) - -BUG FIXES: +## [2.7.0] (May 5, 2022) -- The `launchdarkly_feature_flag_environment` data source now checks whether the environment exists and prints out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101) +FEATURES: - Added the `base_permissions` field to the `launchdarkly_custom_role` resource. diff --git a/website/docs/d/feature_flag.html.markdown b/website/docs/d/feature_flag.html.markdown index f362c55d..e9dff707 100644 --- a/website/docs/d/feature_flag.html.markdown +++ b/website/docs/d/feature_flag.html.markdown @@ -72,7 +72,7 @@ Nested `defaults` blocks have the following structure: - `off_variation` - (Required) The index of the variation the flag will default to in all new environments when off. -### Nested Client-Side Availibility Block +### Nested Client-Side Availability Block The nested `client_side_availability` block has the following attributes: diff --git a/website/docs/d/project.html.markdown b/website/docs/d/project.html.markdown index c4160fbe..84873025 100644 --- a/website/docs/d/project.html.markdown +++ b/website/docs/d/project.html.markdown @@ -38,7 +38,7 @@ Please migrate to `default_client_side_availability` to maintain future compatab - `tags` - The project's set of tags. -### Nested Client-Side Availibility Block +### Nested Client-Side Availability Block The nested `default_client_side_availability` block has the following attributes: diff --git a/website/docs/r/feature_flag.html.markdown b/website/docs/r/feature_flag.html.markdown index 22cfda4c..198755d6 100644 --- a/website/docs/r/feature_flag.html.markdown +++ b/website/docs/r/feature_flag.html.markdown @@ -129,7 +129,7 @@ Nested `defaults` blocks have the following structure: - `off_variation` - (Required) The index of the variation the flag will default to in all new environments when off. -### Nested Client-Side Availibility Block +### Nested Client-Side Availability Block The nested `client_side_availability` block has the following structure: diff --git a/website/docs/r/project.html.markdown b/website/docs/r/project.html.markdown index 59c43c06..003e14d2 100644 --- a/website/docs/r/project.html.markdown +++ b/website/docs/r/project.html.markdown @@ -98,7 +98,7 @@ Nested environments `approval_settings` blocks have the following structure: - `required_approval_tags` - An array of tags used to specify which flags with those tags require approval. You may only set `required_approval_tags` if `required` is not set to `true` and vice versa. -### Nested Client side Availibility Block +### Nested Client side Availability Block The nested `default_client_side_availability` block describes which client-side SDKs can use new flags by default. To learn more about this setting, read [Making flags available to client-side and mobile SDKs](https://docs.launchdarkly.com/home/getting-started/feature-flags#making-flags-available-to-client-side-and-mobile-sdks). This block has the following structure: From 8311a3aa4edfaf6b3ad6e8e8c5d3c7d9a1b41187 Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Thu, 1 Sep 2022 13:31:04 +0100 Subject: [PATCH 060/128] Imiller/sc 166499/defaults for boolean flags do not apply to existing environments (#240) * fix variations bug and update tests * remove redundant tests * update changelog * add extra test for good measure --- CHANGELOG.md | 6 + launchdarkly/default_variations_helper.go | 29 ++-- .../default_variations_helper_test.go | 24 ++- ...resource_launchdarkly_feature_flag_test.go | 145 ++++++------------ 4 files changed, 93 insertions(+), 111 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56619f02..d9fa229a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [2.9.2] (Unreleased) + +BUG FIXES: + +- Fixes a bug in the `launchdarkly_feature_flag` resource where explicit defaults were not getting set for boolean flags upon creation. + ## [2.9.1] (August 24, 2022) BUG FIXES: diff --git a/launchdarkly/default_variations_helper.go b/launchdarkly/default_variations_helper.go index d177e507..0fd84f63 100644 --- a/launchdarkly/default_variations_helper.go +++ b/launchdarkly/default_variations_helper.go @@ -9,25 +9,36 @@ import ( func defaultVariationsFromResourceData(d *schema.ResourceData) (*ldapi.Defaults, error) { schemaVariations := d.Get(VARIATIONS).([]interface{}) + numberOfVariations := len(schemaVariations) variationType := d.Get(VARIATION_TYPE).(string) - if len(schemaVariations) == 0 && variationType == BOOL_VARIATION { - // default boolean variations - return &ldapi.Defaults{OnVariation: int32(0), OffVariation: int32(1)}, nil - } rawDefaults, ok := d.GetOk(DEFAULTS) if !ok { - return &ldapi.Defaults{OnVariation: int32(0), OffVariation: int32(len(schemaVariations) - 1)}, nil + defaultOff := numberOfVariations - 1 + if variationType == BOOL_VARIATION { + defaultOff = 1 // otherwise at this point it would be -1 + } + return &ldapi.Defaults{OnVariation: int32(0), OffVariation: int32(defaultOff)}, nil } defaultList := rawDefaults.([]interface{}) + if variationType == BOOL_VARIATION { + if numberOfVariations == 0 && len(defaultList) == 0 { + // default boolean variations + return &ldapi.Defaults{OnVariation: int32(0), OffVariation: int32(1)}, nil + } else { + // this allows us to confidence check the variation indices below + numberOfVariations = 2 + } + } + defaults := defaultList[0].(map[string]interface{}) on := defaults[ON_VARIATION].(int) off := defaults[OFF_VARIATION].(int) - if on >= len(schemaVariations) { - return nil, fmt.Errorf("default on_variation %v is out of range, must be between 0 and %v inclusive", on, len(schemaVariations)-1) + if on >= numberOfVariations { + return nil, fmt.Errorf("default on_variation %v is out of range, must be between 0 and %v inclusive", on, numberOfVariations-1) } - if off >= len(schemaVariations) { - return nil, fmt.Errorf("default off_variation %v is out of range, must be between 0 and %v inclusive", off, len(schemaVariations)-1) + if off >= numberOfVariations { + return nil, fmt.Errorf("default off_variation %v is out of range, must be between 0 and %v inclusive", off, numberOfVariations-1) } return &ldapi.Defaults{OnVariation: int32(on), OffVariation: int32(off)}, nil diff --git a/launchdarkly/default_variations_helper_test.go b/launchdarkly/default_variations_helper_test.go index 0ba48c72..efa9824c 100644 --- a/launchdarkly/default_variations_helper_test.go +++ b/launchdarkly/default_variations_helper_test.go @@ -18,7 +18,7 @@ func TestDefaultVariationsFromResourceData(t *testing.T) { expectedErr error }{ { - name: "no defaults on boolean", + name: "automatic boolean defaults", vars: map[string]interface{}{ VARIATIONS: []interface{}{ map[string]interface{}{ @@ -56,6 +56,28 @@ func TestDefaultVariationsFromResourceData(t *testing.T) { OffVariation: 1, }, }, + { + name: "explicit defautls overwrite default defaults", + vars: map[string]interface{}{ + VARIATIONS: []interface{}{ + map[string]interface{}{ + VALUE: "true", + }, + map[string]interface{}{ + VALUE: "false", + }, + }, + DEFAULTS: []interface{}{ + map[string]interface{}{ + ON_VARIATION: 1, + OFF_VARIATION: 0, + }}, + }, + expected: &ldapi.Defaults{ + OnVariation: 1, + OffVariation: 0, + }, + }, { name: "invalid default on value", vars: map[string]interface{}{ diff --git a/launchdarkly/resource_launchdarkly_feature_flag_test.go b/launchdarkly/resource_launchdarkly_feature_flag_test.go index 6ef1aed7..14715974 100644 --- a/launchdarkly/resource_launchdarkly_feature_flag_test.go +++ b/launchdarkly/resource_launchdarkly_feature_flag_test.go @@ -30,7 +30,7 @@ resource "launchdarkly_feature_flag" "basic" { include_in_snippet = true temporary = true defaults { - on_variation = 0 + on_variation = 1 off_variation = 1 } } @@ -290,7 +290,7 @@ resource "launchdarkly_feature_flag" "defaults" { name = "Feature flag with defaults" variation_type = "boolean" defaults { - on_variation = 0 + on_variation = 1 off_variation = 1 } } @@ -497,7 +497,7 @@ func withRandomProjectIncludeInSnippetTrue(randomProject, resource string) strin %s`, randomProject, resource) } -func TestAccFeatureFlag_Basic(t *testing.T) { +func TestAccFeatureFlag_BasicCreateAndUpdate(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_feature_flag.basic" resource.ParallelTest(t, resource.TestCase{ @@ -518,6 +518,9 @@ func TestAccFeatureFlag_Basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "variations.#", "2"), resource.TestCheckResourceAttr(resourceName, "variations.0.value", "true"), resource.TestCheckResourceAttr(resourceName, "variations.1.value", "false"), + // bool variation defaults should default to 0 and 1 if not set + resource.TestCheckResourceAttr(resourceName, "defaults.0.on_variation", "0"), + resource.TestCheckResourceAttr(resourceName, "defaults.0.off_variation", "1"), resource.TestCheckNoResourceAttr(resourceName, MAINTAINER_ID), ), }, @@ -527,29 +530,6 @@ func TestAccFeatureFlag_Basic(t *testing.T) { // TODO: While we have to account for usingMobileKey being set to true by default, we cant use importStateVerify // ImportStateVerify: true, }, - }, - }) -} - -func TestAccFeatureFlag_Update(t *testing.T) { - projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) - resourceName := "launchdarkly_feature_flag.basic" - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: withRandomProject(projectKey, testAccFeatureFlagBasic), - Check: resource.ComposeTestCheckFunc( - testAccCheckProjectExists("launchdarkly_project.test"), - testAccCheckFeatureFlagExists(resourceName), - resource.TestCheckResourceAttr(resourceName, NAME, "Basic feature flag"), - resource.TestCheckResourceAttr(resourceName, KEY, "basic-flag"), - resource.TestCheckResourceAttr(resourceName, PROJECT_KEY, projectKey), - ), - }, { Config: withRandomProject(projectKey, testAccFeatureFlagUpdate), Check: resource.ComposeTestCheckFunc( @@ -564,7 +544,7 @@ func TestAccFeatureFlag_Update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.1", "update"), resource.TestCheckResourceAttr(resourceName, INCLUDE_IN_SNIPPET, "true"), resource.TestCheckResourceAttr(resourceName, TEMPORARY, "true"), - resource.TestCheckResourceAttr(resourceName, "defaults.0.on_variation", "0"), + resource.TestCheckResourceAttr(resourceName, "defaults.0.on_variation", "1"), resource.TestCheckResourceAttr(resourceName, "defaults.0.off_variation", "1"), ), }, @@ -755,7 +735,7 @@ func TestAccFeatureFlag_InvalidMaintainer(t *testing.T) { }) } -func TestAccFeatureFlag_CreateMultivariate(t *testing.T) { +func TestAccFeatureFlag_CreateAndUpdateMultivariate(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_feature_flag.multivariate" resource.ParallelTest(t, resource.TestCase{ @@ -797,78 +777,6 @@ func TestAccFeatureFlag_CreateMultivariate(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "custom_properties.1.value.0", "very special custom property"), ), }, - }, - }) -} - -func TestAccFeatureFlag_CreateMultivariate2(t *testing.T) { - projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) - resourceName := "launchdarkly_feature_flag.multivariate_numbers" - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: withRandomProject(projectKey, testAccFeatureFlagCreateMultivariate2), - Check: resource.ComposeTestCheckFunc( - testAccCheckProjectExists("launchdarkly_project.test"), - testAccCheckFeatureFlagExists(resourceName), - resource.TestCheckResourceAttr(resourceName, NAME, "multivariate flag 2 name"), - resource.TestCheckResourceAttr(resourceName, KEY, "multivariate-flag-2"), - resource.TestCheckResourceAttr(resourceName, PROJECT_KEY, projectKey), - resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "this is a multivariate flag to test big number values"), - resource.TestCheckResourceAttr(resourceName, VARIATION_TYPE, "number"), - resource.TestCheckResourceAttr(resourceName, "variations.#", "3"), - resource.TestCheckResourceAttr(resourceName, "variations.0.description", "a description"), - resource.TestCheckResourceAttr(resourceName, "variations.0.name", "variation1"), - resource.TestCheckResourceAttr(resourceName, "variations.0.value", "86400000"), - resource.TestCheckResourceAttr(resourceName, "variations.1.value", "123"), - resource.TestCheckResourceAttr(resourceName, "variations.2.value", "123456789"), - resource.TestCheckResourceAttr(resourceName, "tags.#", "3"), - resource.TestCheckResourceAttr(resourceName, "tags.0", "is"), - resource.TestCheckResourceAttr(resourceName, "tags.1", "this"), - resource.TestCheckResourceAttr(resourceName, "tags.2", "unordered"), - ), - }, - }, - }) -} - -func TestAccFeatureFlag_UpdateMultivariate(t *testing.T) { - projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) - resourceName := "launchdarkly_feature_flag.multivariate" - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: withRandomProject(projectKey, testAccFeatureFlagCreateMultivariate), - Check: resource.ComposeTestCheckFunc( - testAccCheckProjectExists("launchdarkly_project.test"), - testAccCheckFeatureFlagExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "variations.#", "3"), - resource.TestCheckResourceAttr(resourceName, "variations.0.description", "a description"), - resource.TestCheckResourceAttr(resourceName, "variations.0.name", "variation1"), - resource.TestCheckResourceAttr(resourceName, "variations.0.value", "string1"), - resource.TestCheckResourceAttr(resourceName, "variations.1.value", "string2"), - resource.TestCheckResourceAttr(resourceName, "variations.2.value", "another option"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.#", "2"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.0.key", "some.property"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.0.name", "Some Property"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.0.value.#", "3"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.0.value.0", "value1"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.0.value.1", "value2"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.0.value.2", "value3"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.1.key", "some.property2"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.1.name", "Some Property"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.1.value.#", "1"), - resource.TestCheckResourceAttr(resourceName, "custom_properties.1.value.0", "very special custom property"), - ), - }, { Config: withRandomProject(projectKey, testAccFeatureFlagUpdateMultivariate), Check: resource.ComposeTestCheckFunc( @@ -922,6 +830,41 @@ func TestAccFeatureFlag_UpdateMultivariate(t *testing.T) { }) } +func TestAccFeatureFlag_CreateMultivariate2(t *testing.T) { + projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "launchdarkly_feature_flag.multivariate_numbers" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: withRandomProject(projectKey, testAccFeatureFlagCreateMultivariate2), + Check: resource.ComposeTestCheckFunc( + testAccCheckProjectExists("launchdarkly_project.test"), + testAccCheckFeatureFlagExists(resourceName), + resource.TestCheckResourceAttr(resourceName, NAME, "multivariate flag 2 name"), + resource.TestCheckResourceAttr(resourceName, KEY, "multivariate-flag-2"), + resource.TestCheckResourceAttr(resourceName, PROJECT_KEY, projectKey), + resource.TestCheckResourceAttr(resourceName, DESCRIPTION, "this is a multivariate flag to test big number values"), + resource.TestCheckResourceAttr(resourceName, VARIATION_TYPE, "number"), + resource.TestCheckResourceAttr(resourceName, "variations.#", "3"), + resource.TestCheckResourceAttr(resourceName, "variations.0.description", "a description"), + resource.TestCheckResourceAttr(resourceName, "variations.0.name", "variation1"), + resource.TestCheckResourceAttr(resourceName, "variations.0.value", "86400000"), + resource.TestCheckResourceAttr(resourceName, "variations.1.value", "123"), + resource.TestCheckResourceAttr(resourceName, "variations.2.value", "123456789"), + resource.TestCheckResourceAttr(resourceName, "tags.#", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.0", "is"), + resource.TestCheckResourceAttr(resourceName, "tags.1", "this"), + resource.TestCheckResourceAttr(resourceName, "tags.2", "unordered"), + ), + }, + }, + }) +} + func TestAccFeatureFlag_UpdateDefaults(t *testing.T) { projectKey := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resourceName := "launchdarkly_feature_flag.defaults" @@ -936,7 +879,7 @@ func TestAccFeatureFlag_UpdateDefaults(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckProjectExists("launchdarkly_project.test"), testAccCheckFeatureFlagExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "defaults.0.on_variation", "0"), + resource.TestCheckResourceAttr(resourceName, "defaults.0.on_variation", "1"), resource.TestCheckResourceAttr(resourceName, "defaults.0.off_variation", "1"), ), }, From 9e135b6531beab8295017b23965fa4470c7b6814 Mon Sep 17 00:00:00 2001 From: Henry Barrow Date: Thu, 1 Sep 2022 14:33:35 +0100 Subject: [PATCH 061/128] Backmerge public (#241) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9fa229a..09c02699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [2.9.2] (Unreleased) +## [2.9.2] (September 1, 2022) BUG FIXES: From c65030c17749aa3ad4a4f8574439eb08dad29360 Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Tue, 13 Sep 2022 17:13:07 +0100 Subject: [PATCH 062/128] Imiller/sc 168660/terraform issue importing project with environments (#243) * Fix typo in multiple docs headers (#111) * prepare v2.9.1 release (#113) * prep v2.9.1 * Fix changelog * update doc Co-authored-by: Lachlan Cooper Co-authored-by: Henry Barrow --- website/docs/r/project.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/r/project.html.markdown b/website/docs/r/project.html.markdown index 003e14d2..14b937ac 100644 --- a/website/docs/r/project.html.markdown +++ b/website/docs/r/project.html.markdown @@ -127,4 +127,6 @@ resource "launchdarkly_project" "example" { } ``` -Managing environment resources with Terraform should always be done on the project unless the project is not also managed with Terraform. +**Note:** Following an import, the first apply may show a diff in the order of your environments as Terraform realigns its state with the order of configurations in your project configuration. This will not change your environments or their SDK keys. + +**Managing environment resources with Terraform should always be done on the project unless the project is not also managed with Terraform.** From 628672ed1e52e2ca1f5a9f11caf904d6870fc43d Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Tue, 20 Sep 2022 13:50:45 -0700 Subject: [PATCH 063/128] [SC-169876] Correctly set bucketBy to nil when empty This will correctly set the bucketBy to nil when making API requests if the value in the Terraform manifest is nil OR if it's explicitly set to an empty string. This is already how segment rules work, but not regular rules or fallthroughs. --- launchdarkly/fallthrough_helper.go | 6 +++--- launchdarkly/rule_helper.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/launchdarkly/fallthrough_helper.go b/launchdarkly/fallthrough_helper.go index 8a30961c..a08bf47b 100644 --- a/launchdarkly/fallthrough_helper.go +++ b/launchdarkly/fallthrough_helper.go @@ -73,9 +73,9 @@ func fallthroughFromResourceData(d *schema.ResourceData) (fallthroughModel, erro fall := f[0].(map[string]interface{}) if isPercentRollout(f) { rollout := fallthroughModel{Rollout: rolloutFromResourceData(fall[ROLLOUT_WEIGHTS])} - bucketBy, ok := fall[BUCKET_BY] - if ok { - rollout.Rollout.BucketBy = ldapi.PtrString(bucketBy.(string)) + bucketBy := fall[BUCKET_BY].(string) + if bucketBy != "" { + rollout.Rollout.BucketBy = &bucketBy } return rollout, nil diff --git a/launchdarkly/rule_helper.go b/launchdarkly/rule_helper.go index 16639495..ae0a9df1 100644 --- a/launchdarkly/rule_helper.go +++ b/launchdarkly/rule_helper.go @@ -65,7 +65,8 @@ func ruleFromResourceData(val interface{}) (rule, error) { } r.Clauses = append(r.Clauses, clause) } - bucketBy, bucketByFound := ruleMap["bucket_by"].(string) + bucketBy := ruleMap["bucket_by"].(string) + bucketByFound := bucketBy != "" if len(rolloutFromResourceData(ruleMap[ROLLOUT_WEIGHTS]).Variations) > 0 { r.Rollout = rolloutFromResourceData(ruleMap[ROLLOUT_WEIGHTS]) if bucketByFound { From a438dfae31b72905ecaa2340f132553516894cfe Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Mon, 12 Sep 2022 17:30:58 -0700 Subject: [PATCH 064/128] [SC-168865] Print error message with API errors This correctly formats and prints the response from the API when we get error responses for the Teams API --- launchdarkly/resource_launchdarkly_team.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launchdarkly/resource_launchdarkly_team.go b/launchdarkly/resource_launchdarkly_team.go index 75ef2ad7..6f1d0c6a 100644 --- a/launchdarkly/resource_launchdarkly_team.go +++ b/launchdarkly/resource_launchdarkly_team.go @@ -152,7 +152,7 @@ func resourceTeamCreate(ctx context.Context, d *schema.ResourceData, metaRaw int _, _, err := client.ld.TeamsApi.PostTeam(client.ctx).TeamPostInput(teamBody).Execute() if err != nil { - return diag.Errorf("Error when calling `TeamsApi.PostTeam`: %v\n\n request: %v", err, teamBody) + return diag.Errorf("Error when creating team %q: %s\n", key, handleLdapiErr(err)) } d.SetId(key) @@ -177,7 +177,7 @@ func resourceTeamRead(ctx context.Context, d *schema.ResourceData, metaRaw inter } if err != nil { - return diag.Errorf("failed to get team %q: %v", teamKey, err) + return diag.Errorf("failed to get team %q: %s", teamKey, handleLdapiErr(err)) } members := make([]ldapi.Member, 0) @@ -199,7 +199,7 @@ func resourceTeamRead(ctx context.Context, d *schema.ResourceData, metaRaw inter } if err != nil { - return diag.Errorf("failed to get members for team %q: %v", teamKey, err) + return diag.Errorf("failed to get members for team %q: %s", teamKey, handleLdapiErr(err)) } members = append(members, memberResponse.Items...) From 3a6f10e3d7c23999d81b3dd5e53e2ad603355471 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 28 Sep 2022 11:05:26 -0700 Subject: [PATCH 065/128] [SC-170290] Add ignore_changes guide to Terraform docs This adds a guide on using `ignore_changes` to workaround certain use cases in the Terraform provider. --- website/docs/d/flag_trigger.html.markdown | 2 +- .../docs/g/use_ignore_changes.html.markdown | 65 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 website/docs/g/use_ignore_changes.html.markdown diff --git a/website/docs/d/flag_trigger.html.markdown b/website/docs/d/flag_trigger.html.markdown index e5822a6e..b0ae0432 100644 --- a/website/docs/d/flag_trigger.html.markdown +++ b/website/docs/d/flag_trigger.html.markdown @@ -2,7 +2,7 @@ layout: "launchdarkly" page_title: "LaunchDarkly: launchdarkly_flag_trigger" description: |- - Get information about LaunchDarkly flag trigers. + Get information about LaunchDarkly flag triggers. --- # launchdarkly_flag_trigger diff --git a/website/docs/g/use_ignore_changes.html.markdown b/website/docs/g/use_ignore_changes.html.markdown new file mode 100644 index 00000000..eca569d3 --- /dev/null +++ b/website/docs/g/use_ignore_changes.html.markdown @@ -0,0 +1,65 @@ +--- +layout: "launchdarkly" +page_title: "LaunchDarkly: Use ignore_changes to create resources with Terraform and update them in the UI" +description: |- + This guide covers +--- + +# Using `ignore_changes` + +This guide explains when and how to use [ignore_changes lifecycle metadata](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes) to avoid having Terraform try to update resources that were modified. + +## When to use `ignore_changes` + +### Use Terraform to create a resource in LaunchDarkly, and manage the resource through the UI + +For example, you might provision teams in LaunchDarkly using Terraform, then allow team members to add new members to the team in the UI without needing to udpate Terraform. This is a case where you simply want to *create* the team using Terraform, but then manage the team for the rest of it's lifecycle through the UI. In order to continue managing the team using Terraform you would need to manually update your manifest to reflect the current state of the team, and then apply. + +``` +data "launchdarkly_team_member" "spongebob" { + email = "spongebob@squarepants.net" +} + +resource "launchdarkly_team" "krusty_krab_staff" { + key = "krusty_krab_staff" + name = "Krusty Krab staff" + description = "Team serving Krabby patties" + members = [data.launchdarkly_team_member.spongebob.id] + + lifecycle { + ignore_changes = [member_ids] + } +} +``` + +### When a resource is modified as a side-effect of other actions in LaunchDarkly + +Sometimes resources in LaunchDarkly are modified as a side-effect of other actions in LaunchDarkly. For example, if you create an experiment using a flag, and then try to apply a Terraform manifest that manages that flag, it will fail. As a workaround for this you can use `ignore_changes` to tell Terraform to not try to update the modified resources. + +``` +resource "launchdarkly_feature_flag" "example" { + project_key = launchdarkly_project.example.key + key = "example-flag" + name = "Example flag" + description = "This demonstrates using ignore_changes" + + variation_type = "boolean" + variations { + value = "true" + name = "True" + } + variations { + value = "false" + name = "False" + } + + defaults { + on_variation = 1 + off_variation = 0 + } + + lifecycle { + ignore_changes = [all] + } +} +``` From 5f2984cbca29598be9c29b4a322cfb38bf658a50 Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Mon, 3 Oct 2022 15:00:16 -0700 Subject: [PATCH 066/128] Backmerge 2.9.3 release --- CHANGELOG.md | 11 +++++++++++ website/docs/index.html.markdown | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c02699..c78d9649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [2.9.3] (October 3, 2022) + +BUG FIXES: + +- Correctly set bucketBy to nil when explicitly set to an empty string to avoid API errors [#120](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/120) +- Print error message from API response for Teams resource + +NOTES: + +- Add `ignore_changes` guide + ## [2.9.2] (September 1, 2022) BUG FIXES: diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index c97f5b24..21caadd5 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -43,7 +43,7 @@ Please refer to [Terraform's documentation on upgrading to v0.13](https://www.te The provider supports the following arguments: -- `access_token` - (Optional) The [personal access token](https://docs.launchdarkly.com/api-access-tokens) or [service token](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens) used to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. +- `access_token` - (Optional) The [personal access token](https://docs.launchdarkly.com/home/account-security/api-access-tokens#personal-tokens) or [service token](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens) used to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. - `oauth_token` - (Optional) An OAuth V2 token you use to authenticate with LaunchDarkly. You can also set this with the `LAUNCHDARKLY_OAUTH_TOKEN` environment variable. You must provide either `access_token` or `oauth_token`. From 259ab9688a43cddfbc885f3a51a766d36c1fe00a Mon Sep 17 00:00:00 2001 From: Lucy Voigt Date: Wed, 26 Oct 2022 09:04:11 -0700 Subject: [PATCH 067/128] [SC-174121] Docs bug fixes This adds the `ignore_changes` guide to the sidebar so that it actually appears in the generated Terraform documentation, and adds the `Enterprise plan` note to the `account_members` resource. Also preps for 2.9.4 release to publish the docs. --- CHANGELOG.md | 7 +++++++ website/docs/r/team_member.html.markdown | 2 +- website/launchdarkly.erb | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c78d9649..1bbb881c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.9.4] (October 26, 2022) + +BUG FIXES: + +- Adds `ignore_changes` guide to the documentation sidebar +- Fixes broken link in `account_members` resource documentation + ## [2.9.3] (October 3, 2022) BUG FIXES: diff --git a/website/docs/r/team_member.html.markdown b/website/docs/r/team_member.html.markdown index 8ebf50df..fc9795be 100644 --- a/website/docs/r/team_member.html.markdown +++ b/website/docs/r/team_member.html.markdown @@ -11,7 +11,7 @@ Provides a LaunchDarkly team member resource. This resource allows you to create and manage team members within your LaunchDarkly organization. --> **Note:** You can only manage team members with "admin" level personal access tokens. To learn more, read [Managing Teams](https://docs.launchdarkly.com/docs/teams). +-> **Note:** You can only manage team members with "admin" level personal access tokens. To learn more, read [Managing Teams](https://docs.launchdarkly.com/docs/teams/managing). ## Example Usage diff --git a/website/launchdarkly.erb b/website/launchdarkly.erb index d4fd4de8..1b7e0260 100644 --- a/website/launchdarkly.erb +++ b/website/launchdarkly.erb @@ -8,6 +8,13 @@
  • LaunchDarkly Provider
  • +
  • + Guides +