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

resource/aws_rds_cluster: Add support for iam_roles to rds_cluster #1093

Closed
wants to merge 1 commit into from

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jul 10, 2017

Fixes: #382

We store the state of the role that was added so that we can understand
if the status of the role is invalid and thus an error has occurred

% make testacc TEST=./aws TESTARGS='-run=TestAccAWSRDSCluster_updateIamRoles'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSRDSCluster_updateIamRoles -timeout 120m
=== RUN   TestAccAWSRDSCluster_updateIamRoles
--- PASS: TestAccAWSRDSCluster_updateIamRoles (190.73s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	190.769s

@stack72 stack72 added the enhancement Requests to existing resources that expand the functionality or scope. label Jul 10, 2017
Fixes: #382

We store the state of the role that was added so that we can understand
if the status of the role is `invalid` and thus an error has occurred

```
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSRDSCluster_updateIamRoles'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSRDSCluster_updateIamRoles -timeout 120m
=== RUN   TestAccAWSRDSCluster_updateIamRoles
--- PASS: TestAccAWSRDSCluster_updateIamRoles (190.73s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	190.769s
```
@stack72 stack72 force-pushed the f-aws-rds-cluster-iam_roles-382 branch from 83f11d3 to 02c6a22 Compare July 10, 2017 16:02
},
"role_status": {
Type: schema.TypeString,
Computed: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Computed values in sets are a bit weird, since it's pretty hard to actually use them (no first-class interpolation syntax for set members) and it makes diffs confusing.

If interpolating the role status is important I'd suggest instead having a separate attribute iam_role_statuses that is a computed map of strings, and expose them in there with the role arn as the key. This way the syntax for interpolating them will be more convenient, and perhaps also the iam_roles attribute itself could be just a set of strings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apparentlymart this is purely for information only - it's nothing to do with the actual diff. It just allows people to see the status of a role.

FYI, the feedback from the original PR was to add this - thus i've added it

Copy link
Member

Choose a reason for hiding this comment

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

@stack72 did you mean this PR? hashicorp/terraform#10822 I can't find any suggestion around status.

I can't think of an example where this field would be useful - and if there's one, then Set will effectively prevent users from doing so due to indexes (i.e. I agree with @apparentlymart ).

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@radeksimko / @apparentlymart back in hashicorp/terraform#10822 I essentially suggested this inclusion. It would seem I didn't do my homework enough and I now think I should not have.

I'll take your suggestion and rework this back to being a set of strings, and add another param to expose the statuses, if we're all on that page?

@stack72
Copy link
Contributor Author

stack72 commented Jul 27, 2017

@catsby / @radeksimko / @apparentlymart / @grubernaut I am going to close this and reopen it from my fork with the correct changes

@stack72 stack72 closed this Jul 27, 2017
stack72 added a commit to stack72/terraform-provider-aws that referenced this pull request Jul 27, 2017
Rework of hashicorp#1093
Fixes: hashicorp#382

```
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSRDSCluster_updateIamRoles'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSRDSCluster_updateIamRoles -timeout 120m
=== RUN   TestAccAWSRDSCluster_updateIamRoles
--- PASS: TestAccAWSRDSCluster_updateIamRoles (170.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	170.374s
```
@radeksimko radeksimko deleted the f-aws-rds-cluster-iam_roles-382 branch July 27, 2017 14:36
jocgir pushed a commit to coveooss/terraform-provider-aws that referenced this pull request Aug 28, 2017
Rework of hashicorp#1093
Fixes: hashicorp#382

```
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSRDSCluster_updateIamRoles'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSRDSCluster_updateIamRoles -timeout 120m
=== RUN   TestAccAWSRDSCluster_updateIamRoles
--- PASS: TestAccAWSRDSCluster_updateIamRoles (170.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	170.374s
```
@ghost
Copy link

ghost commented Apr 11, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Specify IAM role(s) for RDS Cluster
4 participants