generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FFM-9085: Add a terraform resource to create a new target (#660)
* FFM-9085: Add a terraform resource to create a new target * Implement CRUD actions for creating a new target in terraform * Add all the interfaces and implementations * Add unit test * Fix package path * Add build script * Fix code base * Add release target * Include documentation and examples * Update 670.txt * Update resource.tf * add code review comments * fix platform_slo * add documentation for feature-flag-target * add nextGen to featureFlag * Update platform_feature_flag_target.md --------- Co-authored-by: Meet Rathod <rathod.meetsatish@harness.io>
- Loading branch information
1 parent
57e42e1
commit 28ba6a7
Showing
9 changed files
with
499 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
resource_feature_flag_target - Added feature flag target resources to the Harness Terraform Provider. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_platform_feature_flag_target Resource - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Resource for managing Feature Flag Targets. | ||
--- | ||
|
||
# harness_platform_feature_flag_target (Resource) | ||
|
||
Resource for managing Feature Flag Targets. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "harness_platform_feature_flag_target" "target" { | ||
org_id = "test" | ||
project_id = "test" | ||
identifier = "MY_FEATURE" | ||
environment = "MY_ENVIRONMENT" | ||
name = "MY_FEATURE" | ||
account_id = "MY_ACCOUNT_ID" | ||
attributes = { "foo" : "bar" } | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `account_id` (String) Account Identifier | ||
- `environment` (String) Environment Identifier | ||
- `identifier` (String) Identifier of the Feature Flag Target | ||
- `name` (String) Target Name | ||
- `org_id` (String) Organization Identifier | ||
- `project_id` (String) Project Identifier | ||
|
||
### Optional | ||
|
||
- `attributes` (Map of String) Attributes | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
50 changes: 25 additions & 25 deletions
50
examples/resources/harness_platform_feature_flag/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
// Boolean Flag | ||
resource "harness_platform_feature_flag" "mybooleanflag" { | ||
org_id = "test" | ||
org_id = "test" | ||
project_id = "testff" | ||
|
||
kind = "boolean" | ||
name = "MY_FEATURE" | ||
kind = "boolean" | ||
name = "MY_FEATURE" | ||
identifier = "MY_FEATURE" | ||
permanent = false | ||
permanent = false | ||
|
||
default_on_variation = "Enabled" | ||
default_on_variation = "Enabled" | ||
default_off_variation = "Disabled" | ||
|
||
variation { | ||
identifier = "Enabled" | ||
name = "Enabled" | ||
identifier = "Enabled" | ||
name = "Enabled" | ||
description = "The feature is enabled" | ||
value = "true" | ||
value = "true" | ||
} | ||
|
||
variation { | ||
identifier = "Disabled" | ||
name = "Disabled" | ||
identifier = "Disabled" | ||
name = "Disabled" | ||
description = "The feature is disabled" | ||
value = "false" | ||
value = "false" | ||
} | ||
} | ||
|
||
|
||
// Multivariate flag | ||
resource "harness_platform_feature_flag" "mymultivariateflag" { | ||
org_id = "test" | ||
org_id = "test" | ||
project_id = "testff" | ||
|
||
kind = "int" | ||
name = "FREE_TRIAL_DURATION" | ||
kind = "int" | ||
name = "FREE_TRIAL_DURATION" | ||
identifier = "FREE_TRIAL_DURATION" | ||
permanent = false | ||
permanent = false | ||
|
||
default_on_variation = "trial7" | ||
default_on_variation = "trial7" | ||
default_off_variation = "trial20" | ||
|
||
variation { | ||
identifier = "trial7" | ||
name = "7 days trial" | ||
identifier = "trial7" | ||
name = "7 days trial" | ||
description = "Free trial period 7 days" | ||
value = "7" | ||
value = "7" | ||
} | ||
|
||
variation { | ||
identifier = "trial14" | ||
name = "14 days trial" | ||
identifier = "trial14" | ||
name = "14 days trial" | ||
description = "Free trial period 14 days" | ||
value = "14" | ||
value = "14" | ||
} | ||
|
||
variation { | ||
identifier = "trial20" | ||
name = "20 days trial" | ||
identifier = "trial20" | ||
name = "20 days trial" | ||
description = "Free trial period 20 days" | ||
value = "20" | ||
value = "20" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
examples/resources/harness_platform_feature_flag_target/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resource "harness_platform_feature_flag_target" "target" { | ||
org_id = "test" | ||
project_id = "test" | ||
|
||
identifier = "MY_FEATURE" | ||
environment = "MY_ENVIRONMENT" | ||
name = "MY_FEATURE" | ||
account_id = "MY_ACCOUNT_ID" | ||
attributes = { "foo" : "bar" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
resource "harness_platform_ff_api_key" "testserverapikey" { | ||
identifier = "testserver" | ||
name = "TestServer" | ||
description = "this is a server SDK key" | ||
org_id = "test" | ||
project_id = "testff" | ||
env_id = "testenv" | ||
expired_at = 1713729225 | ||
type = "Server" | ||
identifier = "testserver" | ||
name = "TestServer" | ||
description = "this is a server SDK key" | ||
org_id = "test" | ||
project_id = "testff" | ||
env_id = "testenv" | ||
expired_at = 1713729225 | ||
type = "Server" | ||
} | ||
|
||
output "serversdkkey" { | ||
value = harness_platform_ff_api_key.testserverapikey.api_key | ||
value = harness_platform_ff_api_key.testserverapikey.api_key | ||
sensitive = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.