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

provider/aws: db event subscription re-created when changing source_ids #7809

Closed
johanneswuerbach opened this issue Jul 26, 2016 · 1 comment · Fixed by #7892
Closed

provider/aws: db event subscription re-created when changing source_ids #7809

johanneswuerbach opened this issue Jul 26, 2016 · 1 comment · Fixed by #7892

Comments

@johanneswuerbach
Copy link
Contributor

Hi there,

updating the source_ids property of an aws_db_event_subscription resource causes the resource to be recreated (forces new resource).

@radeksimko already pointed out in the initial implementation, that this is actually not required as AWS allows to update the subscription source ids via http://docs.aws.amazon.com/cli/latest/reference/rds/add-source-identifier-to-subscription.html
and http://docs.aws.amazon.com/cli/latest/reference/rds/remove-source-identifier-from-subscription.html
#6367 (comment)

Terraform Version

v0.6.16

Affected Resource(s)

  • aws_db_event_subscription

Expected Behavior

The aws_db_event_subscription should be updated in-place.

Actual Behavior

The aws_db_event_subscription is recreated.

Steps to Reproduce

  1. Create an aws_db_event_subscription with a set of source_ids
  2. terraform apply
  3. Add an additional source_id to the existing resource
  4. terraform plan lists the change as forces new resource
  5. terraform apply recreates the resource.

References

stack72 added a commit that referenced this issue Aug 1, 2016
Updatable

Fixes #7809

This commit adds support for `source_ids` to be updated rather than
forcing new each time. Unfortunately, it must range over the difference
in the source_ids and add and remove them 1 at a time. AWS does not
support batch updating source_ids

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBEventSubscription_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBEventSubscription_ -timeout 120m
=== RUN   TestAccAWSDBEventSubscription_basicUpdate
--- PASS: TestAccAWSDBEventSubscription_basicUpdate (1277.87s)
=== RUN   TestAccAWSDBEventSubscription_withSourceIds
--- PASS: TestAccAWSDBEventSubscription_withSourceIds (1012.96s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
2290.844s
```
stack72 added a commit that referenced this issue Aug 16, 2016
… Updatable (#7892)

* provider/aws: Allow `source_ids` in `aws_db_event_subscription` to be
Updatable

Fixes #7809

This commit adds support for `source_ids` to be updated rather than
forcing new each time. Unfortunately, it must range over the difference
in the source_ids and add and remove them 1 at a time. AWS does not
support batch updating source_ids

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBEventSubscription_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBEventSubscription_ -timeout 120m
=== RUN   TestAccAWSDBEventSubscription_basicUpdate
--- PASS: TestAccAWSDBEventSubscription_basicUpdate (1277.87s)
=== RUN   TestAccAWSDBEventSubscription_withSourceIds
--- PASS: TestAccAWSDBEventSubscription_withSourceIds (1012.96s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
2290.844s
```

* Update resource_aws_db_event_subscription.go
kwilczynski pushed a commit to kwilczynski/terraform that referenced this issue Aug 18, 2016
… Updatable (hashicorp#7892)

* provider/aws: Allow `source_ids` in `aws_db_event_subscription` to be
Updatable

Fixes hashicorp#7809

This commit adds support for `source_ids` to be updated rather than
forcing new each time. Unfortunately, it must range over the difference
in the source_ids and add and remove them 1 at a time. AWS does not
support batch updating source_ids

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBEventSubscription_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBEventSubscription_ -timeout 120m
=== RUN   TestAccAWSDBEventSubscription_basicUpdate
--- PASS: TestAccAWSDBEventSubscription_basicUpdate (1277.87s)
=== RUN   TestAccAWSDBEventSubscription_withSourceIds
--- PASS: TestAccAWSDBEventSubscription_withSourceIds (1012.96s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
2290.844s
```

* Update resource_aws_db_event_subscription.go
@ghost
Copy link

ghost commented Apr 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants