cn-terraform / terraform-aws-sonarqube Goto Github PK
View Code? Open in Web Editor NEWSonarQube Terraform Module for AWS
Home Page: https://registry.terraform.io/modules/cn-terraform/sonarqube
License: Apache License 2.0
SonarQube Terraform Module for AWS
Home Page: https://registry.terraform.io/modules/cn-terraform/sonarqube
License: Apache License 2.0
We've tried Fargate, but moving most of our microservices to kubernetes. Sonarsource has support for this, I'm looking for TF implementation of that.
Unable to actually start the service as it's starting and stopping with error
STOPPED(Essential container in task exited)
Port 9001 makes tg-1 unhealthy, so the ECS service keep restarting due to the health checks from the LB on port 9001, any idea? for now, I set the health check for that port to override with port 9000
Whenever I run terraform plan
/ terraform apply
I get ...
Error: Invalid count argument
on .terraform/modules/sonar.ecs_fargate.ecs-fargate-service/main.tf line 123, in resource "aws_security_group_rule" "ingress_through_https":
123: count = length(data.aws_lb_target_group.lb_https_target_groups)
The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.
Hi, a question that could be a contribution perhaps. But to add a plugin to sonarqube, have you ever done it? Would you know the parameters that I should use in the ecs task?
Plugin example: https://github.com/mc1arke/sonarqube-community-branch-plugin
Is it possible to edit main.tf so that loadbalancing logs are not enabled? It is enabled to save these logs to an S3 bucket.
Reopening #10
Am getting the same error during a plan or apply
What is the dependency order, and can the README be updated to include it?
terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
Warning: Interpolation-only expressions are deprecated
on .terraform/modules/sonar.ecs_fargate/main.tf line 9, in module "ecs-cluster":
9: name = "${var.name_prefix}"
Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.
Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.
(and one more similar warning elsewhere)
Error: Invalid for_each argument
on .terraform/modules/sonar.ecs_fargate.ecs-fargate-service/main.tf line 10, in data "aws_lb_target_group" "lb_http_target_groups":
10: for_each = var.lb_http_tgs_arns != null ? toset(var.lb_http_tgs_arns) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
Error: Invalid for_each argument
on .terraform/modules/sonar.ecs_fargate.ecs-fargate-service/main.tf line 20, in data "aws_lb_listener" "lb_http_listeners":
20: for_each = var.lb_http_listeners_arns != null ? toset(var.lb_http_listeners_arns) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
Using:
terraform -version
Terraform v0.13.5
Hello !
It would nice (a requirement for us) if the load balancer would be spawned with https support.
cn-terraform/ecs-fargate seems to support it.
It loads module "terraform-aws-ecs-fargate" version 2.0.1 which has an issue with ipc_mode
cn-terraform/terraform-aws-ecs-fargate#2
module.sonarqube.module.ecs_fargate.module.ecs-fargate-service.aws_security_group_rule.ingress_through_http["9000"]: Creation complete after 2s [id=sgrule-1510616199]
Error: error creating ELBv2 Listener: LoadBalancerNotFound: Load balancer 'arn:aws:elasticloadbalancing:us-east-1:621884058757:loadbalancer/app/fnx-sonar-lb/9f5cf6d9fd79de06' not found
status code: 400, request id: 193d19f2-9850-4ac7-9265-6ff5a2256c98
Error: Reference to "each" in context without for_each
on .terraform/modules/sonarqube.ecs_fargate.ecs-fargate-service/main.tf line 63, in resource "aws_ecs_service" "service":
63: target_group_arn = each.key
The "each" object can be used only in "module" or "resource" blocks, and only
when the "for_each" argument is set.
Error: each.value cannot be used in this context
on .terraform/modules/sonarqube.ecs_fargate.ecs-fargate-service/main.tf line 65, in resource "aws_ecs_service" "service":
65: container_port = each.value
A reference to "each.value" has been used in a context in which it
unavailable, such as when the configuration no longer contains the value in
its "for_each" expression. Remove this reference to each.value in your
configuration to work around this error.
Releasing state lock. This may take a few moments...
I'm having an issue creating the load balancer, I haven't had a chance to debug but I'll take a look later.
Terraform v 0.13.5
Module version 2.0.20
Just thought I'd bring to your attention.
Hello, this module looks very nice. Great work!
Do you by any chance have an article/example/guide online showing how to set it up?
Add a terraform variable to add tags to aws resources and submodules
Was prompt with the following TF error while using the default Aurora DB specs
DBInstanceClass=db.r4.large, Engine=aurora-postgresql, EngineVersion=14.4, LicenseModel=postgresql-license
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
module.sonarqube.aws_rds_cluster_instance.aurora_db_cluster_instances[1]: Creating...
module.sonarqube.aws_rds_cluster_instance.aurora_db_cluster_instances[0]: Creating...
module.sonarqube.aws_rds_cluster_instance.aurora_db_cluster_instances[2]: Creating...
╷
│ Error: creating RDS Cluster (sonar-sonar-aurora-db) Instance (sonar-aurora-db-instance-0): InvalidParameterCombination: RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.r4.large, Engine=aurora-postgresql, EngineVersion=14.4, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation.
│ status code: 400, request id: 562d74f1-3736-4bda-978d-a37cbc9dd2a4
│
│ with module.sonarqube.aws_rds_cluster_instance.aurora_db_cluster_instances[0],
│ on .terraform/modules/sonarqube/database.tf line 64, in resource "aws_rds_cluster_instance" "aurora_db_cluster_instances":
│ 64: resource "aws_rds_cluster_instance" "aurora_db_cluster_instances" {
│
╵
╷
│ Error: creating RDS Cluster (sonar-sonar-aurora-db) Instance (sonar-aurora-db-instance-1): InvalidParameterCombination: RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.r4.large, Engine=aurora-postgresql, EngineVersion=14.4, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation.
│ status code: 400, request id: 9a81c2bc-a08b-4b99-80db-759569894c56
│
│ with module.sonarqube.aws_rds_cluster_instance.aurora_db_cluster_instances[1],
│ on .terraform/modules/sonarqube/database.tf line 64, in resource "aws_rds_cluster_instance" "aurora_db_cluster_instances":
│ 64: resource "aws_rds_cluster_instance" "aurora_db_cluster_instances" {
│
╵
╷
│ Error: creating RDS Cluster (sonar-sonar-aurora-db) Instance (sonar-aurora-db-instance-2): InvalidParameterCombination: RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.r4.large, Engine=aurora-postgresql, EngineVersion=14.4, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation.
│ status code: 400, request id: 43b2e1d9-daa0-4388-a871-45ba8d6ee40a
│
│ with module.sonarqube.aws_rds_cluster_instance.aurora_db_cluster_instances[2],
│ on .terraform/modules/sonarqube/database.tf line 64, in resource "aws_rds_cluster_instance" "aurora_db_cluster_instances":
│ 64: resource "aws_rds_cluster_instance" "aurora_db_cluster_instances" {
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/pipeline.yml
actions/checkout v4
actions/checkout v4
main.tf
cn-terraform/cloudwatch-logs/aws 1.0.12
cn-terraform/ecs-fargate/aws 2.0.52
ssl.tf
terraform-aws-modules/acm/aws ~> 4.0
versions.tf
aws >= 4
random >= 3
hashicorp/terraform >= 0.13
I get the below error when I run terraform plan. how do I resolve it.
sonarqube % terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
Warning: Value for undeclared variable
The root module does not declare a variable named "availability_zones" but a
value was found in file "terraform.tfvars". To use this value, add a
"variable" block to the configuration.
Using a variables file to set an undeclared variable is deprecated and will
become an error in a future release. If you wish to provide certain "global"
settings to all configurations in your organization, use TF_VAR_...
environment variables to set these instead.
Warning: Interpolation-only expressions are deprecated
on .terraform/modules/sonarqube.ecs_fargate/main.tf line 9, in module "ecs-cluster":
9: name = "${var.name_prefix}"
Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.
Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.
(and one more similar warning elsewhere)
Error: Invalid for_each argument
on .terraform/modules/sonarqube.ecs_fargate.ecs-fargate-service/main.tf line 10, in data "aws_lb_target_group" "lb_http_target_groups":
10: for_each = var.lb_http_tgs_arns != null ? toset(var.lb_http_tgs_arns) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
Error: Invalid for_each argument
on .terraform/modules/sonarqube.ecs_fargate.ecs-fargate-service/main.tf line 20, in data "aws_lb_listener" "lb_http_listeners":
20: for_each = var.lb_http_listeners_arns != null ? toset(var.lb_http_listeners_arns) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
│ Error: error creating RDS cluster: InvalidParameterCombination: Cannot find version 11.7 for aurora-postgresql
│ status code: 400, request id: xxx│
│ with module.sonarqube.aws_rds_cluster.aurora_db,
│ on .terraform/modules/sonarqube/database.tf line 29, in resource "aws_rds_cluster" "aurora_db":
│ 29: resource "aws_rds_cluster" "aurora_db" {
Hey,
Any possiblity of exposing lb_internal from terraform-aws-ecs-fargate-service module? I would like to deploy a private instance of sonarqube.
Thanks.
As written, volumes requires definitions for both a docker_volume_configuration and an efs_volume_configuration, but an aws_ecs_task_definition requires either a docker_volume_configuration or an efs_volume_configuration. It therefore seems that volumes can't actually be used in this module.
Fixing for the error, Elasticsearch can't start
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
--
update ecs fargate module by adding the following vars:
command = [
"-Dsonar.search.javaAdditionalOpts=-Dnode.store.allow_mmapfs=false"
]
ulimits = [
{
"name" : "nofile",
"softLimit" : 65535,
"hardLimit" : 65535
}
]
Hi there,
I can't login with default admin/admin. Is it changed here?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.