diff --git a/go.mod b/go.mod index 7c6df5a9a37..e17bb4bd4d2 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,6 @@ require ( require ( cloud.google.com/go/kms v1.10.1 // indirect cloud.google.com/go/monitoring v1.13.0 // indirect - github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75 // indirect github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/PromonLogicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect @@ -95,7 +94,6 @@ require ( github.com/coreos/pkg v0.0.0-20220810130054-c7d1c02cb6cf // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect - github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/eapache/go-resiliency v1.4.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect @@ -128,7 +126,6 @@ require ( github.com/google/gnostic v0.6.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -169,7 +166,6 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kardianos/govendor v1.0.9 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 // indirect github.com/leodido/go-urn v1.4.0 // indirect @@ -181,8 +177,6 @@ require ( 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.0 // indirect - github.com/mitchellh/gox v1.0.1 // indirect - github.com/mitchellh/iochan v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/spdystream v0.2.0 // indirect @@ -223,9 +217,6 @@ require ( golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.23.0 // indirect - golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect - golang.org/x/tools/go/vcs v0.1.0-deprecated // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect diff --git a/go.sum b/go.sum index ca9a5692a7e..866243379e9 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,6 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75 h1:xGHheKK44eC6K0u5X+DZW/fRaR1LnDdqPHMZMWx5fv8= -github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75/go.mod h1:4/6eNcqZ09BZ9wLK3tZOjBA1nDj+B0728nlX5YRlSmQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -395,8 +393,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU= github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0= -github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 h1:3T8ZyTDp5QxTx3NU48JVb2u+75xc040fofcBaN+6jPA= -github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185/go.mod h1:cFRxtTwTOJkz2x3rQUNCYKWC93yP1VKjR8NUhqFxZNU= github.com/denisenkom/go-mssqldb v0.0.0-20190412130859-3b1d194e553a/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba h1:p6poVbjHDkKa+wtC8frBMwQtT3BmqGYBjzMwJ63tuR4= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= @@ -788,8 +784,6 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -959,7 +953,6 @@ github.com/hashicorp/go-uuid v1.0.2-0.20191001231223-f32f5fe8d6a8/go.mod h1:6SBZ github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 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.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -1152,8 +1145,6 @@ github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVY github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kardianos/govendor v1.0.9 h1:WOH3FcVI9eOgnIZYg96iwUwrL4eOVx+aQ66oyX2R8Yc= -github.com/kardianos/govendor v1.0.9/go.mod h1:yvmR6q9ZZ7nSF5Wvh40v0wfP+3TwwL8zYQp+itoZSVM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= @@ -1272,10 +1263,7 @@ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= -github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -2210,10 +2198,6 @@ golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58 golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= -golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= -golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= -golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4= -golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8= 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= diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_collection.go b/ibm/service/appconfiguration/data_source_ibm_app_config_collection.go index 57628558491..317d760f1c4 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_collection.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_collection.go @@ -4,6 +4,7 @@ package appconfiguration import ( "fmt" + "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go b/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go index 795d60c09f8..33b996ecb35 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go @@ -83,6 +83,11 @@ func DataSourceIBMAppConfigFeature() *schema.Resource { Computed: true, Description: "Rollout percentage of the feature.", }, + "format": { + Type: schema.TypeString, + Computed: true, + Description: "Format of the feature (TEXT, JSON, YAML) and it is a required attribute when `type` is `STRING`. It is not required for `BOOLEAN` and `NUMERIC` types. This property is populated in the response body of `POST, PUT and GET` calls if the type `STRING` is used and not populated for `BOOLEAN` and `NUMERIC` types.", + }, "segment_rules": { Type: schema.TypeList, Computed: true, @@ -216,6 +221,11 @@ func dataSourceIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("[ERROR] Error setting rollout_percentage: %s", err) } } + if result.Format != nil { + if err = d.Set("format", result.Format); err != nil { + return fmt.Errorf("[ERROR] Error setting format: %s", err) + } + } if result.SegmentExists != nil { if err = d.Set("segment_exists", result.SegmentExists); err != nil { return fmt.Errorf("[ERROR] Error setting segment_exists: %s", err) diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_features.go b/ibm/service/appconfiguration/data_source_ibm_app_config_features.go index ce64fe58516..c2894ae7358 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_features.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_features.go @@ -94,6 +94,11 @@ func DataSourceIBMAppConfigFeatures() *schema.Resource { Computed: true, Description: "Feature description.", }, + "format": { + Type: schema.TypeString, + Computed: true, + Description: "Format of the feature (TEXT, JSON, YAML) and it is a required attribute when `type` is `STRING`. It is not required for `BOOLEAN` and `NUMERIC` types. This property is populated in the response body of `POST, PUT and GET` calls if the type `STRING` is used and not populated for `BOOLEAN` and `NUMERIC` types.", + }, "type": { Type: schema.TypeString, Computed: true, @@ -430,6 +435,9 @@ func dataSourceFeaturesListFeaturesToMap(featuresItem appconfigurationv1.Feature if featuresItem.RolloutPercentage != nil { featuresMap["rollout_percentage"] = featuresItem.RolloutPercentage } + if featuresItem.Format != nil { + featuresMap["format"] = featuresItem.Format + } if featuresItem.SegmentRules != nil { segmentRulesList := []map[string]interface{}{} for _, segmentRulesItem := range featuresItem.SegmentRules { diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_features_test.go b/ibm/service/appconfiguration/data_source_ibm_app_config_features_test.go index a6dc607796e..f5ab7045aaf 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_features_test.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_features_test.go @@ -15,7 +15,8 @@ import ( func TestAccIbmAppConfigFeaturesDataSourceBasic(t *testing.T) { environmentID := "dev" - featureType := "BOOLEAN" + featureType := "STRING" + featureFormat := "TEXT" tags := "development feature" name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) featureID := fmt.Sprintf("tf_feature_id_%d", acctest.RandIntRange(10, 100)) @@ -27,7 +28,7 @@ func TestAccIbmAppConfigFeaturesDataSourceBasic(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckIbmAppConfigFeaturesDataSourceConfigBasic(instanceName, name, environmentID, featureID, featureType, description, tags), + Config: testAccCheckIbmAppConfigFeaturesDataSourceConfigBasic(instanceName, name, environmentID, featureID, featureType, featureFormat, description, tags), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_app_config_features.app_config_features_data2", "id"), resource.TestCheckResourceAttrSet("data.ibm_app_config_features.app_config_features_data2", "first.#"), @@ -44,7 +45,7 @@ func TestAccIbmAppConfigFeaturesDataSourceBasic(t *testing.T) { }) } -func testAccCheckIbmAppConfigFeaturesDataSourceConfigBasic(instanceName, name, environmentID, featureID, featureType, description, tags string) string { +func testAccCheckIbmAppConfigFeaturesDataSourceConfigBasic(instanceName, name, environmentID, featureID, featureType, featureFormat, description, tags string) string { return fmt.Sprintf(` resource "ibm_resource_instance" "app_config_terraform_test487" { name = "%s" @@ -59,6 +60,7 @@ func testAccCheckIbmAppConfigFeaturesDataSourceConfigBasic(instanceName, name, e environment_id = "%s" feature_id = "%s" type = "%s" + format="%s" enabled_value = true disabled_value = false description = "%s" @@ -71,5 +73,5 @@ func testAccCheckIbmAppConfigFeaturesDataSourceConfigBasic(instanceName, name, e guid = ibm_app_config_feature.app_config_feature_resource2.guid environment_id = ibm_app_config_feature.app_config_feature_resource2.environment_id } - `, instanceName, name, environmentID, featureID, featureType, description, tags) + `, instanceName, name, environmentID, featureID, featureType, featureFormat, description, tags) } diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_properties.go b/ibm/service/appconfiguration/data_source_ibm_app_config_properties.go index 093706504c7..3b6a4eede75 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_properties.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_properties.go @@ -107,6 +107,11 @@ func DataSourceIBMAppConfigProperties() *schema.Resource { Computed: true, Description: "Tags associated with the property.", }, + "format": { + Type: schema.TypeString, + Computed: true, + Description: "Format of the feature (TEXT, JSON, YAML) and it is a required attribute when `type` is `STRING`. It is not required for `BOOLEAN` and `NUMERIC` types. This property is populated in the response body of `POST, PUT and GET` calls if the type `STRING` is used and not populated for `BOOLEAN` and `NUMERIC` types.", + }, "segment_rules": { Type: schema.TypeList, Computed: true, @@ -372,6 +377,9 @@ func dataSourcePropertiesListPropertiesToMap(property appconfigurationv1.Propert if property.Href != nil { propertyMap["href"] = property.Href } + if property.Format != nil { + propertyMap["format"] = property.Format + } if property.Collections != nil { collectionsList := []map[string]interface{}{} for _, collectionsItem := range property.Collections { diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_property.go b/ibm/service/appconfiguration/data_source_ibm_app_config_property.go index a2e1d4e5deb..00a82d3f95d 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_property.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_property.go @@ -59,6 +59,11 @@ func DataSourceIBMAppConfigProperty() *schema.Resource { Computed: true, Description: "Tags associated with the property.", }, + "format": { + Type: schema.TypeString, + Computed: true, + Description: "Format of the feature (TEXT, JSON, YAML) and it is a required attribute when `type` is `STRING`. It is not required for `BOOLEAN` and `NUMERIC` types. This property is populated in the response body of `POST, PUT and GET` calls if the type `STRING` is used and not populated for `BOOLEAN` and `NUMERIC` types.", + }, "segment_rules": { Type: schema.TypeList, Computed: true, @@ -194,6 +199,11 @@ func dataSourceIbmAppConfigPropertyRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error setting tags: %s", err) } } + if property.Format != nil { + if err = d.Set("format", property.Format); err != nil { + return fmt.Errorf("error setting format: %s", err) + } + } if property.SegmentRules != nil { err = d.Set("segment_rules", dataSourcePropertyFlattenSegmentRules(property.SegmentRules)) if err != nil { diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_segment.go b/ibm/service/appconfiguration/data_source_ibm_app_config_segment.go index c27af01289c..4fec35d5b4d 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_segment.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_segment.go @@ -2,9 +2,10 @@ package appconfiguration import ( "fmt" + "log" + "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) func DataSourceIBMAppConfigSegment() *schema.Resource { diff --git a/ibm/service/appconfiguration/data_source_ibm_app_config_snapshot.go b/ibm/service/appconfiguration/data_source_ibm_app_config_snapshot.go index bd03ec48747..29af793b40f 100644 --- a/ibm/service/appconfiguration/data_source_ibm_app_config_snapshot.go +++ b/ibm/service/appconfiguration/data_source_ibm_app_config_snapshot.go @@ -2,6 +2,7 @@ package appconfiguration import ( "fmt" + "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/ibm/service/appconfiguration/resource_ibm_app_config_collection.go b/ibm/service/appconfiguration/resource_ibm_app_config_collection.go index 5f4e884486b..e80601edbc1 100644 --- a/ibm/service/appconfiguration/resource_ibm_app_config_collection.go +++ b/ibm/service/appconfiguration/resource_ibm_app_config_collection.go @@ -2,6 +2,7 @@ package appconfiguration import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/ibm/service/appconfiguration/resource_ibm_app_config_feature.go b/ibm/service/appconfiguration/resource_ibm_app_config_feature.go index 44ce667c1ca..67e93c1a190 100644 --- a/ibm/service/appconfiguration/resource_ibm_app_config_feature.go +++ b/ibm/service/appconfiguration/resource_ibm_app_config_feature.go @@ -76,6 +76,11 @@ func ResourceIBMIbmAppConfigFeature() *schema.Resource { Optional: true, Description: "Rollout percentage of the feature.", }, + "format": { + Type: schema.TypeString, + Optional: true, + Description: "Format of the feature (TEXT, JSON, YAML).", + }, "segment_rules": { Type: schema.TypeList, Optional: true, @@ -174,6 +179,9 @@ func resourceIbmIbmAppConfigFeatureCreate(d *schema.ResourceData, meta interface if _, ok := d.GetOk("rollout_percentage"); ok { options.SetRolloutPercentage(int64(d.Get("rollout_percentage").(int))) } + if _, ok := d.GetOk("format"); ok { + options.SetFormat(d.Get("format").(string)) + } if _, ok := d.GetOk("description"); ok { options.SetDescription(d.Get("description").(string)) } @@ -320,6 +328,11 @@ func resourceIbmIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("[ERROR] Error setting rollout_percentage: %s", err) } } + if result.Format != nil { + if err = d.Set("format", result.Format); err != nil { + return fmt.Errorf("[ERROR] Error setting format: %s", err) + } + } if result.Tags != nil { if err = d.Set("tags", result.Tags); err != nil { return fmt.Errorf("[ERROR] Error setting tags: %s", err) diff --git a/ibm/service/appconfiguration/resource_ibm_app_config_property.go b/ibm/service/appconfiguration/resource_ibm_app_config_property.go index b4487d24824..9b36cbbd198 100644 --- a/ibm/service/appconfiguration/resource_ibm_app_config_property.go +++ b/ibm/service/appconfiguration/resource_ibm_app_config_property.go @@ -5,10 +5,11 @@ package appconfiguration import ( "fmt" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/ibm/service/appconfiguration/resource_ibm_app_config_segment.go b/ibm/service/appconfiguration/resource_ibm_app_config_segment.go index ae3d356cc69..d0ddb44b027 100644 --- a/ibm/service/appconfiguration/resource_ibm_app_config_segment.go +++ b/ibm/service/appconfiguration/resource_ibm_app_config_segment.go @@ -2,11 +2,12 @@ package appconfiguration import ( "fmt" + "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) func ResourceIBMIbmAppConfigSegment() *schema.Resource { diff --git a/ibm/service/appconfiguration/resource_ibm_app_config_snapshot.go b/ibm/service/appconfiguration/resource_ibm_app_config_snapshot.go index d5447b2b8e1..13bb876a3b2 100644 --- a/ibm/service/appconfiguration/resource_ibm_app_config_snapshot.go +++ b/ibm/service/appconfiguration/resource_ibm_app_config_snapshot.go @@ -2,11 +2,13 @@ package appconfiguration import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func ResourceIBMIbmAppConfigSnapshot() *schema.Resource { diff --git a/website/docs/d/app_config_feature.html.markdown b/website/docs/d/app_config_feature.html.markdown index 7d266620bbd..f3b312dd573 100644 --- a/website/docs/d/app_config_feature.html.markdown +++ b/website/docs/d/app_config_feature.html.markdown @@ -38,6 +38,7 @@ In addition to all argument references list, you can access the following attrib - `name` - (String) Feature name. - `description` - (String) Feature description. - `type` - (String) Type of the feature (BOOLEAN, STRING, NUMERIC). +- `format` - Format of the property (TEXT, JSON, YAML) and this is a required attribute when TYPE STRING is used, not required for BOOLEAN and NUMERIC types. - `enabled_value` - (String) Value of the feature when it is enabled. The value can be Boolean, String or a Numeric value as per the `type` attribute. - `disabled_value` - (String) Value of the feature when it is disabled. The value can be Boolean, String or a Numeric value as per the `type` attribute. - `enabled` - (String) The state of the feature flag. diff --git a/website/docs/r/app_config_feature.html.markdown b/website/docs/r/app_config_feature.html.markdown index a01b5dae223..6d2dad1021a 100644 --- a/website/docs/r/app_config_feature.html.markdown +++ b/website/docs/r/app_config_feature.html.markdown @@ -18,6 +18,7 @@ resource "ibm_app_config_feature" "app_config_feature" { name = "name" type = "type" tags = "tags" + format="format" feature_id = "feature_id" enabled_value = "enabled_value" environment_id = "environment_id" @@ -33,6 +34,7 @@ Review the argument reference that you can specify for your resource. - `guid` - (Required, String) The GUID of the App Configuration service. Fetch GUID from the service instance credentials section of the dashboard. - `environment_id` - (Required, String) The environment ID. - `name` - (Required, String) The feature name. +- `format` - Format of the property (TEXT, JSON, YAML) and this is a required attribute when TYPE STRING is used, not required for BOOLEAN and NUMERIC types. - `feature_id` - (Required, String) The feature ID. - `type` - (Required, String) The feature type. Supported values are **BOOLEAN**, **STRING**, or **NUMERIC**. - `enabled_value` - (Required, String) The value of the feature when it is enabled. The value can be **BOOLEAN**, **STRING**, or **NUMERIC** value as per the `type` attribute.