Skip to content

Commit

Permalink
chore: update docs with feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Maed223 committed Oct 9, 2023
1 parent ca1cede commit 70e4146
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/docs/cdktf/concepts/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ When working with your infrastructure definitions and the need arises to refacto

### Performing Resource Moves

The `moveTo` function is available on all resources and is used for relocating a resource to the location specified by the string target `moveTarget`. To set the `moveTarget` for a resource, utilize the `addMoveTarget` function that is present on the resource to move to.
The `moveTo` function is available on all resources and is used for relocating a resource to the location specified by the string target `moveTarget`. To set a resource's `moveTarget`, use the `addMoveTarget` function that is present on the resource to move to. You can specify an arbitrary string for the `moveTarget`, but it must be unique within your stack.

```ts
new S3Bucket(this, "test-bucket-move-to", {
Expand All @@ -392,7 +392,7 @@ After deployment, both the resource being moved and the move target on the desti

#### Move Targets

A `moveTarget` is accessible anywhere within the context of the stack where it is created. Whether it's set at the root of the stack or within a nested construct, you can access it accordingly.
A `moveTarget` is accessible anywhere within the context of the stack where it is created, including the root of the stack and within a nested construct. Moving resources to a different stack is not supported.

```ts
new S3Bucket(this, "test-bucket-1", {
Expand All @@ -417,7 +417,7 @@ After deploying the resource, you can update your resource to use the newly assi

### Enabling `foreach` on a Resource

If you wish to incorporate a deployed resource into a composition using `foreach`, you can achieve this without destroying the resource by specifying the desired index using the `moveTo` function. The index should correspond to the key found in the `TerraformIterator` named iterator
To incorporate a deployed resource into a `foreach` composition without destroying the resource, specify an index as a second argument in the `moveTo` function. The index should correspond to the key in the `TerraformIterator` named `iterator`.

```ts
const iterator = TerraformIterator.fromMap({
Expand Down

0 comments on commit 70e4146

Please sign in to comment.