diff --git a/CHANGELOG.md b/CHANGELOG.md index e31eee453b..9b4455ddc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,17 @@ The following functions changed: - `Fn.mergeLists()` does not exist anymore, use `Fn.concat()` instead - `Fn.mergeMaps()` does not exist anymore, use `Fn.merge()` instead +As part of this change, we use the same parameter names as Terraform which might require changing keyword arguments in Python. + +```python +# old +Fn.join(",", [src.stringResource.result, src.stringResource.result]) +Fn.join(separator=",", value=[src.stringResource.result, src.stringResource.result]) +# new +Fn.join(",", [src.stringResource.result, src.stringResource.result]) # stays the same +Fn.join(separator=",", list=[src.stringResource.result, src.stringResource.result]) # value -> list +``` + ## 0.15.5 ### fix diff --git a/examples/python/documentation/stacks.py b/examples/python/documentation/stacks.py index 82a829252a..14dc664419 100644 --- a/examples/python/documentation/stacks.py +++ b/examples/python/documentation/stacks.py @@ -137,7 +137,7 @@ def __init__(self, scope: Construct, id: str, config: BackendStackConfig): ''' #DOCS_BLOCK_START:stack-dependencies -self.allResources = TerraformLocal(self, "merge_items", Fn.merge_lists(resourceFromStackA.items, resourceFromStackB.items)) +self.allResources = TerraformLocal(self, "merge_items", Fn.concat(resourceFromStackA.items, resourceFromStackB.items)) #DOCS_BLOCK_END:stack-dependencies ''' diff --git a/test/python/terraform-functions/main.py b/test/python/terraform-functions/main.py index d237f23369..7e50d84826 100755 --- a/test/python/terraform-functions/main.py +++ b/test/python/terraform-functions/main.py @@ -27,7 +27,7 @@ def __init__(self, scope: Construct, ns: str): } }) TerraformOutput(self, "computed", value=Fn.element( - Fn.merge_lists([{"id": resource.id}, {"value": "123"}]), 1)) + Fn.merge([{"id": resource.id}, {"value": "123"}]), 1)) app = Testing.stub_version(App(stack_traces=False)) diff --git a/website/docs/cdktf/concepts/stacks.mdx b/website/docs/cdktf/concepts/stacks.mdx index 785cd5f55f..bb893f24f4 100644 --- a/website/docs/cdktf/concepts/stacks.mdx +++ b/website/docs/cdktf/concepts/stacks.mdx @@ -872,7 +872,7 @@ this.allResources = new TerraformLocal(this, "merge_items", Fn.mergeLists(Arrays ``` ```python -self.allResources = TerraformLocal(self, "merge_items", Fn.merge_lists(resourceFromStackA.items, resourceFromStackB.items)) +self.allResources = TerraformLocal(self, "merge_items", Fn.concat(resourceFromStackA.items, resourceFromStackB.items)) ``` ```csharp