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

add "pet_name_length" parameter to the random_pet resource #407

Open
1 task done
georgikoemdzhiev opened this issue May 23, 2023 · 3 comments
Open
1 task done

add "pet_name_length" parameter to the random_pet resource #407

georgikoemdzhiev opened this issue May 23, 2023 · 3 comments

Comments

@georgikoemdzhiev
Copy link

georgikoemdzhiev commented May 23, 2023

Terraform CLI and Provider Versions

Terraform CLI version: v.1.4.6

Use Cases or Problem Statement

Some resource parameters have a maximum length defined such as the domain_name property of the aws_opensearch_domain resource in the AWS provider (i.e. the domain name must be <= than 28 characters long). In those cases, if we want to use the random_pet resources to generate a random name for the domain_name property, it may generate a name that is longer than the maximum allowed length.

Current:

resource "random_pet" "cluster" {
  length = 1
}

resource "aws_opensearch_domain" "opensearch" {
  domain_name    = "my-team-name-${random_pet.cluster.id}-${var.environment}"
  engine_version = var.engine_version
...

Proposal

Add a pet_name_length property to the random_pet resource

How much impact is this issue causing?

Low

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@d-medvedev1
Copy link

Do you have an ideas, how many letters will be in word generated by random_pet resource?
I tried to generate few dozens and the shortest word I've seen had 3 letters and the longest had 8 letters.

@bendbennett
Copy link
Contributor

Hi @georgikoemdzhiev 👋

Thank you for submitting this enhancement request. We will prioritise looking into this issue further on the basis of the level of community interest indicated by up-votes.

@bendbennett
Copy link
Contributor

Hi @d-medvedev1 👋

The pet names are generated within the random_pet resource using the golang-petname Go module. The number of letters in the generated pet name(s) are dependent upon the length, separator, and prefix attributes supplied. An examination of the lists used within the golang-petname Go module should provide some guidance in this respect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants