Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove readonly properties within replication_settings for aws_dms_replication_config resource #34356

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
982a720
allows move to new instance arn
misterjacko Apr 13, 2023
c6b05aa
fixes acc tests
misterjacko Apr 14, 2023
ef79b67
adds changelog
Apr 14, 2023
fb8b829
add acc test
misterjacko Apr 14, 2023
34f450c
increases some timeouts
misterjacko Apr 20, 2023
d2bcc3f
feat: use RFC3339 date for cdc_start_time
Jun 12, 2023
006d554
feat: use RFC3339 date for cdc_start_time
jeremychauvet Jun 12, 2023
8ec3d39
Merge branch 'b-19801-dms-replication-task-cdc-start-time-allow-non-u…
Jun 12, 2023
2472e54
feat: use RFC3339 date for cdc_start_time
jeremychauvet Jun 12, 2023
d26698b
feat: allow RFC3339 date for cdc_start_time
jeremychauvet Jun 13, 2023
6ab260e
feat: allow RFC3339 date for cdc_start_time
jeremychauvet Jun 13, 2023
b8b643b
feat: remove readonly properties and updated tests
DanielRieske Nov 11, 2023
942efea
chore: added changelog
DanielRieske Nov 11, 2023
b5b160a
chore: fmt changelog
DanielRieske Nov 11, 2023
5f6d052
Merge branch 'main' into HEAD
ewbankkit Dec 14, 2023
87ba32e
Add 'internal/json' package.
ewbankkit Dec 14, 2023
9613585
'internal/ujson' -> 'internal/json/ujson'.
ewbankkit Dec 14, 2023
71251ea
Add 'json.RemoveReadOnlyFields'.
ewbankkit Dec 14, 2023
6ce0b89
Add 'verify.SuppressEquivalentJSONRemovingReadOnlyFieldsDiffs'.
ewbankkit Dec 14, 2023
44c774e
r/aws_dms_replication_config: Use 'verify.SuppressEquivalentJSONRemov…
ewbankkit Dec 14, 2023
144aeb8
startReplication: replication NotFound is OK.
ewbankkit Dec 14, 2023
99d7818
dms: Add 'TaskSettings'.
ewbankkit Dec 14, 2023
e455fcf
'RemoveReadOnlyFields' -> 'RemoveFields'.
ewbankkit Dec 14, 2023
5c37118
Move 'internal/experimental/depgraph/stack' -> 'internal/types/stack'.
ewbankkit Dec 15, 2023
106f2c1
Add 'json.RemoveEmptyFields'.
ewbankkit Dec 15, 2023
825407b
'flattenSettings' -> 'flattenTaskSettings'.
ewbankkit Dec 15, 2023
4f8ddd6
Fix 'TestStack'.
ewbankkit Dec 15, 2023
370ec89
Move 'internal/option' -> 'internal/types/option'.
ewbankkit Dec 15, 2023
d1e9a80
generate/tags: 'internal/option' -> 'internal/types/option'.
ewbankkit Dec 15, 2023
bb6806c
Run 'make gen'.
ewbankkit Dec 15, 2023
5060bd2
provider: 'internal/option' -> 'internal/types/option'.
ewbankkit Dec 15, 2023
2f620b8
stack.Peek() and Pop() return Option.
ewbankkit Dec 15, 2023
1e47a79
json.RemoveEmptyFields: Use a stack.
ewbankkit Dec 18, 2023
9c30cb0
json.RemoveEmptyFields: 'string' -> '[]byte'.
ewbankkit Dec 18, 2023
87b4841
dms: Add 'suppressEquivalentTaskSettings'.
ewbankkit Dec 18, 2023
80ff3ae
dms: Add 'setLastReplicationError'.
ewbankkit Dec 18, 2023
2a313df
r/aws_dms_replication_task: Use 'dms.MigrationTypeValue_Values()'.
ewbankkit Dec 18, 2023
bc2419c
Merge branch 'main' into HEAD
ewbankkit Dec 18, 2023
fa60946
Merge commit '6ab260e1e5ace4a802f78da379b2c3ab61094e2a' into HEAD
ewbankkit Dec 18, 2023
7d8b609
Tweak CHANGELOG entry.
ewbankkit Dec 18, 2023
2584012
Tweak CHANGELOG entry.
ewbankkit Dec 18, 2023
be6996b
Tweak documentation.
ewbankkit Dec 18, 2023
c6c270f
Add 'timestamp.IsRFC3339()'.
ewbankkit Dec 18, 2023
60da92a
Add 'flex.StringValueToInt64Value'.
ewbankkit Dec 18, 2023
2873e18
r/aws_dms_replication_task: Correct update of 'cdc_start_time'.
ewbankkit Dec 18, 2023
c6f7689
Merge commit '34f450c6f2d8bffc04455cec506289513332b2d1' into HEAD
ewbankkit Dec 18, 2023
5da0ce1
Tweak CHANGELOG entry.
ewbankkit Dec 18, 2023
ac5377b
r/aws_dms_replication_task: Tidy up Create.
ewbankkit Dec 18, 2023
abe4bc1
r/aws_dms_replication_task: Tidy up Read.
ewbankkit Dec 18, 2023
c99231d
r/aws_dms_replication_task: Prevent erroneous diffs on `replication_t…
ewbankkit Dec 18, 2023
e75ba7f
dms: Tidy up 'startReplicationTask'.
ewbankkit Dec 18, 2023
940841a
dms: Tidy up 'stopReplicationTask'.
ewbankkit Dec 18, 2023
956aff9
r/aws_dms_replication_task: Tidy up Delete.
ewbankkit Dec 18, 2023
e3b0689
r/aws_dms_replication_task: Tidy up Update.
ewbankkit Dec 18, 2023
6020ccf
r/aws_dms_replication_task: Tidy up waiters.
ewbankkit Dec 18, 2023
2254145
r/aws_dms_replication_task: Tidy up acceptance tests.
ewbankkit Dec 18, 2023
cca7ce7
Fix semgrep 'dgryski.semgrep-go.oddifsequence.odd-sequence-ifs'.
ewbankkit Dec 18, 2023
3527c44
Fix terrafmt error.
ewbankkit Dec 18, 2023
d0ded6b
dms: Tweak acceptance test configuration names.
ewbankkit Dec 19, 2023
b025e27
Simplify 'TestAccDMSEndpoint_pauseReplicationTasks'.
ewbankkit Dec 19, 2023
a50d08e
Simplify 'TestAccDMSEndpoint_pauseReplicationTasks' again.
ewbankkit Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/30721.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_dms_replication_task: Remove [ForceNew](https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#forcenew) from `replication_instance_arn`, allowing in-place migration between DMS instances
```
3 changes: 3 additions & 0 deletions .changelog/31917.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_dms_replication_task: Allow `cdc_start_time` to use [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) formatted dates in addition to UNIX timestamps
```
7 changes: 7 additions & 0 deletions .changelog/34356.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:bug
resource/aws_dms_replication_config: Prevent erroneous diffs on `replication_settings`
```

```release-note:bug
resource/aws_dms_replication_task: Prevent erroneous diffs on `replication_task_settings`
```
2 changes: 1 addition & 1 deletion .teamcity/scripts/provider_tests/acceptance_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ TF_ACC=1 go test \
./internal/flex/... \
./internal/framework/... \
./internal/generate/... \
./internal/json/... \
./internal/logging/... \
./internal/maps/... \
./internal/provider/... \
Expand All @@ -54,7 +55,6 @@ TF_ACC=1 go test \
./internal/tags/... \
./internal/tfresource/... \
./internal/types/... \
./internal/ujson/... \
./internal/vault/... \
./internal/verify/... \
-json -v -count=1 -parallel "%ACCTEST_PARALLELISM%" -timeout=0 -run=TestAcc
2 changes: 1 addition & 1 deletion .teamcity/scripts/provider_tests/unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go test \
./internal/flex/... \
./internal/framework/... \
./internal/generate/... \
./internal/json/... \
./internal/logging/... \
./internal/maps/... \
./internal/provider/... \
Expand All @@ -26,7 +27,6 @@ go test \
./internal/tags/... \
./internal/tfresource/... \
./internal/types/... \
./internal/ujson/... \
./internal/vault/... \
./internal/verify/... \
-json
15 changes: 8 additions & 7 deletions internal/experimental/depgraph/dependency_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices"
"github.com/hashicorp/terraform-provider-aws/internal/types/stack"
"golang.org/x/exp/slices"
)

Expand Down Expand Up @@ -204,20 +205,20 @@ func depthFirstSearch(edges map[string][]string) func(s string) ([]string, error

inCurrentPath := make(map[string]struct{})
currentPath := make([]string, 0)
todo := newStack()
todo := stack.New[*todoValue]()

todo.push(&todoValue{
todo.Push(&todoValue{
node: s,
})

for todo.len() > 0 {
current := todo.peek().(*todoValue)
for todo.Len() > 0 {
current := todo.Peek().MustUnwrap()
node := current.node

if !current.processed {
// Visit edges.
if slices.Contains(visited, node) {
todo.pop()
todo.Pop()

continue
}
Expand All @@ -232,7 +233,7 @@ func depthFirstSearch(edges map[string][]string) func(s string) ([]string, error
nodeEdges := edges[node]

for i := len(nodeEdges) - 1; i >= 0; i-- {
todo.push(&todoValue{
todo.Push(&todoValue{
node: nodeEdges[i],
})
}
Expand All @@ -241,7 +242,7 @@ func depthFirstSearch(edges map[string][]string) func(s string) ([]string, error
} else {
// Edges have been visited.
// Unroll the stack.
todo.pop()
todo.Pop()
if n := len(currentPath); n > 0 {
currentPath = currentPath[:n-1]
}
Expand Down
56 changes: 0 additions & 56 deletions internal/experimental/depgraph/stack.go

This file was deleted.

12 changes: 9 additions & 3 deletions internal/flex/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,17 @@ func StringToIntValue(v *string) int {
return i
}

// StringValueToInt64 converts a string to a Go int64 pointer value.
// StringValueToInt64 converts a string to a Go int64 pointer.
// Invalid integer strings are converted to 0.
func StringValueToInt64(v string) *int64 {
i, _ := strconv.Atoi(v)
return aws.Int64(int64(i))
return aws.Int64(StringValueToInt64Value(v))
}

// StringValueToInt64Value converts a string to a Go int64 value.
// Invalid integer strings are converted to 0.
func StringValueToInt64Value(v string) int64 {
i, _ := strconv.ParseInt(v, 0, 64)
return i
}

// Takes a string of resource attributes separated by the ResourceIdSeparator constant
Expand Down
48 changes: 24 additions & 24 deletions internal/generate/tags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ type TemplateData struct {

// The following are specific to writing import paths in the `headerBody`;
// to include the package, set the corresponding field's value to true
ConnsPkg bool
FmtPkg bool
HelperSchemaPkg bool
InternalTypesPkg bool
LoggingPkg bool
NamesPkg bool
SkipAWSImp bool
SkipServiceImp bool
SkipTypesImp bool
TfLogPkg bool
TfResourcePkg bool
TimePkg bool
ConnsPkg bool
FmtPkg bool
HelperSchemaPkg bool
InternalOptionPkg bool
LoggingPkg bool
NamesPkg bool
SkipAWSImp bool
SkipServiceImp bool
SkipTypesImp bool
TfLogPkg bool
TfResourcePkg bool
TimePkg bool

IsDefaultListTags bool
IsDefaultUpdateTags bool
Expand Down Expand Up @@ -298,18 +298,18 @@ func main() {
ProviderNameUpper: providerNameUpper,
ServicePackage: servicePackage,

ConnsPkg: (*listTags && *listTagsFunc == defaultListTagsFunc) || (*updateTags && *updateTagsFunc == defaultUpdateTagsFunc),
FmtPkg: *updateTags,
HelperSchemaPkg: awsPkg == "autoscaling",
InternalTypesPkg: (*listTags && *listTagsFunc == defaultListTagsFunc) || *serviceTagsMap || *serviceTagsSlice,
LoggingPkg: *updateTags,
NamesPkg: *updateTags && !*skipNamesImp,
SkipAWSImp: *skipAWSImp,
SkipServiceImp: *skipServiceImp,
SkipTypesImp: *skipTypesImp,
TfLogPkg: *updateTags,
TfResourcePkg: (*getTag || *waitForPropagation),
TimePkg: *waitForPropagation,
ConnsPkg: (*listTags && *listTagsFunc == defaultListTagsFunc) || (*updateTags && *updateTagsFunc == defaultUpdateTagsFunc),
FmtPkg: *updateTags,
HelperSchemaPkg: awsPkg == "autoscaling",
InternalOptionPkg: (*listTags && *listTagsFunc == defaultListTagsFunc) || *serviceTagsMap || *serviceTagsSlice,
LoggingPkg: *updateTags,
NamesPkg: *updateTags && !*skipNamesImp,
SkipAWSImp: *skipAWSImp,
SkipServiceImp: *skipServiceImp,
SkipTypesImp: *skipTypesImp,
TfLogPkg: *updateTags,
TfResourcePkg: (*getTag || *waitForPropagation),
TimePkg: *waitForPropagation,

CreateTagsFunc: createTagsFunc,
GetTagFunc: *getTagFunc,
Expand Down
4 changes: 2 additions & 2 deletions internal/generate/tags/templates/v1/header_body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import (
{{- if .TfResourcePkg }}
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
{{- end }}
{{- if .InternalTypesPkg }}
"github.com/hashicorp/terraform-provider-aws/internal/types"
{{- if .InternalOptionPkg }}
"github.com/hashicorp/terraform-provider-aws/internal/types/option"
{{- end }}
{{- if .NamesPkg }}
"github.com/hashicorp/terraform-provider-aws/names"
Expand Down
2 changes: 1 addition & 1 deletion internal/generate/tags/templates/v1/list_tags_body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (p *servicePackage) {{ .ListTagsFunc | Title }}(ctx context.Context, meta a
}

if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some(tags)
inContext.TagsOut = option.Some(tags)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func {{ .GetTagsInFunc }}(ctx context.Context) map[string]*string {
// {{ .SetTagsOutFunc }} sets {{ .ServicePackage }} service tags in Context.
func {{ .SetTagsOutFunc }}(ctx context.Context, tags map[string]*string) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ func {{ .GetTagsInFunc }}(ctx context.Context) []*{{ .TagPackage }}.{{ .TagType
{{- if or ( .TagType2 ) ( .TagTypeAddBoolElem ) }}
func {{ .SetTagsOutFunc }}(ctx context.Context, tags any{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string{{ end }}) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}))
}
}
{{- else }}
func {{ .SetTagsOutFunc }}(ctx context.Context, tags []*{{ .TagPackage }}.{{ .TagType }}) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags))
}
}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions internal/generate/tags/templates/v2/header_body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import (
{{- if .TfResourcePkg }}
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
{{- end }}
{{- if .InternalTypesPkg }}
"github.com/hashicorp/terraform-provider-aws/internal/types"
{{- if .InternalOptionPkg }}
"github.com/hashicorp/terraform-provider-aws/internal/types/option"
{{- end }}
{{- if .NamesPkg }}
"github.com/hashicorp/terraform-provider-aws/names"
Expand Down
2 changes: 1 addition & 1 deletion internal/generate/tags/templates/v2/list_tags_body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (p *servicePackage) {{ .ListTagsFunc | Title }}(ctx context.Context, meta a
}

if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some(tags)
inContext.TagsOut = option.Some(tags)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func {{ .GetTagsInFunc }}(ctx context.Context) map[string]*string {
// {{ .SetTagsOutFunc }} sets {{ .ServicePackage }} service tags in Context.
func {{ .SetTagsOutFunc }}(ctx context.Context, tags map[string]*string) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ func {{ .GetTagsInFunc }}(ctx context.Context) []awstypes.{{ .TagType }} {
{{- if or ( .TagType2 ) ( .TagTypeAddBoolElem ) }}
func {{ .SetTagsOutFunc }}(ctx context.Context, tags any{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string{{ end }}) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}))
}
}
{{- else }}
func {{ .SetTagsOutFunc }}(ctx context.Context, tags []awstypes.{{ .TagType }}) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags))
}
}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func {{ .GetTagsInFunc }}(ctx context.Context) map[string]string {
// {{ .SetTagsOutFunc }} sets {{ .ServicePackage }} service tags in Context.
func {{ .SetTagsOutFunc }}(ctx context.Context, tags map[string]string) {
if inContext, ok := tftags.FromContext(ctx); ok {
inContext.TagsOut = types.Some({{ .KeyValueTagsFunc }}(ctx, tags))
inContext.TagsOut = option.Some({{ .KeyValueTagsFunc }}(ctx, tags))
}
}

Expand Down
Loading
Loading