-
Notifications
You must be signed in to change notification settings - Fork 0
Time to parameterize #3
Conversation
| task-definition: ${{ steps.cube-api-task-def.outputs.task-definition }} | ||
| service: cube_api | ||
| cluster: production | ||
| cluster: prod-sync_cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mixing - and _ 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep! i noticed it as well. I will fix in a follow up!
| set -e | ||
|
|
||
| AWS_REGION="us-east-1" | ||
| ECR_REPOSITORY="prod-sync-cubestore-ecr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just store the full ECR repo in a SSM parameter and pull that? Would be less fragile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya let me do this in a follow up - I need to do multiple envs for this as well
|
|
||
| aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REGISTRY | ||
|
|
||
| docker build --platform linux/amd64 -t $REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/cubestore/Dockerfile . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would maybe add linux/arm64 as a second platform target. The rationale is
- Local dev is almost always going to be arm64, we want to ensure we still work for devs
- Graviton (aws ARM) is great and we will probably want to use that ASAP honestly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed so local dev is going to use docker-compose so ill update in my next pr for that - I also need to test the ARM cube image to see if it works!
| } | ||
| } | ||
|
|
||
| module "vpc" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sensible we will probably want to use the same VPC for sync_backend/tasks
Co-authored-by: Samantha Hughes <shughes.uk@gmail.com>
| repository = aws_ecr_repository.cube_repo.name | ||
|
|
||
| policy = <<EOF | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way prefer this method of defining lifecycle policies btw https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecr_lifecycle_policy_document
| @@ -1,5 +1,5 @@ | |||
| resource "aws_ecs_cluster" "main" { | |||
| name = "production" | |||
| name = "${var.cluster_prefix}_cluster" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| name = "${var.cluster_prefix}_cluster" | |
| name = "${var.cluster_prefix}-cluster" |
Uh oh!
There was an error while loading. Please reload this page.