Giter VIP home page Giter VIP logo

Comments (6)

acwwat avatar acwwat commented on July 17, 2024 1

@EugenKon There certainly seems to be some inconsistencies within AWS, although the provider is technically somewhat adhering to the requirements.

What I can see is that the Console is the only place where it provides the specifications for the event subscription name. As you can see in the screenshot, the spec is "alphanumeric" + hyphens with max 255 characters, although the error message spells it out more explicitly:

Must contain only letters, digits, or hyphens. Must start with a letter.

More notable is that the provider validation does not enforce the "must start with a letter" requirement.

image

The API reference does not even mention the regex.

For consistency, I can update the validation and the error message in the provider to match the UI which I consider to be the current source of truth (best we got today anyway). However the general issue of inconsistency and API reference accuracy are more of upstream AWS issues to be addressed.

from terraform-provider-aws.

github-actions avatar github-actions commented on July 17, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

from terraform-provider-aws.

acwwat avatar acwwat commented on July 17, 2024

@EugenKon By definition, alphanumeric would only include 0-9, a-z, and A-Z. Along with -, the validation regex is ^[0-9A-Za-z-]+$. Since the name db_event_subs in your example includes underscores (_), it does not match the regex.

from terraform-provider-aws.

EugenKon avatar EugenKon commented on July 17, 2024

@acwwat AFAIK all languages defines alphanumeric as \w and it is [a-zA-Z0-9_]. If you define something else then it should be spelled explicitly:
The name should contain characters from the next regex ^[0-9A-Za-z-]+$`

By the way, why I can use _ character in the name for security groups? This is very inconsistent!

resource "aws_security_group" "allow_all_internal" {
  name   = "${var.project_name}-allow-all_internal"
  vpc_id = aws_vpc.main.id
  ...

To my mind this is a bug that _ is not allowed for the name option of aws_db_event_subscription resource.

from terraform-provider-aws.

EugenKon avatar EugenKon commented on July 17, 2024

Hm... Probably AWS_Provider documentation for this resource should be updated to mention this limitation. Probably it would worth to mention this limitation and provide a link to AWS documentation which will describe this. Thus on Terraform Doc site we do not need to change anything, because it will just refer to AWS.

Must contain only letters, digits, or hyphens. Must start with a letter.

Yeah, AWS error message is more informative than from Terraform.

from terraform-provider-aws.

acwwat avatar acwwat commented on July 17, 2024

Welp, there are apparently even more validation when I checked the error returned by the AWS API:

Error: creating RDS Event Subscription (db-event-subs--20240629040402468400000001): operation error RDS: CreateEventSubscription, https response error StatusCode: 400, RequestID: c3b55887-216e-4fdb-96c9-a47ec6b597fd, api error InvalidParameterValue: The parameter Subscription Identifier is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.

I feel that it's a fool's errand to update the validation code in the provider as I am sure there are many, many other cases in other AWS services, but nonetheless I'll try to fix just this one.

from terraform-provider-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.