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

Fix random_string resource numeric input deprecation #9

Merged

Conversation

arthurbdiniz
Copy link
Contributor

@arthurbdiniz arthurbdiniz commented Oct 8, 2022

Signed-off-by: Arthur Diniz arthurbdiniz@gmail.com

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

This module uses a resource called random_string. This resource has an input field that is deprecated and it's a good idea to update to the new format.

number -> numeric

No breaking changes.

Types of changes

What types of changes does your code introduce to <repo_name>?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md doc.
  • I have added the necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

Before

╷
│ Warning: Attribute Deprecated
│ 
│   with module.securityhub.random_string.to_slack_cf_suffix,
│   on .terraform/modules/securityhub/event-to-slack-cf.tf line 7, in resource "random_string" "to_slack_cf_suffix":
│    7:   number  = false
│ 
│ **NOTE**: This is deprecated, use `numeric` instead.

After

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.securityhub.aws_securityhub_account.default will be created
  + resource "aws_securityhub_account" "default" {
      + id = (known after apply)
    }

  # module.securityhub.aws_securityhub_standards_subscription.cis[0] will be created
  + resource "aws_securityhub_standards_subscription" "cis" {
      + id            = (known after apply)
      + standards_arn = "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0"
    }

  # module.securityhub.aws_securityhub_standards_subscription.foundational[0] will be created
  + resource "aws_securityhub_standards_subscription" "foundational" {
      + id            = (known after apply)
      + standards_arn = "arn:aws:securityhub:sa-east-1::standards/aws-foundational-security-best-practices/v/1.0.0"
    }

Plan: 3 to add, 0 to change, 0 to destroy.

@arthurbdiniz arthurbdiniz self-assigned this Oct 8, 2022
@arthurbdiniz arthurbdiniz force-pushed the fix/random_string_resource_numeric_input_deprecation branch from 311f665 to ac82197 Compare October 8, 2022 13:43
caiovfernandes
caiovfernandes previously approved these changes Oct 8, 2022
lzrocha
lzrocha previously approved these changes Oct 9, 2022
Copy link
Contributor

@brunodasilvalenga brunodasilvalenga left a comment

Choose a reason for hiding this comment

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

Hey @arthurbdiniz could you consider including the minimum AWS provider version that supports the new feature?

Signed-off-by: Arthur Diniz <arthurbdiniz@gmail.com>
@arthurbdiniz arthurbdiniz force-pushed the fix/random_string_resource_numeric_input_deprecation branch from ac82197 to 5ac88a8 Compare October 11, 2022 00:54
@arthurbdiniz
Copy link
Contributor Author

Hey @arthurbdiniz could you consider including the minimum AWS provider version that supports the new feature?

Hey @brunodasilvalenga, this was a change on the random provider and not AWS terraform provider. As a warning deprecation, the old attribute will only be removed on the next MAJOR release of the provider following Provider Attribute Rename Docs.

So in my opinion the best approach is to define the version to >= v3.3.0.

required_providers {
    random = ">= 3.3.0"
}

If you have other approaches for this requirement I will be around to discuss and make the necessary changes.

@brunodasilvalenga brunodasilvalenga merged commit 8b41cfb into master Oct 11, 2022
@brunodasilvalenga brunodasilvalenga deleted the fix/random_string_resource_numeric_input_deprecation branch October 11, 2022 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants