Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 2.10.0 release #135

Merged
merged 123 commits into from
Feb 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
8fd56bd
prepare release (#80) (#188)
sloloris Jan 20, 2022
aea6005
Do not allow 0% segment rule weights (#189)
ldhenry Jan 21, 2022
f1e972c
Fix flag trigger creation panic (#190)
ldhenry Jan 21, 2022
09a6fa3
Backmerge/release 2.4.1 (#191)
ldhenry Jan 21, 2022
e493b76
Add Slack webhooks to audit_log_subscription (#192)
ldhenry Feb 7, 2022
2512cf3
backmerge v2.5.0 (#193)
ldhenry Feb 8, 2022
f4332bc
Use jennifer to generate audit log subscription configs (#194)
ldhenry Feb 8, 2022
de0fe41
Run terraform provider acceptance tests daily and notify of failures …
ldhenry Feb 8, 2022
9a38dde
Update changelog branch (#195)
ldhenry Feb 9, 2022
d285706
[ sc-143291] update autogenerated audit_log_subscription configs (#197)
monsagri Mar 14, 2022
42d99ac
Increase checkpoint-api.harhicorp.com timeout to 10s (#198)
ldhenry Mar 17, 2022
04b73ff
Updated destination tests to use random env keys to avoid env conflic…
ctawiah Apr 6, 2022
b6bc3f2
Merge pull request #199 from launchdarkly/ctawiah/sc-148136/randomize…
ctawiah Apr 6, 2022
e722f06
[sc 148065] add approvals bypass to terraform docs (#200)
monsagri Apr 7, 2022
b88452a
Backmerge/release 2.6.0 (#201)
monsagri Apr 7, 2022
ae41bdb
fix doc issues (#202)
sloloris Apr 14, 2022
a402d11
[sc-149869] roll back documentation changes regarding (#203)
monsagri Apr 14, 2022
66d55a1
backmerge 2.6.1 (#204)
monsagri Apr 14, 2022
494df8f
Imiller/sc 151834/add base permissions to custom role resource (#205)
sloloris May 4, 2022
38d70bc
Backmerge/release 2.7.0 (#206)
sloloris May 5, 2022
6559f71
(bug-fix) Update modules to accept new API header
May 11, 2022
4795ea3
Merge pull request #207 from launchdarkly/fix-ci
lucywyman May 13, 2022
626aaae
Update circleci test timeout to 15 seconds
May 19, 2022
2c88570
Merge pull request #208 from launchdarkly/sunny/sc-153482/increase-ti…
lucywyman May 20, 2022
9084524
Regenerate auditlog configs to resolve CI failures (#211)
ldhenry Jun 30, 2022
54dbc29
Run make generate to supress CI failures (#212)
ldhenry Jul 11, 2022
b9a3419
added a check for environment and warning
Jul 12, 2022
c073a3b
fix go lint error
Jul 12, 2022
822f9d8
Merge branch 'main' into sunny/sc-158595/leftover-resources-cannot-be…
Jul 12, 2022
2ba884b
use environmentExists function
Jul 12, 2022
dd21dac
remove grafana
Jul 13, 2022
66c862c
fix: [sc-158595] leftover resources cannot be cleared out after launc…
Jul 13, 2022
88840f0
Update changelog with bug fix for datasource feature flag environment
Jul 13, 2022
33a1f9f
Merge pull request #215 from launchdarkly/sunny/update-changelog-data…
lucywyman Jul 14, 2022
7b218fe
added changes
Jul 26, 2022
c1a3b89
Merge pull request #216 from launchdarkly/backmerge/release-2.7.1
Jul 26, 2022
70c9c34
upgrade go version 1.18.1 (#217)
sloloris Jul 27, 2022
8bee33e
Backmerge public/release v2.7.1 3 (#219)
ldhenry Jul 27, 2022
402b508
Remove invalid integration configurations (#221)
ldhenry Jul 28, 2022
db398b8
Add blacklist to manifest codegen and remove Zapier. (#222)
ldhenry Jul 28, 2022
b9e966d
Backmerge release 2.7.2 (#223)
ldhenry Jul 28, 2022
e7d7f77
Update Go api client to 10.0.1
Jun 28, 2022
6a6345e
Fix up v10 migration PR
Jul 28, 2022
11e3b82
Merge pull request #225 from launchdarkly/migrate-terraform-to-v10
lucywyman Jul 28, 2022
e9c8d43
[SC-160359] Create Teams resource and datasource
Jun 28, 2022
1d1e3d3
Fix up documentation
Aug 3, 2022
70e838e
Make lists unsorted to avoid unnecessary change detection
Aug 3, 2022
8fb4544
Update website/docs/d/team.html.markdown
lucywyman Aug 3, 2022
a97b4ae
Make lists unsorted to avoid unnecessary change detection
Aug 3, 2022
1cd0737
Merge pull request #224 from launchdarkly/dominickagnello/sc-160359/u…
lucywyman Aug 4, 2022
da5dacd
prepare 2.6.0 release (#91)
monsagri Apr 7, 2022
43ee03b
prepare 2.6.1 release (#94)
monsagri Apr 14, 2022
519707a
Prepare 2.7.1 release (#103)
Jul 25, 2022
1d371d9
Prepare release 2.7.1 2 (#104)
sloloris Jul 27, 2022
6276ea6
fix merge issue in Circle config (#105)
ldhenry Jul 27, 2022
76f1bcf
Release 2.7.2 (#106)
ldhenry Jul 28, 2022
416ec8b
prepare 2.8.0 release
Aug 4, 2022
8569589
Merge pull request #227 from launchdarkly/backmerge/release-2.8.0
lucywyman Aug 4, 2022
f21dd2c
[SC-163244] Add no-access role for team member resource
Aug 5, 2022
aded53f
Merge pull request #228 from launchdarkly/lucyvoigt/sc-163244/add-no-…
lucywyman Aug 5, 2022
f8caaea
Backmerge 2.9.0 release
Aug 5, 2022
72236a5
[sc-147722] add codeowners file (#230)
monsagri Aug 9, 2022
fd4a7de
Merge pull request #229 from launchdarkly/backmerge/release-2.9.0
lucywyman Aug 10, 2022
c60959a
Dominickagnello/sc 163883/open a pr against the terraform provider (#…
Blugil Aug 10, 2022
8ceb94b
add conditional so that new action only runs in private repo
Aug 10, 2022
229b5b9
Remove example.com email addresses from acceptance tests (#234)
ldhenry Aug 10, 2022
d459813
Retry failed acceptance tests once
Aug 10, 2022
e23033f
Merge pull request #235 from launchdarkly/retry-failed-tests-once
lucywyman Aug 10, 2022
124c1da
Merge pull request #233 from launchdarkly/dominickagnello/sc-163883/o…
lucywyman Aug 11, 2022
362669f
[SC-163262] Suppress diff when value_type doesn't change
Aug 5, 2022
c1ff182
Update launchdarkly/clause_helper.go
lucywyman Aug 23, 2022
a83f848
Merge pull request #236 from launchdarkly/lucyvoigt/sc-163262/don-t-s…
lucywyman Aug 24, 2022
e7affce
[bot] Regenerate integration configs (#237)
github-actions[bot] Aug 24, 2022
b8c9085
Update feature_flag_environmewnt to only create patch statements when…
ldhenry Aug 24, 2022
07e3cc0
merge public/main (#239)
ldhenry Aug 24, 2022
8311a3a
Imiller/sc 166499/defaults for boolean flags do not apply to existing…
sloloris Sep 1, 2022
9e135b6
Backmerge public (#241)
ldhenry Sep 1, 2022
c65030c
Imiller/sc 168660/terraform issue importing project with environments…
sloloris Sep 13, 2022
628672e
[SC-169876] Correctly set bucketBy to nil when empty
Sep 20, 2022
a438dfa
[SC-168865] Print error message with API errors
Sep 13, 2022
c7c9269
Merge pull request #242 from launchdarkly/lucyvoigt/sc-168865/hi-team…
lucywyman Sep 26, 2022
3dcf1bc
Merge pull request #244 from launchdarkly/lucyvoigt/sc-169876/launchd…
lucywyman Sep 26, 2022
3a6f10e
[SC-170290] Add ignore_changes guide to Terraform docs
Sep 28, 2022
8134e76
Merge pull request #245 from launchdarkly/lucyvoigt/sc-170290/update-…
lucywyman Sep 30, 2022
5f2984c
Backmerge 2.9.3 release
Oct 3, 2022
384cfb9
Merge pull request #246 from launchdarkly/backmerge/release-2.9.3
lucywyman Oct 3, 2022
259ab96
[SC-174121] Docs bug fixes
Oct 26, 2022
f8d6a58
Merge pull request #247 from launchdarkly/lucyvoigt/sc-174121/fix-gui…
lucywyman Oct 26, 2022
fae2eba
Imiller/sc 162868/update documentation on using feature flag env sett…
sloloris Oct 31, 2022
94298b1
update links to docs.launchdarkly
mmrj Jan 9, 2023
0940048
Apply some additional copy suggestions from code review
mmrj Jan 9, 2023
b88eb72
add changelog entry
mmrj Jan 10, 2023
5eb15a1
Update CHANGELOG.md
sloloris Jan 10, 2023
7342d64
Merge pull request #251 from launchdarkly/mollyjones2723/sc-182866/in…
mmrj Jan 10, 2023
dfafc3b
should not be able to set targets with empty values (#252)
sloloris Jan 10, 2023
15ee255
fix test (#255)
sloloris Jan 10, 2023
33de477
fix retry command (#254)
sloloris Jan 10, 2023
3d214ef
Update generated audit log config (#267)
sloloris Jan 27, 2023
76a985f
merge main from public?
sloloris Jan 27, 2023
f792697
backmerge (#268)
sloloris Jan 30, 2023
a2b4c4a
[bot] Regenerate integration configs (#269)
github-actions[bot] Feb 1, 2023
2289644
Add optional targeting rule descriptions (#270)
ldhenry Feb 1, 2023
f240372
[bot] Regenerate integration configs
Blugil Feb 8, 2023
143d6d0
Merge pull request #272 from launchdarkly/regenerate-integration-conf…
lucywyman Feb 9, 2023
0d4a2e5
[bot] Regenerate integration configs
Blugil Feb 9, 2023
f6b2ccd
Merge pull request #273 from launchdarkly/regenerate-integration-conf…
lucywyman Feb 9, 2023
8d57914
add ldrelease metadata (#275)
monsagri Feb 16, 2023
4fd103c
[sc 189042] update project releaser config (#276)
monsagri Feb 21, 2023
30edd7c
Releasing version 2.9.6
Feb 21, 2023
98b5c1a
[sc 189042] update project releaser config permissions (#277)
monsagri Feb 21, 2023
a9cee2a
Releasing version 2.9.6
Feb 21, 2023
562f945
[sc 189042] update project releaser artifacts (#278)
monsagri Feb 21, 2023
81b0692
Releasing version 2.9.6
Feb 21, 2023
8233722
add update-version back in (#279)
monsagri Feb 21, 2023
7f383af
Releasing version 2.9.7
Feb 21, 2023
db1bbff
fix changelog (#280)
monsagri Feb 21, 2023
e3061c6
Releasing version 2.9.7
Feb 21, 2023
66c0c5b
(maint) Document 'archived' attribute of feature_flag
Feb 21, 2023
a834b44
[sc 189042] automate terraform provider releases 2 (#282)
monsagri Feb 22, 2023
23dcf51
Merge pull request #281 from launchdarkly/add-archive-docs
lucywyman Feb 22, 2023
0d0a853
Imiller/sc 189789/investigate workarounds for default CSA issue (#283)
sloloris Feb 27, 2023
f567041
Remove tests (#284)
sloloris Feb 27, 2023
e29e95b
Merge branch 'main' into release-2.10.0
sloloris Feb 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Slack webhooks to audit_log_subscription (#192)
  • Loading branch information
ldhenry authored Feb 7, 2022
commit e493b76890085a40dd4e2eaa4c115ab5b3a55495
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
28 changes: 28 additions & 0 deletions launchdarkly/audit_log_subscription_configs.go
Original file line number Diff line number Diff line change
@@ -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
}
15 changes: 7 additions & 8 deletions launchdarkly/audit_log_subscription_helper.go
Original file line number Diff line number Diff line change
@@ -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)
}
Original file line number Diff line number Diff line change
@@ -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"),
),
},
},
})
}
37 changes: 37 additions & 0 deletions launchdarkly/resource_launchdarkly_audit_log_subscription_test.go
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion website/docs/d/audit_log_subscription.html.markdown
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion website/docs/r/audit_log_subscription.html.markdown
Original file line number Diff line number Diff line change
@@ -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.