Skip to content

Commit a2f76f1

Browse files
feat: projects - support auto deploy mode (IBM-Cloud#6492)
* support auto deploy mode * set the default for auto_deploy_mode
1 parent 31d1d19 commit a2f76f1

14 files changed

+147
-82
lines changed

.secrets.baseline

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.mod|go.sum|.*.map|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-09-19T09:28:12Z",
6+
"generated_at": "2025-10-02T08:57:25Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -622,7 +622,7 @@
622622
"hashed_secret": "4fe2c50d3e572f60977cb06e8995a5d7c368758d",
623623
"is_secret": false,
624624
"is_verified": false,
625-
"line_number": 282,
625+
"line_number": 287,
626626
"type": "Hex High Entropy String",
627627
"verified_result": null
628628
}
@@ -642,7 +642,7 @@
642642
"hashed_secret": "06d988e96c3d9325c9fbc7c0ef3c6c0f2b4eb8e7",
643643
"is_secret": false,
644644
"is_verified": false,
645-
"line_number": 43,
645+
"line_number": 44,
646646
"type": "Secret Keyword",
647647
"verified_result": null
648648
}
@@ -842,31 +842,31 @@
842842
"hashed_secret": "731438016c5ab94431f61820f35e3ae5f8ad6004",
843843
"is_secret": false,
844844
"is_verified": false,
845-
"line_number": 545,
845+
"line_number": 548,
846846
"type": "Secret Keyword",
847847
"verified_result": null
848848
},
849849
{
850850
"hashed_secret": "12da2e35d6b50c902c014f1ab9e3032650368df7",
851851
"is_secret": false,
852852
"is_verified": false,
853-
"line_number": 551,
853+
"line_number": 554,
854854
"type": "Secret Keyword",
855855
"verified_result": null
856856
},
857857
{
858858
"hashed_secret": "165722fe6dd0ec0afbeefb51c8258a177497956b",
859859
"is_secret": false,
860860
"is_verified": false,
861-
"line_number": 843,
861+
"line_number": 846,
862862
"type": "Hex High Entropy String",
863863
"verified_result": null
864864
},
865865
{
866866
"hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6",
867867
"is_secret": false,
868868
"is_verified": false,
869-
"line_number": 1509,
869+
"line_number": 1529,
870870
"type": "Base64 High Entropy String",
871871
"verified_result": null
872872
}
@@ -876,47 +876,47 @@
876876
"hashed_secret": "9184b0c38101bf24d78b2bb0d044deb1d33696fc",
877877
"is_secret": false,
878878
"is_verified": false,
879-
"line_number": 146,
879+
"line_number": 148,
880880
"type": "Secret Keyword",
881881
"verified_result": null
882882
},
883883
{
884884
"hashed_secret": "c427f185ddcb2440be9b77c8e45f1cd487a2e790",
885885
"is_secret": false,
886886
"is_verified": false,
887-
"line_number": 1594,
887+
"line_number": 1562,
888888
"type": "Base64 High Entropy String",
889889
"verified_result": null
890890
},
891891
{
892-
"hashed_secret": "1f7e33de15e22de9d2eaf502df284ed25ca40018",
892+
"hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670",
893893
"is_secret": false,
894894
"is_verified": false,
895-
"line_number": 1669,
895+
"line_number": 3766,
896896
"type": "Secret Keyword",
897897
"verified_result": null
898898
},
899899
{
900-
"hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670",
900+
"hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6",
901901
"is_secret": false,
902902
"is_verified": false,
903-
"line_number": 3782,
903+
"line_number": 3779,
904904
"type": "Secret Keyword",
905905
"verified_result": null
906906
},
907907
{
908-
"hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6",
908+
"hashed_secret": "1f7e33de15e22de9d2eaf502df284ed25ca40018",
909909
"is_secret": false,
910910
"is_verified": false,
911-
"line_number": 3795,
911+
"line_number": 3826,
912912
"type": "Secret Keyword",
913913
"verified_result": null
914914
},
915915
{
916916
"hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1",
917917
"is_secret": false,
918918
"is_verified": false,
919-
"line_number": 3837,
919+
"line_number": 3846,
920920
"type": "Secret Keyword",
921921
"verified_result": null
922922
}
@@ -954,15 +954,15 @@
954954
"hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9",
955955
"is_secret": false,
956956
"is_verified": false,
957-
"line_number": 2463,
957+
"line_number": 2490,
958958
"type": "Secret Keyword",
959959
"verified_result": null
960960
},
961961
{
962962
"hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437",
963963
"is_secret": false,
964964
"is_verified": false,
965-
"line_number": 2469,
965+
"line_number": 2496,
966966
"type": "Secret Keyword",
967967
"verified_result": null
968968
}
@@ -3594,7 +3594,7 @@
35943594
"hashed_secret": "a2277f800807615d59cc7925271ea2c54de5fb96",
35953595
"is_secret": false,
35963596
"is_verified": false,
3597-
"line_number": 1388,
3597+
"line_number": 1431,
35983598
"type": "Secret Keyword",
35993599
"verified_result": null
36003600
}
@@ -3700,15 +3700,15 @@
37003700
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
37013701
"is_secret": false,
37023702
"is_verified": false,
3703-
"line_number": 73,
3703+
"line_number": 74,
37043704
"type": "Secret Keyword",
37053705
"verified_result": null
37063706
},
37073707
{
37083708
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
37093709
"is_secret": false,
37103710
"is_verified": false,
3711-
"line_number": 601,
3711+
"line_number": 602,
37123712
"type": "Secret Keyword",
37133713
"verified_result": null
37143714
}
@@ -3736,15 +3736,15 @@
37363736
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
37373737
"is_secret": false,
37383738
"is_verified": false,
3739-
"line_number": 66,
3739+
"line_number": 67,
37403740
"type": "Secret Keyword",
37413741
"verified_result": null
37423742
},
37433743
{
37443744
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
37453745
"is_secret": false,
37463746
"is_verified": false,
3747-
"line_number": 170,
3747+
"line_number": 171,
37483748
"type": "Secret Keyword",
37493749
"verified_result": null
37503750
}
@@ -3772,15 +3772,15 @@
37723772
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
37733773
"is_secret": false,
37743774
"is_verified": false,
3775-
"line_number": 67,
3775+
"line_number": 68,
37763776
"type": "Secret Keyword",
37773777
"verified_result": null
37783778
},
37793779
{
37803780
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
37813781
"is_secret": false,
37823782
"is_verified": false,
3783-
"line_number": 885,
3783+
"line_number": 886,
37843784
"type": "Secret Keyword",
37853785
"verified_result": null
37863786
}
@@ -3790,15 +3790,15 @@
37903790
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
37913791
"is_secret": false,
37923792
"is_verified": false,
3793-
"line_number": 76,
3793+
"line_number": 77,
37943794
"type": "Secret Keyword",
37953795
"verified_result": null
37963796
},
37973797
{
37983798
"hashed_secret": "cf82ffec7623dc7b6f0931140a5b5bae30f5cc69",
37993799
"is_secret": false,
38003800
"is_verified": false,
3801-
"line_number": 618,
3801+
"line_number": 619,
38023802
"type": "Secret Keyword",
38033803
"verified_result": null
38043804
}
@@ -3808,15 +3808,15 @@
38083808
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
38093809
"is_secret": false,
38103810
"is_verified": false,
3811-
"line_number": 67,
3811+
"line_number": 68,
38123812
"type": "Secret Keyword",
38133813
"verified_result": null
38143814
},
38153815
{
38163816
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
38173817
"is_secret": false,
38183818
"is_verified": false,
3819-
"line_number": 312,
3819+
"line_number": 313,
38203820
"type": "Secret Keyword",
38213821
"verified_result": null
38223822
}
@@ -3826,7 +3826,7 @@
38263826
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
38273827
"is_secret": false,
38283828
"is_verified": false,
3829-
"line_number": 731,
3829+
"line_number": 736,
38303830
"type": "Secret Keyword",
38313831
"verified_result": null
38323832
}
@@ -4769,6 +4769,16 @@
47694769
"verified_result": null
47704770
}
47714771
],
4772+
"website/docs/d/pi_network_peer_route_filter.html.markdown": [
4773+
{
4774+
"hashed_secret": "e22a2c86b8cfdb254165910934051a52ba2e3c06",
4775+
"is_secret": false,
4776+
"is_verified": false,
4777+
"line_number": 19,
4778+
"type": "Base64 High Entropy String",
4779+
"verified_result": null
4780+
}
4781+
],
47724782
"website/docs/d/sm_public_certificate_configuration_ca_lets_encrypt.html.markdown": [
47734783
{
47744784
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
@@ -4805,6 +4815,22 @@
48054815
"line_number": 206,
48064816
"type": "Secret Keyword",
48074817
"verified_result": null
4818+
},
4819+
{
4820+
"hashed_secret": "cca04aa5bbf459bb406df2c401738966138d0dba",
4821+
"is_secret": false,
4822+
"is_verified": false,
4823+
"line_number": 222,
4824+
"type": "Secret Keyword",
4825+
"verified_result": null
4826+
},
4827+
{
4828+
"hashed_secret": "5e9b97965aa8f82caad07bb66151c2dafb4ab322",
4829+
"is_secret": false,
4830+
"is_verified": false,
4831+
"line_number": 224,
4832+
"type": "Secret Keyword",
4833+
"verified_result": null
48084834
}
48094835
],
48104836
"website/docs/r/account_settings_template.html.markdown": [
@@ -5450,15 +5476,15 @@
54505476
"hashed_secret": "13ef22c6a31093830639f12a9feb34a8acd9c34f",
54515477
"is_secret": false,
54525478
"is_verified": false,
5453-
"line_number": 36,
5479+
"line_number": 33,
54545480
"type": "Hex High Entropy String",
54555481
"verified_result": null
54565482
},
54575483
{
54585484
"hashed_secret": "b93b47a3e2ea958f8ca87a70ebc9ad0f4d5ffa45",
54595485
"is_secret": false,
54605486
"is_verified": false,
5461-
"line_number": 56,
5487+
"line_number": 53,
54625488
"type": "Hex High Entropy String",
54635489
"verified_result": null
54645490
}

examples/ibm-project/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ resource "ibm_project" "project_instance" {
2929
destroy_on_delete = true
3030
monitoring_enabled = true
3131
auto_deploy = true
32+
auto_deploy_mode = "auto_approval"
3233
}
3334
}
3435

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/IBM/mqcloud-go-sdk v0.4.0
3030
github.com/IBM/networking-go-sdk v0.51.12
3131
github.com/IBM/platform-services-go-sdk v0.87.0
32-
github.com/IBM/project-go-sdk v0.3.8
32+
github.com/IBM/project-go-sdk v0.3.9
3333
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
3434
github.com/IBM/sarama v1.45.0
3535
github.com/IBM/scc-go-sdk/v5 v5.5.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ github.com/IBM/networking-go-sdk v0.51.12 h1:2qv6neG8msFR1dtf9v+rbaC2gIkw9Hnzohv
150150
github.com/IBM/networking-go-sdk v0.51.12/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc=
151151
github.com/IBM/platform-services-go-sdk v0.87.0 h1:hLx/I7n7cb1CyAXdb2qypmCoFiYuxh2g50qN8OGnEQc=
152152
github.com/IBM/platform-services-go-sdk v0.87.0/go.mod h1:aGD045m6I8pfcB77wft8w2cHqWOJjcM3YSSV55BX0Js=
153-
github.com/IBM/project-go-sdk v0.3.8 h1:RPu4vrNHLrs1+csKMI/TWXCgJMf23la8IM2OBd+zb1o=
154-
github.com/IBM/project-go-sdk v0.3.8/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
153+
github.com/IBM/project-go-sdk v0.3.9 h1:D/UfMMn+vMQyvYf9EfocV6HrD3HcVpeIVoUSjNKuROo=
154+
github.com/IBM/project-go-sdk v0.3.9/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
155155
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
156156
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0=
157157
github.com/IBM/sarama v1.45.0 h1:IzeBevTn809IJ/dhNKhP5mpxEXTmELuezO2tgHD9G5E=

ibm/service/project/data_source_ibm_project.go

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ func DataSourceIbmProject() *schema.Resource {
394394
Computed: true,
395395
Description: "A brief explanation of the project's use in the configuration of a deployable architecture. A project can be created without providing a description.",
396396
},
397-
"auto_deploy": &schema.Schema{
398-
Type: schema.TypeBool,
397+
"auto_deploy_mode": &schema.Schema{
398+
Type: schema.TypeString,
399399
Computed: true,
400-
Description: "A boolean flag to enable auto deploy.",
400+
Description: "This is an advanced setting to auto deploy to tell how auto deploy should behave when it is enabled. There are 2 options:> 1. `auto_approval` will automatically approve the configuration after validated without user confirmation.> 2. `manual_approval` will require user confirmation to approve the configuration after validated before deploying the configuration starts.",
401401
},
402402
"monitoring_enabled": &schema.Schema{
403403
Type: schema.TypeBool,
@@ -458,6 +458,11 @@ func DataSourceIbmProject() *schema.Resource {
458458
},
459459
},
460460
},
461+
"auto_deploy": &schema.Schema{
462+
Type: schema.TypeBool,
463+
Computed: true,
464+
Description: "A boolean flag to enable deploying configurations automatically.",
465+
},
461466
},
462467
},
463468
},
@@ -563,7 +568,7 @@ func dataSourceIbmProjectRead(context context.Context, d *schema.ResourceData, m
563568
}
564569

565570
definition := []map[string]interface{}{}
566-
definitionMap, err := DataSourceIbmProjectProjectDefinitionPropertiesToMap(project.Definition)
571+
definitionMap, err := DataSourceIbmProjectProjectDefinitionToMap(project.Definition)
567572
if err != nil {
568573
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "(Data) ibm_project", "read", "definition-to-map").GetDiag()
569574
}
@@ -706,17 +711,15 @@ func DataSourceIbmProjectProjectEnvironmentSummaryDefinitionToMap(model *project
706711
return modelMap, nil
707712
}
708713

709-
func DataSourceIbmProjectProjectDefinitionPropertiesToMap(model *projectv1.ProjectDefinitionProperties) (map[string]interface{}, error) {
714+
func DataSourceIbmProjectProjectDefinitionToMap(model *projectv1.ProjectDefinition) (map[string]interface{}, error) {
710715
modelMap := make(map[string]interface{})
711716
if model.Name != nil {
712717
modelMap["name"] = *model.Name
713718
}
714719
if model.Description != nil {
715720
modelMap["description"] = *model.Description
716721
}
717-
if model.AutoDeploy != nil {
718-
modelMap["auto_deploy"] = *model.AutoDeploy
719-
}
722+
modelMap["auto_deploy_mode"] = *model.AutoDeployMode
720723
if model.MonitoringEnabled != nil {
721724
modelMap["monitoring_enabled"] = *model.MonitoringEnabled
722725
}
@@ -737,6 +740,9 @@ func DataSourceIbmProjectProjectDefinitionPropertiesToMap(model *projectv1.Proje
737740
}
738741
modelMap["terraform_engine"] = []map[string]interface{}{terraformEngineMap}
739742
}
743+
if model.AutoDeploy != nil {
744+
modelMap["auto_deploy"] = *model.AutoDeploy
745+
}
740746
return modelMap, nil
741747
}
742748

0 commit comments

Comments
 (0)