-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: resource tag create * fix: lint errors * fix: lint errors * refactor: refactor tag client * feat: tag update * refactor: refactor tag client * feat: changed tag description * feat: tag import * feat: lint error * feat: assign tags to resources * fix: faraway replica assign tag * feat: tag in cluster examples * fix: plan modifier for cluster to merge plan with state so it can deal with existing tags when planning * fix: cluster assign tags fix * feat: pgd assign tags * fix: lint fix * fix: examples * feat: project tags assign * fix: planmodifier to use state so it can assign and remove correctly * fix: custom plan modifier * fix: commends on build assign tags
- Loading branch information
1 parent
dbfbf6a
commit 92bc3af
Showing
8 changed files
with
122 additions
and
41 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package provider | ||
|
||
import ( | ||
commonApi "github.com/EnterpriseDB/terraform-provider-biganimal/pkg/models/common/api" | ||
commonTerraform "github.com/EnterpriseDB/terraform-provider-biganimal/pkg/models/common/terraform" | ||
"github.com/hashicorp/terraform-plugin-framework/types" | ||
"github.com/hashicorp/terraform-plugin-framework/types/basetypes" | ||
) | ||
|
||
// build tag assign terraform resource as, using api response as input | ||
func buildTFRsrcAssignTagsAs(tfRsrcTagsOut *[]commonTerraform.Tag, apiRespTags []commonApi.Tag) { | ||
*tfRsrcTagsOut = []commonTerraform.Tag{} | ||
for _, v := range apiRespTags { | ||
*tfRsrcTagsOut = append(*tfRsrcTagsOut, commonTerraform.Tag{ | ||
TagId: types.StringValue(v.TagId), | ||
TagName: types.StringValue(v.TagName), | ||
Color: basetypes.NewStringPointerValue(v.Color), | ||
}) | ||
} | ||
} | ||
|
||
// build tag assign request using terraform resource as input | ||
func buildAPIReqAssignTags(tfRsrcTags []commonTerraform.Tag) []commonApi.Tag { | ||
tags := []commonApi.Tag{} | ||
for _, tag := range tfRsrcTags { | ||
tags = append(tags, commonApi.Tag{ | ||
Color: tag.Color.ValueStringPointer(), | ||
TagId: tag.TagId.ValueString(), | ||
TagName: tag.TagName.ValueString(), | ||
}) | ||
} | ||
return tags | ||
} |
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
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