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.4.0 release #77

Merged
merged 47 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7f0ed0f
pull from public
sloloris Aug 2, 2021
d3da275
Merge branch 'master' of github.com:launchdarkly/terraform-provider-l…
sloloris Aug 2, 2021
be20145
Update CHANGELOG.md
sloloris Aug 3, 2021
b3dc2ca
Imiller/ch117193/rename flag_fallthrough to fallthrough & user_target…
sloloris Aug 5, 2021
6922e79
Imiller/ch117375/GitHub issue empty string variation (#135)
sloloris Aug 16, 2021
ff8b35f
Merge branch 'master' of github.com:launchdarkly/terraform-provider-l…
Aug 25, 2021
b85f956
pull from public (#144)
Aug 25, 2021
61c544d
Fix duplicate text in CHANGELOG.md
Aug 25, 2021
84074c7
Fix duplicate text in CHANGELOG
Aug 26, 2021
361e8c2
V2 main (#128)
sloloris Aug 31, 2021
626fbef
Merge branch 'master' of github.com:launchdarkly/terraform-provider-l…
sloloris Aug 31, 2021
2762d14
Fix import of launchdarkly_project nested environments (#153)
ldhenry Sep 15, 2021
966aa6d
update doc (#154)
sloloris Sep 20, 2021
a866315
fix merge conflict in changelog
sloloris Sep 20, 2021
fe9668d
Imiller/sc 119920/add boolean archive attribute to launchdarkly (#155)
sloloris Sep 27, 2021
a298a44
Update index of docs with recommended version (#156)
ldhenry Sep 30, 2021
358b532
Imiller/sc 123568/add approval settings to environment resource (#157)
sloloris Oct 8, 2021
faeb9dd
merge changelog
sloloris Oct 8, 2021
5ee5b57
Imiller/sc 126337/make can apply declined changes default to (#158)
sloloris Oct 11, 2021
2a6511e
fix merge conflict
sloloris Oct 11, 2021
9b2a288
clarify rollout weights (#159)
sloloris Oct 29, 2021
aabe026
Upgrade Terraform provider to use api-client-go 7 (#160)
sloloris Dec 23, 2021
5bf6965
prepare 2.2.0 release (#75) (#162)
monsagri Dec 23, 2021
4276c30
[SC-135367] Project resource should support default flag SDK values (…
monsagri Dec 31, 2021
b6bf635
Fix nil pointer dereference when reading empty approval settings (#169)
ldhenry Jan 5, 2022
0fab9f1
Backmerge v2.3.0 (#170)
ldhenry Jan 5, 2022
b21eb91
Imiller/sc 136707/streamline tests to use key constants where (#172)
sloloris Jan 6, 2022
9cb5f1a
Added validation to project key length
ctawiah Jan 7, 2022
55b89d8
Merge pull request #173 from launchdarkly/ctawiah/sc-135795/proj-key-…
ctawiah Jan 7, 2022
9096697
Added rate limit and conflict retry logic to LD client (#171)
ctawiah Jan 10, 2022
bd2580c
Add golangci-lint pre-commit hook and run hooks in CI (#175)
ldhenry Jan 10, 2022
31bb4e9
Ffeldberg/sc 136452/use the context aware version of all crud (#174)
monsagri Jan 10, 2022
57f0c0f
add integration resource (#164)
sloloris Jan 12, 2022
e2ba14b
Add relay proxy config resource (#168)
ldhenry Jan 12, 2022
7175e48
[sc 137274] add team members data source (#177)
monsagri Jan 12, 2022
76f05f2
add flag triggers resource and data source (#163)
sloloris Jan 12, 2022
be4037d
typo
sloloris Jan 12, 2022
7ab7f6f
[sc 136319] add launchdarkly metric (#167)
monsagri Jan 12, 2022
2ab32b1
[sc 137802] emails need to be url escaped when querying (#178)
monsagri Jan 14, 2022
2f88a68
Ffeldberg/sc 136454/use configurecontextfunc instead of configurefunc…
monsagri Jan 17, 2022
1b1ea7e
Imiller/sc 137617/tf doc improvements (#180)
sloloris Jan 18, 2022
944a723
Ffeldberg/sc 137794/escalation terraform provider throws error (#179)
monsagri Jan 19, 2022
4c8434b
Clean up policy statements helper functions (#182)
ldhenry Jan 19, 2022
50d74b9
Add relay proxy config data source (#183)
ldhenry Jan 19, 2022
7135b15
Remove unnecessary attributes from metric data source test config (#…
ldhenry Jan 19, 2022
9ab50f2
prepare release
sloloris Jan 19, 2022
aeee339
merge master
sloloris Jan 19, 2022
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
37 changes: 31 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ version: 2.1

orbs:
go: circleci/[email protected]
linter: talkiq/[email protected]

jobs:
build:
test:
executor:
name: go/default
tag: "1.16"
tag: &go_version "1.16.10"

steps:
- checkout
- go/mod-download-cached
- run:
name: go vet
command: make vet
- run:
name: Run unit tests
command: TESTARGS="-v" make test
Expand All @@ -25,6 +23,9 @@ jobs:
- run:
name: Test Access Token Resource
command: TESTARGS="-run TestAccAccessToken" make testacc
- run:
name: Test Audit Log Subscription Resource
command: TESTARGS="-run TestAccAuditLogSubscription" make testacc
- run:
name: Test Custom Role Resource
command: TESTARGS="-run TestAccCustomRole" make testacc
Expand All @@ -40,9 +41,18 @@ jobs:
- run:
name: Test Feature Flag Environment Resource
command: TESTARGS="-run TestAccFeatureFlagEnvironment" make testacc
- run:
name: Test Flag Trigger Resource
command: TESTARGS="-run TestAccFlagTrigger" make testacc
- run:
name: Test Metric Resource
command: TESTARGS="-run TestAccMetric" make testacc
- run:
name: Test Project Resource
command: TESTARGS="-run TestAccProject" make testacc
- run:
name: Test Relay Proxy Configuration Resource
command: TESTARGS="-run TestAccRelayProxy" make testacc
- run:
name: Test Segment Resource
command: TESTARGS="-run TestAccSegment" make testacc
Expand All @@ -57,7 +67,22 @@ jobs:
name: Test Webhook Resource
command: TESTARGS="-run TestAccWebhook" make testacc

lint:
executor:
name: go/default
tag: *go_version

steps:
- checkout
- run:
name: Install python
command: |
sudo apt update
sudo apt install python3-pip python-is-python3
- linter/pre-commit

workflows:
main:
jobs:
- build
- test
- lint
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.16.10
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
minimum_pre_commit_version: "2.9.3"

repos:
- repo: https://github.com/ashanbrown/gofmts
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
pass_filenames: false
language: python
additional_dependencies: ['requests']
verbose: true

30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## [2.4.0] (January 19, 2022)

FEATURES:

- Added a `launchdarkly_team_members` data source to allow using multiple team members in one data source.

- Added a new `launchdarkly_metric` resource and data source for managing LaunchDarkly experiment flag metrics.

- Added a new `launchdarkly_flag_triggers` resource and data source for managing LaunchDarkly flag triggers.

- Added a new `launchdarkly_relay_proxy_configuration` resource and data source for managing configurations for the Relay Proxy's [automatic configuration](https://docs.launchdarkly.com/home/relay-proxy/automatic-configuration#writing-an-inline-policy) feature.

- Added a new `launchdarkly_audit_log_subscription` resource and data source for managing LaunchDarkly audit log integration subscriptions.

ENHANCEMENTS:

- Updated tests to use the constant attribute keys defined in launchdarkly/keys.go.

- Added a pre-commit file with a hook to alphabetize launchdarkly/keys.go

- Improved 409 and 429 retry handling.

## [2.3.0] (January 4, 2022)

FEATURES:
Expand Down Expand Up @@ -29,6 +51,14 @@ NOTES:

- The `launchdarkly_feature_flag` resource's argument `include_in_snippet` has been deprecated in favor of `client_side_availability`. Please update your config to use `client_side_availability` in order to maintain compatibility with future versions.

ENHANCEMENTS:

- Upgraded the LaunchDarkly API client to version 7.

=======

> > > > > > > 8c7d0fc67b7d6038363a5a9c20ff8a5ef0f364df

## [2.1.1] (October 11, 2021)

BUG FIXES:
Expand Down
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ vet:
fi

fmt:
go install github.com/ashanbrown/gofmts/cmd/[email protected]
gofmts -w $(GOFMT_FILES)
gofmt -w $(GOFMT_FILES)

fmtcheck:
Expand Down
2 changes: 2 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ $ mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terrafor
$ git clone [email protected]: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.

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

```sh
Expand Down
23 changes: 23 additions & 0 deletions examples/v2/audit_log_subscription/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions examples/v2/audit_log_subscription/example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
terraform {
required_providers {
launchdarkly = {
source = "launchdarkly/launchdarkly"
version = "~> 2.0"
}
}
required_version = ">= 0.13"
}

resource "launchdarkly_audit_log_subscription" "datadog_example" {
integration_key = "datadog"
name = "Example Terraform Subscription"
config = {
api_key = "thisisasecretkey"
host_url = "https://api.datadoghq.com"
}
on = false
tags = ["terraform-managed"]
statements {
actions = ["*"]
effect = "deny"
resources = ["proj/*:env/*:flag/*"]
}
}

resource "launchdarkly_audit_log_subscription" "dynatrace_example" {
integration_key = "dynatrace"
name = "Example Terraform Subscription"
config = {
api_token = "verysecrettoken"
url = "https://launchdarkly.appdynamics.com"
entity = "APPLICATION_METHOD"
}
tags = ["terraform-managed"]
on = true
statements {
actions = ["*"]
effect = "deny"
resources = ["proj/*:env/test:flag/*"]
}
}

resource "launchdarkly_audit_log_subscription" "splunk_example" {
integration_key = "splunk"
name = "Example Terraform Subscription"
config = {
base_url = "https://launchdarkly.splunk.com"
token = "averysecrettoken"
skip_ca_verification = true
}
tags = ["terraform-managed"]
on = true
statements {
actions = ["*"]
effect = "allow"
resources = ["proj/*:env/production:flag/*"]
}
}

39 changes: 39 additions & 0 deletions examples/v2/flag_trigger/example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
terraform {
required_providers {
launchdarkly = {
source = "launchdarkly/launchdarkly"
version = "~> 2.0"
}
}
required_version = ">= 0.13"
}

resource "launchdarkly_project" "trigger_test" {
key = "trigger-test"
name = "A Trigger Test Project"
# configure a production environment
environments {
name = "Terraform Production Environment"
key = "production"
color = "581845"
}
}

resource "launchdarkly_feature_flag" "trigger_test_flag" {
project_key = launchdarkly_project.trigger_test.key
key = "trigger-test-flag"
name = "Trigger Test Flag"

variation_type = "boolean"
}

resource "launchdarkly_flag_trigger" "test_trigger" {
project_key = launchdarkly_project.trigger_test.key
env_key = launchdarkly_project.trigger_test.environments.0.key
flag_key = launchdarkly_feature_flag.trigger_test_flag.key
integration_key = "generic-trigger"
instructions {
kind = "turnFlagOff"
}
enabled = false
}
72 changes: 72 additions & 0 deletions examples/v2/metric/example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
resource "launchdarkly_project" "example" {
key = "example-project"
name = "metrics example project"
environments {
name = "example environment"
key = "example-env"
color = "010101"
}
}

resource "launchdarkly_metric" "pageview_example" {
project_key = launchdarkly_project.example.key
key = "pageview-metric"
name = "Pageview Metric"
description = "example pageview metric"
kind = "pageview"
is_active = false
tags = [
"example",
]
urls {
kind = "substring"
substring = "foo"
}
urls {
kind = "regex"
pattern = "`foo`gm"
}
}

resource "launchdarkly_metric" "click_example" {
project_key = launchdarkly_project.example.key
key = "click-metric"
name = "click Metric"
description = "example click metric"
kind = "click"
selector = ".foo"
tags = [
"example",
]
urls {
kind = "exact"
url = "https://example.com/example/"
}
}

resource "launchdarkly_metric" "custom_example" {
project_key = launchdarkly_project.example.key
key = "custom-metric"
name = "custom Metric"
description = "example custom metric"
kind = "custom"
event_key = "foo"
tags = [
"example",
]
}

resource "launchdarkly_metric" "numeric_example" {
project_key = launchdarkly_project.example.key
key = "numeric-metric"
name = "numeric Metric"
description = "example numeric metric"
kind = "custom"
is_numeric = true
unit = "bar"
success_criteria = "HigherThanBaseline"
event_key = "foo"
tags = [
"example",
]
}
9 changes: 9 additions & 0 deletions examples/v2/metric/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_providers {
launchdarkly = {
source = "launchdarkly/launchdarkly"
version = "~> 2.0.0"
}
}
required_version = ">= 0.13"
}
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ require (
github.com/agext/levenshtein v1.2.3 // indirect
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/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/launchdarkly/api-client-go/v7 v7.0.0
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
Expand Down
Loading