Skip to content
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

Create ECR images using Terraform #5

Open
alan-walsh opened this issue Feb 21, 2024 · 0 comments
Open

Create ECR images using Terraform #5

alan-walsh opened this issue Feb 21, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@alan-walsh
Copy link
Contributor

Can/should we automate the creation of the ECR container images using Terraform? CI/CD? Probably.

Becca has done some preliminary work on this:

/*
resource aws_ecr_repository repo {
name = local.ecr_repository_name
}
*/

/resource null_resource ecr_image {
triggers = {
python_file = var.python
docker_file = var.docker
}
}
/

/*
resource "aws_instance" "exec" {
#provisioner "local-exec" {
command = <<EOF
aws ecr get-login-password --region ${var.region} | docker login --username AWS --password-stdin ${local.account_id}.dkr.ecr.${var.region}.amazonaws.com
cd ${path.module}/lambdas/git_client
docker build -t ${aws_ecr_repository.repo.repository_url}:${local.ecr_image_tag} .
docker push ${aws_ecr_repository.repo.repository_url}:${local.ecr_image_tag}
EOF
}
#do I need to include a path to requirements.txt?
*/

/*
data aws_ecr_image lambda_image {
depends_on = [
null_resource.ecr_image
]
repository_name = local.ecr_repository_name
image_tag = local.ecr_image_tag
}
*/

/*
data "aws_iam_policy_document" "lambda_docx" {
statement {
actions = [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
]
effect = "Allow"
resources = [""]
sid = "Create WatchLogs"
}
statement {
actions = [
"codecommit:GitPull",
"codecommit:GitPush",
"codecommit:GetBranch",
"codecommit:ListBranches",
"codecommit:CreateCommit",
"codecommit:GetCommit",
"codecommit:GetCommitHistory",
"codecommit:GetDifferences",
"codecommit:GetReferences",
"codecommit:BatchGetCommits",
"codecommit:GetTree",
"codecommit:GetObjectIdentifier",
"codecommit:GetMergeCommit"
]
effect = "Allow"
resources = [""]
sid = "CodeCommit"
}
}

resource "aws_iam_policy" "lambda_docx" {
name = "${local.prefix}-lambda-policy"
path = "/"
policy = data.aws_iam_policy_document.lambda.json
}
*/

/*
environment {
variables = {
#BUCKET = "aws_s3_bucket.upload.id",
MPLCONFIGDIR = "/tmp",
WEBHOOK_URL = "https://indiana.webhook.office.com/webhookb2/xxxxxxxxxxx...",
BUCKET = "aws_s3_bucket.download.id"
}
}
*/
@alan-walsh alan-walsh added this to the Future milestone Feb 21, 2024
@alan-walsh alan-walsh added the enhancement New feature or request label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant