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 subnet group description modification #5921

Merged
merged 3 commits into from
Mar 30, 2016

Conversation

ColinHebert
Copy link
Contributor

Do not force a new resource when changing the description of a db subnet group

Do not force a new resource when changing the description of a subnet group
@ColinHebert ColinHebert changed the title provider/aws: Subnet group description modification provider/aws: DB subnet group description modification Mar 29, 2016
@stack72
Copy link
Contributor

stack72 commented Mar 30, 2016

Hi @ColinHebert

This change will indeed mean that when a change is made, that it doesn't force a new subnet group BUT this change will not actually change the description

You would need to include the work here to change the subnet net group description as part of the resourceAwsDbSubnetGroupUpdate func for the changes to actually be pushed to AWS

If you need any pointers here, please do let me know

Paul

@stack72 stack72 added enhancement provider/aws waiting-response An issue/pull request is waiting for a response from the community labels Mar 30, 2016
@ColinHebert
Copy link
Contributor Author

Arg, you are correct, those are the little assumptions that come back and catch you... Anyway, I added the description to the update query (cf. ModifyDBSubnetGroupInput in https://github.com/aws/aws-sdk-go/blob/master/service/rds/api.go)

DBSubnetGroupName: aws.String(d.Id()),
SubnetIds: sIds,
DBSubnetGroupName: aws.String(d.Id()),
DBSubnetGroupDescription: aws.String(d.Get("description").(string)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ColinHebert

This will only actually be called if there is a chance in subnet_ids

This update will need to be reworked. I will manually make those changes on the PR and test it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, added the HasChange on description as well. In the case where the subnet_ids do not change but description does change, the GetChange method is expected to still return the desired value (as it hasn't changed) for the update.

@stack72
Copy link
Contributor

stack72 commented Mar 30, 2016

Hi @ColinHebert

This looks good - thanks for the work here :) Merging now as tests are green :)

make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBSubnetGroup' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDBSubnetGroup -timeout 120m
=== RUN   TestAccAWSDBSubnetGroup_basic
--- PASS: TestAccAWSDBSubnetGroup_basic (20.76s)
=== RUN   TestAccAWSDBSubnetGroup_withUndocumentedCharacters
--- PASS: TestAccAWSDBSubnetGroup_withUndocumentedCharacters (21.65s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    43.211s

@stack72 stack72 merged commit 1801904 into hashicorp:master Mar 30, 2016
@ColinHebert ColinHebert deleted the rds_subnet_group_description branch April 24, 2016 21:53
@ghost
Copy link

ghost commented Apr 26, 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 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants