Skip to content

Validate project name during "zero apply" #447

@aspcanada

Description

@aspcanada

I received several errors during zero apply. It appears that the project name that I chose (0play) should be validated to not accept names that start with a numeral. It appears that some AWS resources do not like names starting with a numeric.

Originally, I thought the issue was the domain that I registered (0play-stage.click).

Error: invalid value for replication_group_id (must begin with a letter)

│
│   with module.stage.module.cache[0].module.redis[0].aws_elasticache_replication_group.default[0],
│   on .terraform/modules/stage.cache.redis/main.tf line 83, in resource "aws_elasticache_replication_group" "default":
│   83:   replication_group_id          = var.replication_group_id == "" ? module.this.id : var.replication_group_id

Error: invalid value for domain_name (must start with a lowercase alphabet and be at least 3 and no more than 28 characters long. Valid characters are a-z (lowercase letters), 0-9, and - (hyphen).)

│   with module.stage.module.logging[0].module.elasticsearch.aws_elasticsearch_domain.default[0],
│   on .terraform/modules/stage.logging.elasticsearch/main.tf line 102, in resource "aws_elasticsearch_domain" "default":
│  102:   domain_name           = module.this.id

Error: first character of "name_prefix" must be a letter

│   with module.stage.module.db[0].module.rds_postgres[0].module.db_option_group.aws_db_option_group.this[0],
│   on .terraform/modules/stage.db.rds_postgres/modules/db_option_group/main.tf line 4, in resource "aws_db_option_group" "this":
│    4:   name_prefix              = var.name_prefix

Error: first character of parameter group "name_prefix" must be a letter

│   with module.stage.module.db[0].module.rds_postgres[0].module.db_parameter_group.aws_db_parameter_group.this[0],
│   on .terraform/modules/stage.db.rds_postgres/modules/db_parameter_group/main.tf line 36, in resource "aws_db_parameter_group" "this":
│   36:   name_prefix = var.name_prefix
│
╵
make[1]: *** [apply-env] Error 1
make: *** [make-apply] Error 2
2022/01/19 14:18:20 Module Apply failed: Module (zero-aws-eks-stack)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood first ticket, minimal dependencies

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions