https://github.com/dtaniwaki/terraform-codepipeline-run-task
Terraform module to run a task in codepipeline
https://github.com/dtaniwaki/terraform-codepipeline-run-task
aws codepipeline ecs terraform
Last synced: 3 months ago
JSON representation
Terraform module to run a task in codepipeline
- Host: GitHub
- URL: https://github.com/dtaniwaki/terraform-codepipeline-run-task
- Owner: dtaniwaki
- License: apache-2.0
- Created: 2022-07-24T16:17:06.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-03T05:46:00.000Z (almost 4 years ago)
- Last Synced: 2025-09-10T02:29:25.930Z (11 months ago)
- Topics: aws, codepipeline, ecs, terraform
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-codepipeline-run-task
## Usage
e.g.
```tf
resource "aws_ecs_cluster" "app" {
...
}
resource "aws_ecs_task_definition" "app_db_migration" {
...
}
module "run_task" {
source = "codepipeline_run_task/modules"
name = "app-db-migration"
task_definition_arn = aws_ecs_task_definition.app_db_migration.arn
}
resource "aws_codepipeline" "app_deploy" {
name = "app-deploy"
...
stage {
name = "deploy"
action {
name = "db-migration"
category = "Invoke"
owner = "AWS"
provider = "Lambda"
version = "1"
input_artifacts = ["SourceArtifact"]
run_order = 1
configuration = {
FunctionName = module.run_task.lambda_function_name
UserParameters = jsonencode({
cluster = aws_ecs_cluster.app.name
taskDefinitionFamily = aws_ecs_task_definition.app_db_migration.family
containerName = "app-db-migration"
networkConfiguration = {
"awsvpcConfiguration" : {
"subnets" : var.private_subnet_ids,
"securityGroups" : [aws_security_group.app.id],
"assignPublicIp" : "DISABLED",
}
}
overrides = {
}
})
}
}
}
}
```