Skip to content

Commit

Permalink
feat: Move state from terraform cloud to amazon s3.
Browse files Browse the repository at this point in the history
  • Loading branch information
dksifoua committed Jul 25, 2024
1 parent d1d8dcb commit 0bcc4dd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/jenkins/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "aws_ecs_task_definition" "jenkins_controller" {
operating_system_family = "LINUX"
}

depends_on = [null_resource.build_docker_image]
# depends_on = [null_resource.build_docker_image]
tags = var.tags
}

Expand Down
4 changes: 2 additions & 2 deletions modules/jenkins/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data "aws_subnets" "main" {
}
}

locals {
/*locals {
jenkins_agent_conf = templatefile("${path.module}/templates/clouds.ecs.yaml", {
cluster_agent_fargate = aws_ecs_cluster.jenkins.arn
cluster_agent_region = data.aws_region.current.name
Expand Down Expand Up @@ -44,7 +44,7 @@ resource "null_resource" "build_docker_image" {
}
depends_on = [local_file.jenkins_agent_conf]
}
}*/

resource "aws_cloudwatch_log_group" "ecs" {
name = var.log_group
Expand Down
2 changes: 1 addition & 1 deletion modules/jenkins/plugins/plugins.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# amazon-ecs:latest
amazon-ecs:latest
blueocean:latest
configuration-as-code:latest
docker-plugin:latest
Expand Down
15 changes: 8 additions & 7 deletions terraform.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
terraform {
required_version = ">= 1.6.6"

cloud {
organization = "dksifoua"

workspaces {
name = "aws-jenkins-deployment"
}
backend "s3" {
bucket = "tf-state-dimitri"
key = "aws-jenkins-deployment/terraform.tfstate"
region = "us-east-1"
profile = "[email protected]"
encrypt = true
}

required_providers {
Expand All @@ -26,5 +26,6 @@ terraform {
}

provider "aws" {
region = "us-east-1"
region = "us-east-1"
profile = "[email protected]"
}

0 comments on commit 0bcc4dd

Please sign in to comment.