cn-terraform / terraform-aws-jenkins Goto Github PK
View Code? Open in Web Editor NEWJenkins Terraform Module for AWS
Home Page: https://registry.terraform.io/modules/cn-terraform/jenkins
License: Apache License 2.0
Jenkins Terraform Module for AWS
Home Page: https://registry.terraform.io/modules/cn-terraform/jenkins
License: Apache License 2.0
ask stopped at: 2023-09-24T18:55:17.602Z
CannotPullContainerError: pull image manifest has been retried 5 time(s): failed to resolve ref docker.io/cnservices/jenkins-master:latest: failed to do request: Head "https://registry-1.docker.io/v2/cnservices/jenkins-master/manifests/latest": dial tcp 34.205.13.154:443: i/o timeout
ECS Jenkins server fails to start with this error:
November 30, 2023 at 19:06 (UTC+3:00) | Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
November 30, 2023 at 19:06 (UTC+3:00) | touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
November 30, 2023 at 19:06 (UTC+3:00) Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
November 30, 2023 at 19:06 (UTC+3:00) touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
"When expanding the plan for
│ module.jenkins.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].aws_s3_bucket.logs to include new
│ values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value
│ for .tags_all: new element "Name" has appeared.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker."
module.jenkins.module.ecs-fargate-service.aws_security_group_rule.ingress_through_http["8080"]: Creation complete after 0s [id=sgrule-542379680]
module.jenkins.module.ecs-fargate-service.aws_security_group_rule.ingress_through_http["5000"]: Creation complete after 1s [id=sgrule-1272381205]
Error: Provider produced inconsistent final plan
When expanding the plan for
module.jenkins.module.ecs-fargate-service.aws_ecs_service.service to include
new values learned so far during apply, provider
"registry.terraform.io/hashicorp/aws" produced an invalid new value for
.load_balancer: block set length changed from 1 to 2.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
HI! I'm trying to figure out if there's a way to populate plugins for install_plugins.sh. There doesn't seem to be an environment file, and I'm not sure if there's a way to mount a file in an ECS/fargate task, or whether I need to try and run a dummy container to write it out from variable, and then use volumes from to mount that container.
Am I missing something, do you already have this solved?
Hi,
Thanks for the template, this is veryhelpfull. I had one doubt in the jenkins master configuration. Where will the Jenkins master file be stored ? When we use EC2 we mount a EFS to teh docker container, so that all data gets copied to EFS and when i restart eh Jenkins master Image i can mount the same EFS so that it will pick the configurations. In fargate how do we do it ?
resources are failing with following error.
ResourceInitializationError: failed to invoke EFS utils commands to set up EFS volumes: stderr: Failed to resolve "fs-0867a83d8ed398433.efs.
I have no need to put this on the public internet, so I would like to do this using purely internal subnets.
however, when I pass an empty list to the public subnets, I get
Error: Error creating application Load Balancer: ValidationError: At least two subnets in two different Availability Zones must be specified
status code: 400, request id: e60ff5b6-b39d-4f0a-9d9c-bbac15916143
on .terraform/modules/jenkins.ecs-alb/terraform-aws-ecs-alb-1.0.2/main.tf line 15, in resource "aws_lb" "lb":
15: resource "aws_lb" "lb" {
Also, running this with a mangled local copy (which handles the loadbalancer itself), I get
container_linux.go:341: creating new parent process caused "container_linux.go:1923: running lstat on namespace path \"/var/run/netns/8c63af76dd0a40eeba68e208d1895761\" caused \"lstat /var/run/netns/8c63af76dd0a40eeba68e208d1895761: no such file or directory\""
Which is probably not an issue with this just curious if anyone else has seen that.
The following error occurs with v 2.0.13 of this module:
│ Error: ECS Task Definition container_definitions is invalid: Error decoding JSON: json: cannot unmarshal string into Go struct field MountPoint.MountPoints.ReadOnly of type bool
│
│ with module.jenkins.module.td.aws_ecs_task_definition.td,
│ on .terraform/modules/jenkins.td/main.tf line 81, in resource "aws_ecs_task_definition" "td":
│ 81: container_definitions = "[${module.container_definition.json_map_encoded}]"
│
╵
version: 2.0.36
my config:
module "jenkins" {
source = "cn-terraform/jenkins/aws"
name_prefix = "jenkins"
region = var.aws_region
vpc_id = module.vpc.vpc_id
public_subnets_ids = module.vpc.public_subnets
private_subnets_ids = module.vpc.private_subnets
}
error, all resources were created, but S3 ACL configuration failed with attached error. After manually enabling ACL for S3 bucket - next terraform run succeeded.
error:
module.jenkins.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].aws_s3_bucket_acl.logs: Creating...
╷
│ Error: error creating S3 bucket ACL for jenkins-jenkins-lb-logs-xfvuunq: AccessControlListNotSupported: The bucket does not allow ACLs
│ status code: 400, request id: MESAYN3CSKNNCVGB, host id: +jNTkMmiwb3vlvpUEP01YBsEwQhzAF8PXnCTyaVPv8cZQgPijZlKt7OUY47B5RNUZy/94Pws4qk=
│
│ with module.jenkins.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].aws_s3_bucket_acl.logs,
│ on .terraform/modules/jenkins.ecs-fargate-service.ecs-alb.lb_logs_s3/main.tf line 26, in resource "aws_s3_bucket_acl" "logs":
│ 26: resource "aws_s3_bucket_acl" "logs" {
│
╵
ERRO[0071] Terraform invocation failed in /Users/aimestereo/projects/StatusMoney/demo/devops/terragrunt/us-west-1/stage/base-infrastructure/.terragrunt-cache/gmYJS8uADB49DexI5-p0wEef0s4/L9aVx8JWyIBukn_KhUmiCNb-eSo/terraform/base-infrastructure prefix=[/Users/aimestereo/projects/StatusMoney/demo/devops/terragrunt/us-west-1/stage/base-infrastructure]
ERRO[0071] 1 error occurred:
* [/Users/aimestereo/projects/StatusMoney/demo/devops/terragrunt/us-west-1/stage/base-infrastructure/.terragrunt-cache/gmYJS8uADB49DexI5-p0wEef0s4/L9aVx8JWyIBukn_KhUmiCNb-eSo/terraform/base-infrastructure] exit status 1
When running this module with TF version 0.13.6 I get the following errors:
on .terraform/modules/jenkins.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: Reference to "each" in context without for_each
on .terraform/modules/jenkins.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/jenkins.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.
Error: each.value cannot be used in this context
on .terraform/modules/jenkins.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.```
I had to change the ports from 5000 to 50000 so the ALB would not kill the task.
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-cluster/aws 1.0.11
cn-terraform/ecs-fargate-service/aws 2.0.39
cn-terraform/ecs-fargate-task-definition/aws 1.0.35
versions.tf
aws >= 4
hashicorp/terraform >= 0.13
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.