Comments (6)
@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.
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.
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.
@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.
@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.
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.
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)
- [New]: Add support for identity_center_configuration for redshift datasource HOT 1
- [Enhancement]: Apache Flink version 1.19 in Amazon Kinesis Data Analytics HOT 2
- [Bug]: AWS Sagemaker Endpoint Config "routing_config"."routing_strategy" should not be optional if instance_count > 1 HOT 3
- [Bug]: aws_lb_trust_store_revocation - panic with invalid CRL file HOT 2
- [Bug]: Fixed-Response `aws_lb_listener_rule` Always Shows Spurious `+ condition {}` Diff HOT 1
- [Bug]: Unexpected id from data.aws_efs_access_point when upgrading yo 5.58.0 HOT 3
- [Enhancement]: resource for CodeDeploy on-premises Instance HOT 1
- [Enhancement]: Add support for EKS Addon Pod Identity Associations HOT 3
- [Bug]: Terraform creates default VPC but does not destroy it when cluster is destroyed HOT 3
- resource/aws_elasticache_replication_group: `description` should be required HOT 1
- [Bug]: Updating a streaming glue job with timeout set to null doesn't get recognized HOT 1
- [Docs]: resource "aws_ssm_association" "example" HOT 2
- [Bug]: aws_sagemaker_space requires "space_settings" but then cannot update them HOT 2
- [Bug]: AWS App Runner services get stuck in state OPERATION_IN_PROGRESS HOT 1
- [Bug]: `TestAccEMRCluster_autoTerminationPolicy` failing due to `ebs_config` missing computed fields HOT 1
- [Enhancement]: can we have data source for "aws_s3_bucket_notification" to refer existing events and add ew event notifications HOT 1
- Replace use of AWS SDK for Go v1 `private/protocol` functions HOT 2
- [Enhancement]: Manage opensearch package association version with terraform HOT 1
- [Bug]: `import` command does not import all the state HOT 3
- [Enhancement]: aws_amplify_domain_association certificate_settings AMPLIFY_MANAGED should be default HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-aws.