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: add assume_role.0.duration and deprecate assume_role.0.duration_seconds #23077

Merged
merged 10 commits into from
Feb 10, 2022

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Feb 9, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #23028

Output from acceptance testing:

--- PASS: TestValidTimeDuration (0.00s)

--- PASS: TestAccAcctestProvider_Region_awsSC2S (29.78s)
--- PASS: TestAccAcctestProvider_Region_awsC2S (29.79s)
--- PASS: TestAccAcctestProvider_Region_awsCommercial (30.50s)
--- PASS: TestAccAcctestProvider_IgnoreTagsKeys_one (32.20s)
--- PASS: TestAccAcctestProvider_DefaultAndIgnoreTags_emptyBlocks (32.53s)
--- PASS: TestAccAcctestProvider_IgnoreTagsKeys_multiple (32.56s)
--- PASS: TestAccAcctestProvider_IgnoreTagsKeyPrefixes_multiple (32.56s)
--- PASS: TestAccAcctestProvider_IgnoreTags_emptyBlock (32.57s)
--- PASS: TestAccAcctestProvider_DefaultTagsTags_one (32.57s)
--- PASS: TestAccAcctestProvider_IgnoreTagsKeyPrefixes_none (32.60s)
--- PASS: TestAccAcctestProvider_DefaultTags_emptyBlock (32.86s)
--- PASS: TestAccAcctestProvider_DefaultTagsTags_none (32.94s)
--- PASS: TestAccAcctestProvider_IgnoreTagsKeyPrefixes_one (34.12s)
--- PASS: TestAccAcctestProvider_IgnoreTagsKeys_none (34.18s)
--- PASS: TestAccAcctestProvider_DefaultTagsTags_multiple (34.35s)
--- PASS: TestAccAcctestProvider_endpoints (34.64s)
--- PASS: TestAccAcctestProvider_AssumeRole_empty (35.44s)
--- PASS: TestAccAcctestProvider_unusualEndpoints (10.27s)
--- PASS: TestAccAcctestProvider_fipsEndpoint (47.65s)

@anGie44 anGie44 added this to the v4.0.0 milestone Feb 9, 2022
@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) labels Feb 9, 2022
@anGie44 anGie44 force-pushed the f-provider-assume-role-duration-changes branch from 69500e9 to f241a1b Compare February 9, 2022 19:30
Type: schema.TypeString,
Optional: true,
Description: "The duration of the role session, e.g. 1h. Valid time units are ns, us (or µs), ms, s, h, or m.",
ValidateFunc: verify.ValidTimeDuration,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Q for reviewer: This validation does not allow for empty strings...or should it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the validation functions provided by the Plugin SDK, and especially validation.IsRFC3339Time(), we're probably fine not checking for it.

anGie44 added a commit that referenced this pull request Feb 9, 2022
@anGie44 anGie44 marked this pull request as ready for review February 9, 2022 19:52
@gdavison gdavison self-assigned this Feb 9, 2022
@anGie44 anGie44 force-pushed the f-provider-assume-role-duration-changes branch from 52ba408 to 4246ecc Compare February 9, 2022 20:59
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Looks good. I have a few comments

website/docs/index.html.markdown Outdated Show resolved Hide resolved
website/docs/guides/version-4-upgrade.html.md Outdated Show resolved Hide resolved
internal/verify/validate.go Outdated Show resolved Hide resolved
Type: schema.TypeString,
Optional: true,
Description: "The duration of the role session, e.g. 1h. Valid time units are ns, us (or µs), ms, s, h, or m.",
ValidateFunc: verify.ValidTimeDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the validation functions provided by the Plugin SDK, and especially validation.IsRFC3339Time(), we're probably fine not checking for it.

Type: schema.TypeString,
Optional: true,
Description: "The duration of the role session, e.g. 1h. Valid time units are ns, us (or µs), ms, s, h, or m.",
ValidateFunc: verify.ValidTimeDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

We could also check for the minimum value of 15 minutes and the absolute maximum of 12 hours

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test output after updates:

--- PASS: TestValidAssumeRoleDuration (0.00s)

anGie44 and others added 4 commits February 9, 2022 17:04
Co-authored-by: Graham Davison <gdavison@hashicorp.com>
Co-authored-by: Graham Davison <gdavison@hashicorp.com>
Co-authored-by: Graham Davison <gdavison@hashicorp.com>
…b.com/hashicorp/terraform-provider-aws into f-provider-assume-role-duration-changes
@github-actions github-actions bot removed the verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) label Feb 9, 2022
@anGie44 anGie44 force-pushed the f-provider-assume-role-duration-changes branch from d9eff35 to 1f82a5c Compare February 9, 2022 22:34
@anGie44 anGie44 requested a review from gdavison February 9, 2022 22:36
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

@anGie44 anGie44 merged commit e602a85 into main Feb 10, 2022
@anGie44 anGie44 deleted the f-provider-assume-role-duration-changes branch February 10, 2022 01:22
github-actions bot pushed a commit that referenced this pull request Feb 10, 2022
@github-actions
Copy link

This functionality has been released in v4.0.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provider: assume role duration parameter
2 participants