Skip to content

Create version constraint on Random, and also move to 'required_providers' (post-Terraform 0.13 change). #707

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

Conversation

boldandbusted
Copy link
Contributor

This is to fix Issue #658 and is my first PR to this project. Some extra icing: update to required_providers post-Terraform 0.13, to squelch Terraform warnings. Thanks for this project and for applying 'Good First Issues' tags. I look forward to the PR review. :)

Note that while I did run terraform validate (and the code throws errors unrelated to my change), I didn't have the opportunity to run apply because of this error:

❯ terraform validate

Error: Invalid value for module argument

  on main.tf line 52, in module "runners":
  52:   runner_log_files = [
  53:     {
  54:       "file_path" : "/var/log/user-data.log",
  55:       "log_stream_name" : "{instance_id}/user_data"
  56:     },
  57:     {
  58:       "file_path" : "/home/runners/actions-runner/_diag/Runner_**.log",
  59:       "log_stream_name" : "{instance_id}/runner"
  60:     }
  61:   ]

The given value is not suitable for child module variable "runner_log_files"
defined at ../../variables.tf:284,1-28: element 0: attributes "log_group_name"
and "prefix_log_group" are required.

terraform init does run, showing the constraint is active:

❯ terraform init
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/random from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using previously-installed hashicorp/aws v3.20.0
- Using previously-installed hashicorp/random v3.1.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Also, I did try to add a line to the CHANGELOG.md per the Contributing Guidelines, but there is no section I could see labeled "Unreleased". :/

I hope to add more to the project in the future. Cheers!

@npalm npalm self-requested a review March 24, 2021 18:00
}
}


provider "aws" {
region = local.aws_region
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the contribution, small remark. Please can you format your code, see also CI failing job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I just pushed a commit to address formatting. I usually do run terraform fmt --recursive but I got too excited. :)

@npalm npalm merged commit e3b87ec into github-aws-runners:develop Mar 28, 2021
npalm pushed a commit that referenced this pull request Mar 28, 2021
* Create version constraint on Random, and also move to 'required_providers' (post-Terraform 0.13 change).

* Formatting.
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.

2 participants