Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai committed Feb 17, 2024
1 parent 3a1227a commit 8d946c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func resourceDataProtectionBackupPolicyPostgreSQL() *pluginsdk.Resource {
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"copy_after": {
"copy_option": {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
Expand Down Expand Up @@ -285,7 +285,7 @@ func resourceDataProtectionBackupPolicyPostgreSQL() *pluginsdk.Resource {
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"copy_after": {
"copy_option": {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
Expand Down Expand Up @@ -542,7 +542,7 @@ func expandBackupPolicyPostgreSQLLifeCycle(input []interface{}) []backuppolicies
targetCopySettingList := make([]backuppolicies.TargetCopySetting, 0)
if tcs := v["target_copy_setting"].([]interface{}); len(tcs) > 0 {
tcsv := tcs[0].(map[string]interface{})
copyAfter, err := expandTargetCopySettingFromJSON(tcsv["copy_after"].(string))
copyAfter, err := expandTargetCopySettingFromJSON(tcsv["copy_option"].(string))
if err != nil {
return results
}
Expand Down Expand Up @@ -935,7 +935,7 @@ func flattenBackupPolicyPostgreSQLBackupTargetDataStoreCopySettingArray(input *[
dataStoreType := string(item.DataStore.DataStoreType)

results = append(results, map[string]interface{}{
"copy_after": copyAfter,
"copy_option": copyAfter,
"data_store_type": dataStoreType,
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ resource "azurerm_data_protection_backup_policy_postgresql" "test" {
duration = "P12W"
data_store_type = "VaultStore"
target_copy_setting {
copy_after = jsonencode({
copy_option = jsonencode({
objectType = "CopyOnExpiryOption"
})
data_store_type = "ArchiveStore"
Expand All @@ -352,7 +352,7 @@ resource "azurerm_data_protection_backup_policy_postgresql" "test" {
duration = "P12M"
data_store_type = "VaultStore"
target_copy_setting {
copy_after = jsonencode({
copy_option = jsonencode({
objectType = "CopyOnExpiryOption"
})
data_store_type = "ArchiveStore"
Expand Down

0 comments on commit 8d946c6

Please sign in to comment.